KFParticlePerformanceBase.cxx 48 KB

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