From 0573e21b904bde3d72862f4330b4b218c88ef9a6 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Wed, 18 Feb 2026 20:55:23 +0100 Subject: [PATCH 01/12] implement the TPC PID for light nuclie in 3prong creator --- PWGHF/DataModel/AliasTables.h | 2 + .../DataModel/CandidateReconstructionTables.h | 31 +++- .../TableProducer/candidateCreator3Prong.cxx | 40 ++++- PWGHF/TableProducer/mcPidTof.cxx | 50 +++++- PWGHF/TableProducer/pidCreator.cxx | 6 +- PWGHF/Utils/utilsPid.h | 154 +++++++++++++++--- 6 files changed, 241 insertions(+), 42 deletions(-) diff --git a/PWGHF/DataModel/AliasTables.h b/PWGHF/DataModel/AliasTables.h index 98594b546db..bb7cce309a3 100644 --- a/PWGHF/DataModel/AliasTables.h +++ b/PWGHF/DataModel/AliasTables.h @@ -47,6 +47,7 @@ using TracksPidPr = soa::Join; using TracksPidDe = soa::Join; using TracksPidTr = soa::Join; using TracksPidHe = soa::Join; +using TracksPidAl = soa::Join; using TracksPidTinyEl = soa::Join; using TracksPidTinyMu = soa::Join; @@ -56,6 +57,7 @@ using TracksPidTinyPr = soa::Join; using TracksPidTinyDe = soa::Join; using TracksPidTinyTr = soa::Join; using TracksPidTinyHe = soa::Join; +using TracksPidTinyAl = soa::Join; } // namespace o2::aod #endif // PWGHF_DATAMODEL_ALIASTABLES_H_ diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 3af629eb0e4..a10f139ced0 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -46,6 +46,7 @@ DECLARE_SOA_COLUMN(TpcTofNSigmaPr, tpcTofNSigmaPr, float); //! Combined NSigma s DECLARE_SOA_COLUMN(TpcTofNSigmaDe, tpcTofNSigmaDe, float); //! Combined NSigma separation with the TPC & TOF detectors for deuteron DECLARE_SOA_COLUMN(TpcTofNSigmaTr, tpcTofNSigmaTr, float); //! Combined NSigma separation with the TPC & TOF detectors for triton DECLARE_SOA_COLUMN(TpcTofNSigmaHe, tpcTofNSigmaHe, float); //! Combined NSigma separation with the TPC & TOF detectors for helium +DECLARE_SOA_COLUMN(TpcTofNSigmaAl, tpcTofNSigmaAl, float); //! Combined NSigma separation with the TPC & TOF detectors for alpha } // namespace pid_tpc_tof_static_full namespace pid_tpc_tof_static_tiny @@ -59,6 +60,7 @@ DECLARE_SOA_COLUMN(TpcTofNSigmaPr, tpcTofNSigmaPr, float); //! Combined NSigma s DECLARE_SOA_COLUMN(TpcTofNSigmaDe, tpcTofNSigmaDe, float); //! Combined NSigma separation with the TPC & TOF detectors for deuteron DECLARE_SOA_COLUMN(TpcTofNSigmaTr, tpcTofNSigmaTr, float); //! Combined NSigma separation with the TPC & TOF detectors for triton DECLARE_SOA_COLUMN(TpcTofNSigmaHe, tpcTofNSigmaHe, float); //! Combined NSigma separation with the TPC & TOF detectors for helium +DECLARE_SOA_COLUMN(TpcTofNSigmaAl, tpcTofNSigmaAl, float); //! Combined NSigma separation with the TPC & TOF detectors for alpha } // namespace pid_tpc_tof_static_tiny // Extension of per particle tables @@ -78,6 +80,8 @@ DECLARE_SOA_TABLE(PidTpcTofFullTr, "AOD", "PIDTPCTOFFULLTr", //! Table of the TP pid_tpc_tof_static_full::TpcTofNSigmaTr); DECLARE_SOA_TABLE(PidTpcTofFullHe, "AOD", "PIDTPCTOFFULLHe", //! Table of the TPC & TOF Combined NSigma for helium pid_tpc_tof_static_full::TpcTofNSigmaHe); +DECLARE_SOA_TABLE(PidTpcTofFullAl, "AOD", "PIDTPCTOFFULLAl", //! Table of the TPC & TOF Combined NSigma for alpha + pid_tpc_tof_static_full::TpcTofNSigmaAl); // Extension of per particle tables DECLARE_SOA_TABLE(PidTpcTofTinyEl, "AOD", "PIDTPCTOFTINYEL", //! Table of the TPC & TOF Combined NSigma for electron pid_tpc_tof_static_tiny::TpcTofNSigmaEl); @@ -95,6 +99,8 @@ DECLARE_SOA_TABLE(PidTpcTofTinyTr, "AOD", "PIDTPCTOFTINYTr", //! Table of the TP pid_tpc_tof_static_tiny::TpcTofNSigmaTr); DECLARE_SOA_TABLE(PidTpcTofTinyHe, "AOD", "PIDTPCTOFTINYHe", //! Table of the TPC & TOF Combined NSigma for helium pid_tpc_tof_static_tiny::TpcTofNSigmaHe); +DECLARE_SOA_TABLE(PidTpcTofTinyAl, "AOD", "PIDTPCTOFTINYAl", //! Table of the TPC & TOF Combined NSigma for alpha + pid_tpc_tof_static_tiny::TpcTofNSigmaAl); // general decay properties namespace hf_cand { @@ -197,6 +203,9 @@ DECLARE_SOA_COLUMN(NSigTpcTr2, nSigTpcTr2, float); //! TPC nSigma for DECLARE_SOA_COLUMN(NSigTpcHe0, nSigTpcHe0, float); //! TPC nSigma for helium hypothesis - prong 0 DECLARE_SOA_COLUMN(NSigTpcHe1, nSigTpcHe1, float); //! TPC nSigma for helium hypothesis - prong 1 DECLARE_SOA_COLUMN(NSigTpcHe2, nSigTpcHe2, float); //! TPC nSigma for helium hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTpcAl0, nSigTpcAl0, float); //! TPC nSigma for alpha hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTpcAl1, nSigTpcAl1, float); //! TPC nSigma for alpha hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTpcAl2, nSigTpcAl2, float); //! TPC nSigma for alpha hypothesis - prong 2 DECLARE_SOA_COLUMN(NSigTofPi0, nSigTofPi0, float); //! TOF nSigma for pion hypothesis - prong 0 DECLARE_SOA_COLUMN(NSigTofPi1, nSigTofPi1, float); //! TOF nSigma for pion hypothesis - prong 1 DECLARE_SOA_COLUMN(NSigTofPi2, nSigTofPi2, float); //! TOF nSigma for pion hypothesis - prong 2 @@ -215,6 +224,9 @@ DECLARE_SOA_COLUMN(NSigTofTr2, nSigTofTr2, float); //! TOF nSigma for DECLARE_SOA_COLUMN(NSigTofHe0, nSigTofHe0, float); //! TOF nSigma for helium hypothesis - prong 0 DECLARE_SOA_COLUMN(NSigTofHe1, nSigTofHe1, float); //! TOF nSigma for helium hypothesis - prong 1 DECLARE_SOA_COLUMN(NSigTofHe2, nSigTofHe2, float); //! TOF nSigma for helium hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTofAl0, nSigTofAl0, float); //! TOF nSigma for alpha hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTofAl1, nSigTofAl1, float); //! TOF nSigma for alpha hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTofAl2, nSigTofAl2, float); //! TOF nSigma for alpha hypothesis - prong 2 DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPi0, tpcTofNSigmaPi0, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 0 [](float tpcNSigmaPi0, float tofNSigmaPi0) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPi0, tofNSigmaPi0); }); DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPi1, tpcTofNSigmaPi1, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 1 @@ -251,6 +263,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaHe1, tpcTofNSigmaHe1, //! Combined NSigma [](float tpcNSigmaHe1, float tofNSigmaHe1) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaHe1, tofNSigmaHe1); }); DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaHe2, tpcTofNSigmaHe2, //! Combined NSigma separation with the TPC & TOF detectors for helium - prong 2 [](float tpcNSigmaHe2, float tofNSigmaHe2) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaHe2, tofNSigmaHe2); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaAl0, tpcTofNSigmaAl0, //! Combined NSigma separation with the TPC & TOF detectors for alpha - prong 0 + [](float tpcNSigmaAl0, float tofNSigmaAl0) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaAl0, tofNSigmaAl0); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaAl1, tpcTofNSigmaAl1, //! Combined NSigma separation with the TPC & TOF detectors for alpha - prong 1 + [](float tpcNSigmaAl1, float tofNSigmaAl1) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaAl1, tofNSigmaAl1); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaAl2, tpcTofNSigmaAl2, //! Combined NSigma separation with the TPC & TOF detectors for alpha - prong 2 + [](float tpcNSigmaAl2, float tofNSigmaAl2) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaAl2, tofNSigmaAl2); }); // tiny (binned) option DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaTinyPi0, tpcTofNSigmaTinyPi0, //! Combined NSigma separation with the TPC & TOF detectors for pion - prong 0 [](float tpcNSigmaPi0, float tofNSigmaPi0) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPi0, tofNSigmaPi0); }); @@ -811,13 +829,22 @@ DECLARE_SOA_TABLE(HfCand3Prong2PidTr, "AOD", "HFCAND3P2PIDTR", //! hf_cand::TpcTofNSigmaTr2); DECLARE_SOA_TABLE(HfCand3Prong0PidHe, "AOD", "HFCAND3P0PIDHe", //! hf_cand::NSigTpcHe0, hf_cand::NSigTofHe0, - hf_cand::TpcTofNSigmaTr0); + hf_cand::TpcTofNSigmaHe0); DECLARE_SOA_TABLE(HfCand3Prong1PidHe, "AOD", "HFCAND3P1PIDHe", //! hf_cand::NSigTpcHe1, hf_cand::NSigTofHe1, hf_cand::TpcTofNSigmaHe1); DECLARE_SOA_TABLE(HfCand3Prong2PidHe, "AOD", "HFCAND3P2PIDHe", //! hf_cand::NSigTpcHe2, hf_cand::NSigTofHe2, hf_cand::TpcTofNSigmaHe2); +DECLARE_SOA_TABLE(HfCand3Prong0PidAl, "AOD", "HFCAND3P0PIDAl", //! + hf_cand::NSigTpcAl0, hf_cand::NSigTofAl0, + hf_cand::TpcTofNSigmaAl0); +DECLARE_SOA_TABLE(HfCand3Prong1PidAl, "AOD", "HFCAND3P1PIDAl", //! + hf_cand::NSigTpcAl1, hf_cand::NSigTofAl1, + hf_cand::TpcTofNSigmaAl1); +DECLARE_SOA_TABLE(HfCand3Prong2PidAl, "AOD", "HFCAND3P2PIDAl", //! + hf_cand::NSigTpcAl2, hf_cand::NSigTofAl2, + hf_cand::TpcTofNSigmaAl2); using HfCand3Prong = HfCand3ProngExt; using HfCand3ProngWPidPiKaPr = soa::Join; @@ -825,6 +852,8 @@ using HfCand3ProngWPidPiKa = soa::Join; using HfCand3ProngWPidPiKaTr = soa::Join; using HfCand3ProngWPidPiKaHe = soa::Join; +using HfCand3ProngWPidPiKaAl = soa::Join; + DECLARE_SOA_TABLE(HfCand3ProngKF, "AOD", "HFCAND3PKF", hf_cand_3prong::KfXError, hf_cand_3prong::KfYError, hf_cand_3prong::KfZError, diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index b88ea949b3e..1c75767b7fa 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -20,6 +20,7 @@ #endif #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -78,6 +79,7 @@ #include using namespace o2; +using namespace o2::analysis; using namespace o2::hf_evsel; using namespace o2::hf_trkcandsel; using namespace o2::aod::hf_cand_3prong; @@ -98,14 +100,23 @@ struct HfCandidateCreator3Prong { Produces rowProng0PidKa; Produces rowProng0PidPr; Produces rowProng0PidDe; + Produces rowProng0PidTr; + Produces rowProng0PidHe; + Produces rowProng0PidAl; Produces rowProng1PidPi; Produces rowProng1PidKa; Produces rowProng1PidPr; Produces rowProng1PidDe; + Produces rowProng1PidTr; + Produces rowProng1PidHe; + Produces rowProng1PidAl; Produces rowProng2PidPi; Produces rowProng2PidKa; Produces rowProng2PidPr; Produces rowProng2PidDe; + Produces rowProng2PidTr; + Produces rowProng2PidHe; + Produces rowProng2PidAl; // vertexing Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; @@ -126,11 +137,13 @@ struct HfCandidateCreator3Prong { Configurable createDs{"createDs", false, "enable Ds+/- candidate creation"}; Configurable createLc{"createLc", false, "enable Lc+/- candidate creation"}; Configurable createXic{"createXic", false, "enable Xic+/- candidate creation"}; - Configurable createCd{"createCd", false, "enable Cd candidate creation"}; + Configurable createCharmNuclei{"createCharmNuclei", false, "enable createCharmNuclei candidate creation"}; // KF Configurable applyTopoConstraint{"applyTopoConstraint", false, "apply origin from PV hypothesis for created candidate, works only in KF mode"}; Configurable applyInvMassConstraint{"applyInvMassConstraint", false, "apply particle type hypothesis to recalculate created candidate's momentum, works only in KF mode"}; + Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3)"}; + HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter Service ccdb{}; @@ -143,11 +156,11 @@ struct HfCandidateCreator3Prong { using FilteredHf3Prongs = soa::Filtered; using FilteredPvRefitHf3Prongs = soa::Filtered>; - using TracksWCovExtraPidPiKaPrDe = soa::Join; + using TracksWCovExtraPidPiKaPrDe = soa::Join; // filter candidates - Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::XicToPKPi))) != static_cast(0)) || (createCd && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CdToDeKPi))) != static_cast(0)); - + Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::XicToPKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CdToDeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CtToTrKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::ChToHeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CaToAlKPi))) != static_cast(0)); + std::shared_ptr hCandidates; HistogramRegistry registry{"registry"}; OutputObj zorroSummary{"zorroSummary"}; @@ -189,7 +202,7 @@ struct HfCandidateCreator3Prong { if (nProcessesUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } - std::array creationFlags = {createDplus, createDs, createLc, createXic, createCd}; + std::array creationFlags = {createDplus, createDs, createLc, createXic, createCharmNuclei}; if (std::accumulate(creationFlags.begin(), creationFlags.end(), 0) == 0) { LOGP(fatal, "At least one particle specie should be enabled for the creation."); } @@ -258,10 +271,19 @@ struct HfCandidateCreator3Prong { fillProngPid(track1, rowProng1PidPr); fillProngPid(track2, rowProng2PidPr); } - if (createCd) { - fillProngPid(track0, rowProng0PidDe); - fillProngPid(track1, rowProng1PidDe); - fillProngPid(track2, rowProng2PidDe); + if (createCharmNuclei) { + fillProngPidLightNuclei(track0, rowProng0PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidAl, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidAl, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidAl, tpcPidBBParamsLightNuclei); } } diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index b08e912e4c2..0c269de208a 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -12,7 +12,7 @@ /// /// \file mcPidTof.cxx /// \author Fabrizio Grosa fabrizio.grosa@cern.ch -/// \brief Task to produce PID tables for TOF split for pi, K, p, de, tr, he3 copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx +/// \brief Task to produce PID tables for TOF split for pi, K, p, de, tr, he3, alpha copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx /// It works only for MC and adds the possibility to apply postcalibrations for MC. /// @@ -722,6 +722,7 @@ static constexpr int IdxPr = 4; static constexpr int IdxDe = 5; static constexpr int IdxTr = 6; static constexpr int IdxHe = 7; +static constexpr int IdxAl = 8; /// Task to produce the response table struct McPidTof { @@ -732,6 +733,7 @@ struct McPidTof { Produces tablePIDDe; Produces tablePIDTr; Produces tablePIDHe; + Produces tablePIDAl; // Tables to produce (full) Produces tablePIDFullPi; @@ -740,6 +742,7 @@ struct McPidTof { Produces tablePIDFullDe; Produces tablePIDFullTr; Produces tablePIDFullHe; + Produces tablePIDFullAl; // Detector response parameters o2::pid::tof::TOFResoParamsV3 mRespParamsV3; @@ -877,6 +880,14 @@ struct McPidTof { } break; } + case IdxAl: { + if (fullTable) { + tablePIDFullAl.reserve(size); + } else { + tablePIDAl.reserve(size); + } + break; + } default: LOG(fatal) << "Wrong particle ID in reserveTable() for " << (fullTable ? "full" : "tiny") << " tables"; break; @@ -929,6 +940,13 @@ struct McPidTof { aod::pidtof_tiny::binning::packInTable(-999.f, tablePIDHe); } break; + case IdxAl: + if (fullTable) { + tablePIDFullAl(-999.f, -999.f); + } else { + aod::pidtof_tiny::binning::packInTable(-999.f, tablePIDAl); + } + break; default: LOG(fatal) << "Wrong particle ID in makeTableEmpty() for " << (fullTable ? "full" : "tiny") << " tables"; break; @@ -1012,6 +1030,7 @@ struct McPidTof { constexpr auto ResponseDe = ResponseImplementation(); constexpr auto ResponseTr = ResponseImplementation(); constexpr auto ResponseHe = ResponseImplementation(); + constexpr auto ResponseAl = ResponseImplementation(); mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, bcs.iteratorAt(0)); // Update the calibration parameters @@ -1092,7 +1111,7 @@ struct McPidTof { nSigma = ResponseTr.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kTriton) { // we rescale only true signal - nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to tritons, to be checked } } aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDTr); @@ -1102,12 +1121,22 @@ struct McPidTof { nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kHelium3) { // we rescale only true signal - nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to helium3, to be checked } } aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDHe); break; } + case IdxAl: { + nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk); + if (enableMcRecalib && trk.has_mcParticle()) { + if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kAlpha) { // we rescale only true signal + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to alpha, to be checked + } + } + aod::pidtof_tiny::binning::packInTable(nSigma, tablePIDAl); + break; + } default: LOG(fatal) << "Wrong particle ID for standard tables"; break; @@ -1168,7 +1197,7 @@ struct McPidTof { nSigma = ResponseTr.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kTriton) { // we rescale only true signal - nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to tritons, to be checked } } tablePIDFullTr(resolution, nSigma); @@ -1179,12 +1208,23 @@ struct McPidTof { nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kHelium3) { // we rescale only true signal - nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to deuterons, to be checked + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to helium3, to be checked } } tablePIDFullHe(resolution, nSigma); break; } + case IdxAl: { + resolution = ResponseHe.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk, resolution); + if (enableMcRecalib && trk.has_mcParticle()) { + if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kAlpha) { // we rescale only true signal + nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to alpha, to be checked + } + } + tablePIDFullAl(resolution, nSigma); + break; + } default: LOG(fatal) << "Wrong particle ID for full tables"; break; diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index 1b5d7ca73f9..131561dd683 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -51,7 +51,8 @@ struct HfPidCreator { Produces trackPidTinyTr; Produces trackPidFullHe; Produces trackPidTinyHe; - + Produces trackPidFullAl; + Produces trackPidTinyAl; /// Function to check whether the process function flag matches the need for filling the table /// \param initContext workflow context (argument of the init function) /// \param table name of the table @@ -89,6 +90,8 @@ struct HfPidCreator { checkTableSwitch(initContext, "PidTpcTofTinyTr", doprocessTinyTr); checkTableSwitch(initContext, "PidTpcTofFullHe", doprocessFullHe); checkTableSwitch(initContext, "PidTpcTofTinyHe", doprocessTinyHe); + checkTableSwitch(initContext, "PidTpcTofFullAl", doprocessFullAl); + checkTableSwitch(initContext, "PidTpcTofTinyAl", doprocessTinyAl); } void processDummy(aod::Collisions const&) {} @@ -121,6 +124,7 @@ struct HfPidCreator { PROCESS_PID(De) PROCESS_PID(Tr) PROCESS_PID(He) + PROCESS_PID(Al) #undef PROCESS_PID }; diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 8be0035453d..3d39b595083 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -20,10 +20,15 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" +#include #include +#include #include +using namespace o2::constants::physics; +using namespace o2::framework; + namespace o2::aod::pid_tpc_tof_utils { /// @brief Species of HF-candidate daughter tracks @@ -33,7 +38,8 @@ enum HfProngSpecies : uint8_t { Proton, Deuteron, Triton, - Helium, + Helium3, + Alpha, NHfProngSpecies }; @@ -45,6 +51,126 @@ enum PidMethod { NPidMethods }; +/// Compute TPC nσ for light nuclei (De/Tr/He3/Al) using a Bethe–Bloch parameter configuration (BB-based PID). +/// +/// \tparam TrackType Track/ASoA row type providing TPC accessors. +/// \param track Track to be tested. +/// \param lightnuclei Species selector: 3=Deuteron, 4=Triton, 5=Helium3, 6=Alpha. +/// \param bbParams is Bethe–Bloch parameters +/// \return TPC nσ for the chosen nucleus hypothesis (or -999 if not applicable). +template +float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, HfProngSpecies lightnuclei, + const Configurable>& bbParams) +{ + if (!track.hasTPC()) { + return -999.f; + } + const int row = static_cast(lightnuclei) - static_cast(HfProngSpecies::Deuteron); + + if (row < 0 || row >= HfProngSpecies::NHfProngSpecies) { + return -999.f; + } + + // Columns: [0..4] BB params, [5] relative resolution (sigma/mean) + const double bb0 = bbParams->get(row, 0u); + const double bb1 = bbParams->get(row, 1u); + const double bb2 = bbParams->get(row, 2u); + const double bb3 = bbParams->get(row, 3u); + const double bb4 = bbParams->get(row, 4u); + const double relRes = bbParams->get(row, 5u); + + if (relRes <= 0.) { + return -999.f; + } + + double mass = 0.; + switch (lightnuclei) { + case HfProngSpecies::Deuteron: + mass = MassDeuteron; + break; + case HfProngSpecies::Triton: + mass = MassTriton; + break; + case HfProngSpecies::Helium3: + mass = MassHelium3; + break; + case HfProngSpecies::Alpha: + mass = MassAlpha; + break; + default: + LOG(fatal) << "Unhandled HfProngSpecies " << static_cast(lightnuclei); + } + + const int charge = (lightnuclei == HfProngSpecies::Helium3 || lightnuclei == HfProngSpecies::Alpha) ? 2 : 1; + const float rigidity = track.tpcInnerParam(); // p/|q| + + const double x = static_cast(charge) * static_cast(rigidity) / mass; + const double expBethe = common::BetheBlochAleph(x, bb0, bb1, bb2, bb3, bb4); + const double expSigma = expBethe * relRes; + + if (expSigma <= 0.) { + return -999.f; + } + + return static_cast((track.tpcSignal() - expBethe) / expSigma); +} + +/// \brief Function to fill tables with HF prong PID information +/// \tparam specPid particle species +/// \tparam TTrack datatype of the prong track +/// \tparam TCursor datatype of the cursor of the prong PID table to fill +/// \param track prong track +/// \param bbParams is Bethe–Bloch parameters (only for light nuclei) +/// \param rowPid cursor of the prong PID table to fill +template +void fillProngPidLightNuclei(TTrack const& track, TCursor& rowPid, + const Configurable>& bbParams) +{ + + // get PID information for the daughter tracks + // TODO: add here the code for a possible PID post-calibrations in MC + float nSigTpc = -999.f; + float nSigTof = -999.f; + if constexpr (SpecPid == HfProngSpecies::Deuteron) { + // deuteron PID + if (track.hasTPC()) { + nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + } + if (track.hasTOF()) { + nSigTof = track.tofNSigmaDe(); + } + } else if constexpr (SpecPid == HfProngSpecies::Triton) { + // triton PID + if (track.hasTPC()) { + nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + } + if (track.hasTOF()) { + nSigTof = track.tofNSigmaTr(); + } + } else if constexpr (SpecPid == HfProngSpecies::Helium3) { + // helium3 PID + if (track.hasTPC()) { + nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + } + if (track.hasTOF()) { + nSigTof = track.tofNSigmaHe(); + } + } else if constexpr (SpecPid == HfProngSpecies::Alpha) { + // helium4 PID + if (track.hasTPC()) { + nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + } + if (track.hasTOF()) { + nSigTof = track.tofNSigmaAl(); + } + } else { + LOG(fatal) << "Unsupported PID. Supported species in HF framework: HfProngSpecies::Deuteron, HfProngSpecies::Triton, HfProngSpecies::Helium3, HfProngSpecies::Alpha"; + } + + // fill candidate prong PID rows + rowPid(nSigTpc, nSigTof); +} + /// Function to combine TPC and TOF nSigma /// \tparam Tiny switch between full and tiny (binned) PID tables /// \param nSigmaTpc is the (binned) nSigma separation in TPC (if Tiny = true) @@ -111,32 +237,8 @@ void fillProngPid(TTrack const& track, TCursor& rowPid) if (track.hasTOF()) { nSigTof = track.tofNSigmaPr(); } - } else if constexpr (SpecPid == HfProngSpecies::Deuteron) { - // deuteron PID - if (track.hasTPC()) { - nSigTpc = track.tpcNSigmaDe(); - } - if (track.hasTOF()) { - nSigTof = track.tofNSigmaDe(); - } - } else if constexpr (SpecPid == HfProngSpecies::Triton) { - // triton PID - if (track.hasTPC()) { - nSigTpc = track.tpcNSigmaTr(); - } - if (track.hasTOF()) { - nSigTof = track.tofNSigmaTr(); - } - } else if constexpr (SpecPid == HfProngSpecies::Helium) { - // triton PID - if (track.hasTPC()) { - nSigTpc = track.tpcNSigmaHe(); - } - if (track.hasTOF()) { - nSigTof = track.tofNSigmaHe(); - } } else { - LOG(fatal) << "Unsupported PID. Supported species in HF framework: HfProngSpecies::Pion, HfProngSpecies::Kaon, HfProngSpecies::Proton, HfProngSpecies::Deuteron, HfProngSpecies::Triton, HfProngSpecies::Helium"; + LOG(fatal) << "Unsupported PID. Supported species in HF framework: HfProngSpecies::Pion, HfProngSpecies::Kaon, HfProngSpecies::Proton"; } // fill candidate prong PID rows From 7b2cd70311b37023e794847ed450773c9813c882 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Feb 2026 08:57:12 +0100 Subject: [PATCH 02/12] fix error related unused quantity --- PWGHF/TableProducer/mcPidTof.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index 0c269de208a..dba9eb2753f 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -1128,7 +1128,7 @@ struct McPidTof { break; } case IdxAl: { - nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk); + nSigma = ResponseAl.GetSeparation(mRespParamsV3, trk); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kAlpha) { // we rescale only true signal nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to alpha, to be checked @@ -1215,8 +1215,8 @@ struct McPidTof { break; } case IdxAl: { - resolution = ResponseHe.GetExpectedSigma(mRespParamsV3, trk); - nSigma = ResponseHe.GetSeparation(mRespParamsV3, trk, resolution); + resolution = ResponseAl.GetExpectedSigma(mRespParamsV3, trk); + nSigma = ResponseAl.GetSeparation(mRespParamsV3, trk, resolution); if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == o2::constants::physics::kAlpha) { // we rescale only true signal nSigma = applyMcRecalib(IdxPr, trk.pt(), nSigma); // FIXME: currently postcalibrations for protons applied to alpha, to be checked From c9ee2116452918d07a0adf5a379d4228946316a7 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Feb 2026 10:20:02 +0100 Subject: [PATCH 03/12] fix comments from vit --- .../DataModel/CandidateReconstructionTables.h | 1 - .../TableProducer/candidateCreator3Prong.cxx | 30 +++++++++---------- PWGHF/Utils/utilsPid.h | 6 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index a10f139ced0..4169fe79f98 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -854,7 +854,6 @@ using HfCand3ProngWPidPiKaTr = soa::Join; using HfCand3ProngWPidPiKaAl = soa::Join; - DECLARE_SOA_TABLE(HfCand3ProngKF, "AOD", "HFCAND3PKF", hf_cand_3prong::KfXError, hf_cand_3prong::KfYError, hf_cand_3prong::KfZError, hf_cand_3prong::KfXPVError, hf_cand_3prong::KfYPVError, hf_cand_3prong::KfZPVError, diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 1c75767b7fa..078e9ac8a2e 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -20,8 +20,8 @@ #endif #include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" @@ -142,7 +142,7 @@ struct HfCandidateCreator3Prong { Configurable applyTopoConstraint{"applyTopoConstraint", false, "apply origin from PV hypothesis for created candidate, works only in KF mode"}; Configurable applyInvMassConstraint{"applyInvMassConstraint", false, "apply particle type hypothesis to recalculate created candidate's momentum, works only in KF mode"}; - Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3)"}; + Configurable> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], hf_presel_lightnuclei::NParticleRows, hf_presel_lightnuclei::NBetheBlochParams, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams}, "TPC PID Bethe–Bloch parameter configurations for light nuclei (deuteron, triton, helium-3)"}; HfEventSelection hfEvSel; // event selection and monitoring o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter @@ -160,7 +160,7 @@ struct HfCandidateCreator3Prong { // filter candidates Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::XicToPKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CdToDeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CtToTrKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::ChToHeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CaToAlKPi))) != static_cast(0)); - + std::shared_ptr hCandidates; HistogramRegistry registry{"registry"}; OutputObj zorroSummary{"zorroSummary"}; @@ -272,18 +272,18 @@ struct HfCandidateCreator3Prong { fillProngPid(track2, rowProng2PidPr); } if (createCharmNuclei) { - fillProngPidLightNuclei(track0, rowProng0PidDe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track1, rowProng1PidDe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track2, rowProng2PidDe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track0, rowProng0PidHe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track1, rowProng1PidHe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track2, rowProng2PidHe, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track0, rowProng0PidTr, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track1, rowProng1PidTr, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track2, rowProng2PidTr, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track0, rowProng0PidAl, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track1, rowProng1PidAl, tpcPidBBParamsLightNuclei); - fillProngPidLightNuclei(track2, rowProng2PidAl, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidDe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidHe, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidTr, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track0, rowProng0PidAl, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track1, rowProng1PidAl, tpcPidBBParamsLightNuclei); + fillProngPidLightNuclei(track2, rowProng2PidAl, tpcPidBBParamsLightNuclei); } } diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 3d39b595083..ff3f30529f4 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -59,7 +59,8 @@ enum PidMethod { /// \param bbParams is Bethe–Bloch parameters /// \return TPC nσ for the chosen nucleus hypothesis (or -999 if not applicable). template -float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, HfProngSpecies lightnuclei, +float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, + HfProngSpecies lightnuclei, const Configurable>& bbParams) { if (!track.hasTPC()) { @@ -123,7 +124,8 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, HfProngSpecies l /// \param bbParams is Bethe–Bloch parameters (only for light nuclei) /// \param rowPid cursor of the prong PID table to fill template -void fillProngPidLightNuclei(TTrack const& track, TCursor& rowPid, +void fillProngPidLightNuclei(TTrack const& track, + TCursor& rowPid, const Configurable>& bbParams) { From 386d95b312eeb9e08e77657109c239ef02929777 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Feb 2026 13:53:54 +0100 Subject: [PATCH 04/12] fix comments from vit --- PWGHF/Utils/utilsPid.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index ff3f30529f4..655da3d038a 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -26,9 +26,6 @@ #include -using namespace o2::constants::physics; -using namespace o2::framework; - namespace o2::aod::pid_tpc_tof_utils { /// @brief Species of HF-candidate daughter tracks @@ -61,7 +58,7 @@ enum PidMethod { template float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, HfProngSpecies lightnuclei, - const Configurable>& bbParams) + const o2::framework::Configurable>& bbParams) { if (!track.hasTPC()) { return -999.f; @@ -87,16 +84,16 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, double mass = 0.; switch (lightnuclei) { case HfProngSpecies::Deuteron: - mass = MassDeuteron; + mass = o2::constants::physics::MassDeuteron; break; case HfProngSpecies::Triton: - mass = MassTriton; + mass = o2::constants::physics::MassTriton; break; case HfProngSpecies::Helium3: - mass = MassHelium3; + mass = o2::constants::physics::MassHelium3; break; case HfProngSpecies::Alpha: - mass = MassAlpha; + mass = o2::constants::physics::MassAlpha; break; default: LOG(fatal) << "Unhandled HfProngSpecies " << static_cast(lightnuclei); @@ -126,7 +123,7 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, template void fillProngPidLightNuclei(TTrack const& track, TCursor& rowPid, - const Configurable>& bbParams) + const o2::framework::Configurable>& bbParams) { // get PID information for the daughter tracks From 020b1bfd22a0b9a594e6ba879bdef811b42b62e1 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Feb 2026 15:18:25 +0100 Subject: [PATCH 05/12] fix comments from vit --- PWGHF/Utils/utilsPid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 655da3d038a..1a85b7fab07 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -103,7 +103,7 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, const float rigidity = track.tpcInnerParam(); // p/|q| const double x = static_cast(charge) * static_cast(rigidity) / mass; - const double expBethe = common::BetheBlochAleph(x, bb0, bb1, bb2, bb3, bb4); + const double expBethe = o2::common::BetheBlochAleph(x, bb0, bb1, bb2, bb3, bb4); const double expSigma = expBethe * relRes; if (expSigma <= 0.) { From f9f27bcc2e1f05c68e06c05716707ef8ce0fa54a Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Feb 2026 17:11:31 +0100 Subject: [PATCH 06/12] fix typo --- PWGHF/Utils/utilsPid.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 1a85b7fab07..f1fb54fd528 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -52,18 +52,18 @@ enum PidMethod { /// /// \tparam TrackType Track/ASoA row type providing TPC accessors. /// \param track Track to be tested. -/// \param lightnuclei Species selector: 3=Deuteron, 4=Triton, 5=Helium3, 6=Alpha. +/// \param species Species selector: 3=Deuteron, 4=Triton, 5=Helium3, 6=Alpha. /// \param bbParams is Bethe–Bloch parameters /// \return TPC nσ for the chosen nucleus hypothesis (or -999 if not applicable). template float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, - HfProngSpecies lightnuclei, + HfProngSpecies species, const o2::framework::Configurable>& bbParams) { if (!track.hasTPC()) { return -999.f; } - const int row = static_cast(lightnuclei) - static_cast(HfProngSpecies::Deuteron); + const int row = static_cast(species) - static_cast(HfProngSpecies::Deuteron); if (row < 0 || row >= HfProngSpecies::NHfProngSpecies) { return -999.f; @@ -82,7 +82,7 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, } double mass = 0.; - switch (lightnuclei) { + switch (species) { case HfProngSpecies::Deuteron: mass = o2::constants::physics::MassDeuteron; break; @@ -96,10 +96,10 @@ float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, mass = o2::constants::physics::MassAlpha; break; default: - LOG(fatal) << "Unhandled HfProngSpecies " << static_cast(lightnuclei); + LOG(fatal) << "Unhandled HfProngSpecies " << static_cast(species); } - const int charge = (lightnuclei == HfProngSpecies::Helium3 || lightnuclei == HfProngSpecies::Alpha) ? 2 : 1; + const int charge = (species == HfProngSpecies::Helium3 || species == HfProngSpecies::Alpha) ? 2 : 1; const float rigidity = track.tpcInnerParam(); // p/|q| const double x = static_cast(charge) * static_cast(rigidity) / mass; From 0df2f37cc4fef28dbb291d4953a355dbe182d033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:12:41 +0100 Subject: [PATCH 07/12] Update utilsPid.h From a16758f4e90c052ec998916413330b5fa6bbe99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 19 Feb 2026 17:47:43 +0100 Subject: [PATCH 08/12] change the function name --- PWGHF/Utils/utilsPid.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index f1fb54fd528..90171b2a8c9 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -56,7 +56,7 @@ enum PidMethod { /// \param bbParams is Bethe–Bloch parameters /// \return TPC nσ for the chosen nucleus hypothesis (or -999 if not applicable). template -float getTPCNSigmaLightNucleiBetheBloch(const TrackType& track, +float getNSigmaTpcLightNucleiBetheBloch(const TrackType& track, HfProngSpecies species, const o2::framework::Configurable>& bbParams) { @@ -133,7 +133,7 @@ void fillProngPidLightNuclei(TTrack const& track, if constexpr (SpecPid == HfProngSpecies::Deuteron) { // deuteron PID if (track.hasTPC()) { - nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + nSigTpc = getNSigmaTpcLightNucleiBetheBloch(track, SpecPid, bbParams); } if (track.hasTOF()) { nSigTof = track.tofNSigmaDe(); @@ -141,7 +141,7 @@ void fillProngPidLightNuclei(TTrack const& track, } else if constexpr (SpecPid == HfProngSpecies::Triton) { // triton PID if (track.hasTPC()) { - nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + nSigTpc = getNSigmaTpcLightNucleiBetheBloch(track, SpecPid, bbParams); } if (track.hasTOF()) { nSigTof = track.tofNSigmaTr(); @@ -149,7 +149,7 @@ void fillProngPidLightNuclei(TTrack const& track, } else if constexpr (SpecPid == HfProngSpecies::Helium3) { // helium3 PID if (track.hasTPC()) { - nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + nSigTpc = getNSigmaTpcLightNucleiBetheBloch(track, SpecPid, bbParams); } if (track.hasTOF()) { nSigTof = track.tofNSigmaHe(); @@ -157,7 +157,7 @@ void fillProngPidLightNuclei(TTrack const& track, } else if constexpr (SpecPid == HfProngSpecies::Alpha) { // helium4 PID if (track.hasTPC()) { - nSigTpc = getTPCNSigmaLightNucleiBetheBloch(track, SpecPid, bbParams); + nSigTpc = getNSigmaTpcLightNucleiBetheBloch(track, SpecPid, bbParams); } if (track.hasTOF()) { nSigTof = track.tofNSigmaAl(); From a98230e6197414eab40e1d257103a63a91f41c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 19 Feb 2026 18:00:30 +0100 Subject: [PATCH 09/12] Fix typo for the lower case of table declarations --- .../DataModel/CandidateReconstructionTables.h | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 4169fe79f98..50c51aec9ef 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -74,13 +74,13 @@ DECLARE_SOA_TABLE(PidTpcTofFullKa, "AOD", "PIDTPCTOFFULLKA", //! Table of the TP pid_tpc_tof_static_full::TpcTofNSigmaKa); DECLARE_SOA_TABLE(PidTpcTofFullPr, "AOD", "PIDTPCTOFFULLPR", //! Table of the TPC & TOF Combined NSigma for proton pid_tpc_tof_static_full::TpcTofNSigmaPr); -DECLARE_SOA_TABLE(PidTpcTofFullDe, "AOD", "PIDTPCTOFFULLDe", //! Table of the TPC & TOF Combined NSigma for deuteron +DECLARE_SOA_TABLE(PidTpcTofFullDe, "AOD", "PIDTPCTOFFULLDE", //! Table of the TPC & TOF Combined NSigma for deuteron pid_tpc_tof_static_full::TpcTofNSigmaDe); -DECLARE_SOA_TABLE(PidTpcTofFullTr, "AOD", "PIDTPCTOFFULLTr", //! Table of the TPC & TOF Combined NSigma for triton +DECLARE_SOA_TABLE(PidTpcTofFullTr, "AOD", "PIDTPCTOFFULLTR", //! Table of the TPC & TOF Combined NSigma for triton pid_tpc_tof_static_full::TpcTofNSigmaTr); -DECLARE_SOA_TABLE(PidTpcTofFullHe, "AOD", "PIDTPCTOFFULLHe", //! Table of the TPC & TOF Combined NSigma for helium +DECLARE_SOA_TABLE(PidTpcTofFullHe, "AOD", "PIDTPCTOFFULLHE", //! Table of the TPC & TOF Combined NSigma for helium pid_tpc_tof_static_full::TpcTofNSigmaHe); -DECLARE_SOA_TABLE(PidTpcTofFullAl, "AOD", "PIDTPCTOFFULLAl", //! Table of the TPC & TOF Combined NSigma for alpha +DECLARE_SOA_TABLE(PidTpcTofFullAl, "AOD", "PIDTPCTOFFULLAL", //! Table of the TPC & TOF Combined NSigma for alpha pid_tpc_tof_static_full::TpcTofNSigmaAl); // Extension of per particle tables DECLARE_SOA_TABLE(PidTpcTofTinyEl, "AOD", "PIDTPCTOFTINYEL", //! Table of the TPC & TOF Combined NSigma for electron @@ -95,11 +95,11 @@ DECLARE_SOA_TABLE(PidTpcTofTinyPr, "AOD", "PIDTPCTOFTINYPR", //! Table of the TP pid_tpc_tof_static_tiny::TpcTofNSigmaPr); DECLARE_SOA_TABLE(PidTpcTofTinyDe, "AOD", "PIDTPCTOFTINYDE", //! Table of the TPC & TOF Combined NSigma for deuteron pid_tpc_tof_static_tiny::TpcTofNSigmaDe); -DECLARE_SOA_TABLE(PidTpcTofTinyTr, "AOD", "PIDTPCTOFTINYTr", //! Table of the TPC & TOF Combined NSigma for triton +DECLARE_SOA_TABLE(PidTpcTofTinyTr, "AOD", "PIDTPCTOFTINYTR", //! Table of the TPC & TOF Combined NSigma for triton pid_tpc_tof_static_tiny::TpcTofNSigmaTr); -DECLARE_SOA_TABLE(PidTpcTofTinyHe, "AOD", "PIDTPCTOFTINYHe", //! Table of the TPC & TOF Combined NSigma for helium +DECLARE_SOA_TABLE(PidTpcTofTinyHe, "AOD", "PIDTPCTOFTINYHE", //! Table of the TPC & TOF Combined NSigma for helium pid_tpc_tof_static_tiny::TpcTofNSigmaHe); -DECLARE_SOA_TABLE(PidTpcTofTinyAl, "AOD", "PIDTPCTOFTINYAl", //! Table of the TPC & TOF Combined NSigma for alpha +DECLARE_SOA_TABLE(PidTpcTofTinyAl, "AOD", "PIDTPCTOFTINYAL", //! Table of the TPC & TOF Combined NSigma for alpha pid_tpc_tof_static_tiny::TpcTofNSigmaAl); // general decay properties namespace hf_cand @@ -827,22 +827,22 @@ DECLARE_SOA_TABLE(HfCand3Prong1PidTr, "AOD", "HFCAND3P1PIDTR", //! DECLARE_SOA_TABLE(HfCand3Prong2PidTr, "AOD", "HFCAND3P2PIDTR", //! hf_cand::NSigTpcTr2, hf_cand::NSigTofTr2, hf_cand::TpcTofNSigmaTr2); -DECLARE_SOA_TABLE(HfCand3Prong0PidHe, "AOD", "HFCAND3P0PIDHe", //! +DECLARE_SOA_TABLE(HfCand3Prong0PidHe, "AOD", "HFCAND3P0PIDHE", //! hf_cand::NSigTpcHe0, hf_cand::NSigTofHe0, hf_cand::TpcTofNSigmaHe0); -DECLARE_SOA_TABLE(HfCand3Prong1PidHe, "AOD", "HFCAND3P1PIDHe", //! +DECLARE_SOA_TABLE(HfCand3Prong1PidHe, "AOD", "HFCAND3P1PIDHE", //! hf_cand::NSigTpcHe1, hf_cand::NSigTofHe1, hf_cand::TpcTofNSigmaHe1); -DECLARE_SOA_TABLE(HfCand3Prong2PidHe, "AOD", "HFCAND3P2PIDHe", //! +DECLARE_SOA_TABLE(HfCand3Prong2PidHe, "AOD", "HFCAND3P2PIDHE", //! hf_cand::NSigTpcHe2, hf_cand::NSigTofHe2, hf_cand::TpcTofNSigmaHe2); -DECLARE_SOA_TABLE(HfCand3Prong0PidAl, "AOD", "HFCAND3P0PIDAl", //! +DECLARE_SOA_TABLE(HfCand3Prong0PidAl, "AOD", "HFCAND3P0PIDAL", //! hf_cand::NSigTpcAl0, hf_cand::NSigTofAl0, hf_cand::TpcTofNSigmaAl0); -DECLARE_SOA_TABLE(HfCand3Prong1PidAl, "AOD", "HFCAND3P1PIDAl", //! +DECLARE_SOA_TABLE(HfCand3Prong1PidAl, "AOD", "HFCAND3P1PIDAL", //! hf_cand::NSigTpcAl1, hf_cand::NSigTofAl1, hf_cand::TpcTofNSigmaAl1); -DECLARE_SOA_TABLE(HfCand3Prong2PidAl, "AOD", "HFCAND3P2PIDAl", //! +DECLARE_SOA_TABLE(HfCand3Prong2PidAl, "AOD", "HFCAND3P2PIDAL", //! hf_cand::NSigTpcAl2, hf_cand::NSigTofAl2, hf_cand::TpcTofNSigmaAl2); From 19cf6e3a6f52cf56e93319b565617f775b93781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 19 Feb 2026 22:29:18 +0100 Subject: [PATCH 10/12] keep the blank line --- PWGHF/TableProducer/pidCreator.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index 131561dd683..d108a443539 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -53,6 +53,7 @@ struct HfPidCreator { Produces trackPidTinyHe; Produces trackPidFullAl; Produces trackPidTinyAl; + /// Function to check whether the process function flag matches the need for filling the table /// \param initContext workflow context (argument of the init function) /// \param table name of the table From de47dac48968ed2274931109fc3295996edc51b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 20 Feb 2026 13:58:20 +0100 Subject: [PATCH 11/12] fix vit's comments --- .../TableProducer/candidateCreator3Prong.cxx | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 078e9ac8a2e..334f185a169 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -156,7 +156,7 @@ struct HfCandidateCreator3Prong { using FilteredHf3Prongs = soa::Filtered; using FilteredPvRefitHf3Prongs = soa::Filtered>; - using TracksWCovExtraPidPiKaPrDe = soa::Join; + using TracksWCovExtraPidPiKaPrLightNuclei = soa::Join; // filter candidates Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::XicToPKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CdToDeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CtToTrKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::ChToHeKPi))) != static_cast(0)) || (createCharmNuclei && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::CaToAlKPi))) != static_cast(0)); @@ -290,7 +290,7 @@ struct HfCandidateCreator3Prong { template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const&, + TracksWCovExtraPidPiKaPrLightNuclei const&, BCsType const& bcs) { // loop over triplets of track indices @@ -310,9 +310,9 @@ struct HfCandidateCreator3Prong { continue; } - auto track0 = rowTrackIndexProng3.template prong0_as(); - auto track1 = rowTrackIndexProng3.template prong1_as(); - auto track2 = rowTrackIndexProng3.template prong2_as(); + auto track0 = rowTrackIndexProng3.template prong0_as(); + auto track1 = rowTrackIndexProng3.template prong1_as(); + auto track2 = rowTrackIndexProng3.template prong2_as(); auto trackParVar0 = getTrackParCov(track0); auto trackParVar1 = getTrackParCov(track1); auto trackParVar2 = getTrackParCov(track2); @@ -467,7 +467,7 @@ struct HfCandidateCreator3Prong { template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const&, + TracksWCovExtraPidPiKaPrLightNuclei const&, BCsType const& bcs) { for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { @@ -485,9 +485,9 @@ struct HfCandidateCreator3Prong { continue; } - auto track0 = rowTrackIndexProng3.template prong0_as(); - auto track1 = rowTrackIndexProng3.template prong1_as(); - auto track2 = rowTrackIndexProng3.template prong2_as(); + auto track0 = rowTrackIndexProng3.template prong0_as(); + auto track1 = rowTrackIndexProng3.template prong1_as(); + auto track2 = rowTrackIndexProng3.template prong2_as(); /// Set the magnetic field from ccdb. /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, @@ -716,7 +716,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/ PV refit and w/o centrality selections void processPvRefitWithDCAFitterN(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -726,7 +726,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/o PV refit and w/o centrality selections void processNoPvRefitWithDCAFitterN(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -736,7 +736,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/ PV refit and w/o centrality selections void processPvRefitWithKFParticle(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -746,7 +746,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections void processNoPvRefitWithKFParticle(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -762,7 +762,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0C void processPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -772,7 +772,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0C void processNoPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -782,7 +782,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0C void processPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -792,7 +792,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0C void processNoPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -808,7 +808,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0M void processPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -818,7 +818,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0M void processNoPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -828,7 +828,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0M void processPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -838,7 +838,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0M void processNoPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -854,7 +854,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on UPC void processPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -868,7 +868,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on UPC void processNoPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -882,7 +882,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on UPC void processPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -896,7 +896,7 @@ struct HfCandidateCreator3Prong { /// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on UPC void processNoPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPrDe const& tracks, + TracksWCovExtraPidPiKaPrLightNuclei const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, From 336b72e3db6a358e7ce3c63d02aa561d7a6a85a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 20 Feb 2026 13:59:18 +0100 Subject: [PATCH 12/12] fix vit's comments --- PWGHF/Utils/utilsPid.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 90171b2a8c9..3f7aa28f5cc 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -60,26 +60,29 @@ float getNSigmaTpcLightNucleiBetheBloch(const TrackType& track, HfProngSpecies species, const o2::framework::Configurable>& bbParams) { + constexpr float RetValNotApplicable = -999.f; + if (!track.hasTPC()) { - return -999.f; + return RetValNotApplicable; } const int row = static_cast(species) - static_cast(HfProngSpecies::Deuteron); if (row < 0 || row >= HfProngSpecies::NHfProngSpecies) { - return -999.f; + return RetValNotApplicable; } // Columns: [0..4] BB params, [5] relative resolution (sigma/mean) + + const double relRes = bbParams->get(row, 5u); + if (relRes <= 0.) { + return RetValNotApplicable; + } + const double bb0 = bbParams->get(row, 0u); const double bb1 = bbParams->get(row, 1u); const double bb2 = bbParams->get(row, 2u); const double bb3 = bbParams->get(row, 3u); const double bb4 = bbParams->get(row, 4u); - const double relRes = bbParams->get(row, 5u); - - if (relRes <= 0.) { - return -999.f; - } double mass = 0.; switch (species) { @@ -107,7 +110,7 @@ float getNSigmaTpcLightNucleiBetheBloch(const TrackType& track, const double expSigma = expBethe * relRes; if (expSigma <= 0.) { - return -999.f; + return RetValNotApplicable; } return static_cast((track.tpcSignal() - expBethe) / expSigma);