From f156abc95bdeea0990ffdae54104dc532898289d Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 21 Oct 2025 11:32:57 +0200 Subject: [PATCH 1/5] NucleiTask - Fix error --- PWGLF/Tasks/Nuspex/{LFNucleiBATask.cxx => lfNucleiBATask.cxx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename PWGLF/Tasks/Nuspex/{LFNucleiBATask.cxx => lfNucleiBATask.cxx} (100%) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx similarity index 100% rename from PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx rename to PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx From c14bcd9b8a5a85e3ea858be2b0d593dc2fef6e4f Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 21 Oct 2025 11:39:26 +0200 Subject: [PATCH 2/5] NucleiTask - Fix bugs in mult dependent histos --- PWGLF/Tasks/Nuspex/{lfNucleiBATask.cxx => LFNucleiBATask.cxx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename PWGLF/Tasks/Nuspex/{lfNucleiBATask.cxx => LFNucleiBATask.cxx} (100%) diff --git a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx similarity index 100% rename from PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx rename to PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx From e41855d186bc3c51d6c3d7862921f7c3144d663c Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Thu, 13 Nov 2025 22:14:46 +0100 Subject: [PATCH 3/5] NucleiTask - Add mult depend event loss --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 9954a8254e5..81c759b8ac6 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -430,6 +430,15 @@ struct LFNucleiBATask { histoGen.add("helium/MCReco/ptGen_INELgt0_Prim_antiHe", "generated particles", HistType::kTH1F, {ptHeAxis}); if (enableCentrality) { + histoGen.add("events/hMCGenVsMult", "hMCGenVsMult", HistType::kTH2D, {{3, 0.f, 3.f}, {binsPercentile}}); + histoGen.get(HIST("events/hMCGenVsMult"))->GetXaxis()->SetBinLabel(1, "All"); + histoGen.get(HIST("events/hMCGenVsMult"))->GetXaxis()->SetBinLabel(2, "Vtz"); + histoGen.get(HIST("events/hMCGenVsMult"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + + histoGen.add("events/hMCGenRecoVsMult", "hMCGenRecoVsMult", HistType::kTH2D, {{2, 0.f, 2.f}, {binsPercentile}}); + histoGen.get(HIST("events/hMCGenRecoVsMult"))->GetXaxis()->SetBinLabel(1, "INEL"); + histoGen.get(HIST("events/hMCGenRecoVsMult"))->GetXaxis()->SetBinLabel(2, "INELgt0"); + histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}}); histoGen.add("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}}); histoGen.add("helium/MCGen/ptGenVsMult_INELgt0_Prim_He", "generated particles", HistType::kTH2F, {{ptHeAxis}, {binsPercentile}}); @@ -6632,13 +6641,22 @@ struct LFNucleiBATask { // EVENT LOSS DENOMINATOR // No cuts histoGen.fill(HIST("events/hMCGen"), 0.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCGenVsMult"), 0.5, mcCollision.centFT0M()); + // Vtz cut if (mcCollision.posZ() < cfgVzCutLow || mcCollision.posZ() > cfgVzCutHigh) return; histoGen.fill(HIST("events/hMCGen"), 1.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCGenVsMult"), 1.5, mcCollision.centFT0M()); + // INEL > 0 - if (isINELgt0true) + if (isINELgt0true) { histoGen.fill(HIST("events/hMCGen"), 2.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCGenVsMult"), 2.5, mcCollision.centFT0M()); + } // SIGNAL LOSS DENOMINATOR for (const auto& mcParticle : mcParticles) { @@ -6736,8 +6754,14 @@ struct LFNucleiBATask { // EVENT LOSS NUMERATOR histoGen.fill(HIST("events/hMCGenReco"), 0.5); - if (recoIdxINELgt0 > 0) + if (enableCentrality) + histoGen.fill(HIST("events/hMCGenRecoVsMult"), 0.5, mcCollision.centFT0M()); + + if (recoIdxINELgt0 > 0) { histoGen.fill(HIST("events/hMCGenReco"), 1.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCGenRecoVsMult"), 1.5, mcCollision.centFT0M()); + } // SIGNAL LOSS NUMERATOR for (const auto& mcParticle : mcParticles) { From 02f7d326bebdb49fb65660e87351a7491baecf17 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Thu, 13 Nov 2025 22:33:03 +0100 Subject: [PATCH 4/5] NucleiTask - Fix format error --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 81c759b8ac6..a437c0f0a4c 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -6756,8 +6756,8 @@ struct LFNucleiBATask { histoGen.fill(HIST("events/hMCGenReco"), 0.5); if (enableCentrality) histoGen.fill(HIST("events/hMCGenRecoVsMult"), 0.5, mcCollision.centFT0M()); - - if (recoIdxINELgt0 > 0) { + + if (recoIdxINELgt0 > 0) { histoGen.fill(HIST("events/hMCGenReco"), 1.5); if (enableCentrality) histoGen.fill(HIST("events/hMCGenRecoVsMult"), 1.5, mcCollision.centFT0M()); From 2a88d9fd965bca3fb4aefc28ce73989681944d55 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Fri, 14 Nov 2025 23:21:01 +0100 Subject: [PATCH 5/5] NucleiTask - Fix wrong multiplicity estimator in reco --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 111 ++++++++++++++++---------- 1 file changed, 68 insertions(+), 43 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index a437c0f0a4c..09ddf7d765a 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -411,12 +411,18 @@ struct LFNucleiBATask { histoGen.get(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(2, "Ev sel passed"); histoGen.get(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + histoGen.add("helium/MCGen/h2HeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}}); + histoGen.add("helium/MCGen/h2antiHeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}}); + histoGen.add("helium/MCGen/ptGen_INEL_Prim_He", "generated particles", HistType::kTH1F, {ptHeAxis}); histoGen.add("helium/MCGen/ptGen_INEL_Prim_antiHe", "generated particles", HistType::kTH1F, {ptHeAxis}); histoGen.add("helium/MCGen/ptGen_INELgt0_Prim_He", "generated particles", HistType::kTH1F, {ptHeAxis}); histoGen.add("helium/MCGen/ptGen_INELgt0_Prim_antiHe", "generated particles", HistType::kTH1F, {ptHeAxis}); + histoGen.add("helium/MCGenReco/h2HeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}}); + histoGen.add("helium/MCGenReco/h2antiHeliumYvsPt", "#it{y} vs #it{p}_{T} (He)", HistType::kTH2F, {{96, -1.2, 1.2}, {ptHeAxis}}); + histoGen.add("helium/MCGenReco/ptGen_INEL_Prim_He", "generated particles", HistType::kTH1F, {ptHeAxis}); histoGen.add("helium/MCGenReco/ptGen_INEL_Prim_antiHe", "generated particles", HistType::kTH1F, {ptHeAxis}); @@ -2282,7 +2288,8 @@ struct LFNucleiBATask { template void fillHistograms(const CollisionType& event, const TracksType& tracks, - const ParticleType& particles) + const ParticleType& particles, + float centFT0M) { histos.fill(HIST("event/eventSkimming"), 0.5); // Apply skimming @@ -2299,7 +2306,7 @@ struct LFNucleiBATask { // Event histos fill if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 0, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 0, centFT0M); else histos.fill(HIST("event/eventSelection"), 0); if (enableDebug) @@ -2311,7 +2318,7 @@ struct LFNucleiBATask { return; } else { if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 1, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 1, centFT0M); else histos.fill(HIST("event/eventSelection"), 1); if (enableDebug) @@ -2323,7 +2330,7 @@ struct LFNucleiBATask { return; } else { if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 2, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 2, centFT0M); else histos.fill(HIST("event/eventSelection"), 2); if (enableDebug) @@ -2335,7 +2342,7 @@ struct LFNucleiBATask { return; } else { if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 3, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 3, centFT0M); else histos.fill(HIST("event/eventSelection"), 3); if (enableDebug) @@ -2346,7 +2353,7 @@ struct LFNucleiBATask { (event.selection_bit(aod::evsel::kNoTimeFrameBorder)) && (event.selection_bit(aod::evsel::kIsTriggerTVX))) { if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 4, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 4, centFT0M); else histos.fill(HIST("event/eventSelection"), 4); } @@ -2354,7 +2361,7 @@ struct LFNucleiBATask { if (evselOptions.useSel8 && !event.sel8()) return; if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 5, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 5, centFT0M); else histos.fill(HIST("event/eventSelection"), 5); if (enableDebug) @@ -2363,7 +2370,7 @@ struct LFNucleiBATask { if (event.posZ() < cfgVzCutLow || event.posZ() > cfgVzCutHigh) return; if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 6, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 6, centFT0M); else histos.fill(HIST("event/eventSelection"), 6); @@ -2373,11 +2380,11 @@ struct LFNucleiBATask { if (evselOptions.removeTFBorder && !event.selection_bit(aod::evsel::kNoTimeFrameBorder)) return; } - if (event.centFT0M() <= cfgMultCutLow || event.centFT0M() > cfgMultCutHigh) { + if (centFT0M <= cfgMultCutLow || centFT0M > cfgMultCutHigh) { return; } if (enableCentrality) - histos.fill(HIST("event/eventSelection"), 7, event.centFT0M()); + histos.fill(HIST("event/eventSelection"), 7, centFT0M); else histos.fill(HIST("event/eventSelection"), 7); @@ -2395,11 +2402,11 @@ struct LFNucleiBATask { // Event histos fill if (enableCentrality) - histos.fill(HIST("event/h1VtxZ"), event.posZ(), event.centFT0M()); + histos.fill(HIST("event/h1VtxZ"), event.posZ(), centFT0M); else histos.fill(HIST("event/h1VtxZ"), event.posZ()); if (enableDebug && enableCentrality) - debugHistos.fill(HIST("event/hFT0M"), event.centFT0M()); + debugHistos.fill(HIST("event/hFT0M"), centFT0M); if constexpr (IsFilteredData) { if (enableCentrality) @@ -3268,7 +3275,7 @@ struct LFNucleiBATask { if (usenITSLayer && !itsClusterMap.test(trkqcOptions.nITSLayer)) continue; if (enableCentrality) - histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronVsMult"), DPt, track.dcaXY(), event.centFT0M()); + histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronVsMult"), DPt, track.dcaXY(), centFT0M); else histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteron"), DPt, track.dcaXY()); if (!track.hasTOF() && (outFlagOptions.enableNoTOFPlots)) @@ -3278,7 +3285,7 @@ struct LFNucleiBATask { if (usenITSLayer && !itsClusterMap.test(trkqcOptions.nITSLayer)) continue; if (enableCentrality) - histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteronVsMult"), antiDPt, track.dcaXY(), event.centFT0M()); + histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteronVsMult"), antiDPt, track.dcaXY(), centFT0M); else histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteron"), antiDPt, track.dcaXY()); if (!track.hasTOF() && (outFlagOptions.enableNoTOFPlots)) @@ -4504,7 +4511,7 @@ struct LFNucleiBATask { switch (useHasTRDConfig) { case 0: if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3DeuteronVspTNSigmaTPCVsMult"), DPt, track.tpcNSigmaDe(), event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3DeuteronVspTNSigmaTPCVsMult"), DPt, track.tpcNSigmaDe(), centFT0M); else histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), DPt, track.tpcNSigmaDe()); break; @@ -4529,7 +4536,7 @@ struct LFNucleiBATask { switch (useHasTRDConfig) { case 0: if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3antiDeuteronVspTNSigmaTPCVsMult"), antiDPt, track.tpcNSigmaDe(), event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3antiDeuteronVspTNSigmaTPCVsMult"), antiDPt, track.tpcNSigmaDe(), centFT0M); else histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), antiDPt, track.tpcNSigmaDe()); break; @@ -4552,7 +4559,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaITSHe"), track.p(), nITSHe); histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTPC"), hePt, track.tpcNSigmaHe()); if (enableCentrality) - histos.fill(HIST("tracks/helium/h3HeliumVspTNSigmaTPCVsMult"), hePt, track.tpcNSigmaHe(), event.centFT0M()); + histos.fill(HIST("tracks/helium/h3HeliumVspTNSigmaTPCVsMult"), hePt, track.tpcNSigmaHe(), centFT0M); } if (isAntiHeWoTPCpid) { if (outFlagOptions.enableExpSignalTPC) @@ -4560,7 +4567,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaITSHe"), track.p(), nITSHe); histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTPC"), antihePt, track.tpcNSigmaHe()); if (enableCentrality) - histos.fill(HIST("tracks/helium/h3antiHeliumVspTNSigmaTPCVsMult"), antihePt, track.tpcNSigmaHe(), event.centFT0M()); + histos.fill(HIST("tracks/helium/h3antiHeliumVspTNSigmaTPCVsMult"), antihePt, track.tpcNSigmaHe(), centFT0M); } if (isHeWTPCpid) { histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaITSHe_wTPCpid"), track.p(), nITSHe); @@ -4986,7 +4993,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/hPtDeTOF"), DPt); histos.fill(HIST("tracks/deuteron/h2TOFmassDeuteronVsPt"), massTOF, DPt); if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3TOFmass2DeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt, event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3TOFmass2DeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt, centFT0M); else histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, DPt); if (outFlagOptions.enableBetaCut && (track.beta() > cfgBetaCut)) { @@ -5012,7 +5019,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/deuteron/hPtantiDeTOF"), antiDPt); histos.fill(HIST("tracks/deuteron/h2TOFmassantiDeuteronVsPt"), massTOF, antiDPt); if (enableCentrality) - histos.fill(HIST("tracks/deuteron/h3TOFmass2antiDeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt, event.centFT0M()); + histos.fill(HIST("tracks/deuteron/h3TOFmass2antiDeuteronVsPtVsMult"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt, centFT0M); else histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - MassDeuteronVal * MassDeuteronVal, antiDPt); if (outFlagOptions.enableBetaCut && (track.beta() > cfgBetaCut)) { @@ -5041,7 +5048,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/helium/h2TOFmassDeltaHeliumVsPt"), 2.f * massTOFhe - MassHeliumVal, hePt); histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), 2.f * massTOFhe * 2.f * massTOFhe - MassHeliumVal * MassHeliumVal, hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h3TOFmass2HeliumVsPtVsMult"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h3TOFmass2HeliumVsPtVsMult"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, hePt, centFT0M); if (outFlagOptions.enableBetaCut && (track.beta() > cfgBetaCut)) { histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt_BetaCut"), 2.f * massTOFhe, hePt); histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt_BetaCut"), 2.f * massTOFhe * 2.f * massTOFhe - MassHeliumVal * MassHeliumVal, hePt); @@ -5056,7 +5063,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/helium/h2TOFmassDeltaantiHeliumVsPt"), 2.f * massTOFantihe - MassHeliumVal, antihePt); histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h3TOFmass2antiHeliumVsPtVsMult"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h3TOFmass2antiHeliumVsPtVsMult"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt, centFT0M); if (outFlagOptions.enableBetaCut && (track.beta() > cfgBetaCut)) { histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt_BetaCut"), 2.f * massTOFantihe, antihePt); histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt_BetaCut"), 2.f * massTOFantihe * 2.f * massTOFantihe - MassHeliumVal * MassHeliumVal, antihePt); @@ -5787,7 +5794,7 @@ struct LFNucleiBATask { if (isHelium && passDCAzCutHe && passDCAxyCutHe) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTrue_Z2"), 2 * hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueVsMult_Z2"), 2 * hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueVsMult_Z2"), 2 * hePt, centFT0M); if (outFlagOptions.makeDCAAfterCutPlots) { histos.fill(HIST("tracks/helium/dca/after/hDCAxyVsPtHeliumTrue"), hePt, track.dcaXY()); @@ -5801,7 +5808,7 @@ struct LFNucleiBATask { if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueWPID_Z2"), 2 * hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueWPIDVsMult_Z2"), 2 * hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueWPIDVsMult_Z2"), 2 * hePt, centFT0M); if (outFlagOptions.enableEffPlots) { histos.fill(HIST("tracks/eff/helium/hPtHeTrue_Z2"), 2 * hePt); if (track.hasTOF() && outFlagOptions.doTOFplots) { @@ -5812,13 +5819,13 @@ struct LFNucleiBATask { if (isPhysPrim) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTruePrim_Z2"), 2 * hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2HeliumSpectraTruePrimVsMult_Z2"), 2 * hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2HeliumSpectraTruePrimVsMult_Z2"), 2 * hePt, centFT0M); if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) { if (track.hasTOF() && outFlagOptions.doTOFplots) { histos.fill(HIST("tracks/helium/TOF/h1HeliumSpectraTruePrim_Z2"), 2 * hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraTruePrimVsMult_Z2"), 2 * hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/TOF/h2HeliumSpectraTruePrimVsMult_Z2"), 2 * hePt, centFT0M); } } @@ -5845,7 +5852,7 @@ struct LFNucleiBATask { if (isWeakDecay) { histos.fill(HIST("tracks/helium/h1HeliumSpectraTrueSec_Z2"), 2 * hePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueSecVsMult_Z2"), 2 * hePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2HeliumSpectraTrueSecVsMult_Z2"), 2 * hePt, centFT0M); if (outFlagOptions.makeDCAAfterCutPlots) { histos.fill(HIST("tracks/helium/dca/after/hDCAxyVsPtHeliumTrueSec"), hePt, track.dcaXY()); histos.fill(HIST("tracks/helium/dca/after/hDCAzVsPtHeliumTrueSec"), hePt, track.dcaZ()); @@ -5862,7 +5869,7 @@ struct LFNucleiBATask { if (isHelium && passDCAzCutAntiHe && passDCAxyCutAntiHe) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrue_Z2"), 2 * antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueVsMult_Z2"), 2 * antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueVsMult_Z2"), 2 * antihePt, centFT0M); if (outFlagOptions.makeDCAAfterCutPlots) { histos.fill(HIST("tracks/helium/dca/after/hDCAxyVsPtantiHeliumTrue"), antihePt, track.dcaXY()); @@ -5875,7 +5882,7 @@ struct LFNucleiBATask { if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrueWPID_Z2"), 2 * antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueWPIDVsMult_Z2"), 2 * antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueWPIDVsMult_Z2"), 2 * antihePt, centFT0M); if (outFlagOptions.enableEffPlots) { histos.fill(HIST("tracks/eff/helium/hPtantiHeTrue_Z2"), 2 * antihePt); if (track.hasTOF() && outFlagOptions.doTOFplots) { @@ -5886,13 +5893,13 @@ struct LFNucleiBATask { if (isPhysPrim) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTruePrim_Z2"), 2 * antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTruePrimVsMult_Z2"), 2 * antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTruePrimVsMult_Z2"), 2 * antihePt, centFT0M); if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCvar.nsigmaTPCHe) { if (track.hasTOF() && outFlagOptions.doTOFplots) { histos.fill(HIST("tracks/helium/TOF/h1antiHeliumSpectraTruePrim_Z2"), 2 * antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraTruePrimVsMult_Z2"), 2 * antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/TOF/h2antiHeliumSpectraTruePrimVsMult_Z2"), 2 * antihePt, centFT0M); } } @@ -5919,7 +5926,7 @@ struct LFNucleiBATask { if (isWeakDecay) { histos.fill(HIST("tracks/helium/h1antiHeliumSpectraTrueSec_Z2"), 2 * antihePt); if (enableCentrality) - histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueSecVsMult_Z2"), 2 * antihePt, event.centFT0M()); + histos.fill(HIST("tracks/helium/h2antiHeliumSpectraTrueSecVsMult_Z2"), 2 * antihePt, centFT0M); if (outFlagOptions.makeDCAAfterCutPlots) { histos.fill(HIST("tracks/helium/dca/after/hDCAxyVsPtantiHeliumTrueSec"), antihePt, track.dcaXY()); histos.fill(HIST("tracks/helium/dca/after/hDCAzVsPtantiHeliumTrueSec"), antihePt, track.dcaZ()); @@ -6037,7 +6044,7 @@ struct LFNucleiBATask { TrackCandidates const& tracks, o2::aod::BCsWithTimestamps const&) { - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } PROCESS_SWITCH(LFNucleiBATask, processData, "process data", true); @@ -6046,7 +6053,7 @@ struct LFNucleiBATask { TrackCandidatesLfPid const& tracks, o2::aod::BCsWithTimestamps const&) { - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } PROCESS_SWITCH(LFNucleiBATask, processDataLfPid, "process data with LF PID", false); @@ -6057,7 +6064,7 @@ struct LFNucleiBATask { { // Runs on data filtered on the fly with LF Tree creator nuclei task // Takes as input full AO2Ds - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } PROCESS_SWITCH(LFNucleiBATask, processDataFiltered, "process data on the filtered data", false); @@ -6067,7 +6074,7 @@ struct LFNucleiBATask { { // Runs on derived tables produced with LF Tree creator nuclei task // Takes as input derived trees - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } PROCESS_SWITCH(LFNucleiBATask, processDataLight, "process data on the derived trees", false); @@ -6080,7 +6087,7 @@ struct LFNucleiBATask { // Process function that runs on the original AO2D (for the MC) void processMCReco(EventCandidatesMC::iterator const& event, - soa::Join const&, + soa::Join const& mcCollisions, soa::Join const& tracks, aod::McParticles const& mcParticles, o2::aod::BCsWithTimestamps const&) @@ -6102,21 +6109,26 @@ struct LFNucleiBATask { doRecoSep = false; } + float mcCentFT0M = -1.f; + if (doRecoSep && event.has_mcCollision()) { const int mcIdx = event.mcCollisionId(); if (mcIdx >= 0) { effEvtSet.insert(mcIdx); effEvtSetReady = true; + + auto mcColIter = mcCollisions.iteratorAt(mcIdx); + mcCentFT0M = mcColIter.centFT0M(); } } - fillHistograms(event, tracks, mcParticles); + fillHistograms(event, tracks, mcParticles, mcCentFT0M); } // CLOSING PROCESS MC RECO PROCESS_SWITCH(LFNucleiBATask, processMCReco, "process mc reco", false); // Process function that runs on the original AO2D (for the MC) with the LfPIDcalibration void processMCRecoLfPid(EventCandidatesMC::iterator const& event, - soa::Join const&, + soa::Join const& mcCollisions, soa::Join const& tracks, aod::McParticles const& mcParticles, o2::aod::BCsWithTimestamps const&) @@ -6138,15 +6150,20 @@ struct LFNucleiBATask { doRecoSep = false; } + float mcCentFT0M = -1.f; + if (doRecoSep && event.has_mcCollision()) { const int mcIdx = event.mcCollisionId(); if (mcIdx >= 0) { effEvtSet.insert(mcIdx); effEvtSetReady = true; + + auto mcColIter = mcCollisions.iteratorAt(mcIdx); + mcCentFT0M = mcColIter.centFT0M(); } } - fillHistograms(event, tracks, mcParticles); + fillHistograms(event, tracks, mcParticles, mcCentFT0M); } // CLOSING PROCESS MC RECO PROCESS_SWITCH(LFNucleiBATask, processMCRecoLfPid, "process mc reco with LfPid", false); @@ -6267,7 +6284,7 @@ struct LFNucleiBATask { soa::Join const& tracks, o2::aod::BCsWithTimestamps const&) { - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } // CLOSING PROCESS MC RECO ON FILTERED DATA PROCESS_SWITCH(LFNucleiBATask, processMCRecoFiltered, "process mc reco on the filtered data", false); @@ -6275,7 +6292,7 @@ struct LFNucleiBATask { soa::Join const& tracks, o2::aod::BCsWithTimestamps const&) { - fillHistograms(event, tracks, true /*dummy*/); + fillHistograms(event, tracks, true /*dummy*/, event.centFT0M()); } // CLOSING PROCESS MC RECO ON FILTERED DATA PROCESS_SWITCH(LFNucleiBATask, processMCRecoFilteredLight, "process mc reco on the derived trees", false); @@ -6630,11 +6647,14 @@ struct LFNucleiBATask { } PROCESS_SWITCH(LFNucleiBATask, processEvSgLossMC, "process MC SignLoss", false); + // void processMCGen(soa::Join::iterator const& mcCollision, + // aod::McParticles const& mcParticles) + // EVENT LOSS, SIGNAL LOSS and EFFICIENCY CHECKER process function void processMCGenLosses( soa::Join::iterator const& mcCollision, const soa::SmallGroups>& collisions, - o2::aod::McParticles const& mcParticles) + aod::McParticles const& mcParticles) { bool isINELgt0true = pwglf::isINELgtNmc(mcParticles, 0, pdgDB); @@ -6669,10 +6689,12 @@ struct LFNucleiBATask { if (enableHe && isPhysPrim && (std::abs(pdg) == PDGHelium)) { if (pdg > 0) { + histoGen.fill(HIST("helium/MCGen/h2HeliumYvsPt"), mcParticle.y(), pt); histoGen.fill(HIST("helium/MCGen/ptGen_INEL_Prim_He"), pt); if (enableCentrality) histoGen.fill(HIST("helium/MCGen/ptGenVsMult_INEL_Prim_He"), pt, mcCollision.centFT0M()); } else { + histoGen.fill(HIST("helium/MCGen/h2antiHeliumYvsPt"), mcParticle.y(), pt); histoGen.fill(HIST("helium/MCGen/ptGen_INEL_Prim_antiHe"), pt); if (enableCentrality) histoGen.fill(HIST("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M()); @@ -6693,6 +6715,7 @@ struct LFNucleiBATask { int recoIdxINEL = 0; int recoIdxINELgt0 = 0; + // for (const auto& collision : collisions) { for (const auto& collision : collisions) { bool hasTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool hasNoTFB = collision.selection_bit(aod::evsel::kNoTimeFrameBorder); @@ -6774,10 +6797,12 @@ struct LFNucleiBATask { if (enableHe && isPhysPrim && (std::abs(pdg) == PDGHelium)) { if (pdg > 0) { + histoGen.fill(HIST("helium/MCGenReco/h2HeliumYvsPt"), mcParticle.y(), pt); histoGen.fill(HIST("helium/MCGenReco/ptGen_INEL_Prim_He"), pt); if (enableCentrality) histoGen.fill(HIST("helium/MCGenReco/ptGenVsMult_INEL_Prim_He"), pt, mcCollision.centFT0M()); } else { + histoGen.fill(HIST("helium/MCGenReco/h2antiHeliumYvsPt"), mcParticle.y(), pt); histoGen.fill(HIST("helium/MCGenReco/ptGen_INEL_Prim_antiHe"), pt); if (enableCentrality) histoGen.fill(HIST("helium/MCGenReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M());