From 42eef5607e43888938fc511f2f46da74efaaf483 Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:39:40 +0100 Subject: [PATCH 1/2] Refine efficiency correction --- PWGLF/Tasks/Nuspex/chargedparticleRaa.cxx | 318 ++++++++++++++++++---- 1 file changed, 259 insertions(+), 59 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/chargedparticleRaa.cxx b/PWGLF/Tasks/Nuspex/chargedparticleRaa.cxx index 20b8c919bcb..9e64916cf8c 100644 --- a/PWGLF/Tasks/Nuspex/chargedparticleRaa.cxx +++ b/PWGLF/Tasks/Nuspex/chargedparticleRaa.cxx @@ -54,7 +54,7 @@ using ColDataTablePbPb = soa::Join; using ColMCRecTablePbPb = soa::SmallGroups>; using ColMCRecTablepp = soa::SmallGroups>; -using ColMCTrueTable = aod::McCollisions; +using ColMCTrueTable = soa::Join; using TrackDataTable = soa::Join; using FilTrackDataTable = soa::Filtered; using TrackMCRecTable = soa::Join; @@ -69,6 +69,40 @@ enum { kTrackTypeend }; +enum { + kGenpTbegin = 0, + kNoGenpTVar = 1, + kGenpTup, + kGenpTdown, + kGenpTend +}; + +enum { + kGenTrkTypebegin = 0, + kGenAll = 1, + kGenPion, + kGenKaon, + kGenProton, + kGenOther, + kGenTrkTypeend +}; + +enum { + kRecTrkTypebegin = 0, + kRecoAll = 1, + kRecoHasmc, + kRecoPrimary, + kRecoPion, + kRecoKaon, + kRecoProton, + kRecoOther, + kRecoSecondary, + kRecoWeakDecay, + kRecoFake, + kRecoBkg, + kRecTrkTypeend +}; + static constexpr TrackSelectionFlags::flagtype TrackSelectionIts = TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | TrackSelectionFlags::kITSHits; @@ -86,8 +120,13 @@ AxisSpec axisVtxZ{40, -20, 20, "Vertex Z", "VzAxis"}; AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"}; AxisSpec axisPhi{629, 0, o2::constants::math::TwoPI, "#phi"}; AxisSpec axisCent{100, 0, 100, "#Cent"}; +AxisSpec axisDeltaPt{50, -1.0, +1.0, "#Delta(pT)"}; +AxisSpec axisGenPtVary = {kGenpTend - 1, +kGenpTbegin + 0.5, +kGenpTend - 0.5, "", "GenpTVaryAxis"}; +AxisSpec axisGenTrkType = {kGenTrkTypeend - 1, +kGenTrkTypebegin + 0.5, +kGenTrkTypeend - 0.5, "", "GenTrackTypeAxis"}; +AxisSpec axisRecTrkType = {kRecTrkTypeend - 1, +kRecTrkTypebegin + 0.5, +kRecTrkTypeend - 0.5, "", "RecTrackTypeAxis"}; AxisSpec axisTrackType = {kTrackTypeend - 1, +kTrackTypebegin + 0.5, +kTrackTypeend - 0.5, "", "TrackTypeAxis"}; -auto static constexpr kMinCharge = 3.f; +auto static constexpr KminCharge = 3.f; +auto static constexpr KminPtCut = 0.1f; struct ChargedparticleRaa { @@ -139,15 +178,30 @@ struct ChargedparticleRaa { histos.add("hdatahistpp", "hdatahistpp", kTHnSparseD, {axisVtxZ, axisPt, axisTrackType}, false); } - if (doprocessMCPbPb) { - histos.add("hmczvtxcent", "hmczvtxcent", kTH2D, {axisVtxZ, centAxis}, false); - histos.add("hmcrechistPbPb", "hmcrechistPbPb", kTHnSparseD, {axisVtxZ, centAxis, axisPt, axisTrackType}, false); - histos.add("hmcgenhistPbPb", "hmcgenhistPbPb", kTHnSparseD, {axisVtxZ, centAxis, axisPt}, false); + if (doprocessMCeffPbPb) { + histos.add("hPbPbGenMCvtxz", "hPbPbGenMCvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hPbPbGenMCvtxzcent", "hPbPbGenMCvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hPbPbGenMCAssoRecvtxz", "hPbPbGenMCAssoRecvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hPbPbGenMCAssoRecvtxzcent", "hPbPbGenMCAssoRecvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hPbPbGenMCdndpt", "hPbPbGenMCdndpt", kTHnSparseD, {axisVtxZ, centAxis, axisPt, axisPhi}, false); + histos.add("hPbPbGenMCAssoRecdndpt", "hPbPbGenMCAssoRecdndpt", kTHnSparseD, {axisVtxZ, centAxis, axisPt, axisPhi, axisGenTrkType, axisGenPtVary}, false); + + histos.add("hPbPbRecMCvtxz", "hPbPbRecMCvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hPbPbRecMCvtxzcent", "hPbPbRecMCvtxzcent", kTH2D, {axisVtxZ, centAxis}, false); + histos.add("hPbPbRecMCcent", "hPbPbRecMCcent", kTH1D, {axisCent}, false); + histos.add("hPbPbRecMCdndpt", "hPbPbRecMCdndpt", kTHnSparseD, {axisVtxZ, centAxis, axisPt, axisPhi, axisRecTrkType}, false); + histos.add("hPbPbEtaReso", "hPbPbEtaReso", kTH2D, {axisPt, axisDeltaPt}); } - if (doprocessMCpp) { - histos.add("hmcrechistpp", "hmcrechistpp", kTHnSparseD, {axisVtxZ, axisPt, axisTrackType}, false); - histos.add("hmcgenhistpp", "hmcgenhistpp", kTHnSparseD, {axisVtxZ, axisPt}, false); + if (doprocessMCeffpp) { + histos.add("hppGenMCvtxz", "hppGenMCvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hppGenMCAssoRecvtxz", "hppGenMCAssoRecvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hppGenMCdndpt", "hppGenMCdndpt", kTHnSparseD, {axisVtxZ, axisPt, axisPhi}, false); + histos.add("hppGenMCAssoRecdndpt", "hppGenMCAssoRecdndpt", kTHnSparseD, {axisVtxZ, axisPt, axisPhi, axisGenTrkType, axisGenPtVary}, false); + + histos.add("hppRecMCvtxz", "hppRecMCvtxz", kTH1D, {axisVtxZ}, false); + histos.add("hppRecMCdndpt", "hppRecMCdndpt", kTHnSparseD, {axisVtxZ, axisPt, axisPhi, axisRecTrkType}, false); + histos.add("hppEtaReso", "hppEtaReso", kTH2D, {axisPt, axisDeltaPt}); } if (doprocessEvtLossSigLossMCpp || doprocessEvtLossSigLossMCPbPb) { @@ -259,7 +313,7 @@ struct ChargedparticleRaa { if (pdgTrack == nullptr) { return false; } - if (std::abs(pdgTrack->Charge()) < kMinCharge) { + if (std::abs(pdgTrack->Charge()) < KminCharge) { return false; } if (std::abs(track.eta()) >= etaRange) { @@ -321,71 +375,225 @@ struct ChargedparticleRaa { } } - void processMCPbPb(ColMCTrueTable::iterator const&, ColMCRecTablePbPb const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMCeffPbPb(ColMCTrueTable::iterator const& mcCollision, ColMCRecTablePbPb const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { - + auto gencent = -999; + bool atLeastOne = false; for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } - histos.fill(HIST("VtxZHist"), RecCol.posZ()); - histos.fill(HIST("CentPercentileMCRecHist"), RecCol.centFT0C()); - histos.fill(HIST("hmczvtxcent"), RecCol.posZ(), RecCol.centFT0C()); + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + atLeastOne = true; + gencent = RecCol.centFT0C(); + } + histos.fill(HIST("hPbPbGenMCvtxz"), mcCollision.posZ()); + histos.fill(HIST("hPbPbGenMCvtxzcent"), mcCollision.posZ(), gencent); + if (atLeastOne) { + histos.fill(HIST("hPbPbGenMCAssoRecvtxz"), mcCollision.posZ()); + histos.fill(HIST("hPbPbGenMCAssoRecvtxzcent"), mcCollision.posZ(), gencent); + } + for (const auto& particle : GenParticles) { + if (!isGenTrackSelected(particle)) { + continue; + } + histos.fill(HIST("hPbPbGenMCdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi()); + if (atLeastOne) { + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(kGenAll), kNoGenpTVar); + if (particle.pt() < KminPtCut) { + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTup, -10.0 * particle.pt() + 2); + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTdown, 5.0 * particle.pt() + 0.5); + } else { + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTup); + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTdown); + } + int pid = 0; + switch (std::abs(particle.pdgCode())) { + case PDG_t::kPiPlus: + pid = kGenPion; + break; + case PDG_t::kKPlus: + pid = kGenKaon; + break; + case PDG_t::kProton: + pid = kGenProton; + break; + default: + pid = kGenOther; + break; + } + histos.fill(HIST("hPbPbGenMCAssoRecdndpt"), mcCollision.posZ(), gencent, particle.pt(), particle.phi(), static_cast(pid), kNoGenpTVar); + } // Associated with reco col + } // track (mcgen) loop + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + histos.fill(HIST("hPbPbRecMCvtxz"), RecCol.posZ()); + histos.fill(HIST("hPbPbRecMCcent"), RecCol.centFT0C()); + histos.fill(HIST("hPbPbRecMCvtxzcent"), RecCol.posZ(), RecCol.centFT0C()); auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + std::vector mclabels; for (const auto& Rectrack : recTracksPart) { if (!isTrackSelected(Rectrack)) { continue; } - histos.fill(HIST("hmcrechistPbPb"), RecCol.posZ(), RecCol.centFT0C(), Rectrack.pt(), kGlobalplusITS); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrechistPbPb"), RecCol.posZ(), RecCol.centFT0C(), Rectrack.pt(), kGlobalonly); + histos.fill(HIST("hPbPbRecMCdndpt"), RecCol.posZ(), RecCol.centFT0C(), Rectrack.pt(), Rectrack.phi(), static_cast(kRecoAll)); + if (Rectrack.has_mcParticle()) { + int pid = 0; + auto mcpart = Rectrack.mcParticle(); + histos.fill(HIST("hPbPbEtaReso"), Rectrack.pt(), Rectrack.pt() - mcpart.pt()); + histos.fill(HIST("hPbPbRecMCdndpt"), RecCol.posZ(), RecCol.centFT0C(), mcpart.pt(), mcpart.phi(), static_cast(kRecoHasmc)); + if (mcpart.isPhysicalPrimary()) { + histos.fill(HIST("hPbPbRecMCdndpt"), RecCol.posZ(), RecCol.centFT0C(), mcpart.pt(), mcpart.phi(), static_cast(kRecoPrimary)); + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kRecoPion; + break; + case PDG_t::kKPlus: + pid = kRecoKaon; + break; + case PDG_t::kProton: + pid = kRecoProton; + break; + default: + pid = kRecoOther; + break; + } + } else { + pid = kRecoSecondary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kRecoWeakDecay; + } + } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kRecoFake; + } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hPbPbRecMCdndpt"), RecCol.posZ(), RecCol.centFT0C(), mcpart.pt(), mcpart.phi(), static_cast(pid)); } else { - histos.fill(HIST("hmcrechistPbPb"), RecCol.posZ(), RecCol.centFT0C(), Rectrack.pt(), kITSonly); + histos.fill(HIST("hPbPbRecMCdndpt"), RecCol.posZ(), RecCol.centFT0C(), Rectrack.pt(), Rectrack.phi(), static_cast(kRecoBkg)); } } // track (mcrec) loop - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgenhistPbPb"), RecCol.posZ(), RecCol.centFT0C(), particle.pt()); - } // track (mcgen) loop } // collision loop } - void processMCpp(ColMCTrueTable::iterator const&, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMCeffpp(ColMCTrueTable::iterator const& mcCollision, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { - + bool atLeastOne = false; for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } - histos.fill(HIST("VtxZHist"), RecCol.posZ()); + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + atLeastOne = true; + } + histos.fill(HIST("hppGenMCvtxz"), mcCollision.posZ()); + if (atLeastOne) { + histos.fill(HIST("hppGenMCAssoRecvtxz"), mcCollision.posZ()); + } + for (const auto& particle : GenParticles) { + if (!isGenTrackSelected(particle)) { + continue; + } + histos.fill(HIST("hppGenMCdndpt"), mcCollision.posZ(), particle.pt(), particle.phi()); + if (atLeastOne) { + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(kGenAll), kNoGenpTVar); + if (particle.pt() < KminPtCut) { + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTup, -10.0 * particle.pt() + 2); + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTdown, 5.0 * particle.pt() + 0.5); + } else { + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTup); + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(kGenAll), kGenpTdown); + } + int pid = 0; + switch (std::abs(particle.pdgCode())) { + case PDG_t::kPiPlus: + pid = kGenPion; + break; + case PDG_t::kKPlus: + pid = kGenKaon; + break; + case PDG_t::kProton: + pid = kGenProton; + break; + default: + pid = kGenOther; + break; + } + histos.fill(HIST("hppGenMCAssoRecdndpt"), mcCollision.posZ(), particle.pt(), particle.phi(), static_cast(pid), kNoGenpTVar); + } // Associated with reco col + } // track (mcgen) loop + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + histos.fill(HIST("hppRecMCvtxz"), RecCol.posZ()); auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + std::vector mclabels; for (const auto& Rectrack : recTracksPart) { if (!isTrackSelected(Rectrack)) { continue; } - histos.fill(HIST("hmcrechistpp"), RecCol.posZ(), Rectrack.pt(), kGlobalplusITS); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrechistpp"), RecCol.posZ(), Rectrack.pt(), kGlobalonly); + histos.fill(HIST("hppRecMCdndpt"), RecCol.posZ(), Rectrack.pt(), Rectrack.phi(), static_cast(kRecoAll)); + if (Rectrack.has_mcParticle()) { + int pid = 0; + auto mcpart = Rectrack.mcParticle(); + histos.fill(HIST("hppEtaReso"), Rectrack.pt(), Rectrack.pt() - mcpart.pt()); + histos.fill(HIST("hppRecMCdndpt"), RecCol.posZ(), mcpart.pt(), mcpart.phi(), static_cast(kRecoHasmc)); + if (mcpart.isPhysicalPrimary()) { + histos.fill(HIST("hppRecMCdndpt"), RecCol.posZ(), mcpart.pt(), mcpart.phi(), static_cast(kRecoPrimary)); + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kRecoPion; + break; + case PDG_t::kKPlus: + pid = kRecoKaon; + break; + case PDG_t::kProton: + pid = kRecoProton; + break; + default: + pid = kRecoOther; + break; + } + } else { + pid = kRecoSecondary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kRecoWeakDecay; + } + } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kRecoFake; + } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hppRecMCdndpt"), RecCol.posZ(), mcpart.pt(), mcpart.phi(), static_cast(pid)); } else { - histos.fill(HIST("hmcrechistpp"), RecCol.posZ(), Rectrack.pt(), kITSonly); + histos.fill(HIST("hppRecMCdndpt"), RecCol.posZ(), Rectrack.pt(), Rectrack.phi(), static_cast(kRecoBkg)); } } // track (mcrec) loop - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgenhistpp"), RecCol.posZ(), particle.pt()); - } // track (mcgen) loop } // collision loop } - void processEvtLossSigLossMCpp(soa::Join::iterator const& mcCollision, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles) + void processEvtLossSigLossMCpp(ColMCTrueTable::iterator const& mcCollision, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { return; @@ -393,22 +601,18 @@ struct ChargedparticleRaa { if (std::abs(mcCollision.posZ()) >= vtxRange) { return; } - // All generated events - histos.fill(HIST("MCEventHist"), 1); - bool atLeastOne = false; - auto numcontributors = -999; for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } - if (RecCol.numContrib() <= numcontributors) { + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; - } else { - numcontributors = RecCol.numContrib(); } atLeastOne = true; } + // All generated events + histos.fill(HIST("MCEventHist"), 1); if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); } @@ -425,7 +629,7 @@ struct ChargedparticleRaa { } } - void processEvtLossSigLossMCPbPb(soa::Join::iterator const& mcCollision, ColMCRecTablePbPb const& RecCols, TrackMCTrueTable const& GenParticles) + void processEvtLossSigLossMCPbPb(ColMCTrueTable::iterator const& mcCollision, ColMCRecTablePbPb const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { return; @@ -433,25 +637,21 @@ struct ChargedparticleRaa { if (std::abs(mcCollision.posZ()) >= vtxRange) { return; } - // All generated events - histos.fill(HIST("MCEventHist"), 1); - histos.fill(HIST("hImpactParameterGen"), mcCollision.impactParameter()); - bool atLeastOne = false; auto centrality = -999.; - auto numcontributors = -999; for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } - if (RecCol.numContrib() <= numcontributors) { + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { continue; - } else { - numcontributors = RecCol.numContrib(); } centrality = RecCol.centFT0C(); atLeastOne = true; } + // All generated events + histos.fill(HIST("MCEventHist"), 1); + histos.fill(HIST("hImpactParameterGen"), mcCollision.impactParameter()); if (atLeastOne) { histos.fill(HIST("MCEventHist"), 2); histos.fill(HIST("hImpactParameterRec"), mcCollision.impactParameter()); @@ -472,8 +672,8 @@ struct ChargedparticleRaa { PROCESS_SWITCH(ChargedparticleRaa, processDataPbPb, "process data heavy-ion", false); PROCESS_SWITCH(ChargedparticleRaa, processDatapp, "process data pp", false); - PROCESS_SWITCH(ChargedparticleRaa, processMCPbPb, "process MC heavy-ion", false); - PROCESS_SWITCH(ChargedparticleRaa, processMCpp, "process MC pp", false); + PROCESS_SWITCH(ChargedparticleRaa, processMCeffPbPb, "process MC heavy-ion", false); + PROCESS_SWITCH(ChargedparticleRaa, processMCeffpp, "process MC pp", false); PROCESS_SWITCH(ChargedparticleRaa, processEvtLossSigLossMCpp, "process Signal Loss, Event Loss", false); PROCESS_SWITCH(ChargedparticleRaa, processEvtLossSigLossMCPbPb, "process Signal Loss, Event Loss", false); }; From 974f86ba6124dd73316eeda707e27b3dbdc57dbf Mon Sep 17 00:00:00 2001 From: abmodak <67369858+abmodak@users.noreply.github.com> Date: Thu, 25 Dec 2025 03:24:59 +0100 Subject: [PATCH 2/2] Apply FT0 amplitude cut for QA --- .../Tasks/longrangecorrDerived.cxx | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index 751a5cedec5..7a2af04602f 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -91,6 +91,9 @@ struct LongrangecorrDerived { Configurable cfgZdcCut{"cfgZdcCut", 0.1f, "ZDC threshold"}; Configurable cfgGapSideCut{"cfgGapSideCut", 0, "Gap-side A=0, C=1, AC = 2, No Gap = -1, All events = 3"}; + Configurable isApplyAmpCut{"isApplyAmpCut", false, "Enable FT0 amplitude cut"}; + Configurable cfgLowAmpCut{"cfgLowAmpCut", 2.0f, "Low FT0 amplitude cut"}; + ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 10, 15, 25, 50, 60, 1000}, "multiplicity axis"}; ConfigurableAxis axisPhi{"axisPhi", {96, 0, TwoPI}, "#phi axis"}; ConfigurableAxis axisEtaTrig{"axisEtaTrig", {40, -1., 1.}, "#eta trig axis"}; @@ -101,6 +104,8 @@ struct LongrangecorrDerived { ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; ConfigurableAxis axisDeltaEta{"axisDeltaEta", {40, -6, -2}, "delta eta axis for histograms"}; ConfigurableAxis axisInvMass{"axisInvMass", {VARIABLE_WIDTH, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95, 2.0}, "invariant mass axis"}; + ConfigurableAxis axisInvMassQA{"axisInvMassQA", {20, 0.45, 0.55}, "invariant mass axis for QA"}; + ConfigurableAxis axisAmplitude{"axisAmplitude", {5000, 0, 10000}, "FT0 amplitude"}; ConfigurableAxis axisMultME{"axisMultME", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 1000}, "Mixing bins - multiplicity"}; ConfigurableAxis axisVtxZME{"axisVtxZME", {VARIABLE_WIDTH, -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10}, "Mixing bins - z-vertex"}; @@ -168,12 +173,14 @@ struct LongrangecorrDerived { histos.add("Trig_phi", "Trig_phi", kTH1D, {axisPhi}); histos.add("Trig_etavsphi", "Trig_etavsphi", kTH2D, {axisPhi, axisEtaTrig}); histos.add("Trig_pt", "Trig_pt", kTH1D, {axisPtTrigger}); + histos.add("Trig_invMass", "Trig_invMass", kTH1D, {axisInvMassQA}); histos.add("Trig_hist", "Trig_hist", kTHnSparseF, {axisVtxZ, axisMultiplicity, axisPtTrigger, axisInvMass}); histos.add("Assoc_eta", "Assoc_eta", kTH1D, {axisEtaAssoc}); histos.add("Assoc_phi", "Assoc_phi", kTH1D, {axisPhi}); histos.add("Assoc_etavsphi", "Assoc_etavsphi", kTH2D, {axisPhi, axisEtaAssoc}); histos.add("Assoc_pt", "Assoc_pt", kTH1D, {axisPtAssoc}); + histos.add("Assoc_amp", "Assoc_amp", kTH1D, {axisAmplitude}); histos.add("deltaEta_deltaPhi_same", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); histos.add("deltaEta_deltaPhi_mixed", "", kTH2D, {axisDeltaPhi, axisDeltaEta}); @@ -193,6 +200,9 @@ struct LongrangecorrDerived { histos.fill(HIST("Trig_eta"), track.eta()); histos.fill(HIST("Trig_phi"), track.phi()); histos.fill(HIST("Trig_pt"), track.pt()); + if constexpr (std::experimental::is_detected::value) { + histos.fill(HIST("Trig_invMass"), track.invMass()); + } } template @@ -201,6 +211,11 @@ struct LongrangecorrDerived { histos.fill(HIST("Assoc_etavsphi"), track.phi(), track.eta()); histos.fill(HIST("Assoc_eta"), track.eta()); histos.fill(HIST("Assoc_phi"), track.phi()); + if constexpr (std::experimental::is_detected::value) { + histos.fill(HIST("Assoc_amp"), track.amplitude()); + } else { + histos.fill(HIST("Assoc_pt"), track.pt()); + } } template @@ -229,6 +244,8 @@ struct LongrangecorrDerived { using HasInvMass = decltype(std::declval().invMass()); template using HasUpc = decltype(std::declval().gapSide()); + template + using HasFt0 = decltype(std::declval().channelID()); template void fillCorrHist(TTarget target, TTriggers const& triggers, TAssocs const& assocs, bool mixing, float vz, float multiplicity, float eventWeight) @@ -250,6 +267,10 @@ struct LongrangecorrDerived { } } for (auto const& assoTrack : assocs) { + if constexpr (std::experimental::is_detected::value) { + if (isApplyAmpCut && (assoTrack.amplitude() < cfgLowAmpCut)) + continue; + } float deltaPhi = RecoDecay::constrainAngle(triggerTrack.phi() - assoTrack.phi(), -PIHalf); float deltaEta = triggerTrack.eta() - assoTrack.eta(); if (!mixing) {