From c2292992c94129d2a3ad170a6360ed4b30869e38 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 ba188f9e645d9e0d5ba5a93fcb0cce4705b07706 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 8e01eb0ca50..0e45f9ce92e 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -237,7 +237,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)"}; @@ -2577,7 +2581,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 413eeb181e4c18130959d489f752bcaf52434a66 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 0e45f9ce92e..ae9ff43da7e 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) #include "PWGLF/DataModel/LFNucleiTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" @@ -237,11 +242,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)"}; @@ -2581,11 +2590,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 6797d5b503b8f43315c2297914d668fa6412e4d1 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 --- PWGLF/Tasks/Nuspex/{LFNucleiBATask.cxx => lfNucleiBATask.cxx} | 3 +++ 1 file changed, 3 insertions(+) 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 ae9ff43da7e..930c388418c 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -18,9 +18,12 @@ <<<<<<< HEAD ======= +<<<<<<< HEAD:PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx // o2-linter: disable=name/workflow-file >>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) +======= +>>>>>>> a353f854f (NucleiTask - Files renamed):PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx #include "PWGLF/DataModel/LFNucleiTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/mcCentrality.h" From c04905866b75a984e8d13a39fcd18fd817ce865d Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Mon, 8 Jun 2026 15:45:41 +0200 Subject: [PATCH 5/6] NucleiTask - Add missing histograms --- PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx | 76 +++++++++++++-------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx index 930c388418c..25c8246ba19 100644 --- a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -15,15 +15,7 @@ /// \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 -======= -<<<<<<< HEAD:PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx -// o2-linter: disable=name/workflow-file ->>>>>>> 5678d3143 (NucleiTask - Fix O2Lint errors) - -======= ->>>>>>> a353f854f (NucleiTask - Files renamed):PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx #include "PWGLF/DataModel/LFNucleiTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/mcCentrality.h" @@ -245,15 +237,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)"}; @@ -362,7 +346,7 @@ struct lfNucleiBATask { const AxisSpec avClsAxis{avClsBins, ""}; const AxisSpec avClsEffAxis{avClsBins, " / cosh(#eta)"}; - if (doprocessData == true && doprocessMCReco == true) { + if (((doprocessData == true) || (doprocessDataLfPid == true)) && ((doprocessMCReco == true) || (doprocessMCRecoLfPid == true) || (doprocessMCGen == true))) { LOG(fatal) << "Can't enable processData and processMCReco in the same time, pick one!"; } if (doprocessEvSgLossMC) { @@ -476,6 +460,11 @@ struct lfNucleiBATask { histoGen.get(HIST("events/hMCGenRecoVsMult"))->GetXaxis()->SetBinLabel(1, "INEL"); histoGen.get(HIST("events/hMCGenRecoVsMult"))->GetXaxis()->SetBinLabel(2, "INELgt0"); + histoGen.add("events/hMCRecoVsMult", "hMCRecoVsMult", HistType::kTH2D, {{3, 0.f, 3.f}, {binsPercentile}}); + histoGen.get(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(1, "All"); + histoGen.get(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(2, "Ev sel passed"); + histoGen.get(HIST("events/hMCRecoVsMult"))->GetXaxis()->SetBinLabel(3, "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}}); @@ -502,7 +491,9 @@ struct lfNucleiBATask { debugHistos.add("qa/h1VtxZ_Centrality", "V_{z};V_{z} (in cm); counts", HistType::kTH1F, {{1500, -15, 15}}); if (enableCentrality) { - debugHistos.add("event/hFT0M", "hFT0M", HistType::kTH1F, {{binsPercentile, "Centrality FT0M"}}); + debugHistos.add("event/hFT0M", "hFT0M (INEL)", HistType::kTH1F, {{binsPercentile, "Centrality FT0M"}}); + debugHistos.add("event/hFT0M_INELgt0", "hFT0M (INELgt0)", HistType::kTH1F, {{binsPercentile, "Centrality FT0M"}}); + debugHistos.add("event/hFT0M_INELgt1", "hFT0M (INELgt1)", HistType::kTH1F, {{binsPercentile, "Centrality FT0M"}}); debugHistos.add("event/hFV0M", "hFV0M", HistType::kTH1F, {{binsPercentile, "Centrality FV0M"}}); } } @@ -1818,9 +1809,10 @@ struct lfNucleiBATask { } else { histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPC", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); - histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); - histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } + + histos.add("tracks/deuteron/h2DeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(d) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); + histos.add("tracks/deuteron/h2antiDeuteronVspTNSigmaTPCTruePrim", "NSigmaTPC(#bar{d}) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); } if (enableTr) { histos.add("tracks/triton/h2TritonVspTNSigmaTPC", "NSigmaTPC(t) vs pT; #it{p}_{T} (GeV/#it{c}); NSigmaTPC", HistType::kTH2F, {{ptAxis}, {sigmaTPCAxis}}); @@ -2182,11 +2174,13 @@ struct lfNucleiBATask { } } // To be optimised - if (!doprocessMCGen && !doprocessMCReco && !doprocessMCRecoLfPid && !doprocessMCRecoFiltered && !doprocessMCRecoFilteredLight) { + if (!doprocessMCGen && !doprocessMCReco && !doprocessMCRecoLfPid && !doprocessMCRecoFiltered && !doprocessMCRecoFilteredLight && !doprocessEvSgLossMC && !doprocessMCGenLosses) { + LOG(info) << "DATA mode "; LOG(info) << "Histograms of lfNucleiBATask:"; histos.print(); return; } + LOG(info) << " MC mode "; // MC histograms - all, primary, sec. from weak decay, sec. from material if (enableCentrality) spectraGen.add("histGenVetxZ", "PosZ generated events", HistType::kTH2F, {{1500, -15.f, 15.f, "Vertex Z (cm)"}, {binsPercentile, "Centrality FT0M"}}); @@ -2322,10 +2316,12 @@ struct lfNucleiBATask { spectraGen.add("alpha/histGenPtantiAlSec", "generated particles", HistType::kTH1F, {ptAxis}); spectraGen.add("alpha/histSecTransportPtantiAl", "generated particles", HistType::kTH1F, {ptAxis}); } + + LOG(info) << "MC Histograms defined"; + // LOG(info) << "Histograms of lfNucleiBATask:"; LOG(info) << "Histograms of lfNucleiBATask:"; histos.print(); - if (doprocessMCGen) - spectraGen.print(); + spectraGen.print(); } template @@ -2461,8 +2457,13 @@ struct lfNucleiBATask { histos.fill(HIST("event/h1VtxZ"), event.posZ(), centFT0M); else histos.fill(HIST("event/h1VtxZ"), event.posZ()); - if (enableDebug && enableCentrality) + if (enableDebug && enableCentrality) { debugHistos.fill(HIST("event/hFT0M"), centFT0M); + if (event.isInelGt0()) + debugHistos.fill(HIST("event/hFT0M_INELgt0"), centFT0M); + if (event.isInelGt1()) + debugHistos.fill(HIST("event/hFT0M_INELgt1"), centFT0M); + } if constexpr (IsFilteredData) { if (enableCentrality) @@ -2593,15 +2594,7 @@ 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; } @@ -4619,12 +4612,12 @@ struct lfNucleiBATask { histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), DPt, track.tpcNSigmaDe()); break; case 1: - if (track.hasTRD()) { + if (track.hasTRD() && !enableCentrality) { histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), DPt, track.tpcNSigmaDe()); } break; case 2: - if (!track.hasTRD()) { + if (!track.hasTRD() && !enableCentrality) { histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), DPt, track.tpcNSigmaDe()); } break; @@ -4644,12 +4637,12 @@ struct lfNucleiBATask { histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), antiDPt, track.tpcNSigmaDe()); break; case 1: - if (track.hasTRD()) { + if (track.hasTRD() && !enableCentrality) { histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), antiDPt, track.tpcNSigmaDe()); } break; case 2: - if (!track.hasTRD()) { + if (!track.hasTRD() && !enableCentrality) { histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), antiDPt, track.tpcNSigmaDe()); } break; @@ -6691,7 +6684,7 @@ struct lfNucleiBATask { } } } // Close processMCGen - PROCESS_SWITCH(lfNucleiBATask, processMCGen, "process MC Generated", true); + PROCESS_SWITCH(lfNucleiBATask, processMCGen, "process MC Generated", false); void processEvSgLossMC(soa::Join::iterator const& mcCollision, aod::McParticles const& mcParticles, @@ -6779,9 +6772,6 @@ 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, @@ -6855,6 +6845,8 @@ struct lfNucleiBATask { // Check event selection histoGen.fill(HIST("events/hMCReco"), 0.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCRecoVsMult"), 0.5, mcCollision.centFT0M()); if (evselOptions.useTVXtrigger && !hasTVX) continue; if (evselOptions.removeTFBorder && !hasNoTFB) @@ -6862,11 +6854,15 @@ struct lfNucleiBATask { if (evselOptions.removeITSROFBorder && !hasNoItsRofFB) continue; histoGen.fill(HIST("events/hMCReco"), 1.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCRecoVsMult"), 1.5, mcCollision.centFT0M()); recoIdxINEL++; if (collision.isInelGt0() && isINELgt0true) { histoGen.fill(HIST("events/hMCReco"), 2.5); + if (enableCentrality) + histoGen.fill(HIST("events/hMCRecoVsMult"), 2.5, mcCollision.centFT0M()); recoIdxINELgt0++; } From 37afbb721df07c7b128acf47d9b881cf53126d06 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Mon, 8 Jun 2026 15:50:05 +0200 Subject: [PATCH 6/6] NucleiTask - Disable O2Linter error --- PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx index 25c8246ba19..781d5e5cdc6 100644 --- a/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/lfNucleiBATask.cxx @@ -16,6 +16,8 @@ /// /// \author Giovanni Malfattore and Rutuparna Rath +// o2-linter: disable=name/workflow-file + #include "PWGLF/DataModel/LFNucleiTables.h" #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/mcCentrality.h"