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