From fe6dbf32583e321f248dcee6b0cb734f2191ed9c Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Fri, 14 Apr 2023 01:33:52 +0200 Subject: [PATCH 1/4] [PWGLF] LightNucleiTask - Add PV cut, add pTOF histos --- PWGLF/DataModel/LFNucleiTables.h | 7 + PWGLF/TableProducer/LFTreeCreatorNuclei.cxx | 1 + PWGLF/Tasks/LFNucleiBATask.cxx | 203 +++++++++++++------- 3 files changed, 137 insertions(+), 74 deletions(-) diff --git a/PWGLF/DataModel/LFNucleiTables.h b/PWGLF/DataModel/LFNucleiTables.h index 85ffe73525e..7efc712bf19 100644 --- a/PWGLF/DataModel/LFNucleiTables.h +++ b/PWGLF/DataModel/LFNucleiTables.h @@ -55,11 +55,16 @@ DECLARE_SOA_COLUMN(P, p, float); DECLARE_SOA_COLUMN(Sign, sign, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Flags, flags, uint8_t); DECLARE_SOA_DYNAMIC_COLUMN(Rapidity, rapidity, [](float p, float pz, float mass) -> float { const auto energy = sqrt(p * p + mass * mass); return 0.5f * log((energy + pz) / (energy - pz)); }); +DECLARE_SOA_DYNAMIC_COLUMN(IsPVContributor, isPVContributor, + [](uint8_t flags) -> bool { + return (flags & o2::aod::track::PVContributor) == o2::aod::track::PVContributor; + }); DECLARE_SOA_COLUMN(TPCNSigmaPi, tpcNSigmaPi, float); DECLARE_SOA_COLUMN(TPCNSigmaKa, tpcNSigmaKa, float); DECLARE_SOA_COLUMN(TPCNSigmaPr, tpcNSigmaPr, float); @@ -145,6 +150,8 @@ DECLARE_SOA_TABLE(LfCandNucleusFull, "AOD", "LFNUCL", full::TPCChi2Ncl, full::ITSChi2NCl, full::ITSClusterMap, + full::Flags, + full::IsPVContributor, full::Rapidity); DECLARE_SOA_TABLE(LfCandNucleusMC, "AOD", "LFNUCLMC", mcparticle::PdgCode, diff --git a/PWGLF/TableProducer/LFTreeCreatorNuclei.cxx b/PWGLF/TableProducer/LFTreeCreatorNuclei.cxx index 86869c8a6a4..90a36dd5092 100644 --- a/PWGLF/TableProducer/LFTreeCreatorNuclei.cxx +++ b/PWGLF/TableProducer/LFTreeCreatorNuclei.cxx @@ -134,6 +134,7 @@ struct LfTreeCreatorNuclei { track.p(), track.eta(), track.phi(), + track.isPVContributor(), track.sign(), track.itsNCls(), track.tpcNClsCrossedRows(), diff --git a/PWGLF/Tasks/LFNucleiBATask.cxx b/PWGLF/Tasks/LFNucleiBATask.cxx index 7e599efe98b..4c7effec2fb 100644 --- a/PWGLF/Tasks/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/LFNucleiBATask.cxx @@ -81,6 +81,7 @@ struct LFNucleiBATask { Configurable doTOFplots{"doTOFplots", true, "Flag to export plots of tracks with 1 hit on TOF."}; Configurable enableExpSignalTPC{"enableExpSignalTPC", true, "Flag to export dEdX - dEdX(exp) plots."}; Configurable enableExpSignalTOF{"enableExpSignalTOF", false, "Flag to export T - T(exp) plots."}; + Configurable isPVContributorCut{"isPVContributorCut", false, "Flag to enable isPVContributor cut."}; Configurable makeDCABeforeCutPlots{"makeDCABeforeCutPlots", false, "Flag to enable plots of DCA before cuts"}; Configurable makeDCAAfterCutPlots{"makeDCAAfterCutPlots", false, "Flag to enable plots of DCA after cuts"}; @@ -145,23 +146,41 @@ struct LFNucleiBATask { histos.add("qa/h1chi2ITS", "#chi^{2}_{ITS}/n_{ITS}; #chi^{2}_{ITS}/n_{ITS};counts", HistType::kTH1F, {{51, -0.5, 50.5}}); histos.add("qa/h1chi2TPC", "#chi^{2}_{TPC}/n_{TPC}; #chi^{2}_{TPC}/n_{TPC}; counts", HistType::kTH1F, {{11, -0.5, 10.5}}); - histos.add("tracks/h2pVsTPCmomentum", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (enablePtSpectra) { + histos.add("tracks/eff/h2pVsTPCmomentum", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - if (enablePr) { - histos.add("tracks/proton/h2pVsTPCmomentumPr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - histos.add("tracks/proton/h2pVsTPCmomentumantiPr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - } - if (enableDe) { - histos.add("tracks/deuteron/h2pVsTPCmomentumDe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - histos.add("tracks/deuteron/h2pVsTPCmomentumantiDe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - } - if (enableTr) { - histos.add("tracks/triton/h2pVsTPCmomentumTr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - histos.add("tracks/triton/h2pVsTPCmomentumantiTr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - } - if (enableHe) { - histos.add("tracks/helium/h2pVsTPCmomentumHe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); - histos.add("tracks/helium/h2pVsTPCmomentumantiHe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (enablePr) { + histos.add("tracks/eff/proton/h2pVsTPCmomentumPr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/proton/h2pVsTPCmomentumantiPr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (doTOFplots) { + histos.add("tracks/eff/proton/h2pVsTOFExpMomentumPr", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/proton/h2pVsTOFExpMomentumantiPr", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + } + } + if (enableDe) { + histos.add("tracks/eff/deuteron/h2pVsTPCmomentumDe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/deuteron/h2pVsTPCmomentumantiDe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (doTOFplots) { + histos.add("tracks/eff/deuteron/h2pVsTOFExpMomentumDe", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/deuteron/h2pVsTOFExpMomentumantiDe", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + } + } + if (enableTr) { + histos.add("tracks/eff/triton/h2pVsTPCmomentumTr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/triton/h2pVsTPCmomentumantiTr", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (doTOFplots) { + histos.add("tracks/eff/triton/h2pVsTOFExpMomentumTr", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/triton/h2pVsTOFExpMomentumantiTr", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + } + } + if (enableHe) { + histos.add("tracks/eff/helium/h2pVsTPCmomentumHe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/helium/h2pVsTPCmomentumantiHe", "#it{p}_{TPC} vs #it{p}; #it{p}_{TPC}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + if (doTOFplots) { + histos.add("tracks/eff/helium/h2pVsTOFExpMomentumHe", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + histos.add("tracks/eff/helium/h2pVsTOFExpMomentumantiHe", "#it{p}_{TOF} vs #it{p}; #it{p}_{TOF}; #it{p}", HistType::kTH2F, {{800, 0.f, 8.f}, {800, 0.f, 8.f}}); + } + } } if (enableDebug) { @@ -176,28 +195,28 @@ struct LFNucleiBATask { if (enablePtSpectra) { if (enablePr) { - histos.add("tracks/eff/hPtPr", "Track #it{p}_{T} (p); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiPr", "Track #it{p}_{T} (#bar{p}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtPrTOF", "Track #it{p}_{T} (p); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiPrTOF", "Track #it{p}_{T} (#bar{p}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/proton/hPtPr", "Track #it{p}_{T} (p); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/proton/hPtantiPr", "Track #it{p}_{T} (#bar{p}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/proton/hPtPrTOF", "Track #it{p}_{T} (p); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/proton/hPtantiPrTOF", "Track #it{p}_{T} (#bar{p}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); } if (enableDe) { - histos.add("tracks/eff/hPtDe", "Track #it{p}_{T} (d); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiDe", "Track #it{p}_{T} (#bar{d}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtDeTOF", "Track #it{p}_{T} (d); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiDeTOF", "Track #it{p}_{T} (#bar{d}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/deuteron/hPtDe", "Track #it{p}_{T} (d); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/deuteron/hPtantiDe", "Track #it{p}_{T} (#bar{d}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/deuteron/hPtDeTOF", "Track #it{p}_{T} (d); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/deuteron/hPtantiDeTOF", "Track #it{p}_{T} (#bar{d}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); } if (enableTr) { - histos.add("tracks/eff/hPtTr", "Track #it{p}_{T} (t); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiTr", "Track #it{p}_{T} (#bar{t}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtTrTOF", "Track #it{p}_{T} (t); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiTrTOF", "Track #it{p}_{T} (#bar{t}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/triton/hPtTr", "Track #it{p}_{T} (t); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/triton/hPtantiTr", "Track #it{p}_{T} (#bar{t}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/triton/hPtTrTOF", "Track #it{p}_{T} (t); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/triton/hPtantiTrTOF", "Track #it{p}_{T} (#bar{t}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); } if (enableHe) { - histos.add("tracks/eff/hPtHe", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiHe", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtHeTOF", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); - histos.add("tracks/eff/hPtantiHeTOF", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtHe", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtantiHe", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtHeTOF", "Track #it{p}_{T} (He); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); + histos.add("tracks/eff/helium/hPtantiHeTOF", "Track #it{p}_{T} (#bar{He}); #it{p}_{T} (GeV/#it{c}); counts", HistType::kTH1F, {{400, 0., 8.}}); } } // tracks @@ -530,7 +549,7 @@ struct LFNucleiBATask { histos.add("tracks/h2TPCsignVsBetaGamma", "TPC <-dE/dX> vs #beta#gamma/Z; Signed #beta#gamma; TPC <-dE/dx> (a.u.)", HistType::kTH2F, {{600, -6.f, 6.f}, {dedxAxis}}); histos.add("tracks/h2TOFbetaVsP", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); histos.add("tracks/h2TOFbetaVsP_debug", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); - histos.add("tracks/h2withTPCProtonCutTOFbetaVsP", "TOF #beta (with N_{#sigma(TPC(p))} cut) vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta (with N_{#sigma(TPC(p))} cut)", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); + histos.add("tracks/h2withTPCProtonCutTOFbetaVsP", "TOF #beta (with N#sigma_{TPC}(p))} cut) vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta (with N#sigma_{TPC}(p))} cut)", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); if (enableBetaCut) histos.add("tracks/h2TOFbetaVsP_BetaCut", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); } @@ -1086,6 +1105,9 @@ struct LFNucleiBATask { histos.fill(HIST("event/h1CentV0M"), event.multFV0M()); for (auto& track : tracks) { + if (isPVContributorCut && !track.isPVContributor()) { + continue; + } if constexpr (!IsFilteredData) { if (!track.isGlobalTrackWoDCA()) { @@ -1301,7 +1323,8 @@ struct LFNucleiBATask { } } - histos.fill(HIST("tracks/h2pVsTPCmomentum"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/h2pVsTPCmomentum"), track.tpcInnerParam(), track.p()); // TPC if (enableDebug) histos.fill(HIST("debug/h2TPCsignVsTPCmomentumFull"), track.tpcInnerParam() / (1.f * track.sign()), track.tpcSignal()); @@ -1821,9 +1844,10 @@ struct LFNucleiBATask { if (enablePr) { if ((std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Proton))) < yCut)) { if (track.sign() > 0) { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtPr"), track.pt()); - histos.fill(HIST("tracks/proton/h2pVsTPCmomentumPr"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/proton/hPtPr"), track.pt()); + histos.fill(HIST("tracks/eff/proton/h2pVsTPCmomentumPr"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/proton/h1ProtonSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/proton/h2TPCsignVsTPCmomentumProton"), track.tpcInnerParam(), track.tpcSignal()); @@ -1831,9 +1855,10 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/proton/hc/h2TPCsignVsTPCmomentumProton_hard"), track.tpcInnerParam(), track.tpcSignal()); } } else { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiPr"), track.pt()); - histos.fill(HIST("tracks/proton/h2pVsTPCmomentumantiPr"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/proton/hPtantiPr"), track.pt()); + histos.fill(HIST("tracks/eff/proton/h2pVsTPCmomentumantiPr"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/proton/h1antiProtonSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/proton/h2TPCsignVsTPCmomentumantiProton"), track.tpcInnerParam(), track.tpcSignal()); @@ -1848,9 +1873,10 @@ struct LFNucleiBATask { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { if (track.sign() > 0) { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtDe"), track.pt()); - histos.fill(HIST("tracks/deuteron/h2pVsTPCmomentumDe"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/deuteron/hPtDe"), track.pt()); + histos.fill(HIST("tracks/eff/deuteron/h2pVsTPCmomentumDe"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/deuteron/h1DeuteronSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/deuteron/h2TPCsignVsTPCmomentumDeuteron"), track.tpcInnerParam(), track.tpcSignal()); @@ -1858,9 +1884,10 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/deuteron/hc/h2TPCsignVsTPCmomentumDeuteron_hard"), track.tpcInnerParam(), track.tpcSignal()); } } else { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiDe"), track.pt()); - histos.fill(HIST("tracks/deuteron/h2pVsTPCmomentumantiDe"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/deuteron/hPtantiDe"), track.pt()); + histos.fill(HIST("tracks/eff/deuteron/h2pVsTPCmomentumantiDe"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/deuteron/h1antiDeuteronSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/deuteron/h2TPCsignVsTPCmomentumantiDeuteron"), track.tpcInnerParam(), track.tpcSignal()); @@ -1875,9 +1902,10 @@ struct LFNucleiBATask { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaTr()) < nsigmaTPCTr)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if ((isTriton) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if (track.sign() > 0) { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtTr"), track.pt()); - histos.fill(HIST("tracks/triton/h2pVsTPCmomentumTr"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/triton/hPtTr"), track.pt()); + histos.fill(HIST("tracks/eff/triton/h2pVsTPCmomentumTr"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/triton/h1TritonSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/triton/h2TPCsignVsTPCmomentumTriton"), track.tpcInnerParam(), track.tpcSignal()); @@ -1885,9 +1913,10 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/triton/hc/h2TPCsignVsTPCmomentumTriton_hard"), track.tpcInnerParam(), track.tpcSignal()); } } else { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiTr"), track.pt()); - histos.fill(HIST("tracks/triton/h2pVsTPCmomentumantiTr"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/triton/hPtantiTr"), track.pt()); + histos.fill(HIST("tracks/eff/triton/h2pVsTPCmomentumantiTr"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/triton/h1antiTritonSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/triton/h2TPCsignVsTPCmomentumantiTriton"), track.tpcInnerParam(), track.tpcSignal()); @@ -1901,9 +1930,10 @@ struct LFNucleiBATask { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { if (track.sign() > 0) { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtHe"), track.pt()); - histos.fill(HIST("tracks/helium/h2pVsTPCmomentumHe"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/helium/hPtHe"), track.pt()); + histos.fill(HIST("tracks/eff/helium/h2pVsTPCmomentumHe"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/helium/h1HeliumSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/helium/h2TPCsignVsTPCmomentumHelium"), track.tpcInnerParam(), track.tpcSignal()); @@ -1911,9 +1941,10 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/helium/hc/h2TPCsignVsTPCmomentumHelium_hard"), track.tpcInnerParam(), track.tpcSignal()); } } else { - if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiHe"), track.pt()); - histos.fill(HIST("tracks/helium/h2pVsTPCmomentumantiHe"), track.tpcInnerParam(), track.p()); + if (enablePtSpectra) { + histos.fill(HIST("tracks/eff/helium/hPtantiHe"), track.pt()); + histos.fill(HIST("tracks/eff/helium/h2pVsTPCmomentumantiHe"), track.tpcInnerParam(), track.p()); + } histos.fill(HIST("tracks/helium/h1antiHeliumSpectra"), track.pt()); if (enablePIDplot) histos.fill(HIST("tracks/helium/h2TPCsignVsTPCmomentumantiHelium"), track.tpcInnerParam(), track.tpcSignal()); @@ -1962,28 +1993,52 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/h2withTPCProtonCutTOFbetaVsP"), track.p() / (1.f * track.sign()), track.beta()); } if (enablePr) { - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr && track.sign() > 0) + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr && track.sign() > 0) { histos.fill(HIST("tracks/proton/h2ProtonTOFbetaVsP"), track.p(), track.beta()); - if (std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr && track.sign() < 0) + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/proton/h2pVsTOFExpMomentumPr"), track.tofExpMom(), track.p()); + } + if (std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr && track.sign() < 0) { histos.fill(HIST("tracks/proton/h2antiProtonTOFbetaVsP"), track.p(), track.beta()); + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/proton/h2pVsTOFExpMomentumantiPr"), track.tofExpMom(), track.p()); + } } if (enableDe) { - if (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe && track.sign() > 0) + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe && track.sign() > 0) { histos.fill(HIST("tracks/deuteron/h2DeuteronTOFbetaVsP"), track.p(), track.beta()); - if (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe && track.sign() < 0) + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/deuteron/h2pVsTOFExpMomentumDe"), track.tofExpMom(), track.p()); + } + if (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe && track.sign() < 0) { histos.fill(HIST("tracks/deuteron/h2antiDeuteronTOFbetaVsP"), track.p(), track.beta()); + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/deuteron/h2pVsTOFExpMomentumantiDe"), track.tofExpMom(), track.p()); + } } if (enableTr) { - if (isTriton && track.sign() > 0) + if (isTriton && track.sign() > 0) { histos.fill(HIST("tracks/triton/h2TritonTOFbetaVsP"), track.p(), track.beta()); - if (isTriton && track.sign() < 0) + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/triton/h2pVsTOFExpMomentumTr"), track.tofExpMom(), track.p()); + } + if (isTriton && track.sign() < 0) { histos.fill(HIST("tracks/triton/h2antiTritonTOFbetaVsP"), track.p(), track.beta()); + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/triton/h2pVsTOFExpMomentumantiTr"), track.tofExpMom(), track.p()); + } } if (enableHe) { - if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe && track.sign() > 0) + if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe && track.sign() > 0) { histos.fill(HIST("tracks/helium/h2HeliumTOFbetaVsP"), track.p(), track.beta()); - if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe && track.sign() < 0) + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumHe"), track.tofExpMom(), track.p()); + } + if (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe && track.sign() < 0) { histos.fill(HIST("tracks/helium/h2antiHeliumTOFbetaVsP"), track.p(), track.beta()); + if (enablePtSpectra) + histos.fill(HIST("tracks/eff/helium/h2pVsTOFExpMomentumantiHe"), track.tofExpMom(), track.p()); + } } if (enableDebug) { @@ -2050,7 +2105,7 @@ struct LFNucleiBATask { if (enablePr) { if ((std::abs(track.tpcNSigmaPr()) < nsigmaTPCPr) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Proton))) < yCut)) { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtPrTOF"), track.pt()); + histos.fill(HIST("tracks/eff/proton/hPtPrTOF"), track.pt()); if (track.sign() > 0) { histos.fill(HIST("tracks/proton/h2TOFmassProtonVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/proton/h2TOFmass2ProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); @@ -2080,7 +2135,7 @@ struct LFNucleiBATask { } } else { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiPrTOF"), track.pt()); + histos.fill(HIST("tracks/eff/proton/hPtantiPrTOF"), track.pt()); histos.fill(HIST("tracks/proton/h2TOFmassantiProtonVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/proton/h2TOFmass2antiProtonVsPt"), massTOF * massTOF - fMassProton * fMassProton, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2115,7 +2170,7 @@ struct LFNucleiBATask { if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { if (track.sign() > 0) { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtDeTOF"), track.pt()); + histos.fill(HIST("tracks/eff/deuteron/hPtDeTOF"), track.pt()); histos.fill(HIST("tracks/deuteron/h2TOFmassDeuteronVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/deuteron/h2TOFmass2DeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2145,7 +2200,7 @@ struct LFNucleiBATask { } else { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiDeTOF"), track.pt()); + histos.fill(HIST("tracks/eff/deuteron/hPtantiDeTOF"), track.pt()); histos.fill(HIST("tracks/deuteron/h2TOFmassantiDeuteronVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/deuteron/h2TOFmass2antiDeuteronVsPt"), massTOF * massTOF - fMassDeuteron * fMassDeuteron, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2181,7 +2236,7 @@ struct LFNucleiBATask { if ((isTriton) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Triton))) < yCut)) { if (track.sign() > 0) { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtTrTOF"), track.pt()); + histos.fill(HIST("tracks/eff/triton/hPtTrTOF"), track.pt()); histos.fill(HIST("tracks/triton/h2TOFmassTritonVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/triton/h2TOFmass2TritonVsPt"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2193,7 +2248,7 @@ struct LFNucleiBATask { } } else { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiTrTOF"), track.pt()); + histos.fill(HIST("tracks/eff/triton/hPtantiTrTOF"), track.pt()); histos.fill(HIST("tracks/triton/h2TOFmassantiTritonVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/triton/h2TOFmass2antiTritonVsPt"), massTOF * massTOF - fMassTriton * fMassTriton, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2211,7 +2266,7 @@ struct LFNucleiBATask { if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { if (track.sign() > 0) { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtHeTOF"), track.pt()); + histos.fill(HIST("tracks/eff/helium/hPtHeTOF"), track.pt()); histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { @@ -2225,7 +2280,7 @@ struct LFNucleiBATask { } } else { if (enablePtSpectra) - histos.fill(HIST("tracks/eff/hPtantiHeTOF"), track.pt()); + histos.fill(HIST("tracks/eff/helium/hPtantiHeTOF"), track.pt()); histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt"), massTOF, track.pt()); histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { From d6cad464f38d2ea67af159bab45347f8f20b7b7c Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Fri, 14 Apr 2023 01:39:07 +0200 Subject: [PATCH 2/4] [PWGLF] LightNucleiTask - Fix minor typos --- PWGLF/Tasks/LFNucleiBATask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/LFNucleiBATask.cxx b/PWGLF/Tasks/LFNucleiBATask.cxx index 4c7effec2fb..696f2ce3e58 100644 --- a/PWGLF/Tasks/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/LFNucleiBATask.cxx @@ -549,7 +549,7 @@ struct LFNucleiBATask { histos.add("tracks/h2TPCsignVsBetaGamma", "TPC <-dE/dX> vs #beta#gamma/Z; Signed #beta#gamma; TPC <-dE/dx> (a.u.)", HistType::kTH2F, {{600, -6.f, 6.f}, {dedxAxis}}); histos.add("tracks/h2TOFbetaVsP", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); histos.add("tracks/h2TOFbetaVsP_debug", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); - histos.add("tracks/h2withTPCProtonCutTOFbetaVsP", "TOF #beta (with N#sigma_{TPC}(p))} cut) vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta (with N#sigma_{TPC}(p))} cut)", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); + histos.add("tracks/h2withTPCProtonCutTOFbetaVsP", "TOF #beta (with N#sigma_{TPC}(p)) cut) vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta (with N#sigma_{TPC}(p)) cut)", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); if (enableBetaCut) histos.add("tracks/h2TOFbetaVsP_BetaCut", "TOF #beta vs #it{p}/Z; Signed #it{p} (GeV/#it{c}); TOF #beta", HistType::kTH2F, {{500, -5.f, 5.f}, {betaAxis}}); } From 60ca0dd42436d639d033e401efe90c29fd242f69 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Fri, 14 Apr 2023 01:33:52 +0200 Subject: [PATCH 3/4] [PWGLF] LightNucleiTask - Add PV cut, add pTOF histos --- PWGLF/Tasks/LFNucleiBATask.cxx | 232 +++++++++++++++++---------------- 1 file changed, 122 insertions(+), 110 deletions(-) diff --git a/PWGLF/Tasks/LFNucleiBATask.cxx b/PWGLF/Tasks/LFNucleiBATask.cxx index 696f2ce3e58..493d1f7cac3 100644 --- a/PWGLF/Tasks/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/LFNucleiBATask.cxx @@ -17,6 +17,7 @@ /// \author Giovanni Malfattore and Rutuparna Rath /// #include "PWGLF/DataModel/LFNucleiTables.h" +#include #include "ReconstructionDataFormats/Track.h" #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -97,10 +98,12 @@ struct LFNucleiBATask { Configurable enableStrongCut{"enableStrongCut", false, "Flag to change | NSigma TPC(nucl)| < nSigmaTPC --> NOT | NSigma TPC(p)| > nStrongCut"}; Configurable enableNucleiHardCut{"enableNucleiHardCut", false, "Flag to enable TPC sigma histograms filled without the 'nearby' particle (at low momentum)"}; Configurable enablePtSpectra{"enablePtSpectra", false, "Flag to enable histograms for efficiency debug."}; + Configurable rapDebug{"rapDebug", false, "Flag to enable helium rapidity cut debug histograms."}; Configurable useHasTRDConfig{"useHasTRDConfig", 0, "No selections on TRD (0); With TRD (1); Without TRD (2)"}; Configurable massTOFConfig{"massTOFConfig", 0, "Estimate massTOF using beta with (0) TPC momentum (1) TOF expected momentum"}; Configurable tritonSelConfig{"tritonSelConfig", 0, "Select tritons using (0) 3Sigma TPC triton (1) additional 3sigma TPC pi,K,p veto cut"}; + // Configurable heRapiditySelConfig{"heRapiditySelConfig", 0, "Select rapidity configuration for Helium selection"}; Configurable nITSLayer{"nITSLayer", 0, "ITS Layer (0-6)"}; Configurable usenITSLayer{"usenITSLayer", false, "Flag to enable ITS layer hit"}; @@ -763,6 +766,10 @@ struct LFNucleiBATask { histos.add("tracks/helium/h2TOFmassHeliumVsPt_BetaCut", "h2TOFmassHeliumVsPt_BetaCut; TOFmass; #it{p}_{T} (GeV)", HistType::kTH2F, {{320, 0.4, 4.}, {250, 0., 5.}}); histos.add("tracks/helium/h2TOFmassantiHeliumVsPt_BetaCut", "h2TOFmassantiHeliumVsPt_BetaCut; TOFmass; #it{p}_{T} (GeV)", HistType::kTH2F, {{320, 0.4, 4.}, {250, 0., 5.}}); } + if (rapDebug) { + histos.add("tracks/helium/h2TOFmassHeliumVsPt_NORAPIDITYCUT", "h2TOFmassHeliumVsPt_NORAPIDITYCUT; TOFmass; #it{p}_{T} (GeV)", HistType::kTH2F, {{320, 0.4, 4.}, {250, 0., 5.}}); + histos.add("tracks/helium/h2TOFmassantiHeliumVsPt_NORAPIDITYCUT", "h2TOFmassantiHeliumVsPt_NORAPIDITYCUT; TOFmass; #it{p}_{T} (GeV)", HistType::kTH2F, {{320, 0.4, 4.}, {250, 0., 5.}}); + } } // TOF mass squared histograms if (enablePr) { @@ -1098,6 +1105,9 @@ struct LFNucleiBATask { float gamma = 0., massTOF = 0.; bool isTriton = kFALSE; + bool deRapCut = kFALSE; + bool heRapCut = kFALSE; + TLorentzVector lVec_helium{}; // Event histos fill histos.fill(HIST("event/h1VtxZ"), event.posZ()); @@ -1131,6 +1141,18 @@ struct LFNucleiBATask { break; } + // debug on helium rapidity cut + // switch (heRapiditySelConfig) { + // case 0: + deRapCut = TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut; + heRapCut = TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut; + // break; + // case 1: + // lVec_helium.SetPtEtaPhiM(2.f * track.pt(), track.eta(), track.phi(), fMassHelium); + // heRapCut = TMath::Abs(lVec_helium.Rapidity()) < yCut; + // break; + // } + // Tracks DCA histos fill if (makeDCABeforeCutPlots) { histos.fill(HIST("tracks/dca/before/hDCAxy"), track.dcaXY()); @@ -1368,26 +1390,24 @@ struct LFNucleiBATask { } } } - if (enableDe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut) { - if (enableExpSignalTPC) - histos.fill(HIST("tracks/deuteron/h2DeuteronTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffDe()); + if (enableDe && deRapCut) { + if (enableExpSignalTPC) + histos.fill(HIST("tracks/deuteron/h2DeuteronTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffDe()); - switch (useHasTRDConfig) { - case 0: + switch (useHasTRDConfig) { + case 0: + histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); + break; + case 1: + if (track.hasTRD()) { histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - break; - case 1: - if (track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - } - break; - case 2: - if (!track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - } - break; - } + } + break; + case 2: + if (!track.hasTRD()) { + histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); + } + break; } } if (enableTr) { @@ -1395,13 +1415,11 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/triton/h2TritonVspTNSigmaTPC"), track.pt(), track.tpcNSigmaTr()); } } - if (enableHe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut) { - if (enableExpSignalTPC) - histos.fill(HIST("tracks/helium/h2HeliumTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffHe()); + if (enableHe && heRapCut) { + if (enableExpSignalTPC) + histos.fill(HIST("tracks/helium/h2HeliumTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffHe()); - histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTPC"), track.pt(), track.tpcNSigmaHe()); - } + histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTPC"), track.pt(), track.tpcNSigmaHe()); } if (enableAl) { if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Alpha))) < yCut) { @@ -1431,26 +1449,24 @@ struct LFNucleiBATask { } } } - if (enableDe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut) { - if (enableExpSignalTPC) - histos.fill(HIST("tracks/deuteron/h2antiDeuteronTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffDe()); + if (enableDe && deRapCut) { + if (enableExpSignalTPC) + histos.fill(HIST("tracks/deuteron/h2antiDeuteronTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffDe()); - switch (useHasTRDConfig) { - case 0: + switch (useHasTRDConfig) { + case 0: + histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); + break; + case 1: + if (track.hasTRD()) { histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - break; - case 1: - if (track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - } - break; - case 2: - if (!track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); - } - break; - } + } + break; + case 2: + if (!track.hasTRD()) { + histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTPC"), track.pt(), track.tpcNSigmaDe()); + } + break; } } if (enableTr) { @@ -1458,13 +1474,11 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/triton/h2antiTritonVspTNSigmaTPC"), track.pt(), track.tpcNSigmaTr()); } } - if (enableHe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut) { - if (enableExpSignalTPC) - histos.fill(HIST("tracks/helium/h2antiHeliumTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffHe()); + if (enableHe && heRapCut) { + if (enableExpSignalTPC) + histos.fill(HIST("tracks/helium/h2antiHeliumTPCExpSignalDiffVsPt"), track.pt(), track.tpcExpSignalDiffHe()); - histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTPC"), track.pt(), track.tpcNSigmaHe()); - } + histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTPC"), track.pt(), track.tpcNSigmaHe()); } if (enableAl) { if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Alpha))) < yCut) { @@ -1499,33 +1513,29 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/proton/h2ProtonTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffPr()); } } - if (enableDe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut) { - switch (useHasTRDConfig) { - case 0: + if (enableDe && deRapCut) { + switch (useHasTRDConfig) { + case 0: + histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); + break; + case 1: + if (track.hasTRD()) { histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - break; - case 1: - if (track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - } - break; - case 2: - if (!track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - } - break; - } - if (enableExpSignalTOF) - histos.fill(HIST("tracks/deuteron/h2DeuteronTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffDe()); + } + break; + case 2: + if (!track.hasTRD()) { + histos.fill(HIST("tracks/deuteron/h2DeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); + } + break; } + if (enableExpSignalTOF) + histos.fill(HIST("tracks/deuteron/h2DeuteronTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffDe()); } - if (enableHe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut) { - histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTOF"), track.pt(), track.tofNSigmaHe()); - if (enableExpSignalTOF) - histos.fill(HIST("tracks/helium/h2HeliumTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffHe()); - } + if (enableHe && heRapCut) { + histos.fill(HIST("tracks/helium/h2HeliumVspTNSigmaTOF"), track.pt(), track.tofNSigmaHe()); + if (enableExpSignalTOF) + histos.fill(HIST("tracks/helium/h2HeliumTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffHe()); } if (enableEvTimeSplitting && track.hasTOF()) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { @@ -1685,33 +1695,29 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/proton/h2antiProtonTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffPr()); } } - if (enableDe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut) { - switch (useHasTRDConfig) { - case 0: + if (enableDe && deRapCut) { + switch (useHasTRDConfig) { + case 0: + histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); + break; + case 1: + if (track.hasTRD()) { histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - break; - case 1: - if (track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - } - break; - case 2: - if (!track.hasTRD()) { - histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); - } - break; - } - if (enableExpSignalTOF) - histos.fill(HIST("tracks/deuteron/h2antiDeuteronTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffDe()); + } + break; + case 2: + if (!track.hasTRD()) { + histos.fill(HIST("tracks/deuteron/h2antiDeuteronVspTNSigmaTOF"), track.pt(), track.tofNSigmaDe()); + } + break; } + if (enableExpSignalTOF) + histos.fill(HIST("tracks/deuteron/h2antiDeuteronTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffDe()); } - if (enableHe) { - if (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut) { - histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTOF"), track.pt(), track.tofNSigmaHe()); - if (enableExpSignalTOF) - histos.fill(HIST("tracks/helium/h2antiHeliumTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffHe()); - } + if (enableHe && heRapCut) { + histos.fill(HIST("tracks/helium/h2antiHeliumVspTNSigmaTOF"), track.pt(), track.tofNSigmaHe()); + if (enableExpSignalTOF) + histos.fill(HIST("tracks/helium/h2antiHeliumTOFExpSignalDiffVsPt"), track.pt(), track.tofExpSignalDiffHe()); } if (enableEvTimeSplitting && track.hasTOF()) { if (track.isEvTimeTOF() && track.isEvTimeT0AC()) { @@ -1871,7 +1877,7 @@ struct LFNucleiBATask { if (enableDe) { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { - if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { + if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && deRapCut) { if (track.sign() > 0) { if (enablePtSpectra) { histos.fill(HIST("tracks/eff/deuteron/hPtDe"), track.pt()); @@ -1928,7 +1934,7 @@ struct LFNucleiBATask { } if (enableHe) { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { - if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { + if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && heRapCut) { if (track.sign() > 0) { if (enablePtSpectra) { histos.fill(HIST("tracks/eff/helium/hPtHe"), track.pt()); @@ -2167,7 +2173,7 @@ struct LFNucleiBATask { } if (enableDe) { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { - if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut)) { + if ((std::abs(track.tpcNSigmaDe()) < nsigmaTPCDe) && deRapCut) { if (track.sign() > 0) { if (enablePtSpectra) histos.fill(HIST("tracks/eff/deuteron/hPtDeTOF"), track.pt()); @@ -2263,34 +2269,40 @@ struct LFNucleiBATask { } if (enableHe) { // if ((((!enableStrongCut) && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe)) || ((enableStrongCut) && (std::abs(track.tpcNSigmaPr()) >= nsigmaTPCStrongCut))) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { - if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && (TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut)) { + if (rapDebug && (std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe)) { + if (track.sign() > 0) + histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt_NORAPIDITYCUT"), 2.f * massTOF, track.pt()); + else + histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt_NORAPIDITYCUT"), 2.f * massTOF, track.pt()); + } + if ((std::abs(track.tpcNSigmaHe()) < nsigmaTPCHe) && heRapCut) { if (track.sign() > 0) { if (enablePtSpectra) histos.fill(HIST("tracks/eff/helium/hPtHeTOF"), track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt"), 2.f * massTOF, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { - histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt_BetaCut"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmassHeliumVsPt_BetaCut"), 2.f * massTOF, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmass2HeliumVsPt_BetaCut"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); } if (enableExpSignalTOF) histos.fill(HIST("tracks/helium/h2HeliumTOFExpSignalDiffVsPtCut"), track.pt(), track.tofExpSignalDiffHe()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaTr()) > 2)) { - histos.fill(HIST("tracks/helium/hc/h2TOFmass2HeliumVsPt_hard"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/hc/h2TOFmass2HeliumVsPt_hard"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); } } else { if (enablePtSpectra) histos.fill(HIST("tracks/eff/helium/hPtantiHeTOF"), track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt"), massTOF, track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt"), 2.f * massTOF, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); if (enableBetaCut && (track.beta() > betaCut)) { - histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt_BetaCut"), massTOF, track.pt()); - histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt_BetaCut"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmassantiHeliumVsPt_BetaCut"), 2.f * massTOF, track.pt()); + histos.fill(HIST("tracks/helium/h2TOFmass2antiHeliumVsPt_BetaCut"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); } if (enableExpSignalTOF) histos.fill(HIST("tracks/helium/h2antiHeliumTOFExpSignalDiffVsPtCut"), track.pt(), track.tofExpSignalDiffHe()); if (enableNucleiHardCut && (std::abs(track.tpcNSigmaTr()) > 2)) { - histos.fill(HIST("tracks/helium/hc/h2TOFmass2antiHeliumVsPt_hard"), massTOF * massTOF - fMassHelium * fMassHelium, track.pt()); + histos.fill(HIST("tracks/helium/hc/h2TOFmass2antiHeliumVsPt_hard"), 2.f * massTOF * 2.f * massTOF - fMassHelium * fMassHelium, track.pt()); } } } From a235df00b2e6d93b0c43855f39b00a5afa124a95 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Wed, 19 Apr 2023 06:41:05 +0200 Subject: [PATCH 4/4] [PWGLF] LightNucleiTask - Fix TOF helium masses bug --- PWGLF/Tasks/LFNucleiBATask.cxx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/PWGLF/Tasks/LFNucleiBATask.cxx b/PWGLF/Tasks/LFNucleiBATask.cxx index 493d1f7cac3..b226bf9360e 100644 --- a/PWGLF/Tasks/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/LFNucleiBATask.cxx @@ -103,7 +103,6 @@ struct LFNucleiBATask { Configurable useHasTRDConfig{"useHasTRDConfig", 0, "No selections on TRD (0); With TRD (1); Without TRD (2)"}; Configurable massTOFConfig{"massTOFConfig", 0, "Estimate massTOF using beta with (0) TPC momentum (1) TOF expected momentum"}; Configurable tritonSelConfig{"tritonSelConfig", 0, "Select tritons using (0) 3Sigma TPC triton (1) additional 3sigma TPC pi,K,p veto cut"}; - // Configurable heRapiditySelConfig{"heRapiditySelConfig", 0, "Select rapidity configuration for Helium selection"}; Configurable nITSLayer{"nITSLayer", 0, "ITS Layer (0-6)"}; Configurable usenITSLayer{"usenITSLayer", false, "Flag to enable ITS layer hit"}; @@ -1142,16 +1141,8 @@ struct LFNucleiBATask { } // debug on helium rapidity cut - // switch (heRapiditySelConfig) { - // case 0: deRapCut = TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Deuteron))) < yCut; heRapCut = TMath::Abs(track.rapidity(o2::track::PID::getMass2Z(o2::track::PID::Helium3))) < yCut; - // break; - // case 1: - // lVec_helium.SetPtEtaPhiM(2.f * track.pt(), track.eta(), track.phi(), fMassHelium); - // heRapCut = TMath::Abs(lVec_helium.Rapidity()) < yCut; - // break; - // } // Tracks DCA histos fill if (makeDCABeforeCutPlots) {