2626#include < Framework/InitContext.h>
2727#include < Framework/runDataProcessing.h>
2828
29+ #include < TAxis.h>
2930#include < TH1.h>
31+ #include < TH2.h>
3032#include < TMathBase.h>
3133#include < TPDGCode.h>
3234#include < TString.h>
@@ -44,7 +46,51 @@ using namespace o2::framework;
4446using namespace o2 ::framework::expressions;
4547
4648struct LfCascpostprocessing {
47- static constexpr int OobRejTofOnly = 2 ;
49+ static constexpr int TrackQualityTofHighPt = 2 ;
50+ static constexpr int TrackQualityMinITS = 3 ;
51+
52+ enum MisidentifiedParticleBin {
53+ kMisIdUnknown = 0 ,
54+ kMisIdElectron ,
55+ kMisIdMuon ,
56+ kMisIdPion ,
57+ kMisIdKaon ,
58+ kMisIdProton ,
59+ kMisIdK0Short ,
60+ kMisIdLambda ,
61+ kMisIdXi ,
62+ kMisIdOmega ,
63+ kMisIdOther ,
64+ kNMisidentifiedParticleBins
65+ };
66+
67+ static int getMisidentifiedParticleBin (int pdgCode)
68+ {
69+ switch (TMath::Abs (pdgCode)) {
70+ case 0 :
71+ return kMisIdUnknown ;
72+ case PDG_t::kElectron :
73+ return kMisIdElectron ;
74+ case PDG_t::kMuonMinus :
75+ return kMisIdMuon ;
76+ case PDG_t::kPiPlus :
77+ return kMisIdPion ;
78+ case PDG_t::kKPlus :
79+ return kMisIdKaon ;
80+ case PDG_t::kProton :
81+ return kMisIdProton ;
82+ case PDG_t::kK0Short :
83+ return kMisIdK0Short ;
84+ case PDG_t::kLambda0 :
85+ return kMisIdLambda ;
86+ case PDG_t::kXiMinus :
87+ return kMisIdXi ;
88+ case PDG_t::kOmegaMinus :
89+ return kMisIdOmega ;
90+ default :
91+ return kMisIdOther ;
92+ }
93+ }
4894
4995 // Xi or Omega
5096 Configurable<bool > isXi{" isXi" , 1 , " Apply cuts for Xi identification" };
@@ -79,7 +125,8 @@ struct LfCascpostprocessing {
79125 Configurable<float > nsigmatofPr{" nsigmatofPr" , 6 , " N sigma TOF Proton" };
80126 Configurable<float > nsigmatofKa{" nsigmatofKa" , 6 , " N sigma TOF Kaon" };
81127 Configurable<int > mintpccrrows{" mintpccrrows" , 50 , " min N TPC crossed rows" };
82- Configurable<int > dooobrej{" dooobrej" , 0 , " OOB rejection: 0 no selection, 1 = ITS||TOF, 2 = TOF only for pT > ptthrtof" };
128+ Configurable<int > dooobrej{" dooobrej" , 0 , " Track association requirement: 0 no selection, 1 = ITS||TOF, 2 = TOF only for pT > ptthrtof, 3 = ITS hits >= trackQualityMinITS" };
129+ Configurable<int > trackQualityMinITS{" trackQualityMinITS" , 2 , " Minimum ITS hits for dooobrej=3 track-quality variation" };
83130
84131 Configurable<bool > isSelectBachBaryon{" isSelectBachBaryon" , 0 , " Bachelor-baryon cascade selection" };
85132 Configurable<float > bachBaryonCosPA{" bachBaryonCosPA" , 0.9999 , " Bachelor baryon CosPA" };
@@ -107,6 +154,13 @@ struct LfCascpostprocessing {
107154 AxisSpec ptAxisPID = {50 , 0 .0f , 10 .0f , " #it{p}_{T} (GeV/#it{c})" };
108155 ConfigurableAxis etaAxis{" etaAxis" , {40 , -2 .0f , 2 .0f }, " #eta" };
109156 AxisSpec pdgCodeAxis = {10001 , -5000 .5f , 5000 .5f , " MC PDG code (0 = no MC assoc.)" };
157+ AxisSpec misidentifiedParticleAxis = {kNMisidentifiedParticleBins , -0 .5f , static_cast <float >(kNMisidentifiedParticleBins ) - 0 .5f , " Associated MC particle" };
158+ auto setMisidentifiedParticleLabels = [](TAxis* axis) {
159+ TString misidentifiedParticleLabels[kNMisidentifiedParticleBins ] = {" Unknown/no assoc." , " e" , " #mu" , " #pi" , " K" , " p" , " K^{0}_{S}" , " #Lambda" , " #Xi" , " #Omega" , " Other" };
160+ for (int n = 1 ; n <= kNMisidentifiedParticleBins ; n++) {
161+ axis->SetBinLabel (n, misidentifiedParticleLabels[n - 1 ]);
162+ }
163+ };
110164
111165 ConfigurableAxis centFT0MAxis{" centFT0MAxis" ,
112166 {VARIABLE_WIDTH , 0 ., 0.01 , 0.05 , 0.1 , 0.5 , 1 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 45 , 50 , 55 , 60 , 65 , 70 , 75 , 80 , 85 , 90 , 95 , 100 , 101 , 105.5 },
@@ -119,8 +173,8 @@ struct LfCascpostprocessing {
119173
120174 AxisSpec rapidityAxis = {200 , -2 .0f , 2 .0f , " y" };
121175
122- TString CutLabel[26 ] = {" All" , " MassWin" , " y" , " EtaDau" , " DCADauToPV" , " CascCosPA" , " V0CosPA" , " DCACascDau" , " DCAV0Dau" , " rCasc" , " rCascMax" , " rV0" , " rV0Max" , " DCAV0ToPV" , " LambdaMass" , " TPCPr" , " TPCPi" , " TOFPr" , " TOFPi" , " TPCBach" , " TOFBach" , " ctau" , " CompDecayMass" , " Bach-baryon" , " NTPCrows" , " OOBRej " };
123- TString CutLabelSummary[29 ] = {" MassWin" , " y" , " EtaDau" , " dcapostopv" , " dcanegtopv" , " dcabachtopv" , " CascCosPA" , " V0CosPA" , " DCACascDau" , " DCAV0Dau" , " rCasc" , " rV0" , " DCAV0ToPV" , " LambdaMass" , " TPCPr" , " TPCPi" , " TOFPr" , " TOFPi" , " TPCBach" , " TOFBach" , " proplifetime" , " rejcomp" , " ptthrtof" , " bachBaryonCosPA" , " bachBaryonDCAxyToPV" , " NTPCrows" , " OOBRej " , " rCascMax" , " rV0Max" };
176+ TString CutLabel[26 ] = {" All" , " MassWin" , " y" , " EtaDau" , " DCADauToPV" , " CascCosPA" , " V0CosPA" , " DCACascDau" , " DCAV0Dau" , " rCasc" , " rCascMax" , " rV0" , " rV0Max" , " DCAV0ToPV" , " LambdaMass" , " TPCPr" , " TPCPi" , " TOFPr" , " TOFPi" , " TPCBach" , " TOFBach" , " ctau" , " CompDecayMass" , " Bach-baryon" , " NTPCrows" , " TrackQuality " };
177+ TString CutLabelSummary[29 ] = {" MassWin" , " y" , " EtaDau" , " dcapostopv" , " dcanegtopv" , " dcabachtopv" , " CascCosPA" , " V0CosPA" , " DCACascDau" , " DCAV0Dau" , " rCasc" , " rV0" , " DCAV0ToPV" , " LambdaMass" , " TPCPr" , " TPCPi" , " TOFPr" , " TOFPi" , " TPCBach" , " TOFBach" , " proplifetime" , " rejcomp" , " ptthrtof" , " bachBaryonCosPA" , " bachBaryonDCAxyToPV" , " NTPCrows" , " TrackQuality " , " rCascMax" , " rV0Max" };
124178
125179 registry.add (" hCandidate" , " hCandidate" , HistType::kTH1F , {{26 , -0.5 , 25.5 }});
126180 for (Int_t n = 1 ; n <= registry.get <TH1 >(HIST (" hCandidate" ))->GetNbinsX (); n++) {
@@ -242,6 +296,14 @@ struct LfCascpostprocessing {
242296 registry.add (" hMisidentifiedCascPdgCode" , " hMisidentifiedCascPdgCode" , {HistType::kTH1F , {pdgCodeAxis}});
243297 registry.add (" hMisidentifiedCascMinusPdgCode" , " hMisidentifiedCascMinusPdgCode" , {HistType::kTH1F , {pdgCodeAxis}});
244298 registry.add (" hMisidentifiedCascPlusPdgCode" , " hMisidentifiedCascPlusPdgCode" , {HistType::kTH1F , {pdgCodeAxis}});
299+ registry.add (" hMisidentifiedCascParticle" , " hMisidentifiedCascParticle" , {HistType::kTH1F , {misidentifiedParticleAxis}});
300+ registry.add (" hMisidentifiedCascMinusParticle" , " hMisidentifiedCascMinusParticle" , {HistType::kTH1F , {misidentifiedParticleAxis}});
301+ registry.add (" hMisidentifiedCascPlusParticle" , " hMisidentifiedCascPlusParticle" , {HistType::kTH1F , {misidentifiedParticleAxis}});
302+ registry.add (" hMisidentifiedCascParticleVsPt" , " hMisidentifiedCascParticleVsPt" , {HistType::kTH2F , {ptAxis, misidentifiedParticleAxis}});
303+ setMisidentifiedParticleLabels (registry.get <TH1 >(HIST (" hMisidentifiedCascParticle" ))->GetXaxis ());
304+ setMisidentifiedParticleLabels (registry.get <TH1 >(HIST (" hMisidentifiedCascMinusParticle" ))->GetXaxis ());
305+ setMisidentifiedParticleLabels (registry.get <TH1 >(HIST (" hMisidentifiedCascPlusParticle" ))->GetXaxis ());
306+ setMisidentifiedParticleLabels (registry.get <TH2 >(HIST (" hMisidentifiedCascParticleVsPt" ))->GetYaxis ());
245307 registry.add (" hPtXiPlusTrue" , " hPtXiPlusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
246308 registry.add (" hPtXiMinusTrue" , " hPtXiMinusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
247309 registry.add (" hPtOmegaPlusTrue" , " hPtOmegaPlusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
@@ -433,14 +495,19 @@ struct LfCascpostprocessing {
433495 registry.fill (HIST (" hCandidate" ), ++counter);
434496 bool kHasTOF = (candidate.poshastof () || candidate.neghastof () || candidate.bachhastof ());
435497 bool kHasITS = ((candidate.positshits () > 1 ) || (candidate.negitshits () > 1 ) || (candidate.bachitshits () > 1 ));
498+ bool kPassMinITS = ((candidate.positshits () >= trackQualityMinITS) || (candidate.negitshits () >= trackQualityMinITS) || (candidate.bachitshits () >= trackQualityMinITS));
436499 if (dooobrej == 1 ) {
437500 if (!kHasTOF && !kHasITS )
438501 continue ;
439502 registry.fill (HIST (" hCandidate" ), ++counter);
440- } else if (dooobrej == OobRejTofOnly ) {
503+ } else if (dooobrej == TrackQualityTofHighPt ) {
441504 if (!kHasTOF && (candidate.pt () > ptthrtof))
442505 continue ;
443506 registry.fill (HIST (" hCandidate" ), ++counter);
507+ } else if (dooobrej == TrackQualityMinITS) {
508+ if (!kPassMinITS )
509+ continue ;
510+ registry.fill (HIST (" hCandidate" ), ++counter);
444511 } else {
445512 ++counter;
446513 }
@@ -519,11 +586,16 @@ struct LfCascpostprocessing {
519586 // registry.fill(HIST("hBachITSHits"), candidate.bachitshits());
520587
521588 if (isMC && !isCorrectlyRec) {
589+ const int misidentifiedParticleBin = getMisidentifiedParticleBin (candidate.mcPdgCode ());
522590 registry.fill (HIST (" hMisidentifiedCascPdgCode" ), candidate.mcPdgCode ());
591+ registry.fill (HIST (" hMisidentifiedCascParticle" ), misidentifiedParticleBin);
592+ registry.fill (HIST (" hMisidentifiedCascParticleVsPt" ), candidate.pt (), misidentifiedParticleBin);
523593 if (candidate.sign () < 0 ) {
524594 registry.fill (HIST (" hMisidentifiedCascMinusPdgCode" ), candidate.mcPdgCode ());
595+ registry.fill (HIST (" hMisidentifiedCascMinusParticle" ), misidentifiedParticleBin);
525596 } else if (candidate.sign () > 0 ) {
526597 registry.fill (HIST (" hMisidentifiedCascPlusPdgCode" ), candidate.mcPdgCode ());
598+ registry.fill (HIST (" hMisidentifiedCascPlusParticle" ), misidentifiedParticleBin);
527599 }
528600 }
529601
0 commit comments