From e8f552134973ba26fbee3d90f4ce8b523e3a8cec Mon Sep 17 00:00:00 2001 From: Navneet Date: Tue, 25 Aug 2026 01:19:07 +0530 Subject: [PATCH] To add the configurable for system selection --- .../Tasks/Resonances/chargedkstaranalysis.cxx | 61 +++++++++++++------ 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index dbb854f8129..a721c73b11f 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -87,6 +87,10 @@ struct Chargedkstaranalysis { kAssocReco, kNSteps }; + enum CollisionSystem : int { + OO = 1, + pp = 2 + }; const int nSteps = static_cast(EvtStep::kNSteps); @@ -128,7 +132,7 @@ struct Chargedkstaranalysis { // fixed variables float rapidityMotherData = 0.5; float beamEnergy = 13600.0; - double beamMomentum = std::sqrt(beamEnergy * beamEnergy / 4 - o2::constants::physics::MassProton * o2::constants::physics::MassProton); // GeV + float beamEnergyOo = 5360.0; int noOfDaughters = 2; } helicityCfgs; @@ -225,6 +229,8 @@ struct Chargedkstaranalysis { Configurable cfgEventCentralityMin{"cfgEventCentralityMin", 0.0f, "Event sel: minimum centrality"}; Configurable cfgEventCentralityMax{"cfgEventCentralityMax", 100.0f, "Event sel: maximum centrality"}; Configurable cfgCentEst{"cfgCentEst", static_cast(CentralityEstimator::FT0C), "Centrality estimator: 1=FT0C, 2=FT0M"}; + Configurable cfgColSyst{"cfgColSyst", static_cast(CollisionSystem::pp), "Collision system: 1=OO, 2=pp"}; + } eventCutCfgs; // MC configurables @@ -313,8 +319,9 @@ struct Chargedkstaranalysis { // int kPiPlus = kPiPlus; int kPDGK0 = kK0; // Variable declaration - ROOT::Math::PxPyPzEVector beam1{0., 0., -helicityCfgs.beamMomentum, 13600. / 2.}; - ROOT::Math::PxPyPzEVector beam2{0., 0., helicityCfgs.beamMomentum, 13600. / 2.}; + + ROOT::Math::PxPyPzEVector beam1{0.0, 0.0, 0.0, 0.0}; + ROOT::Math::PxPyPzEVector beam2{0.0, 0.0, 0.0, 0.0}; double fMaxPosPV = 1e-2; void init(o2::framework::InitContext&) { @@ -512,6 +519,15 @@ struct Chargedkstaranalysis { } // MC if (doprocessMC) { + histos.add("hEvtSelInfoMc", "hEvtSelInfoMc", kTH1F, {{5, 0, 5.0}}); + auto hCutFlowMc = histos.get(HIST("hEvtSelInfoMc")); + if (hCutFlowMc) { + hCutFlowMc->GetXaxis()->SetBinLabel(1, "All Events"); + hCutFlowMc->GetXaxis()->SetBinLabel(2, "coll cuts"); + hCutFlowMc->GetXaxis()->SetBinLabel(3, "rctChecker"); + hCutFlowMc->GetXaxis()->SetBinLabel(4, "Multiplicity"); + hCutFlowMc->GetXaxis()->SetBinLabel(5, "IsINELgt0"); + } if (isQaRequired) { histos.add("QA/MC/QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis}); histos.add("QA/MC/QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis}); @@ -594,7 +610,15 @@ struct Chargedkstaranalysis { hstep->GetXaxis()->SetBinLabel(3, "INEL>0"); hstep->GetXaxis()->SetBinLabel(4, "Assoc with reco coll"); } - + if (eventCutCfgs.cfgColSyst == static_cast(CollisionSystem::OO)) { + double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergyOo * helicityCfgs.beamEnergyOo / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton)); + beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.); + beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.); + } else { + double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergy * helicityCfgs.beamEnergy / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton)); + beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergy / 2.); + beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergy / 2.); + } ccdb->setURL(cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -1070,8 +1094,8 @@ struct Chargedkstaranalysis { void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { if (!doprocessMC && isQaRequired) { - histos.fill(HIST("QA/before/CentDist"), collision.centFT0M()); - histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M()); + histos.fill(HIST("QA/before/CentDist"), getCentrality(collision)); + histos.fill(HIST("QA/before/CentDist1"), getCentrality(collision)); } ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot; @@ -1352,7 +1376,7 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true); - void processMC(soa::Join const& mccolls, aod::McParticles const& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) + void processMC(soa::Join const& mccolls, aod::McParticles const& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) { allowedMcIds.clear(); centTruthByAllowed.clear(); @@ -1364,11 +1388,11 @@ struct Chargedkstaranalysis { if (!coll.has_mcCollision()) { continue; } - + histos.fill(HIST("hEvtSelInfoMc"), 0.5); const auto mcid = coll.mcCollisionId(); - const auto mccoll = coll.template mcCollision_as>(); - const float lCentrality = mccoll.centFT0M(); + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = getCentrality(mccoll); if (doprocessMC && isQaRequired) { histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality); @@ -1377,12 +1401,19 @@ struct Chargedkstaranalysis { if (!colCuts.isSelected(coll)) { continue; } + histos.fill(HIST("hEvtSelInfoMc"), 1.5); if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) { continue; } + histos.fill(HIST("hEvtSelInfoMc"), 2.5); + if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) { + continue; + } + histos.fill(HIST("hEvtSelInfoMc"), 3.5); if (!coll.isInelGt0()) { continue; } + histos.fill(HIST("hEvtSelInfoMc"), 4.5); colCuts.fillQA(coll); if (doprocessMC && isQaRequired) { @@ -1390,10 +1421,6 @@ struct Chargedkstaranalysis { histos.fill(HIST("QA/MC/QAvtxz_wVtxzCut"), coll.posZ()); } - if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) { - continue; - } - if (doprocessMC && isQaRequired) { histos.fill(HIST("QA/MC/QACent_wCentCut"), lCentrality); } @@ -1423,7 +1450,7 @@ struct Chargedkstaranalysis { const auto mcid = coll.globalIndex(); refClassIds.insert(mcid); - const float lCentrality = coll.centFT0M(); + const float lCentrality = getCentrality(coll); refCentByMcId.emplace(mcid, lCentrality); } @@ -1533,8 +1560,8 @@ struct Chargedkstaranalysis { continue; // To check the event is allowed or not } - const auto mccoll = coll.template mcCollision_as>(); - const float lCentrality = mccoll.centFT0M(); + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = getCentrality(mccoll); if (!secondaryCutsCfgs.cfgByPassDauPIDSelection) { auto posDauTrack = v0.template posTrack_as();