From 2eb00bbb3072e14d8ff745317b39d01345d3eb7f Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 19 Oct 2025 23:13:25 +0200 Subject: [PATCH 01/14] Add Cd reconstruction workflow into the HF framework --- Common/Core/TrackSelectorPID.h | 11 + PWGHF/Core/HfHelper.h | 14 + PWGHF/Core/SelectorCuts.h | 52 ++- PWGHF/D2H/TableProducer/CMakeLists.txt | 339 ++++++++++++++-- PWGHF/D2H/Tasks/CMakeLists.txt | 5 + PWGHF/D2H/Tasks/taskCd.cxx | 289 +++++++++++++ .../DataModel/CandidateReconstructionTables.h | 32 ++ PWGHF/DataModel/CandidateSelectionTables.h | 8 + .../TableProducer/candidateCreator3Prong.cxx | 67 +-- PWGHF/TableProducer/candidateSelectorCd.cxx | 384 ++++++++++++++++++ PWGHF/TableProducer/pidCreator.cxx | 5 + PWGHF/TableProducer/trackIndexSkimCreator.cxx | 78 +++- PWGHF/Utils/utilsPid.h | 11 +- 13 files changed, 1207 insertions(+), 88 deletions(-) create mode 100644 PWGHF/D2H/Tasks/taskCd.cxx create mode 100644 PWGHF/TableProducer/candidateSelectorCd.cxx diff --git a/Common/Core/TrackSelectorPID.h b/Common/Core/TrackSelectorPID.h index f0a0e0619e2..46d96cd690b 100644 --- a/Common/Core/TrackSelectorPID.h +++ b/Common/Core/TrackSelectorPID.h @@ -24,6 +24,8 @@ #include +using namespace o2::constants::physics; + /// Class for track selection using PID detectors struct TrackSelectorPID { @@ -127,6 +129,8 @@ class TrackSelectorPidBase nSigma = track.tpcNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tpcNSigmaPr(); + } else if constexpr (pdg == kDeuteron) { + nSigma = track.tpcNSigmaDe(); } else { errorPdg(); } @@ -221,6 +225,8 @@ class TrackSelectorPidBase nSigma = track.tofNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tofNSigmaPr(); + } else if constexpr (pdg == kDeuteron) { + nSigma = track.tofNSigmaDe(); } else { errorPdg(); } @@ -551,6 +557,8 @@ class TrackSelectorPidBase return track.bayesID() == o2::track::PID::Kaon; } else if constexpr (pdg == kProton) { return track.bayesID() == o2::track::PID::Proton; + } else if constexpr (pdg == kDeuteron) { + return track.bayesID() == o2::track::PID::Deuteron; } else { errorPdg(); return false; @@ -579,6 +587,8 @@ class TrackSelectorPidBase prob = track.bayesKa(); } else if constexpr (pdg == kProton) { prob = track.bayesPr(); + } else if constexpr (pdg == kDeuteron) { + prob = track.bayesDe(); } else { errorPdg(); } @@ -661,5 +671,6 @@ using TrackSelectorMu = TrackSelectorPidBase; // Mu using TrackSelectorPi = TrackSelectorPidBase; // Pi using TrackSelectorKa = TrackSelectorPidBase; // Ka using TrackSelectorPr = TrackSelectorPidBase; // Pr +using TrackSelectorDe = TrackSelectorPidBase; // De #endif // COMMON_CORE_TRACKSELECTORPID_H_ diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 85190c4e245..9bbae7b2617 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -410,6 +410,20 @@ class HfHelper return RecoDecay::m(std::array{candidate.pVectorProng2(), candidate.pVectorProng0()}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPiPlus}); } + // Cd± → De± K∓ π± + + template + auto invMassCdToDeKPi(const T& candidate) + { + return candidate.m(std::array{o2::constants::physics::MassDeuteron, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus}); + } + + template + auto invMassCdToPiKDe(const T& candidate) + { + return candidate.m(std::array{o2::constants::physics::MassPiPlus, o2::constants::physics::MassKPlus, o2::constants::physics::MassDeuteron}); + } + // Ξc± → p± K∓ π± template diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index 2feeb313af6..e5da4cb4148 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -68,12 +68,13 @@ static const std::vector labelsCutVarTrack = {"min_dcaxytoprimary", namespace hf_presel_pid { // default values for the PID cuts for protons in the track-index-skim-creator -constexpr float CutsPid[4][6] = {{0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}, +constexpr float CutsPid[5][6] = {{0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}, + {0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}, {0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}, {0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}, {0.f, 1000.f, 5.f, 0.f, 1000.f, 5.f}}; static const std::vector labelsCutsPid = {"minPtTpc", "maxPtTpc", "nSigmaMaxTpc", "minPtTof", "maxPtTof", "nSigmaMaxTof"}; -static const std::vector labelsRowsPid = {"ProtonInLcToPKPi", "ProtonInXicToPKPi", "ProtonInLcToPK0S", "KaonIn3Prongs"}; +static const std::vector labelsRowsPid = {"ProtonInLcToPKPi", "ProtonInXicToPKPi", "ProtonInLcToPK0S", "KaonIn3Prongs", "DeuteronInCdToDeKPi"}; } // namespace hf_presel_pid namespace hf_cuts_bdt_multiclass @@ -1516,6 +1517,53 @@ static const std::vector labelsPt = { static const std::vector labelsCutVar = {"max pKpi mass Lc", "max piKp mass Lc"}; } // namespace hf_cuts_sigmac_to_p_k_pi +namespace hf_cuts_cd_to_de_k_pi +{ +static constexpr int NBinsPt = 6; +static constexpr int NCutVars = 11; +static constexpr int NCutKfVars = 12; +// default values for the pT bin edges (can be used to configure histogram axis) +// offset by 1 from the bin numbers in cuts array +constexpr double BinsPt[NBinsPt + 1] = { + 0., + 2., + 4., + 6., + 8., + 12., + 24.}; +const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; + +// default values for the cuts m, ptP, ptK, ptPi, chi2PCA, dL, cosp, dLXY, NdLXY, ImpParXY, mass(Kpi) +constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 0 < pT < 2 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 2 < pT < 4 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 4 < pT < 6 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 6 < pT < 8 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 8 < pT < 12 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}}; /* 12 < pT < 24 */ + +// default value for the cuts Chi2Prim Chi2Geo DCA, cm Chi2Geo Chi2Topo +// P K Pi KPi PPi PK KPi PPi PK ↓ LdL ↓ +constexpr double CutsKf[NBinsPt][NCutKfVars] = {{3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 0 < pT < 2 */ + {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 2 < pT < 4 */ + {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 4 < pT < 6 */ + {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 6 < pT < 8 */ + {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 8 < pT < 12 */ + {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}}; /* 12 < pT < 24 */ + +// row labels +static const std::vector labelsPt = { + "pT bin 0", + "pT bin 1", + "pT bin 2", + "pT bin 3", + "pT bin 4", + "pT bin 5"}; + +// column labels +static const std::vector labelsCutVar = {"m", "pT De", "pT K", "pT Pi", "Chi2PCA", "decay length", "cos pointing angle", "decLengthXY", "normDecLXY", "impParXY", "mass (Kpi)"}; +} // namespace hf_cuts_cd_to_de_k_pi + } // namespace o2::analysis #endif // PWGHF_CORE_SELECTORCUTS_H_ diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index a60ab1d78ab..e84c579187c 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -9,85 +9,350 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +# Skimming + +o2physics_add_dpl_workflow(track-index-skim-creator + SOURCES trackIndexSkimCreator.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2::DCAFitter O2Physics::AnalysisCCDB O2Physics::MLCore O2Physics::EventFilteringUtils O2Physics::SGCutParHolder + COMPONENT_NAME Analysis) + +# Helpers + +o2physics_add_dpl_workflow(refit-pv-dummy + SOURCES refitPvDummy.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(pid-creator + SOURCES pidCreator.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(mc-pid-tof + SOURCES mcPidTof.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::TOFWorkflowUtils + COMPONENT_NAME Analysis) + # Candidate creators -o2physics_add_dpl_workflow(candidate-creator-b-to-jpsi-reduced - SOURCES candidateCreatorBToJpsiReduced.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore +o2physics_add_dpl_workflow(candidate-creator-2prong + SOURCES candidateCreator2Prong.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-b0-reduced - SOURCES candidateCreatorB0Reduced.cxx +o2physics_add_dpl_workflow(candidate-creator-3prong + SOURCES candidateCreator3Prong.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-b0 + SOURCES candidateCreatorB0.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-bplus-reduced - SOURCES candidateCreatorBplusReduced.cxx +o2physics_add_dpl_workflow(candidate-creator-bplus + SOURCES candidateCreatorBplus.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-bs-reduced - SOURCES candidateCreatorBsReduced.cxx +o2physics_add_dpl_workflow(candidate-creator-bs + SOURCES candidateCreatorBs.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-charm-reso-reduced - SOURCES candidateCreatorCharmResoReduced.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore +o2physics_add_dpl_workflow(candidate-creator-cascade + SOURCES candidateCreatorCascade.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-lb-reduced - SOURCES candidateCreatorLbReduced.cxx +o2physics_add_dpl_workflow(candidate-creator-dstar + SOURCES candidateCreatorDstar.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-lb + SOURCES candidateCreatorLb.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(candidate-creator-sigmac0plusplus + SOURCES candidateCreatorSigmac0plusplus.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-sigmac0plusplus-cascade + SOURCES candidateCreatorSigmac0plusplusCascade.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-xic0-omegac0 + SOURCES candidateCreatorXic0Omegac0.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils KFParticle::KFParticle + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-xic-to-xi-pi-pi + SOURCES candidateCreatorXicToXiPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-xicc + SOURCES candidateCreatorXicc.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-creator-mc-gen + SOURCES candidateCreatorMcGen.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # Candidate selectors -o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi-reduced - SOURCES candidateSelectorB0ToDPiReduced.cxx +o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi + SOURCES candidateSelectorB0ToDPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi-reduced - SOURCES candidateSelectorBplusToD0PiReduced.cxx +o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi + SOURCES candidateSelectorBplusToD0Pi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi-reduced - SOURCES candidateSelectorBsToDsPiReduced.cxx +o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi + SOURCES candidateSelectorBsToDsPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi-reduced - SOURCES candidateSelectorLbToLcPiReduced.cxx +o2physics_add_dpl_workflow(candidate-selector-d0 + SOURCES candidateSelectorD0.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -# Data creators +o2physics_add_dpl_workflow(candidate-selector-dplus-to-pi-k-pi + SOURCES candidateSelectorDplusToPiKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(data-creator-charm-had-pi-reduced - SOURCES dataCreatorCharmHadPiReduced.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils +o2physics_add_dpl_workflow(candidate-selector-ds-to-k-k-pi + SOURCES candidateSelectorDsToKKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(data-creator-charm-reso-reduced - SOURCES dataCreatorCharmResoReduced.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils +o2physics_add_dpl_workflow(candidate-selector-dstar-to-d0-pi + SOURCES candidateSelectorDstarToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(data-creator-jpsi-had-reduced - SOURCES dataCreatorJpsiHadReduced.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils +o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi + SOURCES candidateSelectorLbToLcPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -# Converters +o2physics_add_dpl_workflow(candidate-selector-lc + SOURCES candidateSelectorLc.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml - SOURCES converterReduced3ProngsMl.cxx +o2physics_add_dpl_workflow(candidate-selector-lc-pid-ml + SOURCES candidateSelectorLcPidMl.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-lc-to-k0s-p + SOURCES candidateSelectorLcToK0sP.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-ka + SOURCES candidateSelectorOmegac0ToOmegaKa.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(converter-reduced-hadron-daus-pid - SOURCES converterReducedHadronDausPid.cxx +o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-pi + SOURCES candidateSelectorOmegac0ToOmegaPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-omegac0-xic0-to-omega-ka + SOURCES candidateSelectorOmegac0Xic0ToOmegaKa.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-xic0-to-xi-pi-kf + SOURCES candidateSelectorXic0ToXiPiKf.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-to-xi-pi + SOURCES candidateSelectorToXiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-xic-to-p-k-pi + SOURCES candidateSelectorXicToPKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-xic-to-xi-pi-pi + SOURCES candidateSelectorXicToXiPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(candidate-selector-xicc-to-p-k-pi-pi + SOURCES candidateSelectorXiccToPKPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + + o2physics_add_dpl_workflow(candidate-selector-cd + SOURCES candidateSelectorCd.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +# Tree creators + +o2physics_add_dpl_workflow(tree-creator-b0-to-d-pi + SOURCES treeCreatorB0ToDPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-bplus-to-d0-pi + SOURCES treeCreatorBplusToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-bs-to-ds-pi + SOURCES treeCreatorBsToDsPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-d0-to-k-pi + SOURCES treeCreatorD0ToKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-dplus-to-pi-k-pi + SOURCES treeCreatorDplusToPiKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-ds-to-k-k-pi + SOURCES treeCreatorDsToKKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-lb-to-lc-pi + SOURCES treeCreatorLbToLcPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-lc-to-k0s-p + SOURCES treeCreatorLcToK0sP.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-lc-to-p-k-pi + SOURCES treeCreatorLcToPKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-sigmac-corr-bkg + SOURCES treeCreatorSigmacCorrBkg.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-omegac-st + SOURCES treeCreatorOmegacSt.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-omegac0-to-omega-ka + SOURCES treeCreatorOmegac0ToOmegaKa.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-omegac0-to-omega-pi + SOURCES treeCreatorOmegac0ToOmegaPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-to-xi-pi + SOURCES treeCreatorToXiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-xic0-to-xi-pi-kf + SOURCES treeCreatorXic0ToXiPiKf.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-xic-to-p-k-pi + SOURCES treeCreatorXicToPKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-xic-to-xi-pi-pi + SOURCES treeCreatorXicToXiPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-xicc-to-p-k-pi-pi + SOURCES treeCreatorXiccToPKPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-dstar-to-d0-pi + SOURCES treeCreatorDstarToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(tree-creator-tcc-to-d0-d0-pi + SOURCES treeCreatorTccToD0D0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) +# Derived-data creators + +o2physics_add_dpl_workflow(derived-data-creator-b0-to-d-pi + SOURCES derivedDataCreatorB0ToDPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-bplus-to-d0-pi + SOURCES derivedDataCreatorBplusToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-d0-to-k-pi + SOURCES derivedDataCreatorD0ToKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-dplus-to-pi-k-pi + SOURCES derivedDataCreatorDplusToPiKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-ds-to-k-k-pi + SOURCES derivedDataCreatorDsToKKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-dstar-to-d0-pi + SOURCES derivedDataCreatorDstarToD0Pi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-lc-to-p-k-pi + SOURCES derivedDataCreatorLcToPKPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(derived-data-creator-xic-to-xi-pi-pi + SOURCES derivedDataCreatorXicToXiPiPi.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +# Converters + +o2physics_add_dpl_workflow(converter-dstar-indices + SOURCES converterDstarIndices.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 3fb53720168..4ab01a6fc9f 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -148,3 +148,8 @@ o2physics_add_dpl_workflow(task-xic0-to-xi-pi SOURCES taskXic0ToXiPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(task-cd + SOURCES taskCd.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx new file mode 100644 index 00000000000..228884a8e4f --- /dev/null +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -0,0 +1,289 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file taskCd.cxx +/// \brief Cd± → d± K∓ π± analysis task +/// \author Biao Zhang , Heidelberg Universiity + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsEvSelHf.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/Centrality.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include // std::vector + +using namespace o2; +using namespace o2::analysis; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_centrality; +using namespace o2::hf_occupancy; +using namespace o2::hf_evsel; + +struct HfTaskCd { + Configurable selectionFlagCd{"selectionFlagCd", 1, "Selection Flag for Cd"}; + Configurable> binsPt{"binsPt", std::vector{hf_cuts_cd_to_de_k_pi::vecBinsPt}, "pT bin limits"}; + Configurable fillTHn{"fillTHn", false, "fill THn"}; + + HfHelper hfHelper; + SliceCache cache; + + using Collisions = soa::Join; + using CollisionsWithFT0C = soa::Join; + using CollisionsWithFT0M = soa::Join; + + using CdCandidates = soa::Filtered>; + + Filter filterSelectCandidates = aod::hf_sel_candidate_cd::isSelCdToDeKPi >= selectionFlagCd; + Preslice candCdPerCollision = aod::hf_cand::collisionId; + + ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {72, 0, 36}, ""}; + ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {400, 2.4, 4.4}, ""}; + ConfigurableAxis thnConfigAxisPtProng{"thnConfigAxisPtProng", {100, 0, 20}, ""}; + ConfigurableAxis thnConfigAxisChi2PCA{"thnConfigAxisChi2PCA", {100, 0, 20}, ""}; + ConfigurableAxis thnConfigAxisDecLength{"thnConfigAxisDecLength", {10, 0, 0.05}, ""}; + ConfigurableAxis thnConfigAxisCPA{"thnConfigAxisCPA", {20, 0.8, 1}, ""}; + ConfigurableAxis thnConfigAxisCentrality{"thnConfigAxisCentrality", {100, 0, 100}, ""}; + + HistogramRegistry registry{ + "registry", + {/// mass candidate + {"Data/hMass", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{400, 2.4, 4.4}}}}, + /// pT + {"Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, + {"Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, + {"Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, + {"Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, + /// DCAxy to prim. vertex prongs + {"Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, + {"Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, + {"Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, + /// decay length candidate + {"Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, + /// decay length xy candidate + {"Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, + /// cosine of pointing angle + {"Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, + /// cosine of pointing angle xy + {"Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, + /// Chi 2 PCA to sec. vertex + {"Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}}, + /// eta + {"Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, + /// phi + {"Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}}}; + + HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext&) + { + std::array doprocess{doprocessDataStd, doprocessDataStdWithFT0C, doprocessDataStdWithFT0M}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); + } + auto vbins = (std::vector)binsPt; + /// mass candidate + registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); + registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// DCAxy to prim. vertex prongs + registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// decay length candidate + registry.add("Data/hDecLengthVsPt", "3-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// decay length xy candidate + registry.add("Data/hDecLengthxyVsPt", "3-prong candidates;decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// cosine of pointing angle + registry.add("Data/hCPAVsPt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// cosine of pointing angle xy + registry.add("Data/hCPAxyVsPt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// Chi 2 PCA to sec. vertex + registry.add("Data/hDca2VsPt", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// eta + registry.add("Data/hEtaVsPt", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// phi + registry.add("Data/hPhiVsPt", "3-prong candidates;candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// selection status + registry.add("hSelectionStatus", "3-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + /// impact parameter error + registry.add("Data/hImpParErrProng0", "3-prong candidates;prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hImpParErrProng1", "3-prong candidates;prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hImpParErrProng2", "3-prong candidates;prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + + if (fillTHn) { + const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (de K #pi) (GeV/#it{c}^{2})"}; + const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T}(C_{d}^{+}) (GeV/#it{c})"}; + const AxisSpec thnAxisPtProng0{thnConfigAxisPtProng, "#it{p}_{T}(prong0) (GeV/#it{c})"}; + const AxisSpec thnAxisPtProng1{thnConfigAxisPtProng, "#it{p}_{T}(prong1) (GeV/#it{c})"}; + const AxisSpec thnAxisPtProng2{thnConfigAxisPtProng, "#it{p}_{T}(prong2) (GeV/#it{c})"}; + const AxisSpec thnAxisChi2PCA{thnConfigAxisChi2PCA, "Chi2PCA to sec. vertex (cm)"}; + const AxisSpec thnAxisDecLength{thnConfigAxisDecLength, "decay length (cm)"}; + const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle"}; + const AxisSpec thnAxisCentrality{thnConfigAxisCentrality, "centrality (FT0C)"}; + + std::vector axesStd; + axesStd = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality}; + + registry.add("hnCdVars", "THn for Reconstructed Cd candidates for data", HistType::kTHnSparseF, axesStd); + } + } + + /// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table) + /// \param candidate is candidate + /// \return centrality/multiplicity percentile of the collision + template + float evaluateCentralityColl(const Coll& collision) + { + return o2::hf_centrality::getCentralityColl(collision); + } + + /// Fill histograms for real data + template + void fillHistosData(CollType const& collision, CandType const& candidates) + { + auto thisCollId = collision.globalIndex(); + auto groupedCdCandidates = candidates.sliceBy(candCdPerCollision, thisCollId); + auto numPvContributors = collision.numContrib(); + + for (const auto& candidate : groupedCdCandidates) { + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::CdToDeKPi)) { + continue; + } + + auto pt = candidate.pt(); + auto ptProng0 = candidate.ptProng0(); + auto ptProng1 = candidate.ptProng1(); + auto ptProng2 = candidate.ptProng2(); + auto decayLength = candidate.decayLength(); + auto decayLengthXY = candidate.decayLengthXY(); + auto chi2PCA = candidate.chi2PCA(); + auto cpa = candidate.cpa(); + auto cpaXY = candidate.cpaXY(); + + if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { + registry.fill(HIST("Data/hMass"), hfHelper.invMassCdToDeKPi(candidate)); + registry.fill(HIST("Data/hMassVsPtVsNPvContributors"), hfHelper.invMassCdToDeKPi(candidate), pt, numPvContributors); + registry.fill(HIST("Data/hMassVsPt"), hfHelper.invMassCdToDeKPi(candidate), pt); + } + if (candidate.isSelCdToPiKDe() >= selectionFlagCd) { + registry.fill(HIST("Data/hMass"), hfHelper.invMassCdToPiKDe(candidate)); + registry.fill(HIST("Data/hMassVsPtVsNPvContributors"), hfHelper.invMassCdToPiKDe(candidate), pt, numPvContributors); + registry.fill(HIST("Data/hMassVsPt"), hfHelper.invMassCdToPiKDe(candidate), pt); + } + registry.fill(HIST("Data/hPt"), pt); + registry.fill(HIST("Data/hPtProng0"), ptProng0); + registry.fill(HIST("Data/hPtProng1"), ptProng1); + registry.fill(HIST("Data/hPtProng2"), ptProng2); + registry.fill(HIST("Data/hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("Data/hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("Data/hd0Prong2"), candidate.impactParameter2()); + registry.fill(HIST("Data/hd0VsPtProng0"), candidate.impactParameter0(), pt); + registry.fill(HIST("Data/hd0VsPtProng1"), candidate.impactParameter1(), pt); + registry.fill(HIST("Data/hd0VsPtProng2"), candidate.impactParameter2(), pt); + registry.fill(HIST("Data/hDecLength"), decayLength); + registry.fill(HIST("Data/hDecLengthVsPt"), decayLength, pt); + registry.fill(HIST("Data/hDecLengthxy"), decayLengthXY); + registry.fill(HIST("Data/hDecLengthxyVsPt"), decayLengthXY, pt); + registry.fill(HIST("Data/hCPA"), cpa); + registry.fill(HIST("Data/hCPAVsPt"), cpa, pt); + registry.fill(HIST("Data/hCPAxy"), cpaXY); + registry.fill(HIST("Data/hCPAxyVsPt"), cpaXY, pt); + registry.fill(HIST("Data/hDca2"), chi2PCA); + registry.fill(HIST("Data/hDca2VsPt"), chi2PCA, pt); + registry.fill(HIST("Data/hEta"), candidate.eta()); + registry.fill(HIST("Data/hEtaVsPt"), candidate.eta(), pt); + registry.fill(HIST("Data/hPhi"), candidate.phi()); + registry.fill(HIST("Data/hPhiVsPt"), candidate.phi(), pt); + registry.fill(HIST("hSelectionStatus"), candidate.isSelCdToDeKPi(), pt); + registry.fill(HIST("hSelectionStatus"), candidate.isSelCdToPiKDe(), pt); + registry.fill(HIST("Data/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); + + if (fillTHn) { + float const cent = evaluateCentralityColl(collision); + double massCd(-1); + if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { + massCd = hfHelper.invMassCdToDeKPi(candidate); + std::vector valuesToFill{massCd, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, cent}; + registry.get(HIST("hnCdVars"))->Fill(valuesToFill.data()); + } + if (candidate.isSelCdToPiKDe() >= selectionFlagCd) { + massCd = hfHelper.invMassCdToPiKDe(candidate); + std::vector valuesToFill{massCd, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, cent}; + registry.get(HIST("hnCdVars"))->Fill(valuesToFill.data()); + } + } + } + } + /// Run the analysis on real data + template + void runAnalysisPerCollisionData(CollType const& collisions, + CandType const& candidates) + { + + for (const auto& collision : collisions) { + fillHistosData(collision, candidates); + } + } + + void processDataStd(Collisions const& collisions, + CdCandidates const& selectedCdCandidates, + aod::Tracks const&) + { + runAnalysisPerCollisionData(collisions, selectedCdCandidates); + } + PROCESS_SWITCH(HfTaskCd, processDataStd, "Process Data with the standard method", true); + + void processDataStdWithFT0C(CollisionsWithFT0C const& collisions, + CdCandidates const& selectedCdCandidates, + aod::Tracks const&) + { + runAnalysisPerCollisionData(collisions, selectedCdCandidates); + } + PROCESS_SWITCH(HfTaskCd, processDataStdWithFT0C, "Process real data with the standard method and with FT0C centrality", false); + + void processDataStdWithFT0M(CollisionsWithFT0M const& collisions, + CdCandidates const& selectedCdCandidates, + aod::Tracks const&) + { + runAnalysisPerCollisionData(collisions, selectedCdCandidates); + } + PROCESS_SWITCH(HfTaskCd, processDataStdWithFT0M, "Process real data with the standard method and with FT0M centrality", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 37c96d5627a..5c24594a2ba 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -58,12 +58,14 @@ using TracksPidMu = soa::Join; using TracksPidPi = soa::Join; using TracksPidKa = soa::Join; using TracksPidPr = soa::Join; +using TracksPidDe = soa::Join; using TracksPidTinyEl = soa::Join; using TracksPidTinyMu = soa::Join; using TracksPidTinyPi = soa::Join; using TracksPidTinyKa = soa::Join; using TracksPidTinyPr = soa::Join; +using TracksPidTinyDe = soa::Join; // namespace pid_tpc_tof_utils // { @@ -156,6 +158,7 @@ DECLARE_SOA_COLUMN(TpcTofNSigmaMu, tpcTofNSigmaMu, float); //! Combined NSigma s DECLARE_SOA_COLUMN(TpcTofNSigmaPi, tpcTofNSigmaPi, float); //! Combined NSigma separation with the TPC & TOF detectors for pion DECLARE_SOA_COLUMN(TpcTofNSigmaKa, tpcTofNSigmaKa, float); //! Combined NSigma separation with the TPC & TOF detectors for kaon DECLARE_SOA_COLUMN(TpcTofNSigmaPr, tpcTofNSigmaPr, float); //! Combined NSigma separation with the TPC & TOF detectors for proton +DECLARE_SOA_COLUMN(TpcTofNSigmaDe, tpcTofNSigmaDe, float); //! Combined NSigma separation with the TPC & TOF detectors for deuteron } // namespace pid_tpc_tof_static_full namespace pid_tpc_tof_static_tiny @@ -166,6 +169,7 @@ DECLARE_SOA_COLUMN(TpcTofNSigmaMu, tpcTofNSigmaMu, float); //! Combined NSigma s DECLARE_SOA_COLUMN(TpcTofNSigmaPi, tpcTofNSigmaPi, float); //! Combined NSigma separation with the TPC & TOF detectors for pion DECLARE_SOA_COLUMN(TpcTofNSigmaKa, tpcTofNSigmaKa, float); //! Combined NSigma separation with the TPC & TOF detectors for kaon DECLARE_SOA_COLUMN(TpcTofNSigmaPr, tpcTofNSigmaPr, float); //! Combined NSigma separation with the TPC & TOF detectors for proton +DECLARE_SOA_COLUMN(TpcTofNSigmaDe, tpcTofNSigmaDe, float); //! Combined NSigma separation with the TPC & TOF detectors for deuteron } // namespace pid_tpc_tof_static_tiny // Extension of per particle tables @@ -179,6 +183,8 @@ 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 + pid_tpc_tof_static_full::TpcTofNSigmaDe); // Extension of per particle tables DECLARE_SOA_TABLE(PidTpcTofTinyEl, "AOD", "PIDTPCTOFTINYEL", //! Table of the TPC & TOF Combined NSigma for electron @@ -191,6 +197,8 @@ DECLARE_SOA_TABLE(PidTpcTofTinyKa, "AOD", "PIDTPCTOFTINYKA", //! Table of the TP pid_tpc_tof_static_tiny::TpcTofNSigmaKa); DECLARE_SOA_TABLE(PidTpcTofTinyPr, "AOD", "PIDTPCTOFTINYPR", //! Table of the TPC & TOF Combined NSigma for proton 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); namespace hf_sel_collision { @@ -517,6 +525,9 @@ DECLARE_SOA_COLUMN(NSigTpcKa2, nSigTpcKa2, float); //! TPC nSigma for DECLARE_SOA_COLUMN(NSigTpcPr0, nSigTpcPr0, float); //! TPC nSigma for proton hypothesis - prong 0 DECLARE_SOA_COLUMN(NSigTpcPr1, nSigTpcPr1, float); //! TPC nSigma for proton hypothesis - prong 1 DECLARE_SOA_COLUMN(NSigTpcPr2, nSigTpcPr2, float); //! TPC nSigma for proton hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTpcDe0, nSigTpcDe0, float); //! TPC nSigma for deuteron hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTpcDe1, nSigTpcDe1, float); //! TPC nSigma for deuteron hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTpcDe2, nSigTpcDe2, float); //! TPC nSigma for deuteron 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 @@ -526,6 +537,9 @@ DECLARE_SOA_COLUMN(NSigTofKa2, nSigTofKa2, float); //! TOF nSigma for DECLARE_SOA_COLUMN(NSigTofPr0, nSigTofPr0, float); //! TOF nSigma for proton hypothesis - prong 0 DECLARE_SOA_COLUMN(NSigTofPr1, nSigTofPr1, float); //! TOF nSigma for proton hypothesis - prong 1 DECLARE_SOA_COLUMN(NSigTofPr2, nSigTofPr2, float); //! TOF nSigma for proton hypothesis - prong 2 +DECLARE_SOA_COLUMN(NSigTofDe0, nSigTofDe0, float); //! TOF nSigma for deuteron hypothesis - prong 0 +DECLARE_SOA_COLUMN(NSigTofDe1, nSigTofDe1, float); //! TOF nSigma for deuteron hypothesis - prong 1 +DECLARE_SOA_COLUMN(NSigTofDe2, nSigTofDe2, float); //! TOF nSigma for deuteron 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 @@ -544,6 +558,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPr1, tpcTofNSigmaPr1, //! Combined NSigma [](float tpcNSigmaPr1, float tofNSigmaPr1) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPr1, tofNSigmaPr1); }); DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaPr2, tpcTofNSigmaPr2, //! Combined NSigma separation with the TPC & TOF detectors for proton - prong 2 [](float tpcNSigmaPr2, float tofNSigmaPr2) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPr2, tofNSigmaPr2); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaDe0, tpcTofNSigmaDe0, //! Combined NSigma separation with the TPC & TOF detectors for deuteron - prong 0 + [](float tpcNSigmaDe0, float tofNSigmaDe0) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaDe0, tofNSigmaDe0); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaDe1, tpcTofNSigmaDe1, //! Combined NSigma separation with the TPC & TOF detectors for deuteron - prong 1 + [](float tpcNSigmaDe1, float tofNSigmaDe1) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaDe1, tofNSigmaDe1); }); +DECLARE_SOA_DYNAMIC_COLUMN(TpcTofNSigmaDe2, tpcTofNSigmaDe2, //! Combined NSigma separation with the TPC & TOF detectors for deuteron - prong 2 + [](float tpcNSigmaDe2, float tofNSigmaDe2) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaDe2, tofNSigmaDe2); }); + // 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); }); @@ -980,6 +1001,7 @@ enum DecayType { DplusToPiKPi = 0, LcToPKPi, DsToKKPi, XicToPKPi, + CdToDeKPi, N3ProngDecays }; // always keep N3ProngDecays at the end // Ds± → K± K∓ π± or D± → K± K∓ π± @@ -1099,10 +1121,20 @@ DECLARE_SOA_TABLE(HfCand3Prong1PidPr, "AOD", "HFCAND3P1PIDPR", //! DECLARE_SOA_TABLE(HfCand3Prong2PidPr, "AOD", "HFCAND3P2PIDPR", //! hf_cand::NSigTpcPr2, hf_cand::NSigTofPr2, hf_cand::TpcTofNSigmaPr2); +DECLARE_SOA_TABLE(HfCand3Prong0PidDe, "AOD", "HFCAND3P0PIDDE", //! + hf_cand::NSigTpcDe0, hf_cand::NSigTofDe0, + hf_cand::TpcTofNSigmaDe0); +DECLARE_SOA_TABLE(HfCand3Prong1PidDe, "AOD", "HFCAND3P1PIDDE", //! + hf_cand::NSigTpcDe1, hf_cand::NSigTofDe1, + hf_cand::TpcTofNSigmaDe1); +DECLARE_SOA_TABLE(HfCand3Prong2PidDe, "AOD", "HFCAND3P2PIDDE", //! + hf_cand::NSigTpcDe2, hf_cand::NSigTofDe2, + hf_cand::TpcTofNSigmaDe2); using HfCand3Prong = HfCand3ProngExt; using HfCand3ProngWPidPiKaPr = soa::Join; using HfCand3ProngWPidPiKa = soa::Join; +using HfCand3ProngWPidPiKaDe = soa::Join; DECLARE_SOA_TABLE(HfCand3ProngKF, "AOD", "HFCAND3PKF", hf_cand_3prong::KfXError, hf_cand_3prong::KfYError, hf_cand_3prong::KfZError, diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 125b0fb7286..90ffd6ada32 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -164,6 +164,14 @@ DECLARE_SOA_TABLE(HfSelLc, "AOD", "HFSELLC", //! DECLARE_SOA_TABLE(HfMlLcToPKPi, "AOD", "HFMLLc", //! hf_sel_candidate_lc::MlProbLcToPKPi, hf_sel_candidate_lc::MlProbLcToPiKP); +namespace hf_sel_candidate_cd +{ +DECLARE_SOA_COLUMN(IsSelCdToDeKPi, isSelCdToDeKPi, int); //! +DECLARE_SOA_COLUMN(IsSelCdToPiKDe, isSelCdToPiKDe, int); //! +} // namespace hf_sel_candidate_cd +DECLARE_SOA_TABLE(HfSelCd, "AOD", "HFSELCD", //! + hf_sel_candidate_cd::IsSelCdToDeKPi, hf_sel_candidate_cd::IsSelCdToPiKDe); + namespace hf_sel_candidate_lc_alice3 { DECLARE_SOA_COLUMN(IsSelLcToPKPiNoPid, isSelLcToPKPiNoPid, int); //! diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 0bf6c47fc91..e8138776382 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -94,12 +94,15 @@ struct HfCandidateCreator3Prong { Produces rowProng0PidPi; Produces rowProng0PidKa; Produces rowProng0PidPr; + Produces rowProng0PidDe; Produces rowProng1PidPi; Produces rowProng1PidKa; Produces rowProng1PidPr; + Produces rowProng1PidDe; Produces rowProng2PidPi; Produces rowProng2PidKa; Produces rowProng2PidPr; + Produces rowProng2PidDe; // vertexing Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; @@ -120,6 +123,7 @@ 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"}; // 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"}; @@ -136,10 +140,10 @@ struct HfCandidateCreator3Prong { using FilteredHf3Prongs = soa::Filtered; using FilteredPvRefitHf3Prongs = soa::Filtered>; - using TracksWCovExtraPidPiKaPr = 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)); + 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)); std::shared_ptr hCandidates; HistogramRegistry registry{"registry"}; @@ -181,13 +185,13 @@ 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}; + std::array creationFlags = {createDplus, createDs, createLc, createXic, createCd}; if (std::accumulate(creationFlags.begin(), creationFlags.end(), 0) == 0) { LOGP(fatal, "At least one particle specie should be enabled for the creation."); } - if (createLc && createXic && applyInvMassConstraint) { - LOGP(fatal, "Unable to apply invariant mass constraint due to ambiguity of mass hypothesis: only one of Lc and Xic can be reconstructed."); + if (createLc && createXic && createCd && applyInvMassConstraint) { + LOGP(fatal, "Unable to apply invariant mass constraint due to ambiguity of mass hypothesis: only one of Lc and Xic and Cd can be reconstructed."); } // histograms @@ -248,12 +252,17 @@ struct HfCandidateCreator3Prong { fillProngPid(track1, rowProng1PidPr); fillProngPid(track2, rowProng2PidPr); } + if (createCd) { + fillProngPid(track0, rowProng0PidDe); + fillProngPid(track1, rowProng1PidDe); + fillProngPid(track2, rowProng2PidDe); + } } template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPr const&, + TracksWCovExtraPidPiKaPrDe const&, BCsType const& bcs) { // loop over triplets of track indices @@ -273,9 +282,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); @@ -426,7 +435,7 @@ struct HfCandidateCreator3Prong { template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPr const&, + TracksWCovExtraPidPiKaPrDe const&, BCsType const& bcs) { for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { @@ -444,9 +453,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, @@ -675,7 +684,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -685,7 +694,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -695,7 +704,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -705,7 +714,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -721,7 +730,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -731,7 +740,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -741,7 +750,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -751,7 +760,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -767,7 +776,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -777,7 +786,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -787,7 +796,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -797,7 +806,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); @@ -813,7 +822,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -827,7 +836,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -841,7 +850,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, @@ -855,7 +864,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, - TracksWCovExtraPidPiKaPr const& tracks, + TracksWCovExtraPidPiKaPrDe const& tracks, aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, diff --git a/PWGHF/TableProducer/candidateSelectorCd.cxx b/PWGHF/TableProducer/candidateSelectorCd.cxx new file mode 100644 index 00000000000..d38768d2273 --- /dev/null +++ b/PWGHF/TableProducer/candidateSelectorCd.cxx @@ -0,0 +1,384 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file candidateSelectorCd.cxx +/// \brief Cd± → d± K∓ π± selection task +/// +/// \author Biao Zhang , Heidelberg Universiity + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + +#include "Common/Core/TrackSelectorPID.h" +#include "Common/DataModel/PIDResponseCombined.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::analysis; +using namespace o2::framework; + +/// Struct for applying Cd selection cuts +struct HfCandidateSelectorCd { + Produces hfSelCdCandidate; + + Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + Configurable ptCandMax{"ptCandMax", 36., "Upper bound of candidate pT"}; + Configurable usePid{"usePid", true, "Bool to use or not the PID based on nSigma cut at filtering level"}; + // TPC PID + Configurable ptPidTpcMin{"ptPidTpcMin", 0.1, "Lower bound of track pT for TPC PID"}; + Configurable ptPidTpcMax{"ptPidTpcMax", 1., "Upper bound of track pT for TPC PID"}; + Configurable nSigmaTpcMax{"nSigmaTpcMax", 3., "Nsigma cut on TPC only"}; + Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; + // TOF PID + Configurable ptPidTofMin{"ptPidTofMin", 0.5, "Lower bound of track pT for TOF PID"}; + Configurable ptPidTofMax{"ptPidTofMax", 2.5, "Upper bound of track pT for TOF PID"}; + Configurable nSigmaTofMax{"nSigmaTofMax", 3., "Nsigma cut on TOF only"}; + Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; + // Combined PID options + Configurable usePidTpcAndTof{"usePidTpcAndTof", false, "Bool to decide how to combine TPC and TOF PID: true = both (if present, only one otherwise); false = one is enough"}; + // TPC quality track cuts + Configurable tpcNClustersFoundMin{"tpcNClustersFoundMin", 0, "min number of found TPC clusters"}; + Configurable tpcNCrossedRowsMin{"tpcNCrossedRowsMin", 0, "min number of crossed rows in TPC"}; + Configurable tpcNCrossedRowsOverFindableClustersMin{"tpcNCrossedRowsOverFindableClustersMin", 0., "min ratio crossed rows / findable clusters"}; + Configurable tpcChi2PerClusterMax{"tpcChi2PerClusterMax", 1e10f, "max tpc fit chi2 per TPC cluster"}; + // ITS quality track cuts + Configurable itsNClustersFoundMin{"itsNClustersFoundMin", 0, "min. number of found ITS clusters"}; + Configurable itsChi2PerClusterMax{"itsChi2PerClusterMax", 1e10f, "max its fit chi2 per ITS cluster"}; + // DCA track cuts + Configurable> binsPtTrack{"binsPtTrack", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for DCA XY/Z pT-dependent cut"}; + Configurable> cutsSingleTrack{"cutsSingleTrack", {hf_cuts_single_track::CutsTrack[0], hf_cuts_single_track::NBinsPtTrack, hf_cuts_single_track::NCutVarsTrack, hf_cuts_single_track::labelsPtTrack, hf_cuts_single_track::labelsCutVarTrack}, "Single-track selections"}; + // topological cuts + Configurable> binsPt{"binsPt", std::vector{hf_cuts_cd_to_de_k_pi::vecBinsPt}, "pT bin limits"}; + Configurable> cuts{"cuts", {hf_cuts_cd_to_de_k_pi::Cuts[0], hf_cuts_cd_to_de_k_pi::NBinsPt, hf_cuts_cd_to_de_k_pi::NCutVars, hf_cuts_cd_to_de_k_pi::labelsPt, hf_cuts_cd_to_de_k_pi::labelsCutVar}, "Cd candidate selection per pT bin"}; + // QA switch + Configurable activateQA{"activateQA", false, "Flag to enable QA histogram"}; + + HfHelper hfHelper; + + TrackSelectorPi selectorPion; + TrackSelectorKa selectorKaon; + TrackSelectorDe selectorDeuteron; + + const float massCharmDeuteron = 3.23; // possible mass + + using TracksSel = soa::Join; + + HistogramRegistry registry{"registry"}; + + void init(InitContext const&) + { + + selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); + selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); + selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); + selectorPion.setRangePtTof(ptPidTofMin, ptPidTofMax); + selectorPion.setRangeNSigmaTof(-nSigmaTofMax, nSigmaTofMax); + selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedMax, nSigmaTofCombinedMax); + selectorKaon = selectorPion; + selectorDeuteron = selectorPion; + + if (activateQA) { + constexpr int kNBinsSelections = aod::SelectionStep::NSelectionSteps; + std::string labels[kNBinsSelections]; + labels[0] = "No selection"; + labels[1 + aod::SelectionStep::RecoSkims] = "Skims selection"; + labels[1 + aod::SelectionStep::RecoTopol] = "Skims & Topological selections"; + labels[1 + aod::SelectionStep::RecoPID] = "Skims & Topological & PID selections"; + static const AxisSpec axisSelections = {kNBinsSelections, 0.5, kNBinsSelections + 0.5, ""}; + registry.add("hSelections", "Selections;;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisSelections, {(std::vector)binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + for (int iBin = 0; iBin < kNBinsSelections; ++iBin) { + registry.get(HIST("hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } + } + } + + /// Single track quality cuts + /// \param track is track + /// \return true if track passes all cuts + template + bool isSelectedCandidateProngQuality(const T& trackPos1, const T& trackNeg, const T& trackPos2) + { + if (!isSelectedTrackTpcQuality(trackPos1, tpcNClustersFoundMin.value, tpcNCrossedRowsMin.value, tpcNCrossedRowsOverFindableClustersMin.value, tpcChi2PerClusterMax.value) || + !isSelectedTrackTpcQuality(trackNeg, tpcNClustersFoundMin.value, tpcNCrossedRowsMin.value, tpcNCrossedRowsOverFindableClustersMin.value, tpcChi2PerClusterMax.value) || + !isSelectedTrackTpcQuality(trackPos2, tpcNClustersFoundMin.value, tpcNCrossedRowsMin.value, tpcNCrossedRowsOverFindableClustersMin.value, tpcChi2PerClusterMax.value)) { + return false; + } + if (!isSelectedTrackItsQuality(trackPos1, itsNClustersFoundMin.value, itsChi2PerClusterMax.value) || + !isSelectedTrackItsQuality(trackNeg, itsNClustersFoundMin.value, itsChi2PerClusterMax.value) || + !isSelectedTrackItsQuality(trackPos2, itsNClustersFoundMin.value, itsChi2PerClusterMax.value)) { + return false; + } + return true; + } + + /// Conjugate-independent topological cuts + /// \param candidate is candidate + /// \return true if candidate passes all cuts + template + bool selectionTopol(const T& candidate) + { + auto candpT = candidate.pt(); + + int const pTBin = findBin(binsPt, candpT); + if (pTBin == -1) { + return false; + } + + // check that the candidate pT is within the analysis range + if (candpT < ptCandMin || candpT >= ptCandMax) { + return false; + } + + // cosine of pointing angle + if (candidate.cpa() <= cuts->get(pTBin, "cos pointing angle")) { + return false; + } + + // candidate chi2PCA + if (candidate.chi2PCA() > cuts->get(pTBin, "Chi2PCA")) { + return false; + } + + if (candidate.decayLength() <= cuts->get(pTBin, "decay length")) { + return false; + } + + // candidate decay length XY + if (candidate.decayLengthXY() <= cuts->get(pTBin, "decLengthXY")) { + return false; + } + + // candidate normalized decay length XY + if (candidate.decayLengthXYNormalised() < cuts->get(pTBin, "normDecLXY")) { + return false; + } + + // candidate impact parameter XY + if (std::abs(candidate.impactParameterXY()) > cuts->get(pTBin, "impParXY")) { + return false; + } + + if (!isSelectedCandidateProngDca(candidate)) { + return false; + } + + return true; + } + + /// Conjugate-dependent topological cuts + /// \param candidate is candidate + /// \param trackDeuteron is the track with the deuteron hypothesis + /// \param trackPion is the track with the pion hypothesis + /// \param trackKaon is the track with the kaon hypothesis + /// \return true if candidate passes all cuts for the given Conjugate + template + bool selectionTopolConjugate(const T1& candidate, const T2& trackDeuteron, const T2& trackKaon, const T2& trackPion) + { + + auto candpT = candidate.pt(); + int const pTBin = findBin(binsPt, candpT); + if (pTBin == -1) { + return false; + } + + // cut on daughter pT + if (trackDeuteron.pt() < cuts->get(pTBin, "pT De") || trackKaon.pt() < cuts->get(pTBin, "pT K") || trackPion.pt() < cuts->get(pTBin, "pT Pi")) { + return false; + } + + float massCd{0.f}; + if (trackDeuteron.globalIndex() == candidate.prong0Id()) { + massCd = hfHelper.invMassCdToDeKPi(candidate); + } else { + massCd = hfHelper.invMassCdToPiKDe(candidate); + } + + // cut on Cd->deKpi, piKde mass values + if (std::abs(massCd - massCharmDeuteron) > cuts->get(pTBin, "m")) { + return false; + } + + return true; + } + + /// Single-track dca_xy and dca_z cuts + /// \param candidate is the Cd candidate + /// \return true if all the prongs pass the selections + template + bool isSelectedCandidateProngDca(const T1& candidate) + { + return (isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng0(), candidate.impactParameter0(), candidate.impactParameterZ0()) && + isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng1(), candidate.impactParameter1(), candidate.impactParameterZ1()) && + isSelectedTrackDca(binsPtTrack, cutsSingleTrack, candidate.ptProng2(), candidate.impactParameter2(), candidate.impactParameterZ2())); + } + + /// Apply PID selection + /// \param pidTrackDeuteron is the PID status of deuteron candidate track + /// \param pidTrackKaon is the PID status of kaon candidate track + /// \param pidTrackPion is the PID status of pion candidate track + /// \return true if prongs pass all selections + bool isSelectedPID(const TrackSelectorPID::Status pidTrackDeuteron, const TrackSelectorPID::Status pidTrackKaon, const TrackSelectorPID::Status pidTrackPion) + { + return pidTrackDeuteron != TrackSelectorPID::Rejected && + pidTrackKaon != TrackSelectorPID::Rejected && + pidTrackPion != TrackSelectorPID::Rejected; + } + + /// \brief function to apply Cd selections + /// \param reconstructionType is the reconstruction type (DCAFitterN ) + /// \param candidates Cd candidate table + /// \param tracks track table + template + void runSelectCd(CandType const& candidates, TTracks const&) + { + // looping over 3-prong candidates + for (const auto& candidate : candidates) { + + // final selection flag + auto statusCdToDeKPi = 0; + auto statusCdToPiKDe = 0; + + auto ptCand = candidate.pt(); + + if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::CdToDeKPi)) { + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + if (activateQA) { + registry.fill(HIST("hSelections"), 1, ptCand); + } + continue; + } + + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + aod::SelectionStep::RecoSkims, ptCand); + } + + auto trackPos1 = candidate.template prong0_as(); // positive daughter (negative for the antiparticles) + auto trackNeg = candidate.template prong1_as(); // negative daughter (positive for the antiparticles) + auto trackPos2 = candidate.template prong2_as(); // positive daughter (negative for the antiparticles) + + // implement filter bit 4 cut - should be done before this task at the track selection level + + // track quality selection + bool const trackQualitySel = isSelectedCandidateProngQuality(trackPos1, trackNeg, trackPos2); + if (!trackQualitySel) { + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + continue; + } + + // conjugate-independent topological selection + if (!selectionTopol(candidate)) { + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + continue; + } + + // conjugate-dependent topological selection for Cd + bool const topolCdToDeKPi = selectionTopolConjugate(candidate, trackPos1, trackNeg, trackPos2); + bool const topolCdToPiKDe = selectionTopolConjugate(candidate, trackPos2, trackNeg, trackPos1); + + if (!topolCdToDeKPi && !topolCdToPiKDe) { + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + continue; + } + + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + aod::SelectionStep::RecoTopol, candidate.pt()); + } + + // PID not applied, accepted by default + auto pidCdToDeKPi = 1; + auto pidCdToPiKDe = 1; + + if (usePid) { + // track-level PID selection + TrackSelectorPID::Status pidTrackPos1Deuteron; + TrackSelectorPID::Status pidTrackPos2Deuteron; + TrackSelectorPID::Status pidTrackPos1Pion; + TrackSelectorPID::Status pidTrackPos2Pion; + TrackSelectorPID::Status pidTrackNegKaon; + if (usePidTpcAndTof) { + pidTrackPos1Deuteron = selectorDeuteron.statusTpcAndTof(trackPos1, candidate.nSigTpcDe0(), candidate.nSigTofDe0()); + pidTrackPos2Deuteron = selectorDeuteron.statusTpcAndTof(trackPos2, candidate.nSigTpcDe2(), candidate.nSigTofDe2()); + pidTrackPos1Pion = selectorPion.statusTpcAndTof(trackPos1, candidate.nSigTpcPi0(), candidate.nSigTofPi0()); + pidTrackPos2Pion = selectorPion.statusTpcAndTof(trackPos2, candidate.nSigTpcPi2(), candidate.nSigTofPi2()); + pidTrackNegKaon = selectorKaon.statusTpcAndTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); + } else { + pidTrackPos1Deuteron = selectorDeuteron.statusTpcOrTof(trackPos1, candidate.nSigTpcDe0(), candidate.nSigTofDe0()); + pidTrackPos2Deuteron = selectorDeuteron.statusTpcOrTof(trackPos2, candidate.nSigTpcDe2(), candidate.nSigTofDe2()); + pidTrackPos1Pion = selectorPion.statusTpcOrTof(trackPos1, candidate.nSigTpcPi0(), candidate.nSigTofPi0()); + pidTrackPos2Pion = selectorPion.statusTpcOrTof(trackPos2, candidate.nSigTpcPi2(), candidate.nSigTofPi2()); + pidTrackNegKaon = selectorKaon.statusTpcOrTof(trackNeg, candidate.nSigTpcKa1(), candidate.nSigTofKa1()); + } + + if (!isSelectedPID(pidTrackPos1Deuteron, pidTrackNegKaon, pidTrackPos2Pion)) { + pidCdToDeKPi = 0; // reject CdToDeKPi + } + if (!isSelectedPID(pidTrackPos2Deuteron, pidTrackNegKaon, pidTrackPos1Pion)) { + pidCdToPiKDe = 0; // accept CdToPiKDe + } + } + + if (pidCdToDeKPi == 0 && pidCdToPiKDe == 0) { + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + continue; + } + + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + aod::SelectionStep::RecoPID, candidate.pt()); + } + + if (pidCdToDeKPi == 1 && topolCdToDeKPi && trackQualitySel) { + statusCdToDeKPi = 1; // identified as CdToDeKPi + } + if (pidCdToPiKDe == 1 && topolCdToPiKDe && trackQualitySel) { + statusCdToPiKDe = 1; // identified as CdToPiKDe + } + + hfSelCdCandidate(statusCdToDeKPi, statusCdToPiKDe); + } + } + + /// \brief process function with DCAFitterN + /// \param candidates Cd candidate table + /// \param tracks track table + void processCdWithDCAFitterN(aod::HfCand3ProngWPidPiKaDe const& candidates, + TracksSel const& tracks) + { + runSelectCd(candidates, tracks); + } + PROCESS_SWITCH(HfCandidateSelectorCd, processCdWithDCAFitterN, "Process Cd selection with DCAFitterN", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index e011b18cf9b..e914c4f1c38 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -44,6 +44,8 @@ struct HfPidCreator { Produces trackPidTinyKa; Produces trackPidFullPr; Produces trackPidTinyPr; + Produces trackPidFullDe; + Produces trackPidTinyDe; static constexpr float NSigmaToleranceDefault = .1f; static constexpr float NSigmaDefault = -999.f + NSigmaToleranceDefault; // -999.f is the default value set in TPCPIDResponse.h and PIDTOF.h @@ -79,6 +81,8 @@ struct HfPidCreator { checkTableSwitch(initContext, "PidTpcTofTinyKa", doprocessTinyKa); checkTableSwitch(initContext, "PidTpcTofFullPr", doprocessFullPr); checkTableSwitch(initContext, "PidTpcTofTinyPr", doprocessTinyPr); + checkTableSwitch(initContext, "PidTpcTofFullDe", doprocessFullDe); + checkTableSwitch(initContext, "PidTpcTofTinyDe", doprocessTinyDe); } /// Function to combine TPC and TOF NSigma @@ -132,6 +136,7 @@ struct HfPidCreator { PROCESS_PID(Pi) PROCESS_PID(Ka) PROCESS_PID(Pr) + PROCESS_PID(De) #undef PROCESS_PID }; diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index f95eb86a58a..dd227a4cb4e 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -118,8 +118,10 @@ enum ChannelsProtonPid { LcToPK0S, NChannelsProtonPid }; + // kaon PID (opposite-sign track in 3-prong decays) constexpr int ChannelKaonPid = ChannelsProtonPid::NChannelsProtonPid; +constexpr int ChannelsDeuteronPid = ChannelsProtonPid::NChannelsProtonPid + 1; /// Event selection struct HfTrackIndexSkimCreatorTagSelCollisions { @@ -307,7 +309,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { Configurable useIsGlobalTrackWoDCAForSoftPion{"useIsGlobalTrackWoDCAForSoftPion", false, "check isGlobalTrackWoDCA status for soft pion tracks"}; Configurable useIsQualityTrackITSForSoftPion{"useIsQualityTrackITSForSoftPion", true, "check qualityTracksITS status for soft pion tracks"}; // proton PID, applied only if corresponding process function enabled - Configurable> selectionsPid{"selectionsPid", {hf_presel_pid::CutsPid[0], 4, 6, hf_presel_pid::labelsRowsPid, hf_presel_pid::labelsCutsPid}, "PID selections for proton / kaon applied if proper process function enabled"}; + Configurable> selectionsPid{"selectionsPid", {hf_presel_pid::CutsPid[0], 5, 6, hf_presel_pid::labelsRowsPid, hf_presel_pid::labelsCutsPid}, "PID selections for proton / kaon / deuteron applied if proper process function enabled"}; // CCDB Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable ccdbPathLut{"ccdbPathLut", "GLO/Param/MatLUT", "Path for LUT parametrization"}; @@ -324,9 +326,9 @@ struct HfTrackIndexSkimCreatorTagSelTracks { int runNumber{}; using TracksWithSelAndDca = soa::Join; - using TracksWithSelAndDcaAndPidTpc = soa::Join; - using TracksWithSelAndDcaAndPidTof = soa::Join; - using TracksWithSelAndDcaAndPidTpcTof = soa::Join; + using TracksWithSelAndDcaAndPidTpc = soa::Join; + using TracksWithSelAndDcaAndPidTof = soa::Join; + using TracksWithSelAndDcaAndPidTpcTof = soa::Join; Preslice perCol = aod::track::collisionId; Preslice trackIndicesPerCollision = aod::track_association::collisionId; @@ -338,6 +340,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { // proton PID, if enabled std::array selectorProton{}; TrackSelectorKa selectorKaon; + TrackSelectorDe selectorDeuteron; Partition pvContributors = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); Partition pvContributorsWithPidTpc = ((aod::track::flags & static_cast(aod::track::PVContributor)) == static_cast(aod::track::PVContributor)); @@ -460,6 +463,11 @@ struct HfTrackIndexSkimCreatorTagSelTracks { selectorKaon.setRangePtTof(config.selectionsPid->get(ChannelKaonPid, 3u), config.selectionsPid->get(ChannelKaonPid, 4u)); // 3u == "minPtTof, 4u == "maxPtTof" selectorKaon.setRangeNSigmaTpc(-config.selectionsPid->get(ChannelKaonPid, 2u), config.selectionsPid->get(ChannelKaonPid, 2u)); // 2u == "nSigmaMaxTpc" selectorKaon.setRangeNSigmaTof(-config.selectionsPid->get(ChannelKaonPid, 5u), config.selectionsPid->get(ChannelKaonPid, 5u)); // 5u == "nSigmaMaxTof" + + selectorDeuteron.setRangePtTpc(config.selectionsPid->get(ChannelsDeuteronPid, 0u), config.selectionsPid->get(ChannelsDeuteronPid, 1u)); // 0u == "minPtTpc", 1u == "maxPtTpc" + selectorDeuteron.setRangePtTof(config.selectionsPid->get(ChannelsDeuteronPid, 3u), config.selectionsPid->get(ChannelsDeuteronPid, 4u)); // 3u == "minPtTof, 4u == "maxPtTof" + selectorDeuteron.setRangeNSigmaTpc(-config.selectionsPid->get(ChannelsDeuteronPid, 2u), config.selectionsPid->get(ChannelsDeuteronPid, 2u)); // 2u == "nSigmaMaxTpc" + selectorDeuteron.setRangeNSigmaTof(-config.selectionsPid->get(ChannelsDeuteronPid, 5u), config.selectionsPid->get(ChannelsDeuteronPid, 5u)); // 5u == "nSigmaMaxTof" } /// PID track cuts (for proton only) @@ -468,13 +476,14 @@ struct HfTrackIndexSkimCreatorTagSelTracks { template uint8_t isSelectedPid(const T& hfTrack) { - std::array statusPid{TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted}; + std::array statusPid{TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted, TrackSelectorPID::Accepted}; if constexpr (PidStrategy == ProtonPidStrategy::PidTofOnly) { if (hfTrack.hasTOF()) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTof(hfTrack); } statusPid[ChannelKaonPid] = selectorKaon.statusTof(hfTrack); + statusPid[ChannelsDeuteronPid] = selectorDeuteron.statusTof(hfTrack); } } if constexpr (PidStrategy == ProtonPidStrategy::PidTpcOnly) { @@ -483,6 +492,7 @@ struct HfTrackIndexSkimCreatorTagSelTracks { statusPid[iChannel] = selectorProton[iChannel].statusTpc(hfTrack); } statusPid[ChannelKaonPid] = selectorKaon.statusTpc(hfTrack); + statusPid[ChannelsDeuteronPid] = selectorDeuteron.statusTpc(hfTrack); } } if constexpr (PidStrategy == ProtonPidStrategy::PidTpcOrTof) { @@ -490,16 +500,18 @@ struct HfTrackIndexSkimCreatorTagSelTracks { statusPid[iChannel] = selectorProton[iChannel].statusTpcOrTof(hfTrack); } statusPid[ChannelKaonPid] = selectorKaon.statusTpcOrTof(hfTrack); + statusPid[ChannelsDeuteronPid] = selectorDeuteron.statusTpcOrTof(hfTrack); } if constexpr (PidStrategy == ProtonPidStrategy::PidTpcAndTof) { for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid; ++iChannel) { statusPid[iChannel] = selectorProton[iChannel].statusTpcAndTof(hfTrack); } statusPid[ChannelKaonPid] = selectorKaon.statusTpcAndTof(hfTrack); + statusPid[ChannelsDeuteronPid] = selectorDeuteron.statusTpcAndTof(hfTrack); } - int8_t flag = BIT(ChannelsProtonPid::NChannelsProtonPid + 1) - 1; // all bits on (including the kaon one) - for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid + 1; ++iChannel) { + int8_t flag = BIT(ChannelsProtonPid::NChannelsProtonPid + 2) - 1; // all bits on (including the kaon one) + for (auto iChannel{0u}; iChannel < ChannelsProtonPid::NChannelsProtonPid + 2; ++iChannel) { if (statusPid[iChannel] == TrackSelectorPID::Rejected) { CLRBIT(flag, iChannel); } @@ -1232,6 +1244,10 @@ struct HfTrackIndexSkimCreator { // Xic+ cuts Configurable> binsPtXicToPKPi{"binsPtXicToPKPi", std::vector{hf_cuts_presel_3prong::vecBinsPt}, "pT bin limits for Xic->pKpi pT-dependent cuts"}; Configurable> cutsXicToPKPi{"cutsXicToPKPi", {hf_cuts_presel_3prong::Cuts[0], hf_cuts_presel_3prong::NBinsPt, hf_cuts_presel_3prong::NCutVars, hf_cuts_presel_3prong::labelsPt, hf_cuts_presel_3prong::labelsCutVar}, "Xic->pKpi selections per pT bin"}; + // Cd cuts + Configurable> binsPtCdToDeKPi{"binsPtCdToDeKPi", std::vector{hf_cuts_presel_3prong::vecBinsPt}, "pT bin limits for Cd->DeKpi pT-dependent cuts"}; + Configurable> cutsCdToDeKPi{"cutsCdToDeKPi", {hf_cuts_presel_3prong::Cuts[0], hf_cuts_presel_3prong::NBinsPt, hf_cuts_presel_3prong::NCutVars, hf_cuts_presel_3prong::labelsPt, hf_cuts_presel_3prong::labelsCutVar}, "Cd->deKpi selections per pT bin"}; + // D*+ cuts Configurable> binsPtDstarToD0Pi{"binsPtDstarToD0Pi", std::vector{hf_cuts_presel_dstar::vecBinsPt}, "pT bin limits for D*+->D0pi pT-dependent cuts"}; Configurable> cutsDstarToD0Pi{"cutsDstarToD0Pi", {hf_cuts_presel_dstar::Cuts[0], hf_cuts_presel_dstar::NBinsPt, hf_cuts_presel_dstar::NCutVars, hf_cuts_presel_dstar::labelsPt, hf_cuts_presel_dstar::labelsCutVar}, "D*+->D0pi selections per pT bin"}; @@ -1240,7 +1256,7 @@ struct HfTrackIndexSkimCreator { Configurable applyProtonPidForLcToPKPi{"applyProtonPidForLcToPKPi", false, "Apply proton PID for Lc->pKpi"}; Configurable applyProtonPidForXicToPKPi{"applyProtonPidForXicToPKPi", false, "Apply proton PID for Xic->pKpi"}; Configurable applyKaonPidIn3Prongs{"applyKaonPidIn3Prongs", false, "Apply kaon PID for opposite-sign track in 3-prong and D* decays"}; - + Configurable applyDeuteronPidForCdToDeKPi{"applyDeuteronPidForCdToDeKPi", false, "Require deuteron PID for Cd->deKpi"}; // ML models for triggers Configurable applyMlForHfFilters{"applyMlForHfFilters", false, "Flag to enable ML application for HF Filters"}; Configurable mlModelPathCCDB{"mlModelPathCCDB", "EventFiltering/PWGHF/BDTSmeared", "Path on CCDB of ML models for HF Filters"}; @@ -1267,11 +1283,11 @@ struct HfTrackIndexSkimCreator { // int nColls{0}; //can be added to run over limited collisions per file - for tesing purposes - static constexpr int kN2ProngDecays = hf_cand_2prong::DecayType::N2ProngDecays; // number of 2-prong hadron types - static constexpr int kN3ProngDecays = hf_cand_3prong::DecayType::N3ProngDecays; // number of 3-prong hadron types - static constexpr int kNCuts2Prong[kN2ProngDecays] = {hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars}; // how many different selections are made on 2-prongs - static constexpr int kNCuts3Prong[kN3ProngDecays] = {hf_cuts_presel_3prong::NCutVars, hf_cuts_presel_3prong::NCutVars + 1, hf_cuts_presel_ds::NCutVars, hf_cuts_presel_3prong::NCutVars + 1}; // how many different selections are made on 3-prongs (Lc and Xic have also PID potentially) - static constexpr int kNCutsDstar = 3; // how many different selections are made on Dstars + static constexpr int kN2ProngDecays = hf_cand_2prong::DecayType::N2ProngDecays; // number of 2-prong hadron types + static constexpr int kN3ProngDecays = hf_cand_3prong::DecayType::N3ProngDecays; // number of 3-prong hadron types + static constexpr int kNCuts2Prong[kN2ProngDecays] = {hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars, hf_cuts_presel_2prong::NCutVars}; // how many different selections are made on 2-prongs + static constexpr int kNCuts3Prong[kN3ProngDecays] = {hf_cuts_presel_3prong::NCutVars, hf_cuts_presel_3prong::NCutVars + 1, hf_cuts_presel_ds::NCutVars, hf_cuts_presel_3prong::NCutVars + 1, hf_cuts_presel_3prong::NCutVars + 1}; // how many different selections are made on 3-prongs (Lc and Xic have also PID potentially) + static constexpr int kNCutsDstar = 3; // how many different selections are made on Dstars std::array, 2>, kN2ProngDecays> arrMass2Prong{}; std::array, 2>, kN3ProngDecays> arrMass3Prong{}; // arrays of 2-prong and 3-prong cuts @@ -1339,12 +1355,15 @@ struct HfTrackIndexSkimCreator { arrMass3Prong[hf_cand_3prong::DecayType::XicToPKPi] = std::array{std::array{MassProton, MassKPlus, MassPiPlus}, std::array{MassPiPlus, MassKPlus, MassProton}}; + arrMass3Prong[hf_cand_3prong::DecayType::CdToDeKPi] = std::array{std::array{MassDeuteron, MassKPlus, MassPiPlus}, + std::array{MassPiPlus, MassKPlus, MassDeuteron}}; + // cuts for 2-prong decays retrieved by json. the order must be then one in hf_cand_2prong::DecayType cut2Prong = {config.cutsD0ToPiK, config.cutsJpsiToEE, config.cutsJpsiToMuMu}; binsPt2Prong = {config.binsPtD0ToPiK, config.binsPtJpsiToEE, config.binsPtJpsiToMuMu}; // cuts for 3-prong decays retrieved by json. the order must be then one in hf_cand_3prong::DecayType - cut3Prong = {config.cutsDplusToPiKPi, config.cutsLcToPKPi, config.cutsDsToKKPi, config.cutsXicToPKPi}; - binsPt3Prong = {config.binsPtDplusToPiKPi, config.binsPtLcToPKPi, config.binsPtDsToKKPi, config.binsPtXicToPKPi}; + cut3Prong = {config.cutsDplusToPiKPi, config.cutsLcToPKPi, config.cutsDsToKKPi, config.cutsXicToPKPi, config.cutsCdToDeKPi}; + binsPt3Prong = {config.binsPtDplusToPiKPi, config.binsPtLcToPKPi, config.binsPtDsToKKPi, config.binsPtXicToPKPi, config.binsPtCdToDeKPi}; df2.setPropagateToPCA(config.propagateToPCA); df2.setMaxR(config.maxR); @@ -1392,6 +1411,7 @@ struct HfTrackIndexSkimCreator { registry.add("hMassDsToKKPi", "D_{s}^{#plus} candidates;inv. mass (K K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); registry.add("hMassXicToPKPi", "#Xi_{c}^{#plus} candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); registry.add("hMassDstarToD0Pi", "D^{*#plus} candidates;inv. mass (K #pi #pi) - mass (K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0.135, 0.185}}}); + registry.add("hMassCdToDeKPi", "C Deuteron candidates;inv. mass (De K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); // needed for PV refitting if (doprocess2And3ProngsWithPvRefit || doprocess2And3ProngsWithPvRefitWithPidForHfFiltersBdt) { @@ -1617,11 +1637,13 @@ struct HfTrackIndexSkimCreator { // check proton PID for Lc and Xic whichHypo[iDecay3P] = 3; // 2 bits on - if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && config.applyProtonPidForLcToPKPi) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && config.applyProtonPidForXicToPKPi)) { - if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && !TESTBIT(isIdentifiedPidTrack0, ChannelsProtonPid::LcToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && !TESTBIT(isIdentifiedPidTrack0, ChannelsProtonPid::XicToPKPi))) { + + if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && config.applyProtonPidForLcToPKPi) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && config.applyProtonPidForXicToPKPi) || (iDecay3P == hf_cand_3prong::DecayType::CdToDeKPi && config.applyDeuteronPidForCdToDeKPi)) { + + if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && !TESTBIT(isIdentifiedPidTrack0, ChannelsProtonPid::LcToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && !TESTBIT(isIdentifiedPidTrack0, ChannelsProtonPid::XicToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::CdToDeKPi && !TESTBIT(isIdentifiedPidTrack0, ChannelsDeuteronPid))) { CLRBIT(whichHypo[iDecay3P], 0); } - if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && !TESTBIT(isIdentifiedPidTrack2, ChannelsProtonPid::LcToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && !TESTBIT(isIdentifiedPidTrack2, ChannelsProtonPid::XicToPKPi))) { + if ((iDecay3P == hf_cand_3prong::DecayType::LcToPKPi && !TESTBIT(isIdentifiedPidTrack2, ChannelsProtonPid::LcToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::XicToPKPi && !TESTBIT(isIdentifiedPidTrack2, ChannelsProtonPid::XicToPKPi)) || (iDecay3P == hf_cand_3prong::DecayType::CdToDeKPi && !TESTBIT(isIdentifiedPidTrack2, ChannelsDeuteronPid))) { CLRBIT(whichHypo[iDecay3P], 1); } if (whichHypo[iDecay3P] == 0) { @@ -1632,11 +1654,11 @@ struct HfTrackIndexSkimCreator { continue; // no need to check further for this particle hypothesis } } - // pT const auto binPt = findBin(&binsPt3Prong[iDecay3P], pt); // return immediately if it is outside the defined pT bins if (binPt == -1) { + CLRBIT(isSelected, iDecay3P); whichHypo[iDecay3P] = 0; if (config.debug) { @@ -1853,6 +1875,12 @@ struct HfTrackIndexSkimCreator { registry.fill(HIST("ML/hMlScoreNonpromptXic"), outputScores[iDecay3P][2]); break; } + case hf_cand_3prong::DecayType::CdToDeKPi: { + registry.fill(HIST("ML/hMlScoreBkgCd"), outputScores[iDecay3P][0]); + registry.fill(HIST("ML/hMlScorePromptCd"), outputScores[iDecay3P][1]); + registry.fill(HIST("ML/hMlScoreNonpromptCd"), outputScores[iDecay3P][2]); + break; + } } } if (!isMlSel) { @@ -2607,6 +2635,9 @@ struct HfTrackIndexSkimCreator { case hf_cand_3prong::DecayType::XicToPKPi: registry.fill(HIST("hMassXicToPKPi"), mass3Prong); break; + case hf_cand_3prong::DecayType::CdToDeKPi: + registry.fill(HIST("hMassCdToDeKPi"), mass3Prong); + break; } } if (TESTBIT(whichHypo3Prong[iDecay3P], 1)) { @@ -2621,6 +2652,9 @@ struct HfTrackIndexSkimCreator { case hf_cand_3prong::DecayType::XicToPKPi: registry.fill(HIST("hMassXicToPKPi"), mass3Prong); break; + case hf_cand_3prong::DecayType::CdToDeKPi: + registry.fill(HIST("hMassCdToDeKPi"), mass3Prong); + break; } } } @@ -2858,6 +2892,9 @@ struct HfTrackIndexSkimCreator { case hf_cand_3prong::DecayType::XicToPKPi: registry.fill(HIST("hMassXicToPKPi"), mass3Prong); break; + case hf_cand_3prong::DecayType::CdToDeKPi: + registry.fill(HIST("hMassCdToDeKPi"), mass3Prong); + break; } } if (TESTBIT(whichHypo3Prong[iDecay3P], 1)) { @@ -2872,6 +2909,9 @@ struct HfTrackIndexSkimCreator { case hf_cand_3prong::DecayType::XicToPKPi: registry.fill(HIST("hMassXicToPKPi"), mass3Prong); break; + case hf_cand_3prong::DecayType::CdToDeKPi: + registry.fill(HIST("hMassCdToDeKPi"), mass3Prong); + break; } } } diff --git a/PWGHF/Utils/utilsPid.h b/PWGHF/Utils/utilsPid.h index 83307bc43d8..629db2a0325 100644 --- a/PWGHF/Utils/utilsPid.h +++ b/PWGHF/Utils/utilsPid.h @@ -31,6 +31,7 @@ enum HfProngSpecies : uint8_t { Pion = 0, Kaon, Proton, + Deuteron, NHfProngSpecies }; @@ -108,8 +109,16 @@ 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 { - LOG(fatal) << "Unsupported PID. Supported species in HF framework: HfProngSpecies::Pion, HfProngSpecies::Kaon, HfProngSpecies::Proton"; + LOG(fatal) << "Unsupported PID. Supported species in HF framework: HfProngSpecies::Pion, HfProngSpecies::Kaon, HfProngSpecies::Proton, HfProngSpecies::Deuteron"; } // fill candidate prong PID rows From 08f034cf3d76e818be69ac015810854c5a79e6f5 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 19 Oct 2025 23:18:22 +0200 Subject: [PATCH 02/14] fix the selection --- PWGHF/Core/SelectorCuts.h | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index e5da4cb4148..2a0917cdf97 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -1520,8 +1520,7 @@ static const std::vector labelsCutVar = {"max pKpi mass Lc", "max p namespace hf_cuts_cd_to_de_k_pi { static constexpr int NBinsPt = 6; -static constexpr int NCutVars = 11; -static constexpr int NCutKfVars = 12; +static constexpr int NCutVars = 10; // default values for the pT bin edges (can be used to configure histogram axis) // offset by 1 from the bin numbers in cuts array constexpr double BinsPt[NBinsPt + 1] = { @@ -1535,21 +1534,12 @@ constexpr double BinsPt[NBinsPt + 1] = { const auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; // default values for the cuts m, ptP, ptK, ptPi, chi2PCA, dL, cosp, dLXY, NdLXY, ImpParXY, mass(Kpi) -constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 0 < pT < 2 */ - {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 2 < pT < 4 */ - {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 4 < pT < 6 */ - {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 6 < pT < 8 */ - {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}, /* 8 < pT < 12 */ - {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10, -1.}}; /* 12 < pT < 24 */ - -// default value for the cuts Chi2Prim Chi2Geo DCA, cm Chi2Geo Chi2Topo -// P K Pi KPi PPi PK KPi PPi PK ↓ LdL ↓ -constexpr double CutsKf[NBinsPt][NCutKfVars] = {{3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 0 < pT < 2 */ - {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 2 < pT < 4 */ - {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 4 < pT < 6 */ - {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 6 < pT < 8 */ - {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}, /* 8 < pT < 12 */ - {3., 3., 3., 3., 3., 3., 0.01, 0.01, 0.01, 3., 5., 5.}}; /* 12 < pT < 24 */ +constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}, /* 0 < pT < 2 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}, /* 2 < pT < 4 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}, /* 4 < pT < 6 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}, /* 6 < pT < 8 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}, /* 8 < pT < 12 */ + {0.4, 0.4, 0.4, 0.4, 0., 0.005, 0., 0., 0., 1e+10}}; /* 12 < pT < 24 */ // row labels static const std::vector labelsPt = { @@ -1561,7 +1551,7 @@ static const std::vector labelsPt = { "pT bin 5"}; // column labels -static const std::vector labelsCutVar = {"m", "pT De", "pT K", "pT Pi", "Chi2PCA", "decay length", "cos pointing angle", "decLengthXY", "normDecLXY", "impParXY", "mass (Kpi)"}; +static const std::vector labelsCutVar = {"m", "pT De", "pT K", "pT Pi", "Chi2PCA", "decay length", "cos pointing angle", "decLengthXY", "normDecLXY", "impParXY"}; } // namespace hf_cuts_cd_to_de_k_pi } // namespace o2::analysis From b3a77c20cbfb0af9d63f7b743badb11d929750e4 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 19 Oct 2025 23:28:17 +0200 Subject: [PATCH 03/14] fix the mistake for Cmake file --- PWGHF/D2H/TableProducer/CMakeLists.txt | 339 +++---------------------- PWGHF/TableProducer/CMakeLists.txt | 5 + 2 files changed, 42 insertions(+), 302 deletions(-) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index e84c579187c..a60ab1d78ab 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -9,350 +9,85 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -# Skimming - -o2physics_add_dpl_workflow(track-index-skim-creator - SOURCES trackIndexSkimCreator.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2::DCAFitter O2Physics::AnalysisCCDB O2Physics::MLCore O2Physics::EventFilteringUtils O2Physics::SGCutParHolder - COMPONENT_NAME Analysis) - -# Helpers - -o2physics_add_dpl_workflow(refit-pv-dummy - SOURCES refitPvDummy.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(pid-creator - SOURCES pidCreator.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(mc-pid-tof - SOURCES mcPidTof.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::TOFWorkflowUtils - COMPONENT_NAME Analysis) - # Candidate creators -o2physics_add_dpl_workflow(candidate-creator-2prong - SOURCES candidateCreator2Prong.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-3prong - SOURCES candidateCreator3Prong.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-b0 - SOURCES candidateCreatorB0.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-bplus - SOURCES candidateCreatorBplus.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-bs - SOURCES candidateCreatorBs.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-cascade - SOURCES candidateCreatorCascade.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-dstar - SOURCES candidateCreatorDstar.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils +o2physics_add_dpl_workflow(candidate-creator-b-to-jpsi-reduced + SOURCES candidateCreatorBToJpsiReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-lb - SOURCES candidateCreatorLb.cxx +o2physics_add_dpl_workflow(candidate-creator-b0-reduced + SOURCES candidateCreatorB0Reduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-sigmac0plusplus - SOURCES candidateCreatorSigmac0plusplus.cxx +o2physics_add_dpl_workflow(candidate-creator-bplus-reduced + SOURCES candidateCreatorBplusReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-sigmac0plusplus-cascade - SOURCES candidateCreatorSigmac0plusplusCascade.cxx +o2physics_add_dpl_workflow(candidate-creator-bs-reduced + SOURCES candidateCreatorBsReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-xic0-omegac0 - SOURCES candidateCreatorXic0Omegac0.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils KFParticle::KFParticle - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-creator-xic-to-xi-pi-pi - SOURCES candidateCreatorXicToXiPiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils +o2physics_add_dpl_workflow(candidate-creator-charm-reso-reduced + SOURCES candidateCreatorCharmResoReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-xicc - SOURCES candidateCreatorXicc.cxx +o2physics_add_dpl_workflow(candidate-creator-lb-reduced + SOURCES candidateCreatorLbReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-creator-mc-gen - SOURCES candidateCreatorMcGen.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - # Candidate selectors -o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi - SOURCES candidateSelectorB0ToDPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi - SOURCES candidateSelectorBplusToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi - SOURCES candidateSelectorBsToDsPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-d0 - SOURCES candidateSelectorD0.cxx +o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi-reduced + SOURCES candidateSelectorB0ToDPiReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-dplus-to-pi-k-pi - SOURCES candidateSelectorDplusToPiKPi.cxx +o2physics_add_dpl_workflow(candidate-selector-bplus-to-d0-pi-reduced + SOURCES candidateSelectorBplusToD0PiReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-ds-to-k-k-pi - SOURCES candidateSelectorDsToKKPi.cxx +o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi-reduced + SOURCES candidateSelectorBsToDsPiReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-dstar-to-d0-pi - SOURCES candidateSelectorDstarToD0Pi.cxx +o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi-reduced + SOURCES candidateSelectorLbToLcPiReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi - SOURCES candidateSelectorLbToLcPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-lc - SOURCES candidateSelectorLc.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-lc-pid-ml - SOURCES candidateSelectorLcPidMl.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-lc-to-k0s-p - SOURCES candidateSelectorLcToK0sP.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-ka - SOURCES candidateSelectorOmegac0ToOmegaKa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-omegac0-to-omega-pi - SOURCES candidateSelectorOmegac0ToOmegaPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) +# Data creators -o2physics_add_dpl_workflow(candidate-selector-omegac0-xic0-to-omega-ka - SOURCES candidateSelectorOmegac0Xic0ToOmegaKa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(candidate-selector-xic0-to-xi-pi-kf - SOURCES candidateSelectorXic0ToXiPiKf.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore +o2physics_add_dpl_workflow(data-creator-charm-had-pi-reduced + SOURCES dataCreatorCharmHadPiReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-to-xi-pi - SOURCES candidateSelectorToXiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore +o2physics_add_dpl_workflow(data-creator-charm-reso-reduced + SOURCES dataCreatorCharmResoReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-xic-to-p-k-pi - SOURCES candidateSelectorXicToPKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore +o2physics_add_dpl_workflow(data-creator-jpsi-had-reduced + SOURCES dataCreatorJpsiHadReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-xic-to-xi-pi-pi - SOURCES candidateSelectorXicToXiPiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore - COMPONENT_NAME Analysis) +# Converters -o2physics_add_dpl_workflow(candidate-selector-xicc-to-p-k-pi-pi - SOURCES candidateSelectorXiccToPKPiPi.cxx +o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml + SOURCES converterReduced3ProngsMl.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(candidate-selector-cd - SOURCES candidateSelectorCd.cxx + o2physics_add_dpl_workflow(converter-reduced-hadron-daus-pid + SOURCES converterReducedHadronDausPid.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - -# Tree creators - -o2physics_add_dpl_workflow(tree-creator-b0-to-d-pi - SOURCES treeCreatorB0ToDPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-bplus-to-d0-pi - SOURCES treeCreatorBplusToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-bs-to-ds-pi - SOURCES treeCreatorBsToDsPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-d0-to-k-pi - SOURCES treeCreatorD0ToKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-dplus-to-pi-k-pi - SOURCES treeCreatorDplusToPiKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-ds-to-k-k-pi - SOURCES treeCreatorDsToKKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-lb-to-lc-pi - SOURCES treeCreatorLbToLcPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-lc-to-k0s-p - SOURCES treeCreatorLcToK0sP.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-lc-to-p-k-pi - SOURCES treeCreatorLcToPKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-sigmac-corr-bkg - SOURCES treeCreatorSigmacCorrBkg.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-omegac-st - SOURCES treeCreatorOmegacSt.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::EventFilteringUtils - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-omegac0-to-omega-ka - SOURCES treeCreatorOmegac0ToOmegaKa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-omegac0-to-omega-pi - SOURCES treeCreatorOmegac0ToOmegaPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-to-xi-pi - SOURCES treeCreatorToXiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-xic0-to-xi-pi-kf - SOURCES treeCreatorXic0ToXiPiKf.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-xic-to-p-k-pi - SOURCES treeCreatorXicToPKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-xic-to-xi-pi-pi - SOURCES treeCreatorXicToXiPiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-xicc-to-p-k-pi-pi - SOURCES treeCreatorXiccToPKPiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-dstar-to-d0-pi - SOURCES treeCreatorDstarToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(tree-creator-tcc-to-d0-d0-pi - SOURCES treeCreatorTccToD0D0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) -# Derived-data creators - -o2physics_add_dpl_workflow(derived-data-creator-b0-to-d-pi - SOURCES derivedDataCreatorB0ToDPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-bplus-to-d0-pi - SOURCES derivedDataCreatorBplusToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-d0-to-k-pi - SOURCES derivedDataCreatorD0ToKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-dplus-to-pi-k-pi - SOURCES derivedDataCreatorDplusToPiKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-ds-to-k-k-pi - SOURCES derivedDataCreatorDsToKKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-dstar-to-d0-pi - SOURCES derivedDataCreatorDstarToD0Pi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-lc-to-p-k-pi - SOURCES derivedDataCreatorLcToPKPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(derived-data-creator-xic-to-xi-pi-pi - SOURCES derivedDataCreatorXicToXiPiPi.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - -# Converters - -o2physics_add_dpl_workflow(converter-dstar-indices - SOURCES converterDstarIndices.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 9b28ce9e88d..e84c579187c 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -202,6 +202,11 @@ o2physics_add_dpl_workflow(candidate-selector-xicc-to-p-k-pi-pi PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(candidate-selector-cd + SOURCES candidateSelectorCd.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # Tree creators o2physics_add_dpl_workflow(tree-creator-b0-to-d-pi From 2a600ceb5ff9c7fd9621e8cc789f78ac733db61c Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Mon, 20 Oct 2025 09:18:33 +0200 Subject: [PATCH 04/14] fix typo --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index dd227a4cb4e..ca1a26b95a4 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -118,7 +118,6 @@ enum ChannelsProtonPid { LcToPK0S, NChannelsProtonPid }; - // kaon PID (opposite-sign track in 3-prong decays) constexpr int ChannelKaonPid = ChannelsProtonPid::NChannelsProtonPid; constexpr int ChannelsDeuteronPid = ChannelsProtonPid::NChannelsProtonPid + 1; @@ -1658,7 +1657,6 @@ struct HfTrackIndexSkimCreator { const auto binPt = findBin(&binsPt3Prong[iDecay3P], pt); // return immediately if it is outside the defined pT bins if (binPt == -1) { - CLRBIT(isSelected, iDecay3P); whichHypo[iDecay3P] = 0; if (config.debug) { From 9e99014978e0f55576de168022a9c97e6c85786c Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Mon, 20 Oct 2025 14:19:33 +0200 Subject: [PATCH 05/14] fix the QA plot in creator --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 8 +++++++- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 14 ++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index e8138776382..ca1363ba0c8 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -190,7 +190,7 @@ struct HfCandidateCreator3Prong { LOGP(fatal, "At least one particle specie should be enabled for the creation."); } - if (createLc && createXic && createCd && applyInvMassConstraint) { + if (createLc && createXic && applyInvMassConstraint) { LOGP(fatal, "Unable to apply invariant mass constraint due to ambiguity of mass hypothesis: only one of Lc and Xic and Cd can be reconstructed."); } @@ -200,6 +200,8 @@ struct HfCandidateCreator3Prong { registry.add("hMass3PiKPi", "3-prong candidates;inv. mass (#pi K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{600, 1.6, 2.2}}}); registry.add("hMass3KKPi", "3-prong candidates;inv. mass (KK #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{600, 1.7, 2.3}}}); registry.add("hMass3PiKK", "3-prong candidates;inv. mass (#pi KK) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{600, 1.7, 2.3}}}); + registry.add("hMass3DeKPi", "3-prong candidates;inv. mass (deK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{2000, 2.5, 4.5}}}); + registry.add("hMass3PiKDe", "3-prong candidates;inv. mass (#pi Kde) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{2000, 2.5, 4.5}}}); registry.add("hMass2KPi", "2-prong pairs;inv. mass (K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{1200, 0.8, 2.0}}}); registry.add("hMass2PiK", "2-prong pairs;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{1200, 0.8, 2.0}}}); registry.add("hCovPVXX", "3-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); @@ -419,6 +421,8 @@ struct HfCandidateCreator3Prong { const auto massPiKPi = RecoDecay::m(arrayMomenta, std::array{MassPiPlus, MassKPlus, MassPiPlus}); const auto massKKPi = RecoDecay::m(arrayMomenta, std::array{MassKPlus, MassKPlus, MassPiPlus}); const auto massPiKK = RecoDecay::m(arrayMomenta, std::array{MassPiPlus, MassKPlus, MassKPlus}); + const auto massDeKPi = RecoDecay::m(arrayMomenta, std::array{MassDeuteron, MassKPlus, MassPiPlus}); + const auto massPiKDe = RecoDecay::m(arrayMomenta, std::array{MassPiPlus, MassKPlus, MassDeuteron}); const auto massKPi = RecoDecay::m(std::array{arrayMomenta.at(1), arrayMomenta.at(2)}, std::array{MassKPlus, MassPiPlus}); const auto massPiK = RecoDecay::m(std::array{arrayMomenta.at(0), arrayMomenta.at(1)}, std::array{MassPiPlus, MassKPlus}); registry.fill(HIST("hMass3PiKPi"), massPiKPi); @@ -426,6 +430,8 @@ struct HfCandidateCreator3Prong { registry.fill(HIST("hMass3PiKP"), massPiKP); registry.fill(HIST("hMass3KKPi"), massKKPi); registry.fill(HIST("hMass3PiKK"), massPiKK); + registry.fill(HIST("hMass3DeKPi"), massDeKPi); + registry.fill(HIST("hMass3PiKDe"), massPiKDe); registry.fill(HIST("hMass2KPi"), massKPi); registry.fill(HIST("hMass2PiK"), massPiK); } diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index ca1a26b95a4..f556be3170e 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -1826,14 +1826,14 @@ struct HfTrackIndexSkimCreator { /// \param outputScores is the array of vectors with the output scores to be filled /// \param isSelected ia s bitmap with selection outcome template - void applyMlSelectionForHfFilters3Prong(std::vector featuresCand, std::vector featuresCandPid, std::array, kN3ProngDecays>& outputScores, auto& isSelected) + void applyMlSelectionForHfFilters3Prong(std::vector featuresCand, std::vector featuresCandPid, std::array, kN3ProngDecays - 1>& outputScores, auto& isSelected) { if (isSelected == 0) { return; } const float ptDummy = 1.f; // dummy pT value (only one pT bin) - for (int iDecay3P{0}; iDecay3P < kN3ProngDecays; ++iDecay3P) { + for (int iDecay3P{0}; iDecay3P < kN3ProngDecays - 1; ++iDecay3P) { if (TESTBIT(isSelected, iDecay3P) && hasMlModel3Prong[iDecay3P]) { bool isMlSel = false; if constexpr (UsePidForHfFiltersBdt) { @@ -1873,12 +1873,6 @@ struct HfTrackIndexSkimCreator { registry.fill(HIST("ML/hMlScoreNonpromptXic"), outputScores[iDecay3P][2]); break; } - case hf_cand_3prong::DecayType::CdToDeKPi: { - registry.fill(HIST("ML/hMlScoreBkgCd"), outputScores[iDecay3P][0]); - registry.fill(HIST("ML/hMlScorePromptCd"), outputScores[iDecay3P][1]); - registry.fill(HIST("ML/hMlScoreNonpromptCd"), outputScores[iDecay3P][2]); - break; - } } } if (!isMlSel) { @@ -2568,7 +2562,7 @@ struct HfTrackIndexSkimCreator { // 3-prong selections after secondary vertex applySelection3Prong(pVecCandProng3Pos, secondaryVertex3, pvRefitCoord3Prong2Pos1Neg, cutStatus3Prong, isSelected3ProngCand); - std::array, kN3ProngDecays> mlScores3Prongs; + std::array, kN3ProngDecays - 1> mlScores3Prongs; if (config.applyMlForHfFilters) { const std::vector inputFeatures{trackParVarPcaPos1.getPt(), dcaInfoPos1[0], dcaInfoPos1[1], trackParVarPcaNeg1.getPt(), dcaInfoNeg1[0], dcaInfoNeg1[1], trackParVarPcaPos2.getPt(), dcaInfoPos2[0], dcaInfoPos2[1]}; std::vector inputFeaturesLcPid{}; @@ -2825,7 +2819,7 @@ struct HfTrackIndexSkimCreator { // 3-prong selections after secondary vertex applySelection3Prong(pVecCandProng3Neg, secondaryVertex3, pvRefitCoord3Prong1Pos2Neg, cutStatus3Prong, isSelected3ProngCand); - std::array, kN3ProngDecays> mlScores3Prongs{}; + std::array, kN3ProngDecays - 1> mlScores3Prongs{}; if (config.applyMlForHfFilters) { const std::vector inputFeatures{trackParVarPcaNeg1.getPt(), dcaInfoNeg1[0], dcaInfoNeg1[1], trackParVarPcaPos1.getPt(), dcaInfoPos1[0], dcaInfoPos1[1], trackParVarPcaNeg2.getPt(), dcaInfoNeg2[0], dcaInfoNeg2[1]}; std::vector inputFeaturesLcPid{}; From d596bf54306dce981cc08cef6c103bce85bdf766 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: Tue, 21 Oct 2025 16:33:06 +0200 Subject: [PATCH 06/14] fix linter warning --- Common/Core/TrackSelectorPID.h | 59 +++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/Common/Core/TrackSelectorPID.h b/Common/Core/TrackSelectorPID.h index 46d96cd690b..027038766c5 100644 --- a/Common/Core/TrackSelectorPID.h +++ b/Common/Core/TrackSelectorPID.h @@ -24,8 +24,6 @@ #include -using namespace o2::constants::physics; - /// Class for track selection using PID detectors struct TrackSelectorPID { @@ -45,6 +43,9 @@ class TrackSelectorPidBase /// Default constructor TrackSelectorPidBase() = default; + static constexpr float kPidNsigmaMin = -999.f; + static constexpr float kPidNsigmaMax = 999.f; + /// Conversion operator template operator TrackSelectorPidBase() const @@ -113,7 +114,7 @@ class TrackSelectorPidBase bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = -999.f) { // Accept if selection is disabled via large values. - if (mNSigmaTpcMin < -999. && mNSigmaTpcMax > 999.) { + if (mNSigmaTpcMin < kPidNsigmaMin && mNSigmaTpcMax > kPidNsigmaMax) { return true; } @@ -129,18 +130,18 @@ class TrackSelectorPidBase nSigma = track.tpcNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tpcNSigmaPr(); - } else if constexpr (pdg == kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::kDeuteron) { nSigma = track.tpcNSigmaDe(); } else { errorPdg(); } /// use custom TPC nσ, if a valid value is provided - if (tpcNSigmaCustom > -999.f) { + if (tpcNSigmaCustom > kPidNsigmaMin) { nSigma = tpcNSigmaCustom; } - if (mNSigmaTpcMinCondTof < -999. && mNSigmaTpcMaxCondTof > 999.) { + if (mNSigmaTpcMinCondTof < kPidNsigmaMin && mNSigmaTpcMaxCondTof > kPidNsigmaMax) { conditionalTof = true; } else { conditionalTof = mNSigmaTpcMinCondTof <= nSigma && nSigma <= mNSigmaTpcMaxCondTof; @@ -209,7 +210,7 @@ class TrackSelectorPidBase bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = -999.f) { // Accept if selection is disabled via large values. - if (mNSigmaTofMin < -999. && mNSigmaTofMax > 999.) { + if (mNSigmaTofMin < kPidNsigmaMin && mNSigmaTofMax > kPidNsigmaMax) { return true; } @@ -225,18 +226,18 @@ class TrackSelectorPidBase nSigma = track.tofNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tofNSigmaPr(); - } else if constexpr (pdg == kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::kDeuteron) { nSigma = track.tofNSigmaDe(); } else { errorPdg(); } /// use custom TOF nσ, if a valid value is provided - if (tofNSigmaCustom > -999.f) { + if (tofNSigmaCustom > kPidNsigmaMin) { nSigma = tofNSigmaCustom; } - if (mNSigmaTofMinCondTpc < -999. && mNSigmaTofMaxCondTpc > 999.) { + if (mNSigmaTofMinCondTpc < kPidNsigmaMin && mNSigmaTofMaxCondTpc > kPidNsigmaMax) { conditionalTpc = true; } else { conditionalTpc = mNSigmaTofMinCondTpc <= nSigma && nSigma <= mNSigmaTofMaxCondTpc; @@ -307,7 +308,7 @@ class TrackSelectorPidBase bool isSelectedByRich(const T& track, bool& conditionalTof) { // Accept if selection is disabled via large values. - if (mNSigmaRichMin < -999. && mNSigmaRichMax > 999.) { + if (mNSigmaRichMin < kPidNsigmaMin && mNSigmaRichMax > kPidNsigmaMax) { return true; } @@ -327,7 +328,7 @@ class TrackSelectorPidBase errorPdg(); } - if (mNSigmaRichMinCondTof < -999. && mNSigmaRichMaxCondTof > 999.) { + if (mNSigmaRichMinCondTof < kPidNsigmaMin && mNSigmaRichMaxCondTof > kPidNsigmaMax) { conditionalTof = true; } else { conditionalTof = mNSigmaRichMinCondTof <= nSigma && nSigma <= mNSigmaRichMaxCondTof; @@ -470,23 +471,29 @@ class TrackSelectorPidBase template bool isElectronAndNotPion(const T& track, bool useTof = true, bool useRich = true) { + static constexpr float kPidNsigmaInvalid = -1000.f; + static constexpr float kPidTofRichTransitionPMin = 0.4f; + static constexpr float kPidTofRichTransitionPMax = 0.6f; + static constexpr float kPidRichPionBandPMin = 1.0f; + static constexpr float kPidRichPionBandPMax = 2.0f; + bool isSelTof = false; bool isSelRich = false; bool hasRich = track.richId() > -1; bool hasTof = isValidForTof(track); auto nSigmaTofEl = track.tofNSigmaEl(); auto nSigmaTofPi = track.tofNSigmaPi(); - auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : -1000.; - auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : -1000.; + auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : kPidNsigmaInvalid; + auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : kPidNsigmaInvalid; auto p = track.p(); // TOF - if (useTof && hasTof && (p < 0.6)) { - if (p > 0.4 && hasRich) { + if (useTof && hasTof && (p < kPidTofRichTransitionPMax)) { + if (p > kPidTofRichTransitionPMin && hasRich) { if ((std::abs(nSigmaTofEl) < mNSigmaTofMax) && (std::abs(nSigmaRichEl) < mNSigmaRichMax)) { isSelTof = true; // is selected as electron by TOF and RICH } - } else if (p <= 0.4) { + } else if (p <= kPidTofRichTransitionPMin) { if (std::abs(nSigmaTofEl) < mNSigmaTofMax) { isSelTof = true; // is selected as electron by TOF } @@ -505,7 +512,7 @@ class TrackSelectorPidBase if (std::abs(nSigmaRichEl) < mNSigmaRichMax) { isSelRich = true; // is selected as electron by RICH } - if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > 1.0) && (p < 2.0)) { + if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > kPidRichPionBandPMin) && (p < kPidRichPionBandPMax)) { isSelRich = false; // is selected as pion by RICH } } else { @@ -557,7 +564,7 @@ class TrackSelectorPidBase return track.bayesID() == o2::track::PID::Kaon; } else if constexpr (pdg == kProton) { return track.bayesID() == o2::track::PID::Proton; - } else if constexpr (pdg == kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::kDeuteron) { return track.bayesID() == o2::track::PID::Deuteron; } else { errorPdg(); @@ -587,7 +594,7 @@ class TrackSelectorPidBase prob = track.bayesKa(); } else if constexpr (pdg == kProton) { prob = track.bayesPr(); - } else if constexpr (pdg == kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::kDeuteron) { prob = track.bayesDe(); } else { errorPdg(); @@ -666,11 +673,11 @@ class TrackSelectorPidBase }; // Predefined types -using TrackSelectorEl = TrackSelectorPidBase; // El -using TrackSelectorMu = TrackSelectorPidBase; // Mu -using TrackSelectorPi = TrackSelectorPidBase; // Pi -using TrackSelectorKa = TrackSelectorPidBase; // Ka -using TrackSelectorPr = TrackSelectorPidBase; // Pr -using TrackSelectorDe = TrackSelectorPidBase; // De +using TrackSelectorEl = TrackSelectorPidBase; // El +using TrackSelectorMu = TrackSelectorPidBase; // Mu +using TrackSelectorPi = TrackSelectorPidBase; // Pi +using TrackSelectorKa = TrackSelectorPidBase; // Ka +using TrackSelectorPr = TrackSelectorPidBase; // Pr +using TrackSelectorDe = TrackSelectorPidBase; // De #endif // COMMON_CORE_TRACKSELECTORPID_H_ From 8034074314faa29de9022eb25a1df264ec6518bb 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: Tue, 21 Oct 2025 17:33:45 +0200 Subject: [PATCH 07/14] fix linter warning --- Common/Core/TrackSelectorPID.h | 62 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Common/Core/TrackSelectorPID.h b/Common/Core/TrackSelectorPID.h index 027038766c5..6ef45c36ffa 100644 --- a/Common/Core/TrackSelectorPID.h +++ b/Common/Core/TrackSelectorPID.h @@ -43,8 +43,8 @@ class TrackSelectorPidBase /// Default constructor TrackSelectorPidBase() = default; - static constexpr float kPidNsigmaMin = -999.f; - static constexpr float kPidNsigmaMax = 999.f; + static constexpr float NsigmaPidMin = -999.f; + static constexpr float NsigmaPidMax = 999.f; /// Conversion operator template @@ -114,7 +114,7 @@ class TrackSelectorPidBase bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = -999.f) { // Accept if selection is disabled via large values. - if (mNSigmaTpcMin < kPidNsigmaMin && mNSigmaTpcMax > kPidNsigmaMax) { + if (mNSigmaTpcMin < NsigmaPidMin && mNSigmaTpcMax > NsigmaPidMax) { return true; } @@ -130,18 +130,18 @@ class TrackSelectorPidBase nSigma = track.tpcNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tpcNSigmaPr(); - } else if constexpr (pdg == o2::constants::physics::kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) { nSigma = track.tpcNSigmaDe(); } else { errorPdg(); } /// use custom TPC nσ, if a valid value is provided - if (tpcNSigmaCustom > kPidNsigmaMin) { + if (tpcNSigmaCustom > NsigmaPidMin) { nSigma = tpcNSigmaCustom; } - if (mNSigmaTpcMinCondTof < kPidNsigmaMin && mNSigmaTpcMaxCondTof > kPidNsigmaMax) { + if (mNSigmaTpcMinCondTof < NsigmaPidMin && mNSigmaTpcMaxCondTof > NsigmaPidMax) { conditionalTof = true; } else { conditionalTof = mNSigmaTpcMinCondTof <= nSigma && nSigma <= mNSigmaTpcMaxCondTof; @@ -210,7 +210,7 @@ class TrackSelectorPidBase bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = -999.f) { // Accept if selection is disabled via large values. - if (mNSigmaTofMin < kPidNsigmaMin && mNSigmaTofMax > kPidNsigmaMax) { + if (mNSigmaTofMin < NsigmaPidMin && mNSigmaTofMax > NsigmaPidMax) { return true; } @@ -226,18 +226,18 @@ class TrackSelectorPidBase nSigma = track.tofNSigmaKa(); } else if constexpr (pdg == kProton) { nSigma = track.tofNSigmaPr(); - } else if constexpr (pdg == o2::constants::physics::kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) { nSigma = track.tofNSigmaDe(); } else { errorPdg(); } /// use custom TOF nσ, if a valid value is provided - if (tofNSigmaCustom > kPidNsigmaMin) { + if (tofNSigmaCustom > NsigmaPidMin) { nSigma = tofNSigmaCustom; } - if (mNSigmaTofMinCondTpc < kPidNsigmaMin && mNSigmaTofMaxCondTpc > kPidNsigmaMax) { + if (mNSigmaTofMinCondTpc < NsigmaPidMin && mNSigmaTofMaxCondTpc > NsigmaPidMax) { conditionalTpc = true; } else { conditionalTpc = mNSigmaTofMinCondTpc <= nSigma && nSigma <= mNSigmaTofMaxCondTpc; @@ -308,7 +308,7 @@ class TrackSelectorPidBase bool isSelectedByRich(const T& track, bool& conditionalTof) { // Accept if selection is disabled via large values. - if (mNSigmaRichMin < kPidNsigmaMin && mNSigmaRichMax > kPidNsigmaMax) { + if (mNSigmaRichMin < NsigmaPidMin && mNSigmaRichMax > NsigmaPidMax) { return true; } @@ -328,7 +328,7 @@ class TrackSelectorPidBase errorPdg(); } - if (mNSigmaRichMinCondTof < kPidNsigmaMin && mNSigmaRichMaxCondTof > kPidNsigmaMax) { + if (mNSigmaRichMinCondTof < NsigmaPidMin && mNSigmaRichMaxCondTof > NsigmaPidMax) { conditionalTof = true; } else { conditionalTof = mNSigmaRichMinCondTof <= nSigma && nSigma <= mNSigmaRichMaxCondTof; @@ -471,11 +471,11 @@ class TrackSelectorPidBase template bool isElectronAndNotPion(const T& track, bool useTof = true, bool useRich = true) { - static constexpr float kPidNsigmaInvalid = -1000.f; - static constexpr float kPidTofRichTransitionPMin = 0.4f; - static constexpr float kPidTofRichTransitionPMax = 0.6f; - static constexpr float kPidRichPionBandPMin = 1.0f; - static constexpr float kPidRichPionBandPMax = 2.0f; + static constexpr float PidNsigmaInvalid = -1000.f; + static constexpr float PidTofRichTransitionPMin = 0.4f; + static constexpr float PidTofRichTransitionPMax = 0.6f; + static constexpr float PidRichPionBandPMin = 1.0f; + static constexpr float PidRichPionBandPMax = 2.0f; bool isSelTof = false; bool isSelRich = false; @@ -483,17 +483,17 @@ class TrackSelectorPidBase bool hasTof = isValidForTof(track); auto nSigmaTofEl = track.tofNSigmaEl(); auto nSigmaTofPi = track.tofNSigmaPi(); - auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : kPidNsigmaInvalid; - auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : kPidNsigmaInvalid; + auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : PidNsigmaInvalid; + auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : PidNsigmaInvalid; auto p = track.p(); // TOF - if (useTof && hasTof && (p < kPidTofRichTransitionPMax)) { - if (p > kPidTofRichTransitionPMin && hasRich) { + if (useTof && hasTof && (p < PidTofRichTransitionPMax)) { + if (p > PidTofRichTransitionPMin && hasRich) { if ((std::abs(nSigmaTofEl) < mNSigmaTofMax) && (std::abs(nSigmaRichEl) < mNSigmaRichMax)) { isSelTof = true; // is selected as electron by TOF and RICH } - } else if (p <= kPidTofRichTransitionPMin) { + } else if (p <= PidTofRichTransitionPMin) { if (std::abs(nSigmaTofEl) < mNSigmaTofMax) { isSelTof = true; // is selected as electron by TOF } @@ -512,7 +512,7 @@ class TrackSelectorPidBase if (std::abs(nSigmaRichEl) < mNSigmaRichMax) { isSelRich = true; // is selected as electron by RICH } - if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > kPidRichPionBandPMin) && (p < kPidRichPionBandPMax)) { + if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > PidRichPionBandPMin) && (p < PidRichPionBandPMax)) { isSelRich = false; // is selected as pion by RICH } } else { @@ -564,7 +564,7 @@ class TrackSelectorPidBase return track.bayesID() == o2::track::PID::Kaon; } else if constexpr (pdg == kProton) { return track.bayesID() == o2::track::PID::Proton; - } else if constexpr (pdg == o2::constants::physics::kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) { return track.bayesID() == o2::track::PID::Deuteron; } else { errorPdg(); @@ -594,7 +594,7 @@ class TrackSelectorPidBase prob = track.bayesKa(); } else if constexpr (pdg == kProton) { prob = track.bayesPr(); - } else if constexpr (pdg == o2::constants::physics::kDeuteron) { + } else if constexpr (pdg == o2::constants::physics::Pdg::kDeuteron) { prob = track.bayesDe(); } else { errorPdg(); @@ -673,11 +673,11 @@ class TrackSelectorPidBase }; // Predefined types -using TrackSelectorEl = TrackSelectorPidBase; // El -using TrackSelectorMu = TrackSelectorPidBase; // Mu -using TrackSelectorPi = TrackSelectorPidBase; // Pi -using TrackSelectorKa = TrackSelectorPidBase; // Ka -using TrackSelectorPr = TrackSelectorPidBase; // Pr -using TrackSelectorDe = TrackSelectorPidBase; // De +using TrackSelectorEl = TrackSelectorPidBase; // El +using TrackSelectorMu = TrackSelectorPidBase; // Mu +using TrackSelectorPi = TrackSelectorPidBase; // Pi +using TrackSelectorKa = TrackSelectorPidBase; // Ka +using TrackSelectorPr = TrackSelectorPidBase; // Pr +using TrackSelectorDe = TrackSelectorPidBase; // De #endif // COMMON_CORE_TRACKSELECTORPID_H_ From 4214a1e70287c7aaebbf0f98a8b50fbe05f7c935 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: Wed, 22 Oct 2025 12:30:52 +0200 Subject: [PATCH 08/14] Fix comments from Vit in taskCd.cxx --- PWGHF/D2H/Tasks/taskCd.cxx | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index 228884a8e4f..74a4bf1d0b7 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -112,7 +112,7 @@ struct HfTaskCd { if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } - auto vbins = (std::vector)binsPt; + auto vbins = binsPt; /// mass candidate registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -152,22 +152,11 @@ struct HfTaskCd { const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle"}; const AxisSpec thnAxisCentrality{thnConfigAxisCentrality, "centrality (FT0C)"}; - std::vector axesStd; - axesStd = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality}; - + auto axesStd = std::vector{thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality}; registry.add("hnCdVars", "THn for Reconstructed Cd candidates for data", HistType::kTHnSparseF, axesStd); } } - /// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table) - /// \param candidate is candidate - /// \return centrality/multiplicity percentile of the collision - template - float evaluateCentralityColl(const Coll& collision) - { - return o2::hf_centrality::getCentralityColl(collision); - } - /// Fill histograms for real data template void fillHistosData(CollType const& collision, CandType const& candidates) @@ -177,19 +166,19 @@ struct HfTaskCd { auto numPvContributors = collision.numContrib(); for (const auto& candidate : groupedCdCandidates) { - if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::CdToDeKPi)) { + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::CdToDeKPi)) { continue; } - auto pt = candidate.pt(); - auto ptProng0 = candidate.ptProng0(); - auto ptProng1 = candidate.ptProng1(); - auto ptProng2 = candidate.ptProng2(); - auto decayLength = candidate.decayLength(); - auto decayLengthXY = candidate.decayLengthXY(); - auto chi2PCA = candidate.chi2PCA(); - auto cpa = candidate.cpa(); - auto cpaXY = candidate.cpaXY(); + const auto pt = candidate.pt(); + const auto ptProng0 = candidate.ptProng0(); + const auto ptProng1 = candidate.ptProng1(); + const auto ptProng2 = candidate.ptProng2(); + const auto decayLength = candidate.decayLength(); + const auto decayLengthXY = candidate.decayLengthXY(); + const auto chi2PCA = candidate.chi2PCA(); + const auto cpa = candidate.cpa(); + const auto cpaXY = candidate.cpaXY(); if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { registry.fill(HIST("Data/hMass"), hfHelper.invMassCdToDeKPi(candidate)); @@ -232,7 +221,7 @@ struct HfTaskCd { registry.fill(HIST("Data/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); if (fillTHn) { - float const cent = evaluateCentralityColl(collision); + float const cent = o2::hf_centrality::getCentralityColl(collision); double massCd(-1); if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { massCd = hfHelper.invMassCdToDeKPi(candidate); From 7b6161d2c956c946c90e4f64b822d6c23475dfee 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: Wed, 22 Oct 2025 12:32:03 +0200 Subject: [PATCH 09/14] adjust the order of Cd task according the guidelines --- PWGHF/D2H/Tasks/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 4ab01a6fc9f..83119df1245 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -49,6 +49,11 @@ o2physics_add_dpl_workflow(task-bs PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-cd + SOURCES taskCd.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(task-charm-polarisation SOURCES taskCharmPolarisation.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -148,8 +153,3 @@ o2physics_add_dpl_workflow(task-xic0-to-xi-pi SOURCES taskXic0ToXiPi.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - -o2physics_add_dpl_workflow(task-cd - SOURCES taskCd.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils - COMPONENT_NAME Analysis) From 14d9676b2c3999a92f7febd530432b58a10e3ac3 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: Wed, 22 Oct 2025 12:33:25 +0200 Subject: [PATCH 10/14] fix the comment form vit in the selector --- PWGHF/TableProducer/candidateSelectorCd.cxx | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorCd.cxx b/PWGHF/TableProducer/candidateSelectorCd.cxx index d38768d2273..4eb1c0e2e95 100644 --- a/PWGHF/TableProducer/candidateSelectorCd.cxx +++ b/PWGHF/TableProducer/candidateSelectorCd.cxx @@ -147,44 +147,44 @@ struct HfCandidateSelectorCd { template bool selectionTopol(const T& candidate) { - auto candpT = candidate.pt(); + auto ptCand = candidate.pt(); - int const pTBin = findBin(binsPt, candpT); - if (pTBin == -1) { + int const binPt = findBin(binsPt, ptCand); + if (binPt == -1) { return false; } // check that the candidate pT is within the analysis range - if (candpT < ptCandMin || candpT >= ptCandMax) { + if (ptCand < ptCandMin || ptCand >= ptCandMax) { return false; } // cosine of pointing angle - if (candidate.cpa() <= cuts->get(pTBin, "cos pointing angle")) { + if (candidate.cpa() <= cuts->get(binPt, "cos pointing angle")) { return false; } // candidate chi2PCA - if (candidate.chi2PCA() > cuts->get(pTBin, "Chi2PCA")) { + if (candidate.chi2PCA() > cuts->get(binPt, "Chi2PCA")) { return false; } - if (candidate.decayLength() <= cuts->get(pTBin, "decay length")) { + if (candidate.decayLength() <= cuts->get(binPt, "decay length")) { return false; } // candidate decay length XY - if (candidate.decayLengthXY() <= cuts->get(pTBin, "decLengthXY")) { + if (candidate.decayLengthXY() <= cuts->get(binPt, "decLengthXY")) { return false; } // candidate normalized decay length XY - if (candidate.decayLengthXYNormalised() < cuts->get(pTBin, "normDecLXY")) { + if (candidate.decayLengthXYNormalised() < cuts->get(binPt, "normDecLXY")) { return false; } // candidate impact parameter XY - if (std::abs(candidate.impactParameterXY()) > cuts->get(pTBin, "impParXY")) { + if (std::abs(candidate.impactParameterXY()) > cuts->get(binPt, "impParXY")) { return false; } @@ -205,14 +205,14 @@ struct HfCandidateSelectorCd { bool selectionTopolConjugate(const T1& candidate, const T2& trackDeuteron, const T2& trackKaon, const T2& trackPion) { - auto candpT = candidate.pt(); - int const pTBin = findBin(binsPt, candpT); - if (pTBin == -1) { + auto ptCand = candidate.pt(); + int const binPt = findBin(binsPt, ptCand); + if (binPt == -1) { return false; } // cut on daughter pT - if (trackDeuteron.pt() < cuts->get(pTBin, "pT De") || trackKaon.pt() < cuts->get(pTBin, "pT K") || trackPion.pt() < cuts->get(pTBin, "pT Pi")) { + if (trackDeuteron.pt() < cuts->get(binPt, "pT De") || trackKaon.pt() < cuts->get(binPt, "pT K") || trackPion.pt() < cuts->get(binPt, "pT Pi")) { return false; } @@ -224,7 +224,7 @@ struct HfCandidateSelectorCd { } // cut on Cd->deKpi, piKde mass values - if (std::abs(massCd - massCharmDeuteron) > cuts->get(pTBin, "m")) { + if (std::abs(massCd - massCharmDeuteron) > cuts->get(binPt, "m")) { return false; } From 2d57d251e91f595a77ad3f0e637e247048e5bb9d 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: Wed, 22 Oct 2025 12:34:55 +0200 Subject: [PATCH 11/14] Update TrackSelectorPID.h --- Common/Core/TrackSelectorPID.h | 55 +++++++++++++++++----------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/Common/Core/TrackSelectorPID.h b/Common/Core/TrackSelectorPID.h index 6ef45c36ffa..28cf3ecda93 100644 --- a/Common/Core/TrackSelectorPID.h +++ b/Common/Core/TrackSelectorPID.h @@ -17,6 +17,7 @@ #ifndef COMMON_CORE_TRACKSELECTORPID_H_ #define COMMON_CORE_TRACKSELECTORPID_H_ +#include #include #include @@ -43,8 +44,8 @@ class TrackSelectorPidBase /// Default constructor TrackSelectorPidBase() = default; - static constexpr float NsigmaPidMin = -999.f; - static constexpr float NsigmaPidMax = 999.f; + static constexpr float NSigmaMinDefault{-999.f}; + static constexpr float NSigmaMaxDefault{999.f}; /// Conversion operator template @@ -111,10 +112,10 @@ class TrackSelectorPidBase /// \param tpcNSigmaCustom custom TPC nσ value to be used for the selection, in case the desired value cannot be taken from the track table /// \return true if track satisfies TPC PID hypothesis for given TPC nσ range template - bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = -999.f) + bool isSelectedByTpc(const T& track, bool& conditionalTof, float tpcNSigmaCustom = NSigmaMinDefault) { // Accept if selection is disabled via large values. - if (mNSigmaTpcMin < NsigmaPidMin && mNSigmaTpcMax > NsigmaPidMax) { + if (mNSigmaTpcMin < NSigmaMinDefault && mNSigmaTpcMax > NSigmaMaxDefault) { return true; } @@ -137,11 +138,11 @@ class TrackSelectorPidBase } /// use custom TPC nσ, if a valid value is provided - if (tpcNSigmaCustom > NsigmaPidMin) { + if (tpcNSigmaCustom > NSigmaMinDefault) { nSigma = tpcNSigmaCustom; } - if (mNSigmaTpcMinCondTof < NsigmaPidMin && mNSigmaTpcMaxCondTof > NsigmaPidMax) { + if (mNSigmaTpcMinCondTof < NSigmaMinDefault && mNSigmaTpcMaxCondTof > NSigmaMaxDefault) { conditionalTof = true; } else { conditionalTof = mNSigmaTpcMinCondTof <= nSigma && nSigma <= mNSigmaTpcMaxCondTof; @@ -153,7 +154,7 @@ class TrackSelectorPidBase /// \param track track /// \return TPC selection status (see TrackSelectorPID::Status) template - TrackSelectorPID::Status statusTpc(const T& track, float tpcNSigmaCustom = -999.f) + TrackSelectorPID::Status statusTpc(const T& track, float tpcNSigmaCustom = NSigmaMinDefault) { if (!isValidForTpc(track)) { return TrackSelectorPID::NotApplicable; @@ -207,10 +208,10 @@ class TrackSelectorPidBase /// \param tofNSigmaCustom custom TOF nσ value to be used for the selection, in case the desired value cannot be taken from the track table /// \return true if track satisfies TOF PID hypothesis for given TOF nσ range template - bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = -999.f) + bool isSelectedByTof(const T& track, bool& conditionalTpc, float tofNSigmaCustom = NSigmaMinDefault) { // Accept if selection is disabled via large values. - if (mNSigmaTofMin < NsigmaPidMin && mNSigmaTofMax > NsigmaPidMax) { + if (mNSigmaTofMin < NSigmaMinDefault && mNSigmaTofMax > NSigmaMaxDefault) { return true; } @@ -233,11 +234,11 @@ class TrackSelectorPidBase } /// use custom TOF nσ, if a valid value is provided - if (tofNSigmaCustom > NsigmaPidMin) { + if (tofNSigmaCustom > NSigmaMinDefault) { nSigma = tofNSigmaCustom; } - if (mNSigmaTofMinCondTpc < NsigmaPidMin && mNSigmaTofMaxCondTpc > NsigmaPidMax) { + if (mNSigmaTofMinCondTpc < NSigmaMinDefault && mNSigmaTofMaxCondTpc > NSigmaMaxDefault) { conditionalTpc = true; } else { conditionalTpc = mNSigmaTofMinCondTpc <= nSigma && nSigma <= mNSigmaTofMaxCondTpc; @@ -249,7 +250,7 @@ class TrackSelectorPidBase /// \param track track /// \return TOF selection status (see TrackSelectorPID::Status) template - TrackSelectorPID::Status statusTof(const T& track, float tofNSigmaCustom = -999.f) + TrackSelectorPID::Status statusTof(const T& track, float tofNSigmaCustom = NSigmaMinDefault) { if (!isValidForTof(track)) { return TrackSelectorPID::NotApplicable; @@ -308,7 +309,7 @@ class TrackSelectorPidBase bool isSelectedByRich(const T& track, bool& conditionalTof) { // Accept if selection is disabled via large values. - if (mNSigmaRichMin < NsigmaPidMin && mNSigmaRichMax > NsigmaPidMax) { + if (mNSigmaRichMin < NSigmaMinDefault && mNSigmaRichMax > NSigmaMaxDefault) { return true; } @@ -328,7 +329,7 @@ class TrackSelectorPidBase errorPdg(); } - if (mNSigmaRichMinCondTof < NsigmaPidMin && mNSigmaRichMaxCondTof > NsigmaPidMax) { + if (mNSigmaRichMinCondTof < NSigmaMinDefault && mNSigmaRichMaxCondTof > NSigmaMaxDefault) { conditionalTof = true; } else { conditionalTof = mNSigmaRichMinCondTof <= nSigma && nSigma <= mNSigmaRichMaxCondTof; @@ -412,7 +413,7 @@ class TrackSelectorPidBase /// \param track track /// \return status of combined PID (TPC or TOF) (see TrackSelectorPID::Status) template - TrackSelectorPID::Status statusTpcOrTof(const T& track, float tpcNSigmaCustom = -999.f, float tofNSigmaCustom = -999.f) + TrackSelectorPID::Status statusTpcOrTof(const T& track, float tpcNSigmaCustom = NSigmaMinDefault, float tofNSigmaCustom = NSigmaMinDefault) { int pidTpc = statusTpc(track, tpcNSigmaCustom); int pidTof = statusTof(track, tofNSigmaCustom); @@ -433,7 +434,7 @@ class TrackSelectorPidBase /// \param track track /// \return status of combined PID (TPC and TOF) (see TrackSelectorPID::Status) template - TrackSelectorPID::Status statusTpcAndTof(const T& track, float tpcNSigmaCustom = -999.f, float tofNSigmaCustom = -999.f) + TrackSelectorPID::Status statusTpcAndTof(const T& track, float tpcNSigmaCustom = NSigmaMinDefault, float tofNSigmaCustom = NSigmaMinDefault) { int pidTpc = TrackSelectorPID::NotApplicable; if (track.hasTPC()) { @@ -471,11 +472,11 @@ class TrackSelectorPidBase template bool isElectronAndNotPion(const T& track, bool useTof = true, bool useRich = true) { - static constexpr float PidNsigmaInvalid = -1000.f; - static constexpr float PidTofRichTransitionPMin = 0.4f; - static constexpr float PidTofRichTransitionPMax = 0.6f; - static constexpr float PidRichPionBandPMin = 1.0f; - static constexpr float PidRichPionBandPMax = 2.0f; + static constexpr float NSigmaInvalid{-1000.f}; + static constexpr float PTofRichTElectronMin{0.4f}; + static constexpr float PTofRichTElectronMax{0.6f}; + static constexpr float PRichPionBandMin{1.0f}; + static constexpr float PRichPionBandMax{2.0f}; bool isSelTof = false; bool isSelRich = false; @@ -483,17 +484,17 @@ class TrackSelectorPidBase bool hasTof = isValidForTof(track); auto nSigmaTofEl = track.tofNSigmaEl(); auto nSigmaTofPi = track.tofNSigmaPi(); - auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : PidNsigmaInvalid; - auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : PidNsigmaInvalid; + auto nSigmaRichEl = hasRich ? track.rich().richNsigmaEl() : NSigmaInvalid; + auto nSigmaRichPi = hasRich ? track.rich().richNsigmaPi() : NSigmaInvalid; auto p = track.p(); // TOF - if (useTof && hasTof && (p < PidTofRichTransitionPMax)) { - if (p > PidTofRichTransitionPMin && hasRich) { + if (useTof && hasTof && (p < PTofRichTElectronMax)) { + if (p > PTofRichTElectronMin && hasRich) { if ((std::abs(nSigmaTofEl) < mNSigmaTofMax) && (std::abs(nSigmaRichEl) < mNSigmaRichMax)) { isSelTof = true; // is selected as electron by TOF and RICH } - } else if (p <= PidTofRichTransitionPMin) { + } else if (p <= PTofRichTElectronMin) { if (std::abs(nSigmaTofEl) < mNSigmaTofMax) { isSelTof = true; // is selected as electron by TOF } @@ -512,7 +513,7 @@ class TrackSelectorPidBase if (std::abs(nSigmaRichEl) < mNSigmaRichMax) { isSelRich = true; // is selected as electron by RICH } - if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > PidRichPionBandPMin) && (p < PidRichPionBandPMax)) { + if ((std::abs(nSigmaRichPi) < mNSigmaRichMax) && (p > PRichPionBandMin) && (p < PRichPionBandMax)) { isSelRich = false; // is selected as pion by RICH } } else { From 9aaf9563813b6e74a0c90643a46b2fdab08d7fcc 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: Wed, 22 Oct 2025 14:16:24 +0200 Subject: [PATCH 12/14] Update PWGHF/D2H/Tasks/taskCd.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGHF/D2H/Tasks/taskCd.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index 74a4bf1d0b7..ec5f57e39c4 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -221,7 +221,7 @@ struct HfTaskCd { registry.fill(HIST("Data/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); if (fillTHn) { - float const cent = o2::hf_centrality::getCentralityColl(collision); + float const cent = o2::hf_centrality::getCentralityColl(collision); double massCd(-1); if (candidate.isSelCdToDeKPi() >= selectionFlagCd) { massCd = hfHelper.invMassCdToDeKPi(candidate); From fbae5b7ea2001ada55002778d7131b1a45569bb9 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: Wed, 22 Oct 2025 14:22:53 +0200 Subject: [PATCH 13/14] remove static --- Common/Core/TrackSelectorPID.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Common/Core/TrackSelectorPID.h b/Common/Core/TrackSelectorPID.h index 28cf3ecda93..da5ed2f6732 100644 --- a/Common/Core/TrackSelectorPID.h +++ b/Common/Core/TrackSelectorPID.h @@ -472,11 +472,11 @@ class TrackSelectorPidBase template bool isElectronAndNotPion(const T& track, bool useTof = true, bool useRich = true) { - static constexpr float NSigmaInvalid{-1000.f}; - static constexpr float PTofRichTElectronMin{0.4f}; - static constexpr float PTofRichTElectronMax{0.6f}; - static constexpr float PRichPionBandMin{1.0f}; - static constexpr float PRichPionBandMax{2.0f}; + constexpr float NSigmaInvalid{-1000.f}; + constexpr float PTofRichTElectronMin{0.4f}; + constexpr float PTofRichTElectronMax{0.6f}; + constexpr float PRichPionBandMin{1.0f}; + constexpr float PRichPionBandMax{2.0f}; bool isSelTof = false; bool isSelRich = false; From a126c7b6ded620f2b4934f78b4ed0217c0fc66b7 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: Wed, 22 Oct 2025 15:36:37 +0200 Subject: [PATCH 14/14] Update taskCd.cxx based on Vit's comments --- PWGHF/D2H/Tasks/taskCd.cxx | 47 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index ec5f57e39c4..5bcd8a328a8 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -59,9 +59,9 @@ struct HfTaskCd { HfHelper hfHelper; SliceCache cache; - using Collisions = soa::Join; - using CollisionsWithFT0C = soa::Join; - using CollisionsWithFT0M = soa::Join; + using CollisionsWEvSel = soa::Join; + using CollisionsWithEvSelFT0C = soa::Join; + using CollisionsWithEvSelFT0M = soa::Join; using CdCandidates = soa::Filtered>; @@ -112,34 +112,33 @@ struct HfTaskCd { if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } - auto vbins = binsPt; /// mass candidate - registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); - registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{400, 2.4, 4.4}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}, {500, 0., 5000.}}}); + registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{400, 2.4, 4.4}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// DCAxy to prim. vertex prongs - registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// decay length candidate - registry.add("Data/hDecLengthVsPt", "3-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hDecLengthVsPt", "3-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// decay length xy candidate - registry.add("Data/hDecLengthxyVsPt", "3-prong candidates;decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hDecLengthxyVsPt", "3-prong candidates;decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// cosine of pointing angle - registry.add("Data/hCPAVsPt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hCPAVsPt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// cosine of pointing angle xy - registry.add("Data/hCPAxyVsPt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hCPAxyVsPt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// Chi 2 PCA to sec. vertex - registry.add("Data/hDca2VsPt", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hDca2VsPt", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// eta - registry.add("Data/hEtaVsPt", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hEtaVsPt", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// phi - registry.add("Data/hPhiVsPt", "3-prong candidates;candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hPhiVsPt", "3-prong candidates;candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// selection status - registry.add("hSelectionStatus", "3-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hSelectionStatus", "3-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); /// impact parameter error - registry.add("Data/hImpParErrProng0", "3-prong candidates;prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hImpParErrProng1", "3-prong candidates;prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hImpParErrProng2", "3-prong candidates;prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hImpParErrProng0", "3-prong candidates;prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hImpParErrProng1", "3-prong candidates;prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("Data/hImpParErrProng2", "3-prong candidates;prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {binsPt, "#it{p}_{T} (GeV/#it{c})"}}}); if (fillTHn) { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (de K #pi) (GeV/#it{c}^{2})"}; @@ -152,7 +151,7 @@ struct HfTaskCd { const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle"}; const AxisSpec thnAxisCentrality{thnConfigAxisCentrality, "centrality (FT0C)"}; - auto axesStd = std::vector{thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality}; + std::vector axesStd{thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality}; registry.add("hnCdVars", "THn for Reconstructed Cd candidates for data", HistType::kTHnSparseF, axesStd); } } @@ -247,7 +246,7 @@ struct HfTaskCd { } } - void processDataStd(Collisions const& collisions, + void processDataStd(CollisionsWEvSel const& collisions, CdCandidates const& selectedCdCandidates, aod::Tracks const&) { @@ -255,7 +254,7 @@ struct HfTaskCd { } PROCESS_SWITCH(HfTaskCd, processDataStd, "Process Data with the standard method", true); - void processDataStdWithFT0C(CollisionsWithFT0C const& collisions, + void processDataStdWithFT0C(CollisionsWithEvSelFT0C const& collisions, CdCandidates const& selectedCdCandidates, aod::Tracks const&) { @@ -263,7 +262,7 @@ struct HfTaskCd { } PROCESS_SWITCH(HfTaskCd, processDataStdWithFT0C, "Process real data with the standard method and with FT0C centrality", false); - void processDataStdWithFT0M(CollisionsWithFT0M const& collisions, + void processDataStdWithFT0M(CollisionsWithEvSelFT0M const& collisions, CdCandidates const& selectedCdCandidates, aod::Tracks const&) {