From ecb13a2006f46008ac221b68aaf71f7d5fb02a52 Mon Sep 17 00:00:00 2001 From: Sawan Sawan Date: Wed, 9 Jul 2025 19:54:29 +0530 Subject: [PATCH] added configurable to take centrality/multiplicity from different detectors --- PWGLF/Tasks/Resonances/kstarqa.cxx | 108 ++++++++++++++--------------- 1 file changed, 51 insertions(+), 57 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 02b25ed6af2..59a3955d6c5 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -86,6 +86,8 @@ struct Kstarqa { Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; Configurable onlyTPC{"onlyTPC", true, "only TPC tracks"}; Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; + Configurable cSelectMultEstimator{"cSelectMultEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"}; + Configurable applyRecMotherRapidity{"applyRecMotherRapidity", true, "Apply rapidity cut on reconstructed mother track"}; // Configurables for track selections Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; @@ -203,7 +205,7 @@ struct Kstarqa { hInvMass.add("hk892GenpT2", "pT distribution of True MC K(892)0", kTHnSparseF, {ptAxis, multiplicityAxis}); hInvMass.add("h1KstarRecMass", "Invariant mass of kstar meson", kTH1F, {invmassAxis}); hInvMass.add("h2KstarRecpt1", "pT of kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis, invmassAxis}); - hInvMass.add("h2KstarRecpt2", "pT of generated kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis}); + hInvMass.add("h2KstarRecpt2", "pT of generated kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis, invmassAxis}); hInvMass.add("h1genmass", "Invariant mass of generated kstar meson", kTH1F, {invmassAxis}); hInvMass.add("h1GenMult", "Multiplicity generated", kTH1F, {multiplicityAxis}); hInvMass.add("h1RecMult", "Multiplicity reconstructed", kTH1F, {multiplicityAxis}); @@ -579,7 +581,16 @@ struct Kstarqa { rEventSelection.fill(HIST("events_check_data"), 3.5); multiplicity = -1; - multiplicity = collision.centFT0M(); + + if (cSelectMultEstimator == 0) { + multiplicity = collision.centFT0M(); + } else if (cSelectMultEstimator == 1) { + multiplicity = collision.centFT0A(); + } else if (cSelectMultEstimator == 2) { + multiplicity = collision.centFT0C(); + } else { + multiplicity = collision.multFT0M(); + } // Fill the event counter if (cQAevents) { @@ -690,76 +701,58 @@ struct Kstarqa { ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2000, 0, 10000}, "TPC multiplicity axis for ME mixing"}; // using BinningTypeTPCMultiplicity = ColumnBinningPolicy; - // using BinningTypeCentralityM = ColumnBinningPolicy; + using BinningTypeCentralityM = ColumnBinningPolicy; using BinningTypeVertexContributor = ColumnBinningPolicy; + using BinningTypeFT0A = ColumnBinningPolicy; BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicity}, true}; - // BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true}; + BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true}; + BinningTypeFT0A binningOnFT0A{{axisVertex, axisMultiplicity}, true}; SameKindPair pair1{binningOnPositions, cfgNoMixedEvents, -1, &cache}; - // SameKindPair pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache}; + SameKindPair pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache}; + SameKindPair pair3{binningOnFT0A, cfgNoMixedEvents, -1, &cache}; void processME(EventCandidates const&, TrackCandidates const&) { - for (const auto& [c1, tracks1, c2, tracks2] : pair1) { - - if (!c1.sel8()) { - continue; - } - if (!c2.sel8()) { - continue; - } - - if (timFrameEvsel && (!c1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c1.selection_bit(aod::evsel::kNoITSROFrameBorder) || !c2.selection_bit(aod::evsel::kNoITSROFrameBorder))) { - continue; - } - - if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) { - return; - } - - if (rctCut.requireRCTFlagChecker && !rctChecker(c1)) { - continue; - } - if (rctCut.requireRCTFlagChecker && !rctChecker(c2)) { - continue; - } - - multiplicity = c1.centFT0M(); - - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - - if (!selectionTrack(t1)) // Kaon + // Map estimator to pair and multiplicity accessor + auto runMixing = [&](auto& pair, auto multiplicityGetter) { + for (const auto& [c1, tracks1, c2, tracks2] : pair) { + if (!c1.sel8() || !c2.sel8()) continue; - if (!selectionTrack(t2)) // Pion - continue; - if (!selectionPID(t1, 1)) // Kaon - continue; - if (!selectionPID(t2, 0)) // Pion + + if (rctCut.requireRCTFlagChecker && (!rctChecker(c1) || !rctChecker(c2))) continue; - // if (cMID) { - // if (cMIDselectionPID(t1, 0)) // misidentified as pion - // continue; - // if (cMIDselectionPID(t1, 2)) // misidentified as proton - // continue; - // if (cMIDselectionPID(t2, 1)) // misidentified as kaon - // continue; - // } + multiplicity = multiplicityGetter(c1); - daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); - daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massPi); - mother = daughter1 + daughter2; // Kstar meson + for (const auto& [t1, t2] : o2::soa::combinations( + o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (!selectionTrack(t1) || !selectionTrack(t2)) + continue; + if (!selectionPID(t1, 1) || !selectionPID(t2, 0)) + continue; - isMix = true; + daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massPi); + mother = daughter1 + daughter2; - // if (std::abs(kstar.Rapidity()) < 0.5) { - // fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix); + isMix = true; - if (std::abs(mother.Rapidity()) < 0.5) { - fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, t1, t2); + if (std::abs(mother.Rapidity()) < 0.5) { + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, t1, t2); + } } } + }; + + // Call mixing based on selected estimator + if (cSelectMultEstimator == 0) { + runMixing(pair1, [](const auto& c) { return c.centFT0M(); }); + } else if (cSelectMultEstimator == 1) { + runMixing(pair2, [](const auto& c) { return c.centFT0A(); }); + } else if (cSelectMultEstimator == 2) { + runMixing(pair3, [](const auto& c) { return c.centFT0C(); }); } } @@ -1017,13 +1010,14 @@ struct Kstarqa { daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); mother = daughter1 + daughter2; // Kstar meson - if (mother.Rapidity() >= 0) { + hInvMass.fill(HIST("h2KstarRecpt2"), mothertrack1.pt(), multiplicity, TMath::Sqrt(mothertrack1.e() * mothertrack1.e() - mothertrack1.p() * mothertrack1.p())); + + if (applyRecMotherRapidity && mother.Rapidity() >= 0) { continue; } hInvMass.fill(HIST("h1KstarRecMass"), mother.M()); hInvMass.fill(HIST("h2KstarRecpt1"), mother.Pt(), multiplicity, mother.M()); - hInvMass.fill(HIST("h2KstarRecpt2"), mothertrack1.pt(), multiplicity); } } }