22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
31 #ifndef HLTCA_STANDALONE
43 #include "Riostream.h"
51 PndFTSParticlePerformanceBase::PndFTSParticlePerformanceBase()
53 const int NHisto_tmp = NTrackPulls + NTrackPullsAtProdVertex + NVertexPulls;
56 fHistosInfo =
new THistoInfo[NHisto];
57 fHistos =
new TH1*[NHisto];
59 const float coeff1 = 10;
60 const THistoInfo tmp[NHisto_tmp]=
62 THistoInfo(
"resX",
"track X resolution [cm]", 30, -0.25, 0.25 ),
63 THistoInfo(
"resY",
"track Y resolution [cm]", 30, -0.25, 0.25 ),
64 THistoInfo(
"resZ",
"track Z resolution [cm]", 30, -0.7, 0.7 ),
65 THistoInfo(
"resPx",
"track Px resolution", 30, -0.3, 0.3 ),
66 THistoInfo(
"resPy",
"track Py resolution", 30, -0.3, 0.3 ),
67 THistoInfo(
"resPz",
"track Pz resolution", 30, -0.3, 0.3 ),
68 THistoInfo(
"pullX",
"track X pull", 30, -7., 7. ),
69 THistoInfo(
"pullY",
"track Y pull", 30, -7., 7. ),
70 THistoInfo(
"pullZ",
"track Z pull", 30, -7., 7. ),
71 THistoInfo(
"pullPx",
"track Px pull", 30, -7., 7. ),
72 THistoInfo(
"pullPy",
"track Py pull", 30, -7., 7. ),
73 THistoInfo(
"pullPz",
"track Pz pull", 30, -7., 7. ),
75 THistoInfo(
"resAtProdPointX",
"track X resolution at prodaction point [cm]", 30, -0.25*coeff1, 0.25*coeff1 ),
76 THistoInfo(
"resAtProdPointY",
"track Y resolution at prodaction point [cm]", 30, -0.25*coeff1, 0.25*coeff1 ),
77 THistoInfo(
"resAtProdPointZ",
"track Z resolution at prodaction point [cm]", 30, -0.7*coeff1, 0.7*coeff1 ),
78 THistoInfo(
"resAtProdPointPx",
"track Px resolution at prodaction point", 30, -0.3, 0.3 ),
79 THistoInfo(
"resAtProdPointPy",
"track Py resolution at prodaction point", 30, -0.3, 0.3 ),
80 THistoInfo(
"resAtProdPointPz",
"track Pz resolution at prodaction point", 30, -0.3, 0.3 ),
81 THistoInfo(
"pullAtProdPointX",
"track X pull at prodaction point", 30, -7., 7. ),
82 THistoInfo(
"pullAtProdPointY",
"track Y pull at prodaction point", 30, -7., 7. ),
83 THistoInfo(
"pullAtProdPointZ",
"track Z pull at prodaction point", 30, -7., 7. ),
84 THistoInfo(
"pullAtProdPointPx",
"track Px pull at prodaction point", 30, -7., 7. ),
85 THistoInfo(
"pullAtProdPointPy",
"track Py pull at prodaction point", 30, -7., 7. ),
86 THistoInfo(
"pullAtProdPointPz",
"track Pz pull at prodaction point", 30, -7., 7. ),
88 THistoInfo(
"resVertexX",
"vertex X resolution [cm]", 30, -0.25, 0.25 ),
89 THistoInfo(
"resVertexY",
"vertex Y resolution [cm]", 30, -0.25, 0.25 ),
90 THistoInfo(
"resVertexZ",
"vertex Z resolution [cm]", 30, -0.7, 0.7 ),
91 THistoInfo(
"pullVertexX",
"vertex X pull", 30, -7., 7. ),
92 THistoInfo(
"pullVertexY",
"vertex Y pull", 30, -7., 7. ),
93 THistoInfo(
"pullVertexZ",
"vertex Z pull", 30, -7., 7. )
96 for (
int iHisto = 0; iHisto < NHisto; iHisto++){
97 fHistosInfo[iHisto] = tmp[iHisto];
100 for(
int i=0;
i < NHisto;
i++ ){
106 void PndFTSParticlePerformanceBase::CreateHistos(
string histoDir, TFile*
outFile)
108 TDirectory *curdir = gDirectory;
109 if ( (histoDir !=
"") && outFile) {
111 fHistoDir = outFile->mkdir(
TString(histoDir) );
113 gDirectory->mkdir(
"TrackInput" );
114 gDirectory->cd(
"TrackInput" );
117 for(
int i = 0;
i < NTrackPulls;
i++, ih++ ){
118 fHistos[ih] =
new TH1D(fHistosInfo[ih].
name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
121 gDirectory->cd(
".." );
122 gDirectory->mkdir(
"TrackAtVertex" );
123 gDirectory->cd(
"TrackAtVertex" );
125 for(
int i = 0;
i < NTrackPullsAtProdVertex;
i++, ih++ ){
126 fHistos[ih] =
new TH1D(fHistosInfo[ih].
name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
129 gDirectory->cd(
".." );
130 gDirectory->mkdir(
"Vertex" );
131 gDirectory->cd(
"Vertex" );
133 for(
int i = 0;
i < NVertexPulls;
i++, ih++ ){
134 fHistos[ih] =
new TH1D(fHistosInfo[ih].
name, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
137 gDirectory->cd(
".." );
140 gDirectory->mkdir(
"KFParticlesFinder");
141 gDirectory->cd(
"KFParticlesFinder");
142 histodir = gDirectory;
143 gDirectory->mkdir(
"Particles");
144 gDirectory->cd(
"Particles");
146 for(
int iPart=0; iPart<fParteff.nParticles; ++iPart)
148 gDirectory->mkdir(fParteff.partName[iPart].Data());
149 gDirectory->cd(fParteff.partName[iPart].Data());
154 gDirectory->mkdir(
"DaughtersQA");
155 gDirectory->cd(
"DaughtersQA");
157 TString parName[nFitQA/2] = {
"X",
"Y",
"Z",
"Px",
"Py",
"Pz",
"E",
"M"};
160 float xMax[nFitQA/2] = {2.,2.,5.,0.3,0.3,0.3,0.03,0.03};
162 for(
int iH=0; iH<nFitQA/2; iH++ ){
163 hFitDaughtersQA[iPart][iH] =
new TH1F((res+parName[iH]).Data(),
164 (res+parName[iH]).Data(),
165 nBins, -xMax[iH],xMax[iH]);
166 hFitDaughtersQA[iPart][iH+8] =
new TH1F((pull+parName[iH]).Data(),
167 (pull+parName[iH]).Data(),
171 gDirectory->cd(
"..");
173 gDirectory->mkdir(
"FitQA");
174 gDirectory->cd(
"FitQA");
176 TString parName[nFitQA/2] = {
"X",
"Y",
"Z",
"Px",
"Py",
"Pz",
"E",
"M"};
179 float xMax[nFitQA/2] = {2.,2.,5.,0.3,0.3,0.3,0.03,0.03};
181 for(
int iH=0; iH<nFitQA/2; iH++ ){
182 hFitQA[iPart][iH] =
new TH1F((res+parName[iH]).Data(),
183 (res+parName[iH]).Data(),
184 nBins, -xMax[iH],xMax[iH]);
185 hFitQA[iPart][iH+8] =
new TH1F((pull+parName[iH]).Data(),
186 (pull+parName[iH]).Data(),
190 gDirectory->cd(
"..");
192 gDirectory->mkdir(
"Parameters");
193 gDirectory->cd(
"Parameters");
195 TString parName[nHistoPartParam] = {
"M",
"p",
"p_{t}",
"y",
"DL",
"c#tau",
"chi2ndf",
"prob",
"#theta",
"phi",
"z",
"l/dl"};
196 TString parAxisName[nHistoPartParam] = {
"m [GeV/c^{2}]",
"p [GeV/c]",
"p_{t} [GeV/c]",
197 "y",
"Decay length [cm]",
"Life time c#tau [cm]",
198 "chi2/ndf",
"prob",
"#theta [rad]",
199 "phi [rad]",
"z [cm]",
"l/dl"};
200 int nBins[nHistoPartParam] = {1000,100,100,100,100,100,100,100,100,100,100,1000};
201 float xMin[nHistoPartParam] = {fParteff.partMHistoMin[iPart], 0., 0., 0., -5., 0., 0., 0., -2., -2., -5., -1.};
202 float xMax[nHistoPartParam] = {fParteff.partMHistoMax[iPart], 10., 3., 6., 55., 30., 20., 1., 2., 2., 55., 35.};
204 for(
int iH=0; iH<nHistoPartParam; iH++)
206 hPartParam[iPart][iH] =
new TH1F(parName[iH].Data(),parName[iH].Data(),
207 nBins[iH],xMin[iH],xMax[iH]);
208 hPartParam[iPart][iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
211 hPartParam2D[iPart][0] =
new TH2F(
"y-p_{t}",
"y-p_{t}",
212 nBins[3],xMin[3],xMax[3],
213 nBins[2],xMin[2],xMax[2]);
214 hPartParam2D[iPart][0]->GetXaxis()->SetTitle(
"y");
215 hPartParam2D[iPart][0]->GetYaxis()->SetTitle(
"p_{t} [GeV/c]");
217 gDirectory->mkdir(
"Signal");
218 gDirectory->cd(
"Signal");
220 for(
int iH=0; iH<nHistoPartParam; iH++)
222 hPartParamSignal[iPart][iH] =
new TH1F((parName[iH]).Data(),(parName[iH]).Data(),
223 nBins[iH],xMin[iH],xMax[iH]);
224 hPartParamSignal[iPart][iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
227 hPartParam2DSignal[iPart][0] =
new TH2F(
"y-p_{t}",
"y-p_{t}",
228 nBins[3],xMin[3],xMax[3],
229 nBins[2],xMin[2],xMax[2]);
230 hPartParam2DSignal[iPart][0]->GetXaxis()->SetTitle(
"y");
231 hPartParam2DSignal[iPart][0]->GetYaxis()->SetTitle(
"p_{t} [GeV/c]");
233 gDirectory->mkdir(
"QA");
234 gDirectory->cd(
"QA");
237 float xMaxQA[nHistoPartParamQA] = {0.01,0.001,0.001};
238 for(
int iH=0; iH<nHistoPartParamQA; iH++ ){
239 hPartParamQA[iPart][iH] =
240 new TH1F((res+parName[iH]).Data(), (res+parName[iH]).Data(), nBinsQA, -xMaxQA[iH],xMaxQA[iH]);
241 hPartParamQA[iPart][iH+nHistoPartParamQA] =
242 new TH1F((pull+parName[iH]).Data(), (pull+parName[iH]).Data(), nBinsQA, -6,6);
245 gDirectory->cd(
"..");
247 gDirectory->cd(
"..");
248 gDirectory->mkdir(
"Background");
249 gDirectory->cd(
"Background");
251 for(
int iH=0; iH<nHistoPartParam; iH++)
253 hPartParamBG[iPart][iH] =
new TH1F((parName[iH]).Data(),(parName[iH]).Data(),
254 nBins[iH],xMin[iH],xMax[iH]);
255 hPartParamBG[iPart][iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
258 hPartParam2DBG[iPart][0] =
new TH2F(
"y-p_{t}",
"y-p_{t}",
259 nBins[3],xMin[3],xMax[3],
260 nBins[2],xMin[2],xMax[2]);
261 hPartParam2DBG[iPart][0]->GetXaxis()->SetTitle(
"y");
262 hPartParam2DBG[iPart][0]->GetYaxis()->SetTitle(
"p_{t} [GeV/c]");
281 gDirectory->cd(
"..");
282 gDirectory->mkdir(
"Ghost");
283 gDirectory->cd(
"Ghost");
285 for(
int iH=0; iH<nHistoPartParam; iH++)
287 hPartParamGhost[iPart][iH] =
new TH1F((parName[iH]).Data(),(parName[iH]).Data(),
288 nBins[iH],xMin[iH],xMax[iH]);
289 hPartParamGhost[iPart][iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
292 hPartParam2DGhost[iPart][0] =
new TH2F(
"y-p_{t}",
"y-p_{t}",
293 nBins[3],xMin[3],xMax[3],
294 nBins[2],xMin[2],xMax[2]);
295 hPartParam2DGhost[iPart][0]->GetXaxis()->SetTitle(
"y");
296 hPartParam2DGhost[iPart][0]->GetYaxis()->SetTitle(
"p_{t} [GeV/c]");
298 gDirectory->cd(
"..");
300 gDirectory->cd(
"..");
302 gDirectory->cd(
"..");
305 gDirectory->cd(
"..");
306 gDirectory->mkdir(
"PrimaryVertexQA");
307 gDirectory->cd(
"PrimaryVertexQA");
316 {
"PVResX",
"x_{rec}-x_{mc}, cm", 100, -0.2f, 0.2f},
317 {
"PVResY",
"y_{rec}-y_{mc}, cm", 100, -0.2f, 0.2f},
318 {
"PVResZ",
"z_{rec}-z_{mc}, cm", 100, -0.2f, 0.2f},
319 {
"PVPullX",
"Pull X", 100, -6.f, 6.f},
320 {
"PVPullY",
"Pull Y", 100, -6.f, 6.f},
321 {
"PVPullZ",
"Pull Z", 100, -6.f, 6.f}
323 for(
int iHPV=0; iHPV<nHistosPV; ++iHPV){
324 hPVFitQa[iHPV] =
new TH1F(Table[iHPV].
name.data(),Table[iHPV].title.data(),
325 Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
328 gDirectory->cd(
"..");
329 gDirectory->mkdir(
"TrackParameters");
330 gDirectory->cd(
"TrackParameters");
335 TString chi2NamePart =
"Chi2Prim";
337 chi2NamePart += fParteff.partName[iPart].Data();
338 hTrackParameters[iPart] =
new TH1F(chi2NamePart.Data(), chi2NamePart.Data(), 1000, 0, 100);
343 gDirectory->cd(
"..");
350 static int iaddName = 0;
353 for(
int i = 0;
i < NTrackPulls + NTrackPullsAtProdVertex + NVertexPulls;
i++, ih++, addName =
TString(iaddName++) ){
354 fHistos[ih] =
new TH1D(fHistosInfo[ih].
name+addName, fHistosInfo[ih].title, fHistosInfo[ih].nx, fHistosInfo[ih].left, fHistosInfo[ih].right);
357 for(
int i = 0;
i < NHisto;
i++ ){
358 fHistos[
i]->SetDirectory(0);
365 void PndFTSParticlePerformanceBase::FillHistos()
369 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
static const int nParticles