CbmRoot
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 
8 TH1F *h_pick_res_x[20][3][3], *h_pick_res_y[20][3][3], *h_pick_pull_x[20][3][3],
9  *h_pick_pull_y[20][3][3], *h_nduplets[20][3], *h_res_x[20][3][3],
10  *h_res_y[20][3][3], *h_res_tx[20][3][3], *h_res_ty[20][3][3],
11  *h_res_qp[20][3][3], *h_pull_x[20][3][3], *h_pull_y[20][3][3],
12  *h_pull_tx[20][3][3], *h_pull_ty[20][3][3], *h_pull_qp[20][3][3];
13 //TH2F *h_dyvsy[20], *h_dxvsx[20];
14 
15 void Pulls(int i,
16  int j,
17  int k,
18  double* mc,
19  L1TrackPar& T,
20  fvec qp0,
21  L1FieldRegion& fld) {
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 
47 void InitL1Histo() {
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] =
69  new TH1F("h_nduplets", "h_nduplets", 50, 0, 5000);
70 
71  const char* lmr[3] = {"left", "middle", "right"};
72  for (int ilmr = 0; ilmr < 3; ilmr++) {
73  gDirectory->mkdir(lmr[ilmr]);
74  gDirectory->cd(lmr[ilmr]);
75  {
76  h_pick_res_x[ist][ilmr][istep] =
77  new TH1F("h_pick_res_x", "h_pick_res_x", 100, -2, 3);
78  h_pick_res_y[ist][ilmr][istep] =
79  new TH1F("h_pick_res_y", "h_pick_res_y", 100, -1, 1);
80  h_pick_pull_x[ist][ilmr][istep] =
81  new TH1F("h_pick_pull_x", "h_pick_pull_x", 100, -10, 10);
82  h_pick_pull_y[ist][ilmr][istep] =
83  new TH1F("h_pick_pull_y", "h_pick_pull_y", 100, -10, 10);
84  h_res_x[ist][ilmr][istep] =
85  new TH1F("h_res_x", "h_res_x", 100, -.01, .01);
86  h_res_y[ist][ilmr][istep] =
87  new TH1F("h_res_y", "h_res_y", 100, -.1, .1);
88  h_res_tx[ist][ilmr][istep] =
89  new TH1F("h_res_tx", "h_res_tx", 100, -.01, .01);
90  h_res_ty[ist][ilmr][istep] =
91  new TH1F("h_res_ty", "h_res_ty", 100, -.01, .01);
92  h_res_qp[ist][ilmr][istep] =
93  new TH1F("h_res_qp", "h_res_qp", 100, -.1, .1);
94  h_pull_x[ist][ilmr][istep] =
95  new TH1F("h_pull_x", "h_pull_x", 100, -10, 10);
96  h_pull_y[ist][ilmr][istep] =
97  new TH1F("h_pull_y", "h_pull_y", 100, -10, 10);
98  h_pull_tx[ist][ilmr][istep] =
99  new TH1F("h_pull_tx", "h_pull_tx", 100, -10, 10);
100  h_pull_ty[ist][ilmr][istep] =
101  new TH1F("h_pull_ty", "h_pull_ty", 100, -10, 10);
102  h_pull_qp[ist][ilmr][istep] =
103  new TH1F("h_pull_qp", "h_pull_qp", 100, -10, 10);
104  gDirectory->cd("..");
105  }
106  }
107  gDirectory->cd("..");
108  }
109  }
110  gDirectory->cd("..");
111  }
112  gDirectory->cd("..");
113  curdir->cd();
114  first_call = 0;
115  }
116 }
117 
118 
119 #endif
h_pull_tx
TH1F * h_pull_tx[20][3][3]
Definition: L1CADebug.h:12
L1TrackPar::qp
fvec qp
Definition: L1TrackPar.h:9
h_res_tx
TH1F * h_res_tx[20][3][3]
Definition: L1CADebug.h:10
F32vec4
Definition: L1/vectors/P4_F32vec4.h:47
CbmL1::algo
L1Algo * algo
Definition: CbmL1.h:119
h_pick_res_x
TH1F * h_pick_res_x[20][3][3]
Definition: L1CADebug.h:8
h_pull_ty
TH1F * h_pull_ty[20][3][3]
Definition: L1CADebug.h:12
sqrt
friend F32vec4 sqrt(const F32vec4 &a)
Definition: L1/vectors/P4_F32vec4.h:41
h_pull_qp
TH1F * h_pull_qp[20][3][3]
Definition: L1CADebug.h:12
L1Extrapolate
void L1Extrapolate(L1TrackPar &T, fvec z_out, fvec qp0, const L1FieldRegion &F, fvec *w=0)
Definition: L1Extrapolation.h:314
h_res_ty
TH1F * h_res_ty[20][3][3]
Definition: L1CADebug.h:10
InitL1Histo
void InitL1Histo()
Definition: L1CADebug.h:47
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
h_pick_res_y
TH1F * h_pick_res_y[20][3][3]
Definition: L1CADebug.h:8
CbmL1.h
L1TrackPar::ty
fvec ty
Definition: L1TrackPar.h:9
Pulls
void Pulls(int i, int j, int k, double *mc, L1TrackPar &T, fvec qp0, L1FieldRegion &fld)
Definition: L1CADebug.h:15
h_pull_x
TH1F * h_pull_x[20][3][3]
Definition: L1CADebug.h:11
L1TrackPar::y
fvec y
Definition: L1TrackPar.h:9
L1Algo::NStations
int NStations
Definition: L1Algo.h:333
L1TrackPar::C44
fvec C44
Definition: L1TrackPar.h:10
L1FieldRegion
Definition: L1Field.h:85
h_res_x
TH1F * h_res_x[20][3][3]
Definition: L1CADebug.h:9
CbmL1::Instance
static CbmL1 * Instance()
Definition: CbmL1.h:129
L1TrackPar::tx
fvec tx
Definition: L1TrackPar.h:9
L1Algo
Definition: L1Algo.h:79
L1TrackPar::x
fvec x
Definition: L1TrackPar.h:9
L1TrackPar::C00
fvec C00
Definition: L1TrackPar.h:9
h_pick_pull_x
TH1F * h_pick_pull_x[20][3][3]
Definition: L1CADebug.h:8
h_nduplets
TH1F * h_nduplets[20][3]
Definition: L1CADebug.h:9
h_pull_y
TH1F * h_pull_y[20][3][3]
Definition: L1CADebug.h:11
L1TrackPar::C33
fvec C33
Definition: L1TrackPar.h:9
L1TrackPar
Definition: L1TrackPar.h:6
L1TrackPar::C11
fvec C11
Definition: L1TrackPar.h:9
h_res_qp
TH1F * h_res_qp[20][3][3]
Definition: L1CADebug.h:11
h_res_y
TH1F * h_res_y[20][3][3]
Definition: L1CADebug.h:10
h_pick_pull_y
TH1F * h_pick_pull_y[20][3][3]
Definition: L1CADebug.h:9
L1TrackPar::C22
fvec C22
Definition: L1TrackPar.h:9
CbmL1::histodir
TDirectory * histodir
Definition: CbmL1.h:352