1616// / \modified by Roman Nepeivoda (roman.nepeivoda@cern.ch)
1717// / \since June 1, 2023
1818
19+ #include " PWGLF/DataModel/LFStrangenessTables.h"
1920#include " PWGLF/DataModel/cascqaanalysis.h"
2021
21- #include < Framework/AnalysisHelpers.h>
22- #include < Framework/AnalysisTask.h>
23- #include < Framework/Configurable.h>
24- #include < Framework/HistogramRegistry.h>
25- #include < Framework/HistogramSpec.h>
26- #include < Framework/InitContext.h>
27- #include < Framework/O2DatabasePDGPlugin.h>
28- #include < Framework/runDataProcessing.h>
22+ #include " Common/DataModel/EventSelection.h"
23+ #include " Common/DataModel/TrackSelectionTables.h"
2924
30- #include < TH1.h>
31- #include < TMath.h>
32- #include < TMathBase.h>
33- #include < TString.h>
34-
35- #include < RtypesCore.h>
25+ #include " Framework/AnalysisTask.h"
26+ #include " Framework/O2DatabasePDGPlugin.h"
27+ #include " Framework/runDataProcessing.h"
3628
3729#include < cmath>
3830
@@ -84,7 +76,7 @@ struct cascpostprocessing {
8476 Configurable<float > bachBaryonCosPA{" bachBaryonCosPA" , 0.9999 , " Bachelor baryon CosPA" };
8577 Configurable<float > bachBaryonDCAxyToPV{" bachBaryonDCAxyToPV" , 0.05 , " DCA bachelor baryon to PV" };
8678
87- Configurable< bool > isMC{ " isMC " , 0 , " 0 - data, 1 - MC " } ;
79+ bool isMC = false ;
8880
8981 Configurable<int > evSelFlag{" evSelFlag" , 2 , " 1 - INEL; 2 - INEL>0; 3 - INEL>1" };
9082
@@ -95,13 +87,16 @@ struct cascpostprocessing {
9587
9688 void init (InitContext const &)
9789 {
90+ isMC = doprocessGen;
9891
9992 AxisSpec ximassAxis = {200 , 1 .28f , 1 .36f };
10093 AxisSpec omegamassAxis = {200 , 1 .59f , 1 .75f };
10194 AxisSpec massAxis = ximassAxis;
10295 if (!isXi)
10396 massAxis = omegamassAxis;
10497 AxisSpec ptAxis = {200 , 0 .0f , 10 .0f , " #it{p}_{T} (GeV/#it{c})" };
98+ AxisSpec ptRecAxis = {200 , 0 .0f , 10 .0f , " #it{p}_{T}^{rec} (GeV/#it{c})" };
99+ AxisSpec ptGenAxis = {200 , 0 .0f , 10 .0f , " #it{p}_{T}^{gen} (GeV/#it{c})" };
105100 AxisSpec ptAxisTopoVar = {50 , 0 .0f , 10 .0f , " #it{p}_{T} (GeV/#it{c})" };
106101 AxisSpec ptAxisPID = {50 , 0 .0f , 10 .0f , " #it{p}_{T} (GeV/#it{c})" };
107102 ConfigurableAxis etaAxis{" etaAxis" , {40 , -2 .0f , 2 .0f }, " #eta" };
@@ -116,7 +111,6 @@ struct cascpostprocessing {
116111 ConfigurableAxis nChargedFT0MGenAxis{" nChargedFT0MGenAxis" , {300 , 0 , 300 }, " N_{FT0M, gen.}" };
117112
118113 AxisSpec rapidityAxis = {200 , -2 .0f , 2 .0f , " y" };
119- AxisSpec phiAxis = {100 , -TMath::Pi () / 2 , 3 . * TMath::Pi () / 2 , " #varphi" };
120114
121115 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" };
122116 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" };
@@ -167,6 +161,10 @@ struct cascpostprocessing {
167161 registry.get <TH1>(HIST (" CascadeSelectionSummary" ))->SetBinContent (29 , v0radiusMax);
168162
169163 registry.add (" hPt" , " hPt" , {HistType::kTH1F , {ptAxis}});
164+ registry.add (" hBachPtMinus" , " hBachPtMinus" , {HistType::kTH1F , {ptAxis}});
165+ registry.add (" hBachPtPlus" , " hBachPtPlus" , {HistType::kTH1F , {ptAxis}});
166+ registry.add (" hBachPtVsCascPtMinus" , " hBachPtVsCascPtMinus" , {HistType::kTH2F , {ptAxis, ptAxis}});
167+ registry.add (" hBachPtVsCascPtPlus" , " hBachPtVsCascPtPlus" , {HistType::kTH2F , {ptAxis, ptAxis}});
170168 registry.add (" hCascMinusInvMassvsPt" , " hCascMinusInvMassvsPt" , HistType::kTH2F , {ptAxis, massAxis});
171169 registry.add (" hCascPlusInvMassvsPt" , " hCascPlusInvMassvsPt" , HistType::kTH2F , {ptAxis, massAxis});
172170 registry.add (" hCascMinusInvMassvsPt_FT0M" , " hCascMinusInvMassvsPt_FT0M" , HistType::kTH3F , {centFT0MAxis, ptAxis, massAxis});
@@ -201,8 +199,6 @@ struct cascpostprocessing {
201199 registry.add (" hRapMinus1D" , " hRapMinus1D" , {HistType::kTH1F , {rapidityAxis}});
202200 registry.add (" hRapPlus" , " hRapPlus" , {HistType::kTH2F , {ptAxis, rapidityAxis}});
203201 registry.add (" hRapPlus1D" , " hRapPlus1D" , {HistType::kTH1F , {rapidityAxis}});
204- registry.add (" hPhiMinus" , " hPhiMinus" , {HistType::kTH2F , {ptAxis, phiAxis}});
205- registry.add (" hPhiPlus" , " hPhiPlus" , {HistType::kTH2F , {ptAxis, phiAxis}});
206202 registry.add (" hCtauMinus" , " hCtauMinus" , {HistType::kTH1F , {{100 , 0 .0f , 40 .0f }}});
207203 registry.add (" hCtauPlus" , " hCtauPlus" , {HistType::kTH1F , {{100 , 0 .0f , 40 .0f }}});
208204
@@ -223,15 +219,19 @@ struct cascpostprocessing {
223219 registry.add (" hCascMinusEtaNeg" , " hCascMinusEtaNeg" , {HistType::kTH1F , {{100 , -1 .0f , 1 .0f }}});
224220 registry.add (" hCascMinusEtaBach" , " hCascMinusEtaBach" , {HistType::kTH1F , {{100 , -1 .0f , 1 .0f }}});
225221
226- // Info for eff x acc from MC
227- registry.add (" hPtCascPlusTrueRec" , " hPtCascPlusTrueRec" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
228- registry.add (" hPtCascMinusTrueRec" , " hPtCascMinusTrueRec" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
229-
230- registry.add (" hCascMinusMassvsPtTrueRec" , " hCascMinusMassvsPtTrueRec" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
231- registry.add (" hCascPlusMassvsPtTrueRec" , " hCascPlusMassvsPtTrueRec" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
232- registry.add (" hCascMinusMassvsPtBG" , " hCascMinusMassvsPtBG" , {HistType::kTH2F , {ptAxis, massAxis}});
233- registry.add (" hCascPlusMassvsPtBG" , " hCascPlusMassvsPtBG" , {HistType::kTH2F , {ptAxis, massAxis}});
234222 if (isMC) {
223+ // Info for eff x acc from MC
224+ registry.add (" hPtCascPlusTrueRec" , " hPtCascPlusTrueRec" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
225+ registry.add (" hPtCascMinusTrueRec" , " hPtCascMinusTrueRec" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
226+ registry.add (" hPtCascPlusTrueRecVsGen" , " hPtCascPlusTrueRecVsGen" , {HistType::kTH2F , {ptRecAxis, ptGenAxis}});
227+ registry.add (" hPtCascMinusTrueRecVsGen" , " hPtCascMinusTrueRecVsGen" , {HistType::kTH2F , {ptRecAxis, ptGenAxis}});
228+
229+ registry.add (" hCascMinusMassvsPtTrueRec" , " hCascMinusMassvsPtTrueRec" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
230+ registry.add (" hCascPlusMassvsPtTrueRec" , " hCascPlusMassvsPtTrueRec" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
231+ registry.add (" hCascMinusMassvsPtBG" , " hCascMinusMassvsPtBG" , {HistType::kTH2F , {ptAxis, massAxis}});
232+ registry.add (" hCascPlusMassvsPtBG" , " hCascPlusMassvsPtBG" , {HistType::kTH2F , {ptAxis, massAxis}});
233+ registry.add (" hCascMinusMassvsPtBG_FT0M" , " hCascMinusMassvsPtBG_FT0M" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
234+ registry.add (" hCascPlusMassvsPtBG_FT0M" , " hCascPlusMassvsPtBG_FT0M" , {HistType::kTH3F , {ptAxis, massAxis, centFT0MAxis}});
235235 registry.add (" hPtXiPlusTrue" , " hPtXiPlusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
236236 registry.add (" hPtXiMinusTrue" , " hPtXiMinusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
237237 registry.add (" hPtOmegaPlusTrue" , " hPtOmegaPlusTrue" , {HistType::kTH3F , {ptAxis, rapidityAxis, centFT0MAxis}});
@@ -280,6 +280,9 @@ struct cascpostprocessing {
280280 counter = -1 ;
281281 registry.fill (HIST (" hCandidate" ), ++counter);
282282
283+ if (candidate.pt () < minpt)
284+ continue ;
285+
283286 // To have trace of how it was before selections
284287 if (candidate.sign () < 0 ) {
285288 registry.fill (HIST (" hXiMinusInvMassvsPt_BefSels" ), candidate.pt (), candidate.massxi ());
@@ -411,7 +414,7 @@ struct cascpostprocessing {
411414 ctau = candidate.ctauomega ();
412415 invmass = candidate.massomega ();
413416 }
414- if (isSelectBachBaryon && (candidate.bachBaryonCosPA () > bachBaryonCosPA || fabs (candidate.bachBaryonDCAxyToPV ()) < bachBaryonDCAxyToPV)) { // Bach-baryon selection if required
417+ if (isSelectBachBaryon && (candidate.bachBaryonCosPA () > bachBaryonCosPA || std:: fabs (candidate.bachBaryonDCAxyToPV ()) < bachBaryonDCAxyToPV)) { // Bach-baryon selection if required
415418 continue ;
416419 }
417420 registry.fill (HIST (" hCandidate" ), ++counter);
@@ -448,26 +451,32 @@ struct cascpostprocessing {
448451 registry.fill (HIST (" hBachBaryonCosPA" ), candidate.pt (), candidate.bachBaryonCosPA ());
449452 registry.fill (HIST (" hBachBaryonDCAxyToPV" ), candidate.pt (), candidate.bachBaryonDCAxyToPV ());
450453 if (candidate.sign () > 0 ) {
454+ registry.fill (HIST (" hBachPtPlus" ), candidate.bachpt ());
455+ registry.fill (HIST (" hBachPtVsCascPtPlus" ), candidate.pt (), candidate.bachpt ());
451456 registry.fill (HIST (" hCtauPlus" ), ctau);
452457 registry.fill (HIST (" hEtaPlus" ), candidate.pt (), candidate.eta ());
453458 registry.fill (HIST (" hRapPlus" ), candidate.pt (), rapidity);
454459 registry.fill (HIST (" hRapPlus1D" ), rapidity);
455- // registry.fill(HIST("hPhiPlus"), candidate.pt(), candidate.phi());
456460 } else {
461+ registry.fill (HIST (" hBachPtMinus" ), candidate.bachpt ());
462+ registry.fill (HIST (" hBachPtVsCascPtMinus" ), candidate.pt (), candidate.bachpt ());
457463 registry.fill (HIST (" hCtauMinus" ), ctau);
458464 registry.fill (HIST (" hEtaMinus" ), candidate.pt (), candidate.eta ());
459465 registry.fill (HIST (" hRapMinus" ), candidate.pt (), rapidity);
460466 registry.fill (HIST (" hRapMinus1D" ), rapidity);
461- // registry.fill(HIST("hPhiMinus"), candidate.pt(), candidate.phi());
462467 }
463468
464469 if (isXi) {
465- isCorrectlyRec = ((TMath::Abs (candidate.mcPdgCode ()) == 3312 ) && (candidate.isPrimary () == 1 )) ? 1 : 0 ;
470+ if (isMC) {
471+ isCorrectlyRec = ((TMath::Abs (candidate.mcPdgCode ()) == 3312 ) && (candidate.isPrimary () == 1 )) ? 1 : 0 ;
472+ }
466473 if (TMath::Abs (candidate.massxi () - pdgDB->Mass (3312 )) < masswintpc) {
467474 isCandidate = 1 ;
468475 }
469476 } else if (!isXi) {
470- isCorrectlyRec = ((TMath::Abs (candidate.mcPdgCode ()) == 3334 ) && (candidate.isPrimary () == 1 )) ? 1 : 0 ;
477+ if (isMC) {
478+ isCorrectlyRec = ((TMath::Abs (candidate.mcPdgCode ()) == 3334 ) && (candidate.isPrimary () == 1 )) ? 1 : 0 ;
479+ }
471480 if (TMath::Abs (candidate.massomega () - pdgDB->Mass (3334 )) < masswintpc) {
472481 isCandidate = 1 ;
473482 }
@@ -500,22 +509,30 @@ struct cascpostprocessing {
500509 // registry.fill(HIST("hBachITSHits"), candidate.bachitshits());
501510
502511 if (candidate.sign () < 0 ) {
503- if (isCorrectlyRec) {
504- registry.fill (HIST (" hPtCascMinusTrueRec" ), candidate.pt (), rapidity, candidate.centFT0M ()); // 3rd axis is from MC calibration
505- registry.fill (HIST (" hCascMinusMassvsPtTrueRec" ), candidate.pt (), invmass, candidate.centFT0M ());
506- } else {
507- registry.fill (HIST (" hCascMinusMassvsPtBG" ), candidate.pt (), invmass);
512+ if (isMC) {
513+ if (isCorrectlyRec) {
514+ registry.fill (HIST (" hPtCascMinusTrueRec" ), candidate.pt (), rapidity, candidate.centFT0M ()); // 3rd axis is from MC calibration
515+ registry.fill (HIST (" hPtCascMinusTrueRecVsGen" ), candidate.pt (), candidate.genPt ());
516+ registry.fill (HIST (" hCascMinusMassvsPtTrueRec" ), candidate.pt (), invmass, candidate.centFT0M ());
517+ } else {
518+ registry.fill (HIST (" hCascMinusMassvsPtBG" ), candidate.pt (), invmass);
519+ registry.fill (HIST (" hCascMinusMassvsPtBG_FT0M" ), candidate.pt (), invmass, candidate.centFT0M ());
520+ }
508521 }
509522 registry.fill (HIST (" hCascMinusInvMassvsPt" ), candidate.pt (), invmass);
510523 registry.fill (HIST (" hCascMinusInvMassvsPt_FT0M" ), candidate.centFT0M (), candidate.pt (), invmass);
511524 registry.fill (HIST (" hCascMinusInvMassvsPt_FV0A" ), candidate.centFV0A (), candidate.pt (), invmass);
512525 }
513526 if (candidate.sign () > 0 ) {
514- if (isCorrectlyRec) {
515- registry.fill (HIST (" hPtCascPlusTrueRec" ), candidate.pt (), rapidity, candidate.centFT0M ()); // 3rd axis is from MC calibration
516- registry.fill (HIST (" hCascPlusMassvsPtTrueRec" ), candidate.pt (), invmass, candidate.centFT0M ());
517- } else {
518- registry.fill (HIST (" hCascPlusMassvsPtBG" ), candidate.pt (), invmass);
527+ if (isMC) {
528+ if (isCorrectlyRec) {
529+ registry.fill (HIST (" hPtCascPlusTrueRec" ), candidate.pt (), rapidity, candidate.centFT0M ()); // 3rd axis is from MC calibration
530+ registry.fill (HIST (" hPtCascPlusTrueRecVsGen" ), candidate.pt (), candidate.genPt ());
531+ registry.fill (HIST (" hCascPlusMassvsPtTrueRec" ), candidate.pt (), invmass, candidate.centFT0M ());
532+ } else {
533+ registry.fill (HIST (" hCascPlusMassvsPtBG" ), candidate.pt (), invmass);
534+ registry.fill (HIST (" hCascPlusMassvsPtBG_FT0M" ), candidate.pt (), invmass, candidate.centFT0M ());
535+ }
519536 }
520537 registry.fill (HIST (" hCascPlusInvMassvsPt" ), candidate.pt (), invmass);
521538 registry.fill (HIST (" hCascPlusInvMassvsPt_FT0M" ), candidate.centFT0M (), candidate.pt (), invmass);
0 commit comments