3838#include " PWGHF/HFC/DataModel/CorrelationTables.h"
3939#include " PWGHF/HFC/Utils/utilsCorrelations.h"
4040
41+ #include " PWGHF/Core/CentralityEstimation.h"
42+
4143using namespace o2 ;
4244using namespace o2 ::analysis;
4345using namespace o2 ::constants::physics;
4446using namespace o2 ::constants::math;
4547using namespace o2 ::framework;
4648using namespace o2 ::framework::expressions;
4749using namespace o2 ::analysis::hf_correlations;
50+
51+ using namespace o2 ::hf_centrality;
52+
4853// /
4954// / Returns deltaPhi values in range [-pi/2., 3.*pi/2.], typically used for correlation studies
5055// /
@@ -71,14 +76,22 @@ struct HfCorrelatorLcHadronsSelection {
7176 HfHelper hfHelper;
7277 SliceCache cache;
7378
74- using SelCollisions = soa::Join<aod::Collisions, aod::EvSels>;
79+ // using SelCollisions = soa::Join<aod::Collisions, aod::EvSels>;
80+ using SelCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
7581 using CandidatesLcData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc>>;
7682 using CandidatesLcMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfCand3ProngMcRec>>;
7783 using CandidatesLcMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
84+
7885
7986 // filter on selection of Lc and decay channel Lc->PKPi
8087 Filter lcFilter = ((o2::aod::hf_track_index::hfflag & static_cast <uint8_t >(1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) != static_cast <uint8_t >(0 )) && (aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc);
8188
89+ template <typename Coll>
90+ float evaluateCentralityColl (const Coll& collision)
91+ {
92+ return o2::hf_centrality::getCentralityColl<Coll>(collision);
93+ }
94+
8295 // / Code to select collisions with at least one Lc - for real data and data-like analysis
8396 void processLcSelectionData (SelCollisions::iterator const & collision,
8497 CandidatesLcData const & candidates)
@@ -87,6 +100,7 @@ struct HfCorrelatorLcHadronsSelection {
87100 bool isLcFound = true ;
88101 bool isSel8 = true ;
89102 bool isNosameBunchPileUp = true ;
103+ bool isCentInRange = false ;
90104 if (doSelLcCollision) {
91105 for (const auto & candidate : candidates) {
92106 if (std::abs (hfHelper.yLc (candidate)) > yCandMax || candidate.pt () < ptCandMin) {
@@ -97,13 +111,19 @@ struct HfCorrelatorLcHadronsSelection {
97111 break ;
98112 }
99113 }
114+
115+ float cent=evaluateCentralityColl (collision);
116+
100117 if (useSel8) {
101118 isSel8 = collision.sel8 ();
102119 }
103120 if (selNoSameBunchPileUpColl) {
104121 isNosameBunchPileUp = static_cast <bool >(collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup ));
105122 }
106- isSelColl = isLcFound && isSel8 && isNosameBunchPileUp;
123+ // isSelColl = isLcFound && isSel8 && isNosameBunchPileUp;
124+ // lcSel(isSelColl);
125+ isCentInRange = cent >= 0 . && cent < 100 .; // adjust percentile as needed
126+ isSelColl = isLcFound && isSel8 && isNosameBunchPileUp && isCentInRange;
107127 lcSel (isSelColl);
108128 }
109129 PROCESS_SWITCH (HfCorrelatorLcHadronsSelection, processLcSelectionData, " Process Lc Collision Selection Data" , true );
@@ -161,6 +181,7 @@ struct HfCorrelatorLcHadronsSelection {
161181// Lc-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth)
162182struct HfCorrelatorLcHadrons {
163183 Produces<aod::LcHadronPair> entryLcHadronPair;
184+ Produces<aod::LcHadronPairC> entryLcHadronPairC;
164185 Produces<aod::LcHadronPairY> entryLcHadronPairY;
165186 Produces<aod::LcHadronPairTrkPID> entryLcHadronPairTrkPID;
166187 Produces<aod::LcHadronRecoInfo> entryLcHadronRecoInfo;
@@ -173,7 +194,7 @@ struct HfCorrelatorLcHadrons {
173194 Produces<aod::Hadron> entryHadron;
174195 Produces<aod::LcHadronTrkPID> entryTrkPID;
175196
176- Configurable<int > selectionFlagLc{" selectionFlagLc" , 1 , " Selection Flag for Lc" };
197+ Configurable<int > selectionFlagLc{" selectionFlagLc" , 1 , " Selection Flag for Lc in mult " };
177198 Configurable<int > numberEventsMixed{" numberEventsMixed" , 5 , " number of events mixed in ME process" };
178199 Configurable<int > applyEfficiency{" applyEfficiency" , 1 , " Flag for applying Lc efficiency weights" };
179200 Configurable<float > yCandMax{" yCandMax" , 0.8 , " max. cand. rapidity" };
@@ -215,7 +236,9 @@ struct HfCorrelatorLcHadrons {
215236 TRandom3* rnd = new TRandom3(0 );
216237
217238 // Event Mixing for the Data Mode
218- using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>;
239+ using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection, aod::CentFT0Ms>>;
240+
241+ // using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>;
219242 using SelCollisionsWithLcMc = soa::Filtered<soa::Join<aod::McCollisions, aod::LcSelection, aod::MultsExtraMC>>; // collisionFilter applied
220243 using CandidatesLcData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfMlLcToPKPi>>;
221244 // Event Mixing for the MCRec Mode
@@ -244,6 +267,9 @@ struct HfCorrelatorLcHadrons {
244267 ConfigurableAxis binsPoolBin{" binsPoolBin" , {9 , 0 ., 9 .}, " PoolBin" };
245268 ConfigurableAxis binsMultFT0M{" binsMultFT0M" , {600 , 0 ., 6000 .}, " Multiplicity as FT0M signal amplitude" };
246269 ConfigurableAxis binsMassLc{" binsMassLc" , {200 , 1.98 , 2.58 }, " inv. mass (p K #pi) (GeV/#it{c}^{2})" };
270+ ConfigurableAxis binsCentFT0M{" binsCentFT0M" , {100 , 0 ., 100 .}, " Centrality percentile (FT0M)" };
271+
272+
247273
248274 BinningType corrBinning{{binsZVtx, binsMultiplicity}, true };
249275
@@ -263,6 +289,7 @@ struct HfCorrelatorLcHadrons {
263289 AxisSpec axisPoolBin = {binsPoolBin, " PoolBin" };
264290 AxisSpec axisRapidity = {100 , -2 , 2 , " Rapidity" };
265291 AxisSpec axisSign = {2 , -1 , 1 , " Sign" };
292+ AxisSpec axisCent = {binsCentFT0M," Centrality" };
266293
267294 registry.add (" hPtCand" , " Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {axisPtLc}});
268295 registry.add (" hPtProng0" , " Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {axisPtLc}});
@@ -280,7 +307,9 @@ struct HfCorrelatorLcHadrons {
280307 registry.add (" hZvtx" , " z vertex;z vertex;entries" , {HistType::kTH1F , {{200 , -20 ., 20 .}}});
281308 registry.add (" hLcBin" , " Lc selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}});
282309 registry.add (" hTracksBin" , " Tracks selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}});
283- registry.add (" hMassLcVsPt" , " Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries" , {HistType::kTH2F , {{axisMassLc}, {axisPtLc}}});
310+ registry.add (" hMassLcVsPtvsmult" , " Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries" , {HistType::kTH3F , {{axisMassLc}, {axisPtLc}, {axisCent}}});
311+
312+ // registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}});
284313 registry.add (" hMassLcData" , " Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries" , {HistType::kTH1F , {{axisMassLc}}});
285314 registry.add (" hLcPoolBin" , " Lc candidates pool bin" , {HistType::kTH1F , {axisPoolBin}});
286315 registry.add (" hTracksPoolBin" , " Particles associated pool bin" , {HistType::kTH1F , {axisPoolBin}});
@@ -323,10 +352,16 @@ struct HfCorrelatorLcHadrons {
323352 registry.add (" hEtaMcGen" , " Lc,Hadron particles - MC Gen" , {HistType::kTH1F , {axisEta}});
324353 registry.add (" hPhiMcGen" , " Lc,Hadron particles - MC Gen" , {HistType::kTH1F , {axisPhi}});
325354 registry.add (" hMultFT0AMcGen" , " Lc,Hadron multiplicity FT0A - MC Gen" , {HistType::kTH1F , {axisMultiplicity}});
326-
327355 corrBinning = {{binsZVtx, binsMultiplicity}, true };
328356 }
329357
358+
359+ template <typename Coll>
360+ float evaluateCentralityColl (const Coll& collision)
361+ {
362+ return o2::hf_centrality::getCentralityColl<Coll>(collision);
363+ }
364+
330365 // / Lc-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth)
331366 void processData (SelCollisionsWithLc::iterator const & collision,
332367 TracksData const & tracks,
@@ -351,6 +386,9 @@ struct HfCorrelatorLcHadrons {
351386 int gCollisionId = collision.globalIndex ();
352387 int64_t timeStamp = bc.timestamp ();
353388
389+ float cent=evaluateCentralityColl (collision);
390+ float zv=collision.posZ ();
391+
354392 int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multFT0M ()));
355393 int nTracks = 0 ;
356394 if (collision.numContrib () > 1 ) {
@@ -389,8 +427,10 @@ struct HfCorrelatorLcHadrons {
389427 registry.fill (HIST (" hPhi" ), RecoDecay::constrainAngle (candidate.phi (), -PIHalf));
390428 registry.fill (HIST (" hY" ), hfHelper.yLc (candidate));
391429 registry.fill (HIST (" hLcBin" ), poolBin);
430+
392431 if (candidate.isSelLcToPKPi () >= selectionFlagLc) {
393- registry.fill (HIST (" hMassLcVsPt" ), hfHelper.invMassLcToPKPi (candidate), candidate.pt (), efficiencyWeightLc);
432+ registry.fill (HIST (" hMassLcVsPtvsmult" ), hfHelper.invMassLcToPKPi (candidate), candidate.pt (), cent, efficiencyWeightLc);
433+ // registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc);
394434 registry.fill (HIST (" hMassLcData" ), hfHelper.invMassLcToPKPi (candidate), efficiencyWeightLc);
395435 registry.fill (HIST (" hSelectionStatusLcToPKPi" ), candidate.isSelLcToPKPi ());
396436 for (unsigned int iclass = 0 ; iclass < classMl->size (); iclass++) {
@@ -400,7 +440,8 @@ struct HfCorrelatorLcHadrons {
400440 entryLc (candidate.phi (), candidate.eta (), candidate.pt () * chargeLc, hfHelper.invMassLcToPKPi (candidate), poolBin, gCollisionId , timeStamp);
401441 }
402442 if (candidate.isSelLcToPiKP () >= selectionFlagLc) {
403- registry.fill (HIST (" hMassLcVsPt" ), hfHelper.invMassLcToPiKP (candidate), candidate.pt (), efficiencyWeightLc);
443+ registry.fill (HIST (" hMassLcVsPtvsmult" ), hfHelper.invMassLcToPiKP (candidate), candidate.pt (), cent, efficiencyWeightLc);
444+ // registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc);
404445 registry.fill (HIST (" hMassLcData" ), hfHelper.invMassLcToPiKP (candidate), efficiencyWeightLc);
405446 registry.fill (HIST (" hSelectionStatusLcToPiKP" ), candidate.isSelLcToPiKP ());
406447 for (unsigned int iclass = 0 ; iclass < classMl->size (); iclass++) {
@@ -435,12 +476,14 @@ struct HfCorrelatorLcHadrons {
435476 }
436477 }
437478 if (candidate.isSelLcToPKPi () >= selectionFlagLc) {
438- entryLcHadronPair (getDeltaPhi (track.phi (), candidate.phi ()),
479+ entryLcHadronPairC (getDeltaPhi (track.phi (), candidate.phi ()),
439480 track.eta () - candidate.eta (),
440481 candidate.pt () * chargeLc,
441482 track.pt () * track.sign (),
442483 poolBin,
443- correlationStatus);
484+ correlationStatus,
485+ cent,
486+ zv);
444487 entryLcHadronPairY (track.y () - hfHelper.yLc (candidate));
445488 entryLcHadronRecoInfo (hfHelper.invMassLcToPKPi (candidate), false );
446489 entryLcHadronGenInfo (false , false , 0 );
@@ -451,12 +494,14 @@ struct HfCorrelatorLcHadrons {
451494 }
452495 }
453496 if (candidate.isSelLcToPiKP () >= selectionFlagLc) {
454- entryLcHadronPair (getDeltaPhi (track.phi (), candidate.phi ()),
497+ entryLcHadronPairC (getDeltaPhi (track.phi (), candidate.phi ()),
455498 track.eta () - candidate.eta (),
456499 candidate.pt () * chargeLc,
457500 track.pt () * track.sign (),
458501 poolBin,
459- correlationStatus);
502+ correlationStatus,
503+ cent,
504+ zv);
460505 entryLcHadronPairY (track.y () - hfHelper.yLc (candidate));
461506 entryLcHadronRecoInfo (hfHelper.invMassLcToPiKP (candidate), false );
462507 entryLcHadronGenInfo (false , false , 0 );
0 commit comments