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