BmnRoot
Loading...
Searching...
No Matches
L1CADebug.h
Go to the documentation of this file.
1#ifndef L1CADebug_h
2#define L1CADebug_h 1
3
4#define DEBUG_CA
5
6#include "CbmL1.h"
7
8TH1F
9 *h_pick_res_x[20][3][3], *h_pick_res_y[20][3][3],
10 *h_pick_pull_x[20][3][3], *h_pick_pull_y[20][3][3],
11 *h_nduplets[20][3],
12 *h_res_x[20][3][3], *h_res_y[20][3][3],
13 *h_res_tx[20][3][3],*h_res_ty[20][3][3], *h_res_qp[20][3][3],
14 *h_pull_x[20][3][3], *h_pull_y[20][3][3],
15 *h_pull_tx[20][3][3], *h_pull_ty[20][3][3], *h_pull_qp[20][3][3]
16 ;
17//TH2F *h_dyvsy[20], *h_dxvsx[20];
18
19void Pulls( int i, int j, int k,
20 double *mc, L1TrackPar &T, fvec qp0, L1FieldRegion &fld )
21{
22 L1TrackPar tmp_T = T;
23 fvec z = mc[5];
24 L1Extrapolate( tmp_T, z, qp0, fld );
25 double dx = mc[0] - tmp_T.x[0];
26 double dy = mc[1] - tmp_T.y[0];
27 double dtx = mc[2] - tmp_T.tx[0];
28 double dty = mc[3] - tmp_T.ty[0];
29 double dqp = mc[4] - tmp_T.qp[0];
30 double sx = sqrt(tmp_T.C00[0]);
31 double sy = sqrt(tmp_T.C11[0]);
32 double stx = sqrt(tmp_T.C22[0]);
33 double sty = sqrt(tmp_T.C33[0]);
34 double sqp = sqrt(tmp_T.C44[0]);
35 h_res_x [i][j][k]->Fill(dx);
36 h_res_y [i][j][k]->Fill(dy);
37 h_res_tx [i][j][k]->Fill(dtx);
38 h_res_ty [i][j][k]->Fill(dty);
39 h_res_qp [i][j][k]->Fill(dqp/mc[4]);
40 h_pull_x [i][j][k]->Fill(dx/sx);
41 h_pull_y [i][j][k]->Fill(dy/sy);
42 h_pull_tx[i][j][k]->Fill(dtx/stx);
43 h_pull_ty[i][j][k]->Fill(dty/sty);
44 h_pull_qp[i][j][k]->Fill(dqp/sqp);
45}
46
48 static bool first_call = 1;
49 if( first_call ){
50 TDirectory *curdir = gDirectory;
51 CbmL1::Instance()->histodir->cd();
52 L1Algo *algo = CbmL1::Instance()->algo;
53 gDirectory->mkdir("L1ALGO");
54 gDirectory->cd("L1ALGO");
55 for( int ist=0; ist<algo->NStations; ist++ ){
56 char stname[225];//, namedir[225], title[225];
57 sprintf(stname,"%i",ist);
58 gDirectory->mkdir(stname);
59 gDirectory->cd(stname);
60 {
61 //h_dyvsy[ist] = new TH2F("h_dyvsy","h_dyvsy",1000,0,100, 1000, 0.,.5);
62 //h_dxvsx[ist] = new TH2F("h_dxvsx","h_dxvsx",1000,0,100, 1000, 0.,2.5);
63 const char* stepname[3]={"D0","Ref","Sec"};
64 for( int istep=0; istep<3; istep++){
65 gDirectory->mkdir(stepname[istep]);
66 gDirectory->cd(stepname[istep]);
67
68 h_nduplets[ist][istep] = new TH1F("h_nduplets","h_nduplets",50,0,5000);
69
70 const char* lmr[3]={"left","middle","right"};
71 for( int ilmr=0; ilmr<3; ilmr++){
72 gDirectory->mkdir(lmr[ilmr]);
73 gDirectory->cd(lmr[ilmr]);
74 {
75 h_pick_res_x[ist][ilmr][istep] = new TH1F("h_pick_res_x","h_pick_res_x",100,-2,3);
76 h_pick_res_y[ist][ilmr][istep] = new TH1F("h_pick_res_y","h_pick_res_y",100,-1,1);
77 h_pick_pull_x[ist][ilmr][istep] = new TH1F("h_pick_pull_x","h_pick_pull_x",100,-10,10);
78 h_pick_pull_y[ist][ilmr][istep] = new TH1F("h_pick_pull_y","h_pick_pull_y",100,-10,10);
79 h_res_x[ist][ilmr][istep] = new TH1F("h_res_x","h_res_x",100,-.01,.01);
80 h_res_y[ist][ilmr][istep] = new TH1F("h_res_y","h_res_y",100,-.1,.1);
81 h_res_tx[ist][ilmr][istep] = new TH1F("h_res_tx","h_res_tx",100,-.01,.01);
82 h_res_ty[ist][ilmr][istep] = new TH1F("h_res_ty","h_res_ty",100,-.01,.01);
83 h_res_qp[ist][ilmr][istep] = new TH1F("h_res_qp","h_res_qp",100,-.1,.1);
84 h_pull_x[ist][ilmr][istep] = new TH1F("h_pull_x","h_pull_x",100,-10,10);
85 h_pull_y[ist][ilmr][istep] = new TH1F("h_pull_y","h_pull_y",100,-10,10);
86 h_pull_tx[ist][ilmr][istep] = new TH1F("h_pull_tx","h_pull_tx",100,-10,10);
87 h_pull_ty[ist][ilmr][istep] = new TH1F("h_pull_ty","h_pull_ty",100,-10,10);
88 h_pull_qp[ist][ilmr][istep] = new TH1F("h_pull_qp","h_pull_qp",100,-10,10);
89 gDirectory->cd("..");
90 }
91 } gDirectory->cd("..");
92 }
93 } gDirectory->cd("..");
94 }
95 gDirectory->cd("..");
96 curdir->cd();
97 first_call = 0;
98 }
99}
100
101
102#endif
TH1F * h_pull_y[20][3][3]
Definition L1CADebug.h:14
TH1F * h_res_tx[20][3][3]
Definition L1CADebug.h:13
TH1F * h_res_x[20][3][3]
Definition L1CADebug.h:12
TH1F * h_res_ty[20][3][3]
Definition L1CADebug.h:13
void InitL1Histo()
Definition L1CADebug.h:47
TH1F * h_nduplets[20][3]
Definition L1CADebug.h:11
TH1F * h_res_qp[20][3][3]
Definition L1CADebug.h:13
TH1F * h_pull_qp[20][3][3]
Definition L1CADebug.h:16
TH1F * h_pick_pull_x[20][3][3]
Definition L1CADebug.h:10
TH1F * h_pull_ty[20][3][3]
Definition L1CADebug.h:15
void Pulls(int i, int j, int k, double *mc, L1TrackPar &T, fvec qp0, L1FieldRegion &fld)
Definition L1CADebug.h:19
TH1F * h_res_y[20][3][3]
Definition L1CADebug.h:12
TH1F * h_pull_x[20][3][3]
Definition L1CADebug.h:14
TH1F * h_pull_tx[20][3][3]
Definition L1CADebug.h:15
TH1F * h_pick_res_y[20][3][3]
Definition L1CADebug.h:9
TH1F * h_pick_pull_y[20][3][3]
Definition L1CADebug.h:10
TH1F * h_pick_res_x[20][3][3]
Definition L1CADebug.h:9
void L1Extrapolate(L1TrackPar &T, fvec z_out, fvec qp0, L1FieldRegion &F, fvec *w=0)
friend F32vec4 sqrt(const F32vec4 &a)
Definition P4_F32vec4.h:34
int i
Definition P4_F32vec4.h:22
L1Algo * algo
Definition CbmL1.h:55
static CbmL1 * Instance()
reconstructed tracks
Definition CbmL1.h:60
int NStations
Definition L1Algo.h:123