Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticlePerformanceBase.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticlePerformanceBase.cxx
1 /*
2  * This file is part of KFParticle package
3  * Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4  * 2007-2019 Goethe University of Frankfurt
5  * 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6  * 2007-2019 Maksym Zyzak
7  *
8  * KFParticle is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * KFParticle is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifdef DO_TPCCATRACKER_EFF_PERFORMANCE
23 
25 
26 #include "TDirectory.h"
27 #include "TH1.h"
28 #include "TH2.h"
29 #include "TH3.h"
30 #include "TProfile.h"
31 #include "TProfile2D.h"
32 
33 
34 KFParticlePerformanceBase::KFParticlePerformanceBase():
35  fParteff(), fPVeff(), fPVeffMCReconstructable(), outfileName(), histodir(0), fNEvents(0), fStoreMCHistograms(1),
36  fStorePrimSecHistograms(1), fStoreZRHistograms(1),fHistoDir(0)
37 {
39  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
40  {
41  for(int iFitQA=0; iFitQA<nFitQA; iFitQA++)
42  {
43  hFitDaughtersQA [iParticle][iFitQA] = nullptr;
44  hFitQA [iParticle][iFitQA] = nullptr;
45  hFitQANoConstraint [iParticle][iFitQA] = nullptr;
46  hFitQAMassConstraint [iParticle][iFitQA] = nullptr;
47  hFitQATopoConstraint [iParticle][iFitQA] = nullptr;
48  hFitQATopoMassConstraint[iParticle][iFitQA] = nullptr;
49  }
50  }
51 
52  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
53  for(int iQA=0; iQA<nDSToParticleQA; iQA++)
54  hDSToParticleQA[iParticle][iQA] = nullptr;
55 
56  for(int iParameterSet=0; iParameterSet<nParametersSet; iParameterSet++)
57  {
58  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
59  {
60  for(int iHisto=0; iHisto<nHistoPartParam; iHisto++)
61  {
62  hPartParam [iParameterSet][iParticle][iHisto] = nullptr;
63  hPartParamPrimary [iParameterSet][iParticle][iHisto] = nullptr;
64  hPartParamPrimaryMass [iParameterSet][iParticle][iHisto] = nullptr;
65  hPartParamPrimaryTopo [iParameterSet][iParticle][iHisto] = nullptr;
66  hPartParamPrimaryTopoMass[iParameterSet][iParticle][iHisto] = nullptr;
67  hPartParamSecondary [iParameterSet][iParticle][iHisto] = nullptr;
68  hPartParamSecondaryMass [iParameterSet][iParticle][iHisto] = nullptr;
69  }
70  }
71  }
72 
73  for(int iParameterSet=0; iParameterSet<nParametersSet; iParameterSet++)
74  {
75  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
76  {
77  for(int iHisto=0; iHisto<nHistoPartParam2D; iHisto++)
78  {
79  hPartParam2D [iParameterSet][iParticle][iHisto] = nullptr;
80  hPartParam2DPrimary [iParameterSet][iParticle][iHisto] = nullptr;
81  hPartParam2DPrimaryMass [iParameterSet][iParticle][iHisto] = nullptr;
82  hPartParam2DPrimaryTopo [iParameterSet][iParticle][iHisto] = nullptr;
83  hPartParam2DPrimaryTopoMass[iParameterSet][iParticle][iHisto] = nullptr;
84  hPartParam2DSecondary [iParameterSet][iParticle][iHisto] = nullptr;
85  hPartParam2DSecondaryMass [iParameterSet][iParticle][iHisto] = nullptr;
86  }
87  }
88  }
89 
90  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
91  for(int iHisto=0; iHisto<nHistoPartParam3D; iHisto++)
92  hPartParam3D[0][iParticle][iHisto] = nullptr;
93 
94  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
95  for(int iEffSet=0; iEffSet<3; iEffSet++)
96  for(int iEff=0; iEff<nPartEfficiency; iEff++)
97  hPartEfficiency[iParticle][iEffSet][iEff] = nullptr;
98 
99  for(int iParticle=0; iParticle<KFPartEfficiencies::nParticles; iParticle++)
100  for(int iEffSet=0; iEffSet<3; iEffSet++)
101  for(int iEff=0; iEff<nPartEfficiency2D; iEff++)
102  hPartEfficiency2D[iParticle][iEffSet][iEff] = nullptr;
103 
104  for(int iEffSet=0; iEffSet<2; iEffSet++)
105  for(int iHistoPV=0; iHistoPV<nHistosPV; iHistoPV++)
106  hPVFitQa[iEffSet][iHistoPV] = nullptr;
107 
108  for(int iEffSet1=0; iEffSet1<2; iEffSet1++)
109  for(int iEffSet2=0; iEffSet2<2; iEffSet2++)
110  for(int iHistoPV=0; iHistoPV<nHistosPV-1; iHistoPV++)
111  hPVFitQa2D[iEffSet1][iEffSet2][iHistoPV] = nullptr;
112 
113  for(int iParam=0; iParam<nHistosPVParam; iParam++)
114  {
115  hPVParam [iParam] = nullptr;
116  hPVParamGhost [iParam] = nullptr;
117  hPVParamSignal[iParam] = nullptr;
118  hPVParamPileup[iParam] = nullptr;
119  hPVParamBG [iParam] = nullptr;
120  }
121 
122  for(int iParam=0; iParam<nHistosPVParam2D; iParam++)
123  hPVParam2D[iParam] = nullptr;
124 
125  for(int iFitQA=0; iFitQA<nFitPVTracksQA; iFitQA++)
126  hFitPVTracksQA[iFitQA] = nullptr;
127 
128  for(int iTP=0; iTP<nHistosTP; iTP++)
129  hTrackParameters[iTP] = nullptr;
130 
131  for(int iEffSet=0; iEffSet<4; iEffSet++)
132  for(int iEff=0; iEff<nPVefficiency; iEff++)
133  hPVefficiency[iEffSet][iEff] = nullptr;
134 }
135 
136 void KFParticlePerformanceBase::CreateHistos(std::string histoDir, TDirectory* outFile, std::map<int,bool> decays)
137 {
145  TDirectory *curdir = gDirectory;
146  if (outFile) {
147  outFile->cd();
148  fHistoDir = outFile;
149  if (histoDir != "") {
150  fHistoDir = outFile->mkdir( TString(histoDir) );
151  fHistoDir->cd();
152  }
153  } else {
154  fHistoDir = TDirectory::CurrentDirectory();
155  }
156  {
157  gDirectory->mkdir("KFParticlesFinder");
158  gDirectory->cd("KFParticlesFinder");
159  histodir = gDirectory;
160  gDirectory->mkdir("Particles");
161  gDirectory->cd("Particles");
162  for(int iPart=0; iPart<fParteff.nParticles; ++iPart)
163  {
164  if(!(decays.empty()) && (iPart < fParteff.fFirstStableParticleIndex || iPart > fParteff.fLastStableParticleIndex))
165  if(decays.find(fParteff.partPDG[iPart]) == decays.end()) continue;
166 
167  gDirectory->mkdir(fParteff.partName[iPart].data());
168  gDirectory->cd(fParteff.partName[iPart].data());
169  {
170  if(fStoreMCHistograms)
171  {
172  TString res = "res";
173  TString pull = "pull";
174 
175  gDirectory->mkdir("DaughtersQA");
176  gDirectory->cd("DaughtersQA");
177  {
178  TString parName[nFitQA/2] = {"X","Y","Z","Px","Py","Pz","E","M"};
179  int nBins = 100;
180  float xMax[nFitQA/2] = {0.15,0.15,0.03,0.01,0.01,0.06,0.06,0.01};
181  // float xMax[nFitQA/2] = {2.,2.,5.,0.3,0.3,0.3,0.03,0.03};
182 
183  for( int iH=0; iH<nFitQA/2; iH++ ){
184  hFitDaughtersQA[iPart][iH] = new TH1F((res+parName[iH]).Data(),
185  (GetDirectoryPath()+res+parName[iH]).Data(),
186  nBins, -xMax[iH],xMax[iH]);
187  hFitDaughtersQA[iPart][iH+8] = new TH1F((pull+parName[iH]).Data(),
188  (GetDirectoryPath()+pull+parName[iH]).Data(),
189  nBins, -6,6);
190  }
191  }
192  gDirectory->cd(".."); //particle directory
193 
194  gDirectory->mkdir("DSToParticleQA");
195  gDirectory->cd("DSToParticleQA");
196  {
197  TString parName[3] = {"X","Y","Z"};
198  int nBins = 100;
199  float xMax[3] = {0.5, 0.5, 2.};
200 
201  for( int iH=0; iH<3; iH++ ){
202  hDSToParticleQA[iPart][iH] = new TH1F((res+parName[iH]).Data(),
203  (GetDirectoryPath()+res+parName[iH]).Data(),
204  nBins, -xMax[iH],xMax[iH]);
205  hDSToParticleQA[iPart][iH+3] = new TH1F((pull+parName[iH]).Data(),
206  (GetDirectoryPath()+pull+parName[iH]).Data(),
207  nBins, -6,6);
208  }
209 
210  hDSToParticleQA[iPart][6] = new TH1F("r", (GetDirectoryPath()+TString("r")).Data(), 1000, 0.0, 20.0);
211  }
212  gDirectory->cd(".."); //particle directory
213 
214  CreateFitHistograms(hFitQA[iPart], iPart);
215  CreateEfficiencyHistograms(hPartEfficiency[iPart],hPartEfficiency2D[iPart]);
216  }
217  gDirectory->mkdir("Parameters");
218  gDirectory->cd("Parameters");
219  {
220  const bool drawZR = IsCollectZRHistogram(iPart);
221  CreateParameterHistograms(hPartParam[0], hPartParam2D[0], hPartParam3D[0], iPart, drawZR);
222 
223  if(IsCollect3DHistogram(iPart))
224  {
225  gDirectory->mkdir("SignalReco");
226  gDirectory->cd("SignalReco");
227  {
228  CreateParameterHistograms(hPartParam[4], hPartParam2D[4], 0, iPart, drawZR);
229  }
230  gDirectory->cd(".."); // Parameters
231  gDirectory->mkdir("BGReco");
232  gDirectory->cd("BGReco");
233  {
234  CreateParameterHistograms(hPartParam[5], hPartParam2D[5], 0, iPart, drawZR);
235  }
236  gDirectory->cd(".."); // Parameters
237  }
238 
239  if(fStoreMCHistograms)
240  {
241  gDirectory->mkdir("Signal");
242  gDirectory->cd("Signal");
243  {
244  CreateParameterHistograms(hPartParam[1], hPartParam2D[1], 0, iPart, drawZR);
245  }
246  gDirectory->cd(".."); // particle directory / Parameters
247  gDirectory->mkdir("Background");
248  gDirectory->cd("Background");
249  {
250  CreateParameterHistograms(hPartParam[2], hPartParam2D[2], 0, iPart, drawZR);
251  }
252  gDirectory->cd(".."); // particle directory
253  gDirectory->mkdir("Ghost");
254  gDirectory->cd("Ghost");
255  {
256  CreateParameterHistograms(hPartParam[3], hPartParam2D[3], 0, iPart, drawZR);
257  }
258  gDirectory->cd(".."); // Parameters
259  gDirectory->mkdir("MCSignal");
260  gDirectory->cd("MCSignal");
261  {
262  CreateParameterHistograms(hPartParam[6], hPartParam2D[6], 0, iPart, drawZR);
263  }
264  gDirectory->cd(".."); // Parameters
265 
266 
267  bool plotPrimaryHistograms = abs(fParteff.partPDG[iPart]) == 310 ||
268  abs(fParteff.partPDG[iPart]) == 3122 ||
269  abs(fParteff.partPDG[iPart]) == 22 ||
270  abs(fParteff.partPDG[iPart]) == 111 ||
271  abs(fParteff.partPDG[iPart]) == 3312 ||
272  abs(fParteff.partPDG[iPart]) == 3334;
273 
274  bool plotSecondaryHistograms = abs(fParteff.partPDG[iPart]) == 310 ||
275  abs(fParteff.partPDG[iPart]) == 3122 ||
276  abs(fParteff.partPDG[iPart]) == 22 ||
277  abs(fParteff.partPDG[iPart]) == 111;
278 
279  if(fStorePrimSecHistograms && plotPrimaryHistograms)
280  {
281  gDirectory->mkdir("Primary");
282  gDirectory->cd("Primary");
283  {
284  CreateParameterSubfolder("NoConstraint (1C-Fit)", hPartParamPrimary, hPartParam2DPrimary, hFitQANoConstraint, iPart, true);
285  CreateParameterSubfolder("MassConstraint (2C-Fit)", hPartParamPrimaryMass, hPartParam2DPrimaryMass, hFitQAMassConstraint, iPart, true);
286  CreateParameterSubfolder("PVConstraint (3C-Fit)", hPartParamPrimaryTopo, hPartParam2DPrimaryTopo, hFitQATopoConstraint, iPart, true);
287  CreateParameterSubfolder("PVMassConstraint (4C-Fit)", hPartParamPrimaryTopoMass, hPartParam2DPrimaryTopoMass, hFitQATopoMassConstraint, iPart, true);
288  }
289  gDirectory->cd(".."); // particle directory / Parameters
290  }
291 
292  if(fStorePrimSecHistograms && plotSecondaryHistograms)
293  {
294  gDirectory->mkdir("Secondary");
295  gDirectory->cd("Secondary");
296  {
297  CreateParameterSubfolder("NoConstraint (1C-Fit)", hPartParamSecondary, hPartParam2DSecondary, 0, iPart, true);
298  CreateParameterSubfolder("MassConstraint (2C-Fit)", hPartParamSecondaryMass, hPartParam2DSecondaryMass, 0, iPart, true);
299  }
300  gDirectory->cd(".."); // particle directory / Parameters
301  }
302  }
303  }
304  gDirectory->cd(".."); //particle directory
305  }
306  gDirectory->cd(".."); //Particles
307  }
308  gDirectory->cd(".."); //main
309  gDirectory->mkdir("PrimaryVertexQA");
310  gDirectory->cd("PrimaryVertexQA");
311  {
312  struct {
313  TString name;
314  TString title;
315  Int_t n;
316  Double_t l,r;
317  } Table[nHistosPV]=
318  {
319  {"PVResX", "x_{rec}-x_{mc}, cm", 100, -0.1f, 0.1f},
320  {"PVResY", "y_{rec}-y_{mc}, cm", 100, -0.1f, 0.1f},
321  {"PVResZ", "z_{rec}-z_{mc}, cm", 100, -1.f, 1.f},
322  {"PVPullX", "Pull X", 100, -6.f, 6.f},
323  {"PVPullY", "Pull Y", 100, -6.f, 6.f},
324  {"PVPullZ", "Pull Z", 100, -6.f, 6.f},
325  {"Lost", "Lost tracks", 102, -0.01f, 1.01f}
326  };
327 
328  TString parName[nHistosPVParam] = {"x","y","z","r","Ntracks","Chi2","NDF","Chi2NDF","prob", "PVpurity",
329  "ghostTr", "triggerTr", "pileupTr", "bgTr", "dzSamePV"};
330  TString parAxisName[nHistosPVParam] = {"x [cm]","y [cm]","z [cm]","r [cm]","N tracks","Chi2","NDF","Chi2NDF","prob","purity",
331  "ghost tracks [%]", "trigger tracks [%]", "pileup tracks [%]", "bg tracks [%]", "dz [cm]"};
332  int nBins[nHistosPVParam] = {1000,1000,1000,1000,1001,10000,1001,10000,100,102,102,102,102,102,1000};
333  float xMin[nHistosPVParam] = {-1., -1., -10., 0, -0.5, 0., -0.5, 0., 0., -0.01, -0.01, -0.01, -0.01, -0.01, 0.};
334  float xMax[nHistosPVParam] = { 1., 1., 10., 10, 1000.5, 1000., 1000.5, 1000., 1., 1.01, 1.01, 1.01, 1.01, 1.01, 100.};
335 
336  TString parName2D[nHistosPVParam2D] = {"xy"};
337  TString parXAxisName2D[nHistosPVParam2D] = {"x [cm]"};
338  TString parYAxisName2D[nHistosPVParam2D] = {"y [cm]"};
339  int nBinsX2D[nHistosPVParam2D] = {1000};
340  float xMin2D[nHistosPVParam2D] = {-1.};
341  float xMax2D[nHistosPVParam2D] = { 1.};
342  int nBinsY2D[nHistosPVParam2D] = {1000};
343  float yMin2D[nHistosPVParam2D] = {-1.};
344  float yMax2D[nHistosPVParam2D] = { 1.};
345 
346  for(int iH=0; iH<nHistosPVParam; iH++)
347  {
348  hPVParam[iH] = new TH1F(parName[iH].Data(),(GetDirectoryPath()+parName[iH]).Data(),
349  nBins[iH],xMin[iH],xMax[iH]);
350  hPVParam[iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
351  }
352 
353  for(int iH=0; iH<nHistosPVParam2D; iH++)
354  {
355  hPVParam2D[iH] = new TH2F(parName2D[iH].Data(),(GetDirectoryPath()+parName2D[iH]).Data(),
356  nBinsX2D[iH],xMin2D[iH],xMax2D[iH],
357  nBinsY2D[iH],yMin2D[iH],yMax2D[iH]);
358  hPVParam2D[iH]->GetXaxis()->SetTitle(parXAxisName2D[iH].Data());
359  hPVParam2D[iH]->GetYaxis()->SetTitle(parYAxisName2D[iH].Data());
360  hPVParam2D[iH]->GetYaxis()->SetTitleOffset(1.0);
361  }
362 
363  gDirectory->mkdir("Efficiency");
364  gDirectory->cd("Efficiency");
365  {
366  TString effName[nPVefficiency] = {"effVsNMCPVTracks","effVsNMCPV","effVsNMCTracks","effVsNPVTracks","effVsNPV","effVsNTracks"};
367  int nBinsEff[nPVefficiency] = { 100 , 100 , 100 , 100 , 100 , 1000 };
368  float xMinEff[nPVefficiency] = { 0., 0., 0., 0., 0., 0.};
369  float xMaxEff[nPVefficiency] = { 100., 100., 1000., 100., 100., 1000.};
370 
371  gDirectory->mkdir("Signal");
372  gDirectory->cd("Signal");
373  {
374  for( int iH=0; iH<nPVefficiency; iH++ ){
375  hPVefficiency[0][iH] = new TProfile( effName[iH].Data(), (GetDirectoryPath()+effName[iH]).Data(), nBinsEff[iH], xMinEff[iH], xMaxEff[iH]);
376  }
377  }
378  gDirectory->cd(".."); //L1
379 
380  gDirectory->mkdir("Pileup");
381  gDirectory->cd("Pileup");
382  {
383  for( int iH=0; iH<nPVefficiency; iH++ ){
384  hPVefficiency[1][iH] = new TProfile( effName[iH].Data(), (GetDirectoryPath()+effName[iH].Data()), nBinsEff[iH], xMinEff[iH], xMaxEff[iH]);
385  }
386  }
387  gDirectory->cd(".."); //L1
388 
389  gDirectory->mkdir("Signal_MCReconstructable");
390  gDirectory->cd("Signal_MCReconstructable");
391  {
392  for( int iH=0; iH<nPVefficiency; iH++ ){
393  hPVefficiency[2][iH] = new TProfile( effName[iH].Data(), (GetDirectoryPath()+effName[iH].Data()), nBinsEff[iH], xMinEff[iH], xMaxEff[iH]);
394  }
395  }
396  gDirectory->cd(".."); //L1
397 
398  gDirectory->mkdir("Pileup_MCReconstructable");
399  gDirectory->cd("Pileup_MCReconstructable");
400  {
401  for( int iH=0; iH<nPVefficiency; iH++ ){
402  hPVefficiency[3][iH] = new TProfile( effName[iH].Data(), (GetDirectoryPath()+effName[iH].Data()), nBinsEff[iH], xMinEff[iH], xMaxEff[iH]);
403  }
404  }
405  gDirectory->cd(".."); //L1
406  }
407  gDirectory->cd(".."); //L1
408 
409  gDirectory->mkdir("PVTracksQA");
410  gDirectory->cd("PVTracksQA");
411  {
412  TString resTrPV = "resTrPV";
413  TString pullTrPV = "pullTrPV";
414  TString parNameTrPV[nFitPVTracksQA/2] = {"X","Y","Z","Px","Py","Pz"};
415  int nBinsTrPV = 100;
416  float xMaxTrPV[nFitPVTracksQA/2] = {0.5,0.5,0.5,0.05,0.05,0.05};
417 
418  for( int iH=0; iH<nFitPVTracksQA/2; iH++ ){
419  hFitPVTracksQA[iH] = new TH1F((resTrPV+parNameTrPV[iH]).Data(),
420  (GetDirectoryPath()+resTrPV+parNameTrPV[iH]).Data(),
421  nBinsTrPV, -xMaxTrPV[iH],xMaxTrPV[iH]);
422  hFitPVTracksQA[iH+nFitPVTracksQA/2] = new TH1F((pullTrPV+parNameTrPV[iH]).Data(),
423  (GetDirectoryPath()+pullTrPV+parNameTrPV[iH]).Data(),
424  nBinsTrPV, -6,6);
425  }
426  }
427  gDirectory->cd(".."); //L1
428 
429  gDirectory->mkdir("Signal");
430  gDirectory->cd("Signal");
431  {
432  gDirectory->mkdir("FitQA");
433  gDirectory->cd("FitQA");
434  {
435  gDirectory->mkdir("FitQAvcNMCPVTracks");
436  gDirectory->cd("FitQAvcNMCPVTracks");
437  {
438  for(int iHPV=0; iHPV<nHistosPV-1; ++iHPV){
439  hPVFitQa2D[0][0][iHPV] = new TH2F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
440  500, 0., 5000.,
441  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
442  }
443  }
444  gDirectory->cd(".."); //FitQA
445 
446  gDirectory->mkdir("FitQAvcNPVTracks");
447  gDirectory->cd("FitQAvcNPVTracks");
448  {
449  for(int iHPV=0; iHPV<nHistosPV-1; ++iHPV){
450  hPVFitQa2D[0][1][iHPV] = new TH2F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
451  500, 0., 5000.,
452  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
453  }
454  }
455  gDirectory->cd(".."); //FitQA
456 
457  for(int iHPV=0; iHPV<nHistosPV; ++iHPV){
458  hPVFitQa[0][iHPV] = new TH1F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
459  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
460  }
461  }
462  gDirectory->cd(".."); //Signal
463 
464  for(int iH=0; iH<nHistosPVParam; iH++)
465  {
466  hPVParamSignal[iH] = new TH1F((parName[iH]).Data(),(GetDirectoryPath()+parName[iH]).Data(),
467  nBins[iH],xMin[iH],xMax[iH]);
468  hPVParamSignal[iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
469  }
470  }
471  gDirectory->cd(".."); //L1
472 
473  gDirectory->mkdir("Pileup");
474  gDirectory->cd("Pileup");
475  {
476  gDirectory->mkdir("FitQA");
477  gDirectory->cd("FitQA");
478  {
479  gDirectory->mkdir("FitQAvcNMCPVTracks");
480  gDirectory->cd("FitQAvcNMCPVTracks");
481  {
482  for(int iHPV=0; iHPV<nHistosPV-1; ++iHPV){
483  hPVFitQa2D[1][0][iHPV] = new TH2F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
484  500, 0., 5000.,
485  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
486  }
487  }
488  gDirectory->cd(".."); //FitQA
489 
490  gDirectory->mkdir("FitQAvcNPVTracks");
491  gDirectory->cd("FitQAvcNPVTracks");
492  {
493  for(int iHPV=0; iHPV<nHistosPV-1; ++iHPV){
494  hPVFitQa2D[1][1][iHPV] = new TH2F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
495  500, 0., 5000.,
496  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
497  }
498  }
499  gDirectory->cd(".."); //FitQA
500 
501  for(int iHPV=0; iHPV<nHistosPV; ++iHPV){
502  hPVFitQa[1][iHPV] = new TH1F(Table[iHPV].name.Data(),(GetDirectoryPath()+Table[iHPV].title).Data(),
503  Table[iHPV].n, Table[iHPV].l, Table[iHPV].r);
504  }
505  }
506  gDirectory->cd(".."); //Signal
507 
508  for(int iH=0; iH<nHistosPVParam; iH++)
509  {
510  hPVParamPileup[iH] = new TH1F((parName[iH]).Data(),(GetDirectoryPath()+parName[iH]).Data(),
511  nBins[iH],xMin[iH],xMax[iH]);
512  hPVParamPileup[iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
513  }
514  }
515  gDirectory->cd(".."); //L1
516 
517  gDirectory->mkdir("Background");
518  gDirectory->cd("Background");
519  {
520  for(int iH=0; iH<nHistosPVParam; iH++)
521  {
522  hPVParamBG[iH] = new TH1F((parName[iH]).Data(),(GetDirectoryPath()+parName[iH]).Data(),
523  nBins[iH],xMin[iH],xMax[iH]);
524  hPVParamBG[iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
525  }
526  }
527  gDirectory->cd(".."); //L1
528 
529  gDirectory->mkdir("Ghost");
530  gDirectory->cd("Ghost");
531  {
532  for(int iH=0; iH<nHistosPVParam; iH++)
533  {
534  hPVParamGhost[iH] = new TH1F((parName[iH]).Data(),(GetDirectoryPath()+parName[iH]).Data(),
535  nBins[iH],xMin[iH],xMax[iH]);
536  hPVParamGhost[iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
537  }
538  }
539  gDirectory->cd(".."); //L1
540  }
541  gDirectory->cd(".."); //L1
542  gDirectory->mkdir("TrackParameters");
543  gDirectory->cd("TrackParameters");
544  {
545  TString chi2Name = "Chi2Prim";
546  for(int iPart=0; iPart < KFPartEfficiencies::nParticles; iPart++)
547  {
548  TString chi2NamePart = "Chi2Prim";
549  chi2NamePart += "_";
550  chi2NamePart += fParteff.partName[iPart].data();
551  hTrackParameters[iPart] = new TH1F(chi2NamePart.Data(), (GetDirectoryPath()+chi2NamePart).Data(), 1000, 0, 100);
552 
553  }
554  hTrackParameters[KFPartEfficiencies::nParticles ] = new TH1F("Chi2Prim_total", (GetDirectoryPath()+TString("Chi2Prim_total")), 1000, 0, 100);
555  hTrackParameters[KFPartEfficiencies::nParticles+1] = new TH1F("Chi2Prim_prim", (GetDirectoryPath()+TString("Chi2Prim_prim")), 1000, 0, 100);
556  hTrackParameters[KFPartEfficiencies::nParticles+2] = new TH1F("Chi2Prim_sec", (GetDirectoryPath()+TString("Chi2Prim_sec")), 1000, 0, 100);
557  hTrackParameters[KFPartEfficiencies::nParticles+3] = new TH1F("Chi2Prim_ghost", (GetDirectoryPath()+TString("Chi2Prim_ghost")), 1000, 0, 100);
558 
559  hTrackParameters[KFPartEfficiencies::nParticles+4] = new TH1F("ProbPrim_total", (GetDirectoryPath()+TString("ProbPrim_total")), 10000, 0, 1);
560  hTrackParameters[KFPartEfficiencies::nParticles+5] = new TH1F("ProbPrim_prim", (GetDirectoryPath()+TString("ProbPrim_prim")), 10000, 0, 1);
561  hTrackParameters[KFPartEfficiencies::nParticles+6] = new TH1F("ProbPrim_sec", (GetDirectoryPath()+TString("ProbPrim_sec")), 10000, 0, 1);
562  hTrackParameters[KFPartEfficiencies::nParticles+7] = new TH1F("ProbPrim_ghost", (GetDirectoryPath()+TString("ProbPrim_ghost")), 10000, 0, 1);
563  }
564  gDirectory->cd(".."); //particle directory
565  curdir->cd();
566  }
567 }
568 
569 void KFParticlePerformanceBase::CreateFitHistograms(TH1F* histo[nFitQA], int iPart)
570 {
575  TString res = "res";
576  TString pull = "pull";
577 
578  TString AxisNameResidual[nFitQA/2];
579  TString AxisNamePull[nFitQA/2];
580 
581  AxisNameResidual[0] = "Residual (x^{reco} - x^{mc}) [cm]";
582  AxisNameResidual[1] = "Residual (y^{reco} - y^{mc}) [cm]";
583  AxisNameResidual[2] = "Residual (z^{reco} - z^{mc}) [cm]";
584  AxisNameResidual[3] = "Residual (P_{x}^{reco} - P_{x}^{mc}) [GeV/c]";
585  AxisNameResidual[4] = "Residual (P_{y}^{reco} - P_{y}^{mc}) [GeV/c]";
586  AxisNameResidual[5] = "Residual (P_{z}^{reco} - P_{z}^{mc}) [GeV/c]";
587  AxisNameResidual[6] = "Residual (E^{reco} - E^{mc}) [GeV/c^{2}]";
588  AxisNameResidual[7] = "Residual (M^{reco} - M^{mc}) [GeV/c^{2}]";
589 
590  AxisNamePull[0] = "Pull x";
591  AxisNamePull[1] = "Pull y";
592  AxisNamePull[2] = "Pull z";
593  AxisNamePull[3] = "Pull P_{x}";
594  AxisNamePull[4] = "Pull P_{y}";
595  AxisNamePull[5] = "Pull P_{z}";
596  AxisNamePull[6] = "Pull E";
597  AxisNamePull[7] = "Pull M";
598 
599  gDirectory->mkdir("FitQA");
600  gDirectory->cd("FitQA");
601  {
602  TString parName[nFitQA/2] = {"X","Y","Z","Px","Py","Pz","E","M"};
603  int nBins = 50;
604  float xMax[nFitQA/2] = {0.15,0.15,1.2,0.02,0.02,0.15,0.15,0.006};
605  float mult[nFitQA/2]={1.f,1.f,1.f,1.f,1.f,1.f,1.f,1.f};
606  if(iPart>63 && iPart<75)
607  for(int iMult=3; iMult<nFitQA/2; iMult++)
608  mult[iMult] = 3;
609  if(iPart>45 && iPart<64)
610  {
611 #ifdef CBM
612  for(int iMult=0; iMult<3; iMult++)
613  mult[iMult] = 0.03;
614  for(int iMult=3; iMult<nFitQA/2; iMult++)
615  mult[iMult] = 3;
616 #else
617  mult[2] = 0.1;
618  for(int iMult=3; iMult<nFitQA/2; iMult++)
619  mult[iMult] = 10;
620  mult[5] = 2;
621  mult[6] = 2;
622 #endif
623  }
624  if(iPart==44 || iPart==45)
625  {
626  mult[0] = 0.25;
627  mult[1] = 0.5;
628  mult[2] = 0.15;
629  for(int iMult=3; iMult<nFitQA/2; iMult++)
630  mult[iMult] = 4;
631  }
632 
633  for( int iH=0; iH<nFitQA/2; iH++ )
634  {
635  histo[iH] = new TH1F((res+parName[iH]).Data(),
636  (GetDirectoryPath()+res+parName[iH]).Data(),
637  nBins, -mult[iH]*xMax[iH],mult[iH]*xMax[iH]);
638  histo[iH]->GetXaxis()->SetTitle(AxisNameResidual[iH].Data());
639  histo[iH+8] = new TH1F((pull+parName[iH]).Data(),
640  (GetDirectoryPath()+pull+parName[iH]).Data(),
641  nBins, -6,6);
642  histo[iH+8]->GetXaxis()->SetTitle(AxisNamePull[iH+8].Data());
643  }
644  }
645  gDirectory->cd("..");
646 }
647 
648 void KFParticlePerformanceBase::CreateEfficiencyHistograms(TProfile* histo[3][nPartEfficiency], TProfile2D* histo2[3][nPartEfficiency2D])
649 {
654  gDirectory->mkdir("Efficiency");
655  gDirectory->cd("Efficiency");
656  {//vs p, pt, y, z, c*tau, decay length, l, r
657  TString partNameEff[nPartEfficiency] = {"EffVsP","EffVsPt","EffVsY","EffVsZ","EffVsCT","EffVsDL","EffVsL","EffVsR","EffVsMt" };
658  TString partAxisNameEff[nPartEfficiency] = {"p [GeV/c]","p_{t} [GeV/c]",
659  "y", "z [cm]", "Life time c#tau [cm]", "Decay length [cm]",
660  "L [cm]", "Rxy [cm]", "m_{t} [GeV/c^{2}]"};
661 #ifdef CBM
662  int nBinsEff[nPartEfficiency] = { 100 , 100 , 100 , 360 , 100 , 100 , 200 , 200 , 100 };
663  float xMinEff[nPartEfficiency] = { 0., 0., 0., -10., 0., 0., 0., 0. , 0.};
664  float xMaxEff[nPartEfficiency] = { 20., 5., 6., 80., 100., 100., 100., 50. , 4.};
665 #else
666  int nBinsEff[nPartEfficiency] = { 100 , 100 , 30 , 100 , 100 , 100 , 100 , 100 , 100 };
667  float xMinEff[nPartEfficiency] = { 0., 0., -1.5, -10., 0., 0., 0., 0., 0. };
668  float xMaxEff[nPartEfficiency] = { 10., 10., 1.5, 10., 30., 5., 1., 1., 10. };
669 #endif
670  TString effTypeName[3] = {"All particles",
671  "Reconstructable daughters",
672  "Reconstructed daughters"};
673 
674  for(int iEff=0; iEff<3; iEff++)
675  {
676  gDirectory->mkdir(effTypeName[iEff].Data());
677  gDirectory->cd(effTypeName[iEff].Data());
678  {
679  for(int iH=0; iH<nPartEfficiency; iH++)
680  {
681  histo[iEff][iH] = new TProfile( partNameEff[iH].Data(), (GetDirectoryPath()+partAxisNameEff[iH]).Data(), nBinsEff[iH], xMinEff[iH], xMaxEff[iH]);
682  histo[iEff][iH]->GetYaxis()->SetTitle("Efficiency");
683  histo[iEff][iH]->GetYaxis()->SetTitleOffset(1.0);
684  histo[iEff][iH]->GetXaxis()->SetTitle(partAxisNameEff[iH].Data());
685  }
686 
687  histo2[iEff][0] = new TProfile2D( "EffVsPtVsY", (GetDirectoryPath()+partAxisNameEff[2]+partAxisNameEff[1]).Data(),
688  nBinsEff[2], xMinEff[2], xMaxEff[2], nBinsEff[1], xMinEff[1], xMaxEff[1]);
689  histo2[iEff][0]->GetZaxis()->SetTitle("Efficiency");
690  histo2[iEff][0]->GetXaxis()->SetTitle(partAxisNameEff[2].Data());
691  histo2[iEff][0]->GetYaxis()->SetTitle(partAxisNameEff[1].Data());
692  histo2[iEff][0]->GetYaxis()->SetTitleOffset(1.0);
693 
694  histo2[iEff][1] = new TProfile2D( "EffVsMtVsY", (GetDirectoryPath()+partAxisNameEff[2]+partAxisNameEff[8]).Data(),
695  nBinsEff[2], xMinEff[2], xMaxEff[2], nBinsEff[8], xMinEff[8], xMaxEff[8]);
696  histo2[iEff][1]->GetZaxis()->SetTitle("Efficiency");
697  histo2[iEff][1]->GetXaxis()->SetTitle(partAxisNameEff[2].Data());
698  histo2[iEff][1]->GetYaxis()->SetTitle(partAxisNameEff[8].Data());
699  histo2[iEff][1]->GetYaxis()->SetTitleOffset(1.0);
700  }
701  gDirectory->cd("..");// particle directory / Efficiency
702  }
703  }
704  gDirectory->cd("..");// particle directory
705 }
706 
707 void KFParticlePerformanceBase::CreateParameterHistograms(TH1F* histoParameters[KFPartEfficiencies::nParticles][nHistoPartParam],
708  TH2F *histoParameters2D[KFPartEfficiencies::nParticles][nHistoPartParam2D],
709  TH3F *histoParameters3D[KFPartEfficiencies::nParticles][nHistoPartParam3D],
710  int iPart, bool drawZR)
711 {
719  TString parName[nHistoPartParam] = {"M","p","p_{t}","y","DecayL","c#tau","chi2ndf","prob","#theta","phi","X","Y","Z","R", "L", "l/dl","m_{t}","Multiplicity"};
720  TString parTitle[nHistoPartParam];
721  TString parName2D[nHistoPartParam2D] = {"y-p_{t}", "Z-R", "Armenteros", "y-m_{t}"};
722  TString parTitle2D[nHistoPartParam2D];
723  TString parName3D[nHistoPartParam3D] = {"y-p_{t}-M", "y-m_{t}-M", "centrality-pt-M", "centrality-y-M", "centrality-mt-M", "ct-pt-M"};
724  TString parTitle3D[nHistoPartParam3D];
725  for(int iParam=0; iParam<nHistoPartParam; iParam++)
726  {
727  TString path = GetDirectoryPath();
728  parTitle[iParam] = path + parName[iParam];
729  if(iParam<nHistoPartParam2D)
730  parTitle2D[iParam] = path + parName2D[iParam];
731  if(iParam<nHistoPartParam3D)
732  parTitle3D[iParam] = path + parName3D[iParam];
733  }
734 
735  TString parAxisName[nHistoPartParam] = {"m [GeV/c^{2}]","p [GeV/c]","p_{t} [GeV/c]",
736  "y","Decay length [cm]","Life time c#tau [cm]",
737  "chi2/ndf","prob","#theta [rad]",
738  "phi [rad]","x [cm]","y [cm]","z [cm]","Rxy [cm]", "L [cm]", "L/dL","m_{t} [GeV/c^{2}]","Multiplicity"};
739 #ifdef CBM
740  int nBins[nHistoPartParam] = {1000, // M
741  100, // p
742  100, // pt
743  40, // y
744  60, // DecayL
745  60, // ctau
746  100, // chi2/ndf
747  100, // prob
748  100, // theta
749  100, // phi
750  200, // X
751  200, // Y
752  360, // Z
753  60, // R
754  140, // L
755  200, // L/dL
756  100, // Mt
757  fParteff.partMaxMult[iPart]+1};
758  float xMin[nHistoPartParam] = { fParteff.partMHistoMin[iPart], // M
759  0.f, // p
760  0.f, // pt
761  0.f, // y
762  -10.f, // DecayL
763  -10.f, // ctau
764  0.f, // chi2/ndf
765  0.f, // prob
766  -2.f, // theta
767  -2.f, // phi
768  -50.f, // X
769  -50.f, // Y
770  -10.f, // Z
771  0.f, // R
772  0.f, // L
773  -1.f, // L/dL
774  0.f, // Mt
775  -0.5f };
776  float xMax[nHistoPartParam] = { fParteff.partMHistoMax[iPart], // M
777  20.f, // p
778  5.f, // pt
779  4.f, // y
780  50.f, // DecayL
781  50.f, // ctau
782  20.f, // chi2/ndf
783  1.f, // prob
784  2.f, // theta
785  2.f, // phi
786  50.f, // X
787  50.f, // Y
788  80.f, // Z
789  30.f, // R
790  70.f, // L
791  35.f, // L/dL
792  4.f, // Mt
793  float(fParteff.partMaxMult[iPart])+0.5f};
794 #else
795  int nBins[nHistoPartParam] = {1000, // M
796  100, // p
797  100, // pt
798  30, // y
799  60, // DecayL
800  60, // ctau
801  100, // chi2/ndf
802  100, // prob
803  100, // theta
804  100, // phi
805  100, // X
806  100, // Y
807  100, // Z
808  100, // R
809  100, // L
810  1000, // L/dL
811  100, // Mt
812  fParteff.partMaxMult[iPart]+1};
813  float xMin[nHistoPartParam] = { fParteff.partMHistoMin[iPart], // M
814  0.f, // p
815  0.f, // pt
816  -1.5f, // y
817  -10.f, // DecayL
818  -10.f, // ctau
819  0.f, // chi2/ndf
820  0.f, // prob
821  0.f, // theta
822  -3.1416f, // phi
823  -10.f, // X
824  -10.f, // Y
825  -30.f, // Z
826  0.f, // R
827  0.f, // L
828  -1.f, // L/dL
829  0.f, // Mt
830  -0.5f };
831  float xMax[nHistoPartParam] = { fParteff.partMHistoMax[iPart], // M
832  10.f, // p
833  10.f, // pt
834  1.5f, // y
835  50.f, // DecayL
836  50.f, // ctau
837  20.f, // chi2/ndf
838  1.f, // prob
839  3.1416f, // theta
840  3.1416f, // phi
841  10.f, // X
842  10.f, // Y
843  30.f, // Z
844  50.f, // R
845  50.f, // L
846  35.f, // L/dL
847  10.f, // Mt
848  float(fParteff.partMaxMult[iPart])+0.5f};
849  if(iPart < 9)
850  {
851  xMin[10] =-50; xMin[11] =-50; xMin[12] =-100;
852  xMax[10] = 50; xMax[11] = 50; xMax[12] = 100; xMax[13] = 50; xMax[14] = 50;
853  }
854 #endif
855  for(int iH=0; iH<nHistoPartParam; iH++)
856  {
857  histoParameters[iPart][iH] = new TH1F(parName[iH].Data(),parTitle[iH].Data(),
858  nBins[iH],xMin[iH],xMax[iH]);
859  histoParameters[iPart][iH]->GetXaxis()->SetTitle(parAxisName[iH].Data());
860  }
861 
862  histoParameters2D[iPart][0] = new TH2F(parName2D[0].Data(),parTitle2D[0].Data(),
863  nBins[3],xMin[3],xMax[3],
864  nBins[2],xMin[2],xMax[2]);
865  histoParameters2D[iPart][0]->GetXaxis()->SetTitle("y");
866  histoParameters2D[iPart][0]->GetYaxis()->SetTitle("p_{t} [GeV/c]");
867  histoParameters2D[iPart][0]->GetYaxis()->SetTitleOffset(1.0);
868 
869  if(drawZR)
870  {
871  histoParameters2D[iPart][1] = new TH2F(parName2D[1].Data(),parTitle2D[1].Data(),
872  nBins[12],xMin[12],xMax[12],
873  nBins[13],xMin[13],xMax[13]);
874  histoParameters2D[iPart][1]->GetXaxis()->SetTitle("Z [cm]");
875  histoParameters2D[iPart][1]->GetYaxis()->SetTitle("R [cm]");
876  histoParameters2D[iPart][1]->GetYaxis()->SetTitleOffset(1.0);
877  }
878  else
879  histoParameters2D[iPart][1] = NULL;
880 
881  //create armenteros plot
882  if(IsCollectArmenteros(iPart))
883  {
884  histoParameters2D[iPart][2] = new TH2F(parName2D[2].Data(),parTitle2D[2].Data(),
885  50, -1.f, 1.f,
886  150, 0.f, 1.f);
887  histoParameters2D[iPart][2]->GetXaxis()->SetTitle("#alpha (p_{L}^{+}-p_{L}^{-})/(p_{L}^{+}+p_{L}^{-})");
888  histoParameters2D[iPart][2]->GetYaxis()->SetTitle("q_{t} [GeV/c]");
889  histoParameters2D[iPart][2]->GetYaxis()->SetTitleOffset(1.0);
890  }
891  else
892  histoParameters2D[iPart][2] = NULL;
893  //create y-mt plot
894  histoParameters2D[iPart][3] = new TH2F(parName2D[3].Data(),parTitle2D[3].Data(),
895  nBins[3],xMin[3], xMax[3], //y
896  nBins[16],xMin[16],xMax[16]); //Mt
897  histoParameters2D[iPart][3]->GetXaxis()->SetTitle("y");
898  histoParameters2D[iPart][3]->GetYaxis()->SetTitle("m_{t} [GeV/c]");
899  histoParameters2D[iPart][3]->GetYaxis()->SetTitleOffset(1.0);
900 
901 
902  if( histoParameters3D && IsCollect3DHistogram(iPart) )
903  {
904  histoParameters3D[iPart][0] = new TH3F(parName3D[0].Data(),parTitle3D[0].Data(),
905  nBins[3],xMin[3],xMax[3],
906  nBins[2],xMin[2],xMax[2],
907  nBins[0],xMin[0],xMax[0]);
908  histoParameters3D[iPart][0]->GetXaxis()->SetTitle("y");
909  histoParameters3D[iPart][0]->GetYaxis()->SetTitle("p_{t} [GeV/c]");
910  histoParameters3D[iPart][0]->GetYaxis()->SetTitleOffset(1.0);
911  histoParameters3D[iPart][0]->GetZaxis()->SetTitle("M");
912 
913  histoParameters3D[iPart][1] = new TH3F(parName3D[1].Data(),parTitle3D[1].Data(),
914  nBins[3],xMin[3],xMax[3],
915  nBins[16],xMin[16],xMax[16],
916  nBins[0],xMin[0],xMax[0]);
917  histoParameters3D[iPart][1]->GetXaxis()->SetTitle("y");
918  histoParameters3D[iPart][1]->GetYaxis()->SetTitle("m_{t} [GeV/c]");
919  histoParameters3D[iPart][1]->GetYaxis()->SetTitleOffset(1.0);
920  histoParameters3D[iPart][1]->GetZaxis()->SetTitle("M");
921 
922  int centralityHisto[3] = {2,3,16};
923  for(int iCH = 0; iCH<3; iCH++)
924  {
925  histoParameters3D[iPart][2+iCH] = new TH3F(parName3D[2+iCH].Data(),parTitle3D[2+iCH].Data(),
926  10,0.,10.,
927  nBins[centralityHisto[iCH]],xMin[centralityHisto[iCH]],xMax[centralityHisto[iCH]],
928  nBins[0],xMin[0],xMax[0]);
929  histoParameters3D[iPart][2+iCH]->GetXaxis()->SetTitle("centrality bin");
930  histoParameters3D[iPart][2+iCH]->GetYaxis()->SetTitle(parAxisName[centralityHisto[iCH]]);
931  histoParameters3D[iPart][2+iCH]->GetYaxis()->SetTitleOffset(1.0);
932  histoParameters3D[iPart][2+iCH]->GetZaxis()->SetTitle("M");
933  }
934 
935  histoParameters3D[iPart][5] = new TH3F(parName3D[5].Data(),parTitle3D[5].Data(),
936  nBins[5],xMin[5],xMax[5],
937  nBins[2],xMin[2],xMax[2],
938  nBins[0],xMin[0],xMax[0]);
939  histoParameters3D[iPart][5]->GetXaxis()->SetTitle("c#tau [cm]");
940  histoParameters3D[iPart][5]->GetYaxis()->SetTitle("p_{t} [GeV/c]");
941  histoParameters3D[iPart][5]->GetYaxis()->SetTitleOffset(1.0);
942  histoParameters3D[iPart][5]->GetZaxis()->SetTitle("M");
943  }
944  else if(histoParameters3D)
945  {
946  histoParameters3D[iPart][0] = NULL;
947  histoParameters3D[iPart][1] = NULL;
948  for(int iCH = 0; iCH<3; iCH++)
949  histoParameters3D[iPart][2+iCH] = NULL;
950  histoParameters3D[iPart][5] = NULL;
951  }
952 }
953 
954 bool KFParticlePerformanceBase::IsCollectZRHistogram(int iParticle) const
955 {
957  return (abs(fParteff.partPDG[iParticle]) == 310 ||
958  abs(fParteff.partPDG[iParticle]) == 3122 ||
959  abs(fParteff.partPDG[iParticle]) == 3312 ||
960  abs(fParteff.partPDG[iParticle]) == 3334 ||
961  abs(fParteff.partPDG[iParticle]) == 22) && fStoreMCHistograms && fStoreZRHistograms;
962 }
963 
964 bool KFParticlePerformanceBase::IsCollect3DHistogram(int iParticle) const
965 {
967  return abs(fParteff.partPDG[iParticle]) == 310 ||
968  abs(fParteff.partPDG[iParticle]) == 3122 ||
969  abs(fParteff.partPDG[iParticle]) == 3312 ||
970  abs(fParteff.partPDG[iParticle]) == 3334 ||
971  abs(fParteff.partPDG[iParticle]) == 3003 ||
972  abs(fParteff.partPDG[iParticle]) == 3103 ||
973  abs(fParteff.partPDG[iParticle]) == 3004 ||
974  abs(fParteff.partPDG[iParticle]) == 3005 ||
975 #ifdef CBM
976  abs(fParteff.partPDG[iParticle]) == 7003112 ||
977  abs(fParteff.partPDG[iParticle]) == 7003222 ||
978  abs(fParteff.partPDG[iParticle]) == 7003312 ||
979  abs(fParteff.partPDG[iParticle]) == 8003222 ||
980  abs(fParteff.partPDG[iParticle]) == 9000321;
981 #else
982  abs(fParteff.partPDG[iParticle]) == 421 ||
983  abs(fParteff.partPDG[iParticle]) == 429 ||
984  abs(fParteff.partPDG[iParticle]) == 426 ||
985  abs(fParteff.partPDG[iParticle]) == 411 ||
986  abs(fParteff.partPDG[iParticle]) == 431 ||
987  abs(fParteff.partPDG[iParticle]) == 4122 ||
988  abs(fParteff.partPDG[iParticle]) == 521 ||
989  abs(fParteff.partPDG[iParticle]) == 511;
990 #endif
991 }
992 
993 bool KFParticlePerformanceBase::IsCollectArmenteros(int iParticle) const
994 {
996  return abs(fParteff.partPDG[iParticle]) == 310 ||
997  abs(fParteff.partPDG[iParticle]) == 3122 ||
998  abs(fParteff.partPDG[iParticle]) == 3312 ||
999  abs(fParteff.partPDG[iParticle]) == 3334 ||
1000  abs(fParteff.partPDG[iParticle]) == 22 ||
1001  abs(fParteff.partPDG[iParticle]) == 111 ||
1002  abs(fParteff.partPDG[iParticle]) == 3003 ||
1003  abs(fParteff.partPDG[iParticle]) == 3103 ||
1004  abs(fParteff.partPDG[iParticle]) == 3004 ||
1005  abs(fParteff.partPDG[iParticle]) == 3005 ||
1006  abs(fParteff.partPDG[iParticle]) == 3203 ||
1007  abs(fParteff.partPDG[iParticle]) == 3008 ||
1008  abs(fParteff.partPDG[iParticle]) == 3000 ||
1009  abs(fParteff.partPDG[iParticle]) == 333 ||
1010 #ifdef CBM
1011  abs(fParteff.partPDG[iParticle]) == 7003112 ||
1012  abs(fParteff.partPDG[iParticle]) == 7003222 ||
1013  abs(fParteff.partPDG[iParticle]) == 7003312 ||
1014  abs(fParteff.partPDG[iParticle]) == 8003222 ||
1015  abs(fParteff.partPDG[iParticle]) == 9000321;
1016 #else
1017  abs(fParteff.partPDG[iParticle]) == 421 ||
1018  abs(fParteff.partPDG[iParticle]) == 420 ||
1019  abs(fParteff.partPDG[iParticle]) == 426 ||
1020  abs(fParteff.partPDG[iParticle]) == 521 ||
1021  abs(fParteff.partPDG[iParticle]) == 511;
1022 #endif
1023 }
1024 
1025 void KFParticlePerformanceBase::CreateParameterSubfolder(TString folderName,
1026  TH1F* histoParameters[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam],
1027  TH2F* histoParameters2D[nParametersSet][KFPartEfficiencies::nParticles][nHistoPartParam2D],
1028  TH1F* histoFit[KFPartEfficiencies::nParticles][nFitQA], int iPart, bool withWrongPVHypothesis)
1029 {
1031  gDirectory->mkdir(folderName.Data());
1032  gDirectory->cd(folderName.Data());
1033  {
1034  gDirectory->mkdir("Signal");
1035  gDirectory->cd("Signal");
1036  {
1037  CreateParameterHistograms(histoParameters[1], histoParameters2D[1], 0, iPart);
1038  }
1039  gDirectory->cd("..");
1040  if(withWrongPVHypothesis)
1041  {
1042  gDirectory->mkdir("WrongPVHypothesis");
1043  gDirectory->cd("WrongPVHypothesis");
1044  {
1045  CreateParameterHistograms(histoParameters[4], histoParameters2D[4], 0, iPart);
1046  }
1047  gDirectory->cd("..");
1048  }
1049  gDirectory->mkdir("Background");
1050  gDirectory->cd("Background");
1051  {
1052  CreateParameterHistograms(histoParameters[2], histoParameters2D[2], 0, iPart);
1053  }
1054  gDirectory->cd("..");
1055  gDirectory->mkdir("Ghost");
1056  gDirectory->cd("Ghost");
1057  {
1058  CreateParameterHistograms(histoParameters[3], histoParameters2D[3], 0, iPart);
1059  }
1060  gDirectory->cd("..");
1061 
1062  CreateParameterHistograms(histoParameters[0], histoParameters2D[0], 0, iPart);
1063  if(histoFit!=0)
1064  CreateFitHistograms(histoFit[iPart], iPart);
1065  }
1066  gDirectory->cd("..");
1067 }
1068 
1069 TString KFParticlePerformanceBase::GetDirectoryPath()
1070 {
1072  TString path = gDirectory->GetPath();
1073  int fileNamePosition = path.Index("Finder/");
1074  path.Remove(0, fileNamePosition+7);
1075  path.ReplaceAll("Particles/", "");
1076  path.ReplaceAll("/Parameters", "");
1077  path+=" ";
1078  return path;
1079 }
1080 
1081 #endif //DO_TPCCATRACKER_EFF_PERFORMANCE
1082