From 5965d1baa0e6fbf93447c8e52a05776787e0c522 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 21 Oct 2025 11:39:26 +0200 Subject: [PATCH 1/6] 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 3d096b9f0303d5e6a463c86a1eadc2dfe184b945 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 2 Jun 2026 16:29:46 +0200 Subject: [PATCH 2/6] NucleiTask - Fix O2Lint errors --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 781d5e5cdc6..26f85791555 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -239,7 +239,11 @@ struct lfNucleiBATask { Configurable enablePtShiftPID{"enablePtShiftPID", true, "Flag to enable wrong PID in tracking pT correction shift"}; Configurable> parShiftPtPID{"parShiftPtPID", {0.0f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}, "Parameters for helium3-Pt wrong pid shift (if enabled)."}; +<<<<<<< HEAD Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; +======= + Configurable CfgPtShiftPID{"CfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; +>>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; @@ -2596,7 +2600,11 @@ struct lfNucleiBATask { } if (enablePtShiftPID && fShiftPtPID) { shiftPtPID = fShiftPtPID->Eval(2 * track.pt()); +<<<<<<< HEAD if (tritonPID && (track.pt() <= cfgPtShiftPID)) { +======= + if (tritonPID && (track.pt() <= CfgPtShiftPID)) { +>>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) hePt = track.pt() - shiftPtPID / 2.f; antihePt = track.pt() - shiftPtPID / 2.f; } From b3c2792c1c86bc6a0d3d08334094ce5aff95ff39 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 2 Jun 2026 16:40:45 +0200 Subject: [PATCH 3/6] NucleiTask - Fix O2Lint errors --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 26f85791555..7faf300b535 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -15,6 +15,11 @@ /// \brief Analysis task for the measurement of the coalescence parameter B2/B3 in pp collisions for (anti)deuteron/(anti)helium-3 /// /// \author Giovanni Malfattore and Rutuparna Rath +<<<<<<< HEAD +======= + +// o2-linter: disable=name/workflow-file +>>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) // o2-linter: disable=name/workflow-file @@ -239,11 +244,15 @@ struct lfNucleiBATask { Configurable enablePtShiftPID{"enablePtShiftPID", true, "Flag to enable wrong PID in tracking pT correction shift"}; Configurable> parShiftPtPID{"parShiftPtPID", {0.0f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}, "Parameters for helium3-Pt wrong pid shift (if enabled)."}; +<<<<<<< HEAD <<<<<<< HEAD Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; ======= Configurable CfgPtShiftPID{"CfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; >>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) +======= + Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; +>>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; @@ -2600,11 +2609,15 @@ struct lfNucleiBATask { } if (enablePtShiftPID && fShiftPtPID) { shiftPtPID = fShiftPtPID->Eval(2 * track.pt()); +<<<<<<< HEAD <<<<<<< HEAD if (tritonPID && (track.pt() <= cfgPtShiftPID)) { ======= if (tritonPID && (track.pt() <= CfgPtShiftPID)) { >>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) +======= + if (tritonPID && (track.pt() <= cfgPtShiftPID)) { +>>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) hePt = track.pt() - shiftPtPID / 2.f; antihePt = track.pt() - shiftPtPID / 2.f; } From a8cb9c53a72fb2910a791b67eaddfe7ff2702fee Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 2 Jun 2026 17:08:55 +0200 Subject: [PATCH 4/6] NucleiTask - Files renamed --- ...{LFNucleiBATask.cxx => lfNucleiBATask.cxx} | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) rename PWGLF/Tasks/Nuspex/{LFNucleiBATask.cxx => lfNucleiBATask.cxx} (99%) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx similarity index 99% rename from PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx rename to PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx index 7faf300b535..7b76b1b6005 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -15,11 +15,6 @@ /// \brief Analysis task for the measurement of the coalescence parameter B2/B3 in pp collisions for (anti)deuteron/(anti)helium-3 /// /// \author Giovanni Malfattore and Rutuparna Rath -<<<<<<< HEAD -======= - -// o2-linter: disable=name/workflow-file ->>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) // o2-linter: disable=name/workflow-file @@ -244,15 +239,7 @@ struct lfNucleiBATask { Configurable enablePtShiftPID{"enablePtShiftPID", true, "Flag to enable wrong PID in tracking pT correction shift"}; Configurable> parShiftPtPID{"parShiftPtPID", {0.0f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}, "Parameters for helium3-Pt wrong pid shift (if enabled)."}; -<<<<<<< HEAD -<<<<<<< HEAD - Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; -======= Configurable CfgPtShiftPID{"CfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; ->>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) -======= - Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; ->>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; @@ -2609,15 +2596,8 @@ struct lfNucleiBATask { } if (enablePtShiftPID && fShiftPtPID) { shiftPtPID = fShiftPtPID->Eval(2 * track.pt()); -<<<<<<< HEAD -<<<<<<< HEAD - if (tritonPID && (track.pt() <= cfgPtShiftPID)) { -======= + if (tritonPID && (track.pt() <= CfgPtShiftPID)) { ->>>>>>> 4b515a987 (NucleiTask - Fix O2Lint errors) -======= - if (tritonPID && (track.pt() <= cfgPtShiftPID)) { ->>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) hePt = track.pt() - shiftPtPID / 2.f; antihePt = track.pt() - shiftPtPID / 2.f; } From 7bcd1c2a6d1d67b0eac51a8d1c801c73312f5991 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Wed, 10 Jun 2026 00:01:55 +0200 Subject: [PATCH 5/6] NucleiTask - Add counter --- PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx | 56 +++++++++++++++++++++------ 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx index 7b76b1b6005..59066df54ec 100644 --- a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -16,7 +16,7 @@ /// /// \author Giovanni Malfattore and Rutuparna Rath -// o2-linter: disable=name/workflow-file +// o2-linter: disable=name/workflow-file (temporary fix) #include "PWGLF/DataModel/LFNucleiTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" @@ -428,6 +428,9 @@ struct lfNucleiBATask { histoGen.get(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(2, "Ev sel passed"); histoGen.get(HIST("events/hMCReco"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + histoGen.add("events/hNRecoCollPerMCColl_INEL", "Reco collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}}); + histoGen.add("events/hNRecoCollPerMCColl_INELgt0", "Reco INEL>0 collisions per MC collision;N_{reco coll};Counts", HistType::kTH1D, {{6, -0.5, 5.5}}); + 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}}); @@ -467,6 +470,9 @@ struct lfNucleiBATask { histoGen.get(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(2, "Ev sel passed"); histoGen.get(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + histoGen.add("events/hNRecoCollPerMCCollVsMult_INEL", "Reco collisions per MC collision vs FT0M;N_{reco coll};FT0M percentile", HistType::kTH2D, {{6, -0.5, 5.5}, {binsPercentile}}); + histoGen.add("events/hNRecoCollPerMCCollVsMult_INELgt0", "Reco INEL>0 collisions per MC collision vs FT0M;N_{reco coll};FT0M percentile", HistType::kTH2D, {{6, -0.5, 5.5}, {binsPercentile}}); + 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}}); @@ -2324,6 +2330,8 @@ struct lfNucleiBATask { LOG(info) << "Histograms of lfNucleiBATask:"; histos.print(); spectraGen.print(); + if (doprocessMCGenLosses) + histoGen.print(); } template @@ -6720,9 +6728,9 @@ struct lfNucleiBATask { if (isTvxEvent) evLossHistos.fill(HIST("evLoss/hEvent"), 1.5); - if (isSel8Event) - evLossHistos.fill(HIST("evLoss/hEvent"), 2.5); if (isMCSel8Event) + evLossHistos.fill(HIST("evLoss/hEvent"), 2.5); + if (isSel8Event) evLossHistos.fill(HIST("evLoss/hEvent"), 3.5); // Loop over all the Generated level particles @@ -6792,6 +6800,7 @@ struct lfNucleiBATask { // 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()); @@ -6824,6 +6833,7 @@ struct lfNucleiBATask { if (enableCentrality) histoGen.fill(HIST("helium/MCGen/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M()); } + if (isINELgt0true) { if (pdg > 0) { histoGen.fill(HIST("helium/MCGen/ptGen_INELgt0_Prim_He"), pt); @@ -6840,33 +6850,49 @@ struct lfNucleiBATask { int recoIdxINEL = 0; int recoIdxINELgt0 = 0; - // for (const auto& collision : collisions) { + bool atLeastOneINEL = false; + bool atLeastOneINELgt0 = false; + for (const auto& collision : collisions) { + bool isSel8Event = collision.sel8(); bool hasTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool hasNoTFB = collision.selection_bit(aod::evsel::kNoTimeFrameBorder); bool hasNoItsRofFB = collision.selection_bit(aod::evsel::kNoITSROFrameBorder); - // Check event selection histoGen.fill(HIST("events/hMCReco"), 0.5); if (enableCentrality) histoGen.fill(HIST("events/hMCRecoVsMult"), 0.5, mcCollision.centFT0M()); + + // Event selection cuts + if (evselOptions.useSel8 && !isSel8Event) + continue; if (evselOptions.useTVXtrigger && !hasTVX) continue; if (evselOptions.removeTFBorder && !hasNoTFB) continue; if (evselOptions.removeITSROFBorder && !hasNoItsRofFB) continue; + + // Vtz cut + if (collision.posZ() < cfgVzCutLow || collision.posZ() > cfgVzCutHigh) + continue; + + // EVENT SPLITTING DENOMINATOR histoGen.fill(HIST("events/hMCReco"), 1.5); if (enableCentrality) histoGen.fill(HIST("events/hMCRecoVsMult"), 1.5, mcCollision.centFT0M()); recoIdxINEL++; + atLeastOneINEL = true; if (collision.isInelGt0() && isINELgt0true) { + // EVENT SPLITTING DENOMINATOR histoGen.fill(HIST("events/hMCReco"), 2.5); if (enableCentrality) histoGen.fill(HIST("events/hMCRecoVsMult"), 2.5, mcCollision.centFT0M()); + recoIdxINELgt0++; + atLeastOneINELgt0 = true; } for (const auto& mcParticle : mcParticles) { @@ -6887,7 +6913,8 @@ struct lfNucleiBATask { if (enableCentrality) histoGen.fill(HIST("helium/MCReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M()); } - if (recoIdxINELgt0 > 0) { + + if (atLeastOneINELgt0) { if (pdg > 0) { histoGen.fill(HIST("helium/MCReco/ptGen_INELgt0_Prim_He"), pt); if (enableCentrality) @@ -6902,16 +6929,22 @@ struct lfNucleiBATask { } } - if (recoIdxINEL < 1) { - return; + histoGen.fill(HIST("events/hNRecoCollPerMCColl_INEL"), recoIdxINEL); + histoGen.fill(HIST("events/hNRecoCollPerMCColl_INELgt0"), recoIdxINELgt0); + if (enableCentrality) { + histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INEL"), recoIdxINEL, mcCollision.centFT0M()); + histoGen.fill(HIST("events/hNRecoCollPerMCCollVsMult_INELgt0"), recoIdxINELgt0, mcCollision.centFT0M()); } - // EVENT LOSS NUMERATOR + if (!atLeastOneINEL) + return; + + // EVENT LOSS NUMERATOR & EVENT SPLITTING NUMERATOR histoGen.fill(HIST("events/hMCGenReco"), 0.5); if (enableCentrality) histoGen.fill(HIST("events/hMCGenRecoVsMult"), 0.5, mcCollision.centFT0M()); - if (recoIdxINELgt0 > 0) { + if (atLeastOneINELgt0) { histoGen.fill(HIST("events/hMCGenReco"), 1.5); if (enableCentrality) histoGen.fill(HIST("events/hMCGenRecoVsMult"), 1.5, mcCollision.centFT0M()); @@ -6938,7 +6971,8 @@ struct lfNucleiBATask { if (enableCentrality) histoGen.fill(HIST("helium/MCGenReco/ptGenVsMult_INEL_Prim_antiHe"), pt, mcCollision.centFT0M()); } - if (recoIdxINELgt0 > 0) { + + if (atLeastOneINELgt0) { if (pdg > 0) { histoGen.fill(HIST("helium/MCGenReco/ptGen_INELgt0_Prim_He"), pt); if (enableCentrality) From 144c4698cb9e534b97ffb216dd6a9210fcb8243f Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Wed, 10 Jun 2026 00:09:22 +0200 Subject: [PATCH 6/6] NucleiTask - Rename variable --- 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 59066df54ec..02b47ebdb03 100644 --- a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -239,7 +239,7 @@ struct lfNucleiBATask { Configurable enablePtShiftPID{"enablePtShiftPID", true, "Flag to enable wrong PID in tracking pT correction shift"}; Configurable> parShiftPtPID{"parShiftPtPID", {0.0f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f}, "Parameters for helium3-Pt wrong pid shift (if enabled)."}; - Configurable CfgPtShiftPID{"CfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; + Configurable cfgPtShiftPID{"cfgPtShiftPID", 1.25f, "Default upper limit for PID pt-shift correction"}; Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; @@ -2605,7 +2605,7 @@ struct lfNucleiBATask { if (enablePtShiftPID && fShiftPtPID) { shiftPtPID = fShiftPtPID->Eval(2 * track.pt()); - if (tritonPID && (track.pt() <= CfgPtShiftPID)) { + if (tritonPID && (track.pt() <= cfgPtShiftPID)) { hePt = track.pt() - shiftPtPID / 2.f; antihePt = track.pt() - shiftPtPID / 2.f; }