From 939a2027c35765fc0ba552668a5c797fc64e162d 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, 23 Apr 2025 16:31:10 +0200 Subject: [PATCH 01/85] Add files via upload --- PWGHF/Core/HfMlResponseLbToLcPi.h | 197 ++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 PWGHF/Core/HfMlResponseLbToLcPi.h diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h new file mode 100644 index 00000000000..db5736ecdd0 --- /dev/null +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -0,0 +1,197 @@ +// 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 HfMlResponseLbToLcPi.h +/// \brief Class to compute the ML response for Lb → Lc∓ π± analysis selections +/// \author Biao Zhang , Heidelberg University + +#ifndef PWGHF_CORE_HfMlResponseLBTOLCPI_H_ +#define PWGHF_CORE_HfMlResponseLBTOLCPI_H_ + +#include +#include +#include + +#include "PWGHF/Core/HfMlResponse.h" +#include "PWGHF/D2H/Utils/utilsRedDataFormat.h" + +// Fill the map of available input features +// the key is the feature's name (std::string) +// the value is the corresponding value in EnumInputFeatures +#define FILL_MAP_Lb(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesLbToLcPi::FEATURE) \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the corresponding GETTER from OBJECT +#define CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ + } + +// Check if the index of mCachedIndices (index associated to a FEATURE) +// matches the entry in EnumInputFeatures associated to this FEATURE +// if so, the inputFeatures vector is filled with the FEATURE's value +// by calling the GETTER function taking OBJECT in argument +#define CHECK_AND_FILL_VEC_Lb_FUNC(OBJECT, FEATURE, GETTER) \ + case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ + inputFeatures.emplace_back(GETTER(OBJECT)); \ + break; \ + } + +// Specific case of CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) +// where OBJECT is named candidate and FEATURE = GETTER +#define CHECK_AND_FILL_VEC_Lb(GETTER) \ + case static_cast(InputFeaturesLbToLcPi::GETTER): { \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ + } + +namespace o2::analysis +{ + +enum class InputFeaturesLbToLcPi : uint8_t { + ptProng0 = 0, + ptProng1, + impactParameter0, + impactParameter1, + impactParameterProduct, + chi2PCA, + decayLength, + decayLengthXY, + decayLengthNormalised, + decayLengthXYNormalised, + cpa, + cpaXY, + maxNormalisedDeltaIP, + prong0MlScoreBkg, + prong0MlScorePrompt, + prong0MlScoreNonprompt, + tpcNSigmaPi1, + tofNSigmaPi1, + tpcTofNSigmaPi1 +}; + +template +class HfMlResponseLbToLcPi : public HfMlResponse +{ + public: + /// Default constructor + HfMlResponseLbToLcPi() = default; + /// Default destructor + virtual ~HfMlResponseLbToLcPi() = default; + + /// Method to get the input features vector needed for ML inference + /// \param candidate is the Lb candidate + /// \param prong1 is the candidate's prong1 + /// \return inputFeatures vector + template + std::vector getInputFeatures(T1 const& candidate, + T2 const& prong1) + { + std::vector inputFeatures; + + for (const auto& idx : MlResponse::mCachedIndices) { + if constexpr (withDmesMl) { + switch (idx) { + CHECK_AND_FILL_VEC_Lb(ptProng0); + CHECK_AND_FILL_VEC_Lb(ptProng1); + CHECK_AND_FILL_VEC_Lb(impactParameter0); + CHECK_AND_FILL_VEC_Lb(impactParameter1); + CHECK_AND_FILL_VEC_Lb(impactParameterProduct); + CHECK_AND_FILL_VEC_Lb(chi2PCA); + CHECK_AND_FILL_VEC_Lb(decayLength); + CHECK_AND_FILL_VEC_Lb(decayLengthXY); + CHECK_AND_FILL_VEC_Lb(decayLengthNormalised); + CHECK_AND_FILL_VEC_Lb(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_Lb(cpa); + CHECK_AND_FILL_VEC_Lb(cpaXY); + CHECK_AND_FILL_VEC_Lb(maxNormalisedDeltaIP); + CHECK_AND_FILL_VEC_Lb(prong0MlScoreBkg); + CHECK_AND_FILL_VEC_Lb(prong0MlScorePrompt); + CHECK_AND_FILL_VEC_Lb(prong0MlScoreNonprompt); + // TPC PID variable + CHECK_AND_FILL_VEC_Lb_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + // TOF PID variable + CHECK_AND_FILL_VEC_Lb_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + // Combined PID variables + CHECK_AND_FILL_VEC_Lb_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + } + } else { + switch (idx) { + CHECK_AND_FILL_VEC_Lb(ptProng0); + CHECK_AND_FILL_VEC_Lb(ptProng1); + CHECK_AND_FILL_VEC_Lb(impactParameter0); + CHECK_AND_FILL_VEC_Lb(impactParameter1); + CHECK_AND_FILL_VEC_Lb(impactParameterProduct); + CHECK_AND_FILL_VEC_Lb(chi2PCA); + CHECK_AND_FILL_VEC_Lb(decayLength); + CHECK_AND_FILL_VEC_Lb(decayLengthXY); + CHECK_AND_FILL_VEC_Lb(decayLengthNormalised); + CHECK_AND_FILL_VEC_Lb(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_Lb(cpa); + CHECK_AND_FILL_VEC_Lb(cpaXY); + CHECK_AND_FILL_VEC_Lb(maxNormalisedDeltaIP); + // TPC PID variable + CHECK_AND_FILL_VEC_Lb_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + // TOF PID variable + CHECK_AND_FILL_VEC_Lb_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + // Combined PID variables + CHECK_AND_FILL_VEC_Lb_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + } + } + } + + return inputFeatures; + } + + protected: + /// Method to fill the map of available input features + void setAvailableInputFeatures() + { + MlResponse::mAvailableInputFeatures = { + FILL_MAP_Lb(ptProng0), + FILL_MAP_Lb(ptProng1), + FILL_MAP_Lb(impactParameter0), + FILL_MAP_Lb(impactParameter1), + FILL_MAP_Lb(impactParameterProduct), + FILL_MAP_Lb(chi2PCA), + FILL_MAP_Lb(decayLength), + FILL_MAP_Lb(decayLengthXY), + FILL_MAP_Lb(decayLengthNormalised), + FILL_MAP_Lb(decayLengthXYNormalised), + FILL_MAP_Lb(cpa), + FILL_MAP_Lb(cpaXY), + FILL_MAP_Lb(maxNormalisedDeltaIP), + FILL_MAP_Lb(prong0MlScoreBkg), + FILL_MAP_Lb(prong0MlScorePrompt), + FILL_MAP_Lb(prong0MlScoreNonprompt), + // TPC PID variable + FILL_MAP_Lb(tpcNSigmaPi1), + // TOF PID variable + FILL_MAP_Lb(tofNSigmaPi1), + // Combined PID variable + FILL_MAP_Lb(tpcTofNSigmaPi1)}; + } +}; + +} // namespace o2::analysis + +#undef FILL_MAP_Lb +#undef CHECK_AND_FILL_VEC_Lb_FULL +#undef CHECK_AND_FILL_VEC_Lb_FUNC +#undef CHECK_AND_FILL_VEC_Lb + +#endif // PWGHF_CORE_HfMlResponseLBTOLCPI_H_ From c24685ce52a0d954ef73ac1416ef0e17670a1361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:40:06 +0200 Subject: [PATCH 02/85] Update HfHelper.h --- PWGHF/Core/HfHelper.h | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 7b723769d85..3d417bfc50a 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -958,6 +958,87 @@ class HfHelper return true; } + /// Apply topological cuts as defined in SelectorCuts.h + /// \param candLb Lb candidate + /// \param cuts Lb candidate selection per pT bin" + /// \param binsPt pT bin limits + /// \return true if candidate passes all selections + template + bool selectionLbToLcPiTopol(const T1& candLb, const T2& cuts, const T3& binsPt) + { + auto ptCandLb = candLb.pt(); + auto ptLc = RecoDecay::pt(candLb.pxProng0(), candLb.pyProng0()); + auto ptPi = RecoDecay::pt(candLb.pxProng1(), candLb.pyProng1()); + + int pTBin = o2::analysis::findBin(binsPt, ptCandLb); + if (pTBin == -1) { + return false; + } + + // Lb mass cut + if (std::abs(invMassLbToLcPi(candLb) - o2::constants::physics::MassLambdaB0) > cuts->get(pTBin, "m")) { + return false; + } + + // pion pt + if (ptPi < cuts->get(pTBin, "pT Pi")) { + return false; + } + + // Lc pt + if (ptLc < cuts->get(pTBin, "pT Lc")) { + return false; + } + + // Lb Decay length + if (candLb.decayLength() < cuts->get(pTBin, "Lb decLen")) { + return false; + } + + // Lb Decay length XY + if (candLb.decayLengthXY() < cuts->get(pTBin, "Lb decLenXY")) { + return false; + } + + // Lb chi2PCA cut + if (candLb.chi2PCA() > cuts->get(pTBin, "Chi2PCA")) { + return false; + } + + // Lb CPA cut + if (candLb.cpa() < cuts->get(pTBin, "CPA")) { + return false; + } + + // d0 of pi + if (std::abs(candLb.impactParameter1()) < cuts->get(pTBin, "d0 Pi")) { + return false; + } + + // d0 of Lc + if (std::abs(candLb.impactParameter0()) < cuts->get(pTBin, "d0 Lc")) { + return false; + } + + return true; + } + + /// \param pidTrackPi PID status of trackPi (prong1 of Lb candidate) + /// \param acceptPIDNotApplicable switch to accept Status::NotApplicable + /// \return true if prong1 of Lb candidate passes all selections + template + bool selectionLbToLcPiPid(const T1& pidTrackPi, const T2& acceptPIDNotApplicable) + { + if (!acceptPIDNotApplicable && pidTrackPi != TrackSelectorPID::Accepted) { + return false; + } + if (acceptPIDNotApplicable && pidTrackPi == TrackSelectorPID::Rejected) { + return false; + } + + return true; + } + /// Apply selection on ML scores for charm-hadron daughter in b-hadron decays (common for all the beauty channels) /// \param cuts ML score selection per bin of charm-hadron pT /// \param binsPtC pT bin limits of charm hadron From 40f2ad915ce96605c654d6a34b351c186a2e0ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:41:02 +0200 Subject: [PATCH 03/85] Update ReducedDataModel.h --- PWGHF/D2H/DataModel/ReducedDataModel.h | 131 ++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index e902d1de8e3..f1da63a030a 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -18,6 +18,7 @@ /// \author Fabio Catalano , CERN /// \author Fabrizio Grosa , CERN /// \author Luca Aglietta , Università degli Studi di Torino (UniTO) +/// \author Biao Zhang , Heidelberg University #ifndef PWGHF_D2H_DATAMODEL_REDUCEDDATAMODEL_H_ #define PWGHF_D2H_DATAMODEL_REDUCEDDATAMODEL_H_ @@ -213,12 +214,18 @@ DECLARE_SOA_COLUMN(TPCNSigmaPiProng2, tpcNSigmaPiProng2, float); //! NsigmaTPCPi DECLARE_SOA_COLUMN(TPCNSigmaKaProng0, tpcNSigmaKaProng0, float); //! NsigmaTPCKa for prong0, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TPCNSigmaKaProng1, tpcNSigmaKaProng1, float); //! NsigmaTPCKa for prong1, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TPCNSigmaKaProng2, tpcNSigmaKaProng2, float); //! NsigmaTPCKa for prong2, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TPCNSigmaPrProng0, tpcNSigmaPrProng0, float); //! NsigmaTPCPr for prong0, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TPCNSigmaPrProng1, tpcNSigmaPrProng1, float); //! NsigmaTPCPr for prong1, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TPCNSigmaPrProng2, tpcNSigmaPrProng2, float); //! NsigmaTPCPr for prong2, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaPiProng0, tofNSigmaPiProng0, float); //! NsigmaTOFPi for prong0, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaPiProng1, tofNSigmaPiProng1, float); //! NsigmaTOFPi for prong1, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaPiProng2, tofNSigmaPiProng2, float); //! NsigmaTOFPi for prong2, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaKaProng0, tofNSigmaKaProng0, float); //! NsigmaTOFKa for prong0, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaKaProng1, tofNSigmaKaProng1, float); //! NsigmaTOFKa for prong1, o2-linter: disable=name/o2-column (written to disk) DECLARE_SOA_COLUMN(TOFNSigmaKaProng2, tofNSigmaKaProng2, float); //! NsigmaTOFKa for prong2, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TOFNSigmaPrProng0, tofNSigmaPrProng0, float); //! NsigmaTOFPr for prong0, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TOFNSigmaPrProng1, tofNSigmaPrProng1, float); //! NsigmaTOFPr for prong1, o2-linter: disable=name/o2-column (written to disk) +DECLARE_SOA_COLUMN(TOFNSigmaPrProng2, tofNSigmaPrProng2, float); //! NsigmaTOFPr for prong2, o2-linter: disable=name/o2-column (written to disk) // dynamic columns DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaPi, tpcTofNSigmaPi, //! Combination of NsigmaTPC and NsigmaTOF, o2-linter: disable=name/o2-column (written to disk) [](float tpcNSigmaPi, float tofNSigmaPi) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPi, tofNSigmaPi); }); @@ -238,6 +245,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaKaProng1, tpcTofNSigmaKaProng1, //! Combi [](float tpcNSigmaKa, float tofNSigmaKa) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaKa, tofNSigmaKa); }); DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaKaProng2, tpcTofNSigmaKaProng2, //! Combination of NsigmaTPC and NsigmaTOF, o2-linter: disable=name/o2-column (written to disk) [](float tpcNSigmaKa, float tofNSigmaKa) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaKa, tofNSigmaKa); }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaPrProng0, tpcTofNSigmaPrProng0, //! Combination of NsigmaTPC and NsigmaTOF, o2-linter: disable=name/o2-column (written to disk) + [](float tpcNSigmaPr, float tofNSigmaPr) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPr, tofNSigmaPr); }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaPrProng1, tpcTofNSigmaPrProng1, //! Combination of NsigmaTPC and NsigmaTOF, o2-linter: disable=name/o2-column (written to disk) + [](float tpcNSigmaPr, float tofNSigmaPr) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPr, tofNSigmaPr); }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCTOFNSigmaPrProng2, tpcTofNSigmaPrProng2, //! Combination of NsigmaTPC and NsigmaTOF, o2-linter: disable=name/o2-column (written to disk) + [](float tpcNSigmaPr, float tofNSigmaPr) -> float { return pid_tpc_tof_utils::combineNSigma(tpcNSigmaPr, tofNSigmaPr); }); } // namespace hf_track_pid_reduced // CAREFUL: need to follow convention [Name = Description + 's'] in DECLARE_SOA_TABLE(Name, "AOD", Description) @@ -356,30 +369,39 @@ DECLARE_SOA_TABLE(HfRedPidDau0s, "AOD", "HFREDPIDDAU0", //! hf_track_pid_reduced::TOFNSigmaPiProng0, hf_track_pid_reduced::TPCNSigmaKaProng0, hf_track_pid_reduced::TOFNSigmaKaProng0, + hf_track_pid_reduced::TPCNSigmaPrProng0, + hf_track_pid_reduced::TOFNSigmaPrProng0, hf_track_vars_reduced::HasTOFProng0, hf_track_vars_reduced::HasTPCProng0, hf_track_pid_reduced::TPCTOFNSigmaPiProng0, - hf_track_pid_reduced::TPCTOFNSigmaKaProng0); + hf_track_pid_reduced::TPCTOFNSigmaKaProng0, + hf_track_pid_reduced::TPCTOFNSigmaPrProng0); DECLARE_SOA_TABLE(HfRedPidDau1s, "AOD", "HFREDPIDDAU1", //! hf_track_pid_reduced::TPCNSigmaPiProng1, hf_track_pid_reduced::TOFNSigmaPiProng1, hf_track_pid_reduced::TPCNSigmaKaProng1, hf_track_pid_reduced::TOFNSigmaKaProng1, + hf_track_pid_reduced::TPCNSigmaPrProng1, + hf_track_pid_reduced::TOFNSigmaPrProng1, hf_track_vars_reduced::HasTOFProng1, hf_track_vars_reduced::HasTPCProng1, hf_track_pid_reduced::TPCTOFNSigmaPiProng1, - hf_track_pid_reduced::TPCTOFNSigmaKaProng1); + hf_track_pid_reduced::TPCTOFNSigmaKaProng1, + hf_track_pid_reduced::TPCTOFNSigmaPrProng1); DECLARE_SOA_TABLE(HfRedPidDau2s, "AOD", "HFREDPIDDAU2", //! hf_track_pid_reduced::TPCNSigmaPiProng2, hf_track_pid_reduced::TOFNSigmaPiProng2, hf_track_pid_reduced::TPCNSigmaKaProng2, hf_track_pid_reduced::TOFNSigmaKaProng2, + hf_track_pid_reduced::TPCNSigmaPrProng2, + hf_track_pid_reduced::TOFNSigmaPrProng2, hf_track_vars_reduced::HasTOFProng2, hf_track_vars_reduced::HasTPCProng2, hf_track_pid_reduced::TPCTOFNSigmaPiProng2, - hf_track_pid_reduced::TPCTOFNSigmaKaProng2); + hf_track_pid_reduced::TPCTOFNSigmaKaProng2, + hf_track_pid_reduced::TPCTOFNSigmaPrProng2); // Beauty candidates prongs namespace hf_cand_b0_reduced @@ -442,6 +464,26 @@ DECLARE_SOA_TABLE(HfRedBsDsMls, "AOD", "HFREDBSDSML", //! Table with ML scores f using HfRedCandBs = soa::Join; +namespace hf_cand_lb_reduced +{ +DECLARE_SOA_INDEX_COLUMN_FULL(Prong0Lc, prong0Lc, int, HfRed3Prongs, "_0"); //! Prong0 index +DECLARE_SOA_INDEX_COLUMN_FULL(Prong1Track, prong1Track, int, HfRedTrackBases, "_1"); //! Prong1 index +DECLARE_SOA_COLUMN(Prong0MlScoreBkg, prong0MlScoreBkg, float); //! Bkg ML score of the Lc daughter +DECLARE_SOA_COLUMN(Prong0MlScorePrompt, prong0MlScorePrompt, float); //! Prompt ML score of the Lc daughter +DECLARE_SOA_COLUMN(Prong0MlScoreNonprompt, prong0MlScoreNonprompt, float); //! Nonprompt ML score of the Lc daughter +} // namespace hf_cand_lb_reduced + +DECLARE_SOA_TABLE(HfRedLbProngs, "AOD", "HFREDLBPRONG", //! Table with Lb daughter indices + hf_cand_lb_reduced::Prong0LcId, hf_cand_lb_reduced::Prong1TrackId); + +DECLARE_SOA_TABLE(HfRedLbLcMls, "AOD", "HFREDLBLCML", //! Table with ML scores for the Lc daughter + hf_cand_lb_reduced::Prong0MlScoreBkg, + hf_cand_lb_reduced::Prong0MlScorePrompt, + hf_cand_lb_reduced::Prong0MlScoreNonprompt, + o2::soa::Marker<1>); + +using HfRedCandLb = soa::Join; + namespace hf_b0_mc { // MC Rec @@ -689,6 +731,89 @@ DECLARE_SOA_TABLE(HfCandBsConfigs, "AOD", "HFCANDBSCONFIG", //! Table with confi hf_cand_bs_config::MySelectionFlagD, hf_cand_bs_config::MyInvMassWindowDPi); +namespace hf_lb_mc +{ +// MC Rec +DECLARE_SOA_COLUMN(PtMother, ptMother, float); //! Transverse momentum of the mother in GeV/c +// MC Gen +DECLARE_SOA_COLUMN(PtTrack, ptTrack, float); //! Transverse momentum of the track in GeV/c +DECLARE_SOA_COLUMN(YTrack, yTrack, float); //! Rapidity of the track +DECLARE_SOA_COLUMN(EtaTrack, etaTrack, float); //! Pseudorapidity of the track +DECLARE_SOA_COLUMN(PtProng0, ptProng0, float); //! Transverse momentum of the track's prong0 in GeV/c +DECLARE_SOA_COLUMN(YProng0, yProng0, float); //! Rapidity of the track's prong0 +DECLARE_SOA_COLUMN(EtaProng0, etaProng0, float); //! Pseudorapidity of the track's prong0 +DECLARE_SOA_COLUMN(PtProng1, ptProng1, float); //! Transverse momentum of the track's prong1 in GeV/c +DECLARE_SOA_COLUMN(YProng1, yProng1, float); //! Rapidity of the track's prong1 +DECLARE_SOA_COLUMN(EtaProng1, etaProng1, float); //! Pseudorapidity of the track's prong1 + +DECLARE_SOA_COLUMN(PdgCodeBeautyMother, pdgCodeBeautyMother, int); //! Pdg code of beauty mother +DECLARE_SOA_COLUMN(PdgCodeCharmMother, pdgCodeCharmMother, int); //! Pdg code of charm mother +DECLARE_SOA_COLUMN(PdgCodeProng0, pdgCodeProng0, int); //! Pdg code of prong0 +DECLARE_SOA_COLUMN(PdgCodeProng1, pdgCodeProng1, int); //! Pdg code of prong1 +DECLARE_SOA_COLUMN(PdgCodeProng2, pdgCodeProng2, int); //! Pdg code of prong2 +DECLARE_SOA_COLUMN(PdgCodeProng3, pdgCodeProng3, int); //! Pdg code of prong3 +} // namespace hf_lb_mc + +// table with results of reconstruction level MC matching +DECLARE_SOA_TABLE(HfMcRecRedLcPis, "AOD", "HFMCRECREDLCPI", //! Table with reconstructed MC information on LcPi(<-Lb) pairs for reduced workflow + hf_cand_lb_reduced::Prong0LcId, + hf_cand_lb_reduced::Prong1TrackId, + hf_cand_lb::FlagMcMatchRec, + hf_cand_lb::FlagWrongCollision, + hf_cand_lb::DebugMcRec, + hf_lb_mc::PtMother); + +// try with extended table ? +// DECLARE_SOA_EXTENDED_TABLE_USER(ExTable, Tracks, "EXTABLE", +DECLARE_SOA_TABLE(HfMcCheckLcPis, "AOD", "HFMCCHECKLCPI", //! Table with reconstructed MC information on LcPi(<-Lb) pairs for MC checks in reduced workflow + hf_lb_mc::PdgCodeBeautyMother, + hf_lb_mc::PdgCodeCharmMother, + hf_lb_mc::PdgCodeProng0, + hf_lb_mc::PdgCodeProng1, + hf_lb_mc::PdgCodeProng2, + hf_lb_mc::PdgCodeProng3, + o2::soa::Marker<1>); + +// Table with same size as HFCANDLc +DECLARE_SOA_TABLE(HfMcRecRedLbs, "AOD", "HFMCRECREDLB", //! Reconstruction-level MC information on Lb candidates for reduced workflow + hf_cand_lb::FlagMcMatchRec, + hf_cand_lb::FlagWrongCollision, + hf_cand_lb::DebugMcRec, + hf_lb_mc::PtMother); + +DECLARE_SOA_TABLE(HfMcCheckLbs, "AOD", "HFMCCHECKLB", //! Table with reconstructed MC information on Lb candidates for MC checks in reduced workflow + hf_lb_mc::PdgCodeBeautyMother, + hf_lb_mc::PdgCodeCharmMother, + hf_lb_mc::PdgCodeProng0, + hf_lb_mc::PdgCodeProng1, + hf_lb_mc::PdgCodeProng2, + hf_lb_mc::PdgCodeProng3, + o2::soa::Marker<2>); + +DECLARE_SOA_TABLE(HfMcGenRedLbs, "AOD", "HFMCGENREDLB", //! Generation-level MC information on Lb candidates for reduced workflow + hf_cand_lb::FlagMcMatchGen, + hf_lb_mc::PtTrack, + hf_lb_mc::YTrack, + hf_lb_mc::EtaTrack, + hf_lb_mc::PtProng0, + hf_lb_mc::YProng0, + hf_lb_mc::EtaProng0, + hf_lb_mc::PtProng1, + hf_lb_mc::YProng1, + hf_lb_mc::EtaProng1); + +// store all configurables values used in the first part of the workflow +// so we can use them in the B0 part +namespace hf_cand_lb_config +{ +DECLARE_SOA_COLUMN(MySelectionFlagLc, mySelectionFlagLc, int8_t); //! Flag to filter selected Lc baryons +DECLARE_SOA_COLUMN(MyInvMassWindowLcPi, myInvMassWindowLcPi, float); //! Half-width of the Lb invariant-mass window in GeV/c2 +} // namespace hf_cand_lb_config + +DECLARE_SOA_TABLE(HfCandLbConfigs, "AOD", "HFCANDLBCONFIG", //! Table with configurables information for reduced workflow + hf_cand_lb_config::MySelectionFlagLc, + hf_cand_lb_config::MyInvMassWindowLcPi); + // Charm resonances analysis namespace hf_reso_3_prong { From 06a3044b46bd6ce98fda48ab455bbb60cfc65a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:42:19 +0200 Subject: [PATCH 04/85] Update CandidateSelectionTables.h --- PWGHF/DataModel/CandidateSelectionTables.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PWGHF/DataModel/CandidateSelectionTables.h b/PWGHF/DataModel/CandidateSelectionTables.h index 06dd445f98e..44719b1e5d9 100644 --- a/PWGHF/DataModel/CandidateSelectionTables.h +++ b/PWGHF/DataModel/CandidateSelectionTables.h @@ -277,11 +277,15 @@ DECLARE_SOA_TABLE(HfMlBplusToD0Pi, "AOD", "HFMLBPLUS", //! namespace hf_sel_candidate_lb { -DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //! +DECLARE_SOA_COLUMN(IsSelLbToLcPi, isSelLbToLcPi, int); //! selection flag on Lb candidate +DECLARE_SOA_COLUMN(MlProbLbToLcPi, mlProbLbToLcPi, float); //! ML score of Lb candidate for signal class + } // namespace hf_sel_candidate_lb DECLARE_SOA_TABLE(HfSelLbToLcPi, "AOD", "HFSELLB", //! hf_sel_candidate_lb::IsSelLbToLcPi); +DECLARE_SOA_TABLE(HfMlLbToLcPi, "AOD", "HFMLLB", //! + hf_sel_candidate_lb::MlProbLbToLcPi); namespace hf_sel_candidate_x { From 79ae5cdbcf9eaa63ec9611c2801fad8a63da8ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:45:47 +0200 Subject: [PATCH 05/85] Update CandidateReconstructionTables.h --- .../DataModel/CandidateReconstructionTables.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 754de37ec45..b413f6d545a 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -1840,13 +1840,21 @@ namespace hf_cand_lb { DECLARE_SOA_INDEX_COLUMN_FULL(Prong0, prong0, int, HfCand3Prong, "_0"); // Lb index // MC matching result: -DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level -DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level -DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); // particle origin, reconstruction level -DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); // particle origin, generator level -DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level +DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); // reconstruction level +DECLARE_SOA_COLUMN(FlagMcMatchGen, flagMcMatchGen, int8_t); // generator level +DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); // particle origin, reconstruction level +DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); // particle origin, generator level +DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level // mapping of decay types enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? + +enum DecayTypeMc : uint8_t { LbToLcPiToPKPiPi = 0, + LbToLcPiToPKPiK, + B0ToDplusPiToPiKPiPi, + PartlyRecoDecay, + OtherDecay, + NDecayTypeMc }; } // namespace hf_cand_lb // declare dedicated Lb candidate table From 35d9e71f86b6a5ad77ff3bac51c9837b0e9a751c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:46:39 +0200 Subject: [PATCH 06/85] Update CMakeLists.txt --- PWGHF/D2H/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/D2H/Tasks/CMakeLists.txt b/PWGHF/D2H/Tasks/CMakeLists.txt index 89f660b85ba..52019c9227e 100644 --- a/PWGHF/D2H/Tasks/CMakeLists.txt +++ b/PWGHF/D2H/Tasks/CMakeLists.txt @@ -84,6 +84,11 @@ o2physics_add_dpl_workflow(task-lb PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(task-lb-reduced + SOURCES taskLbReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(task-lc SOURCES taskLc.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From 7ba146ed8c74fdd2673b4b8b530bf247fb7201f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:50:09 +0200 Subject: [PATCH 07/85] Update CMakeLists.txt --- PWGHF/D2H/TableProducer/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 92eeda51051..445715d9e4e 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -26,6 +26,11 @@ o2physics_add_dpl_workflow(candidate-creator-bs-reduced PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) +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-charm-reso-reduced SOURCES candidateCreatorCharmResoReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -48,6 +53,11 @@ o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi-reduced PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(candidate-selector-Lb-to-Lc-pi-reduced + SOURCES candidateSelectorLbToLcPiReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore + COMPONENT_NAME Analysis) + # Data creators o2physics_add_dpl_workflow(data-creator-charm-had-pi-reduced @@ -65,4 +75,4 @@ o2physics_add_dpl_workflow(data-creator-charm-reso-reduced o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml SOURCES converterReduced3ProngsMl.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) From 80c9c9fbdce34bdeb4ae0d6d9ccdfe8f3d92ba35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:51:13 +0200 Subject: [PATCH 08/85] Add files via upload --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 825 ++++++++++++++++++++++++++++++ 1 file changed, 825 insertions(+) create mode 100644 PWGHF/D2H/Tasks/taskLbReduced.cxx diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx new file mode 100644 index 00000000000..f5255a63ef2 --- /dev/null +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -0,0 +1,825 @@ +// 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 taskLbReduced.cxx +/// \brief Lb → Lc+ π- → (pK- π+) π- analysis task +/// +/// \author Biao Zhang , Heidelberg University + +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Common/Core/RecoDecay.h" + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::analysis; +using namespace o2::framework; +using namespace o2::framework::expressions; + +namespace o2::aod +{ +namespace hf_cand_lb_lite +{ +DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc-baryon daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of bachelor pion (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaBach, absEtaBach, float); //! Absolute pseudorapidity of bachelor pion +DECLARE_SOA_COLUMN(ItsNClsBach, itsNClsBach, int); //! Number of ITS clusters of bachelor pion +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach, tpcNClsCrossedRowsBach, int); //! Number of TPC crossed rows of prongs of bachelor pion +DECLARE_SOA_COLUMN(TpcChi2NClBach, tpcChi2NClBach, float); //! Maximum TPC chi2 of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(PtLcProngMin, ptProngLcMin, float); //! Minimum pT of prongs of Lc-baryon daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(AbsEtaLcProngMin, absEtaProngLcMin, float); //! Minimum absolute pseudorapidity of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(ItsNClsLcProngMin, itsNClsLcProngMin, int); //! Minimum number of ITS clusters of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(TpcNClsCrossedRowsLcProngMin, tpcNClsCrossedRowsLcProngMin, int); //! Minimum number of TPC crossed rows of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(TpcChi2NClLcProngMax, tpcChi2NClLcProngMax, float); //! Maximum TPC chi2 of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc-baryon daughter candidates (GeV/c) +DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2) +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(PtGen, ptGen, float); //! Transverse momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(P, p, float); //! Momentum of candidate (GeV/c) +DECLARE_SOA_COLUMN(Y, y, float); //! Rapidity of candidate +DECLARE_SOA_COLUMN(Eta, eta, float); //! Pseudorapidity of candidate +DECLARE_SOA_COLUMN(Phi, phi, float); //! Azimuth angle of candidate +DECLARE_SOA_COLUMN(E, e, float); //! Energy of candidate (GeV) +DECLARE_SOA_COLUMN(NSigTpcPiBachelor, nSigTpcPiBachelor, float); //! TPC Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiBachelor, nSigTofPiBachelor, float); //! TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiBachelor, nSigTpcTofPiBachelor, float); //! Combined TPC and TOF Nsigma separation for bachelor with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcPrLcProng0, nSigTpcPrLcProng0, float); //! TPC Nsigma separation for Lc-baryon prong0 with proton mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPrLcProng0, nSigTofPrLcProng0, float); //! TOF Nsigma separation for Lc-baryon prong0 with proton mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPrLcProng0, nSigTpcTofPrLcProng0, float); //! Combined TPC and TOF Nsigma separation for Lc-baryon prong0 with proton mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcKaLcProng1, nSigTpcKaLcProng1, float); //! TPC Nsigma separation for Lc-baryon prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTofKaLcProng1, nSigTofKaLcProng1, float); //! TOF Nsigma separation for Lc-baryon prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofKaLcProng1, nSigTpcTofKaLcProng1, float); //! Combined TPC and TOF Nsigma separation for Lc-baryon prong1 with kaon mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcPiLcProng2, nSigTpcPiLcProng2, float); //! TPC Nsigma separation for Lc-baryon prong2 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTofPiLcProng2, nSigTofPiLcProng2, float); //! TOF Nsigma separation for Lc-baryon prong2 with pion mass hypothesis +DECLARE_SOA_COLUMN(NSigTpcTofPiLcProng2, nSigTpcTofPiLcProng2, float); //! Combined TPC and TOF Nsigma separation for Lc-baryon prong0 with pion mass hypothesis +DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Transverse decay length of candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthNormalised, decayLengthNormalised, float); //! Normalised decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthXYNormalised, decayLengthXYNormalised, float); //! Normalised transverse decay length of candidate +DECLARE_SOA_COLUMN(DecayLengthLc, decayLengthLc, float); //! Decay length of Lc-baryon daughter candidate (cm) +DECLARE_SOA_COLUMN(DecayLengthXYLc, decayLengthXYLc, float); //! Transverse decay length of Lc-baryon daughter candidate (cm) +DECLARE_SOA_COLUMN(ImpactParameterLc, impactParameterLc, float); //! Impact parameter product of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(ImpactParameterBach, impactParameterBach, float); //! Impact parameter product of bachelor pion +DECLARE_SOA_COLUMN(ImpactParameterProduct, impactParameterProduct, float); //! Impact parameter product of daughters +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine pointing angle of candidate +DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine pointing angle of candidate in transverse plane +DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs +DECLARE_SOA_COLUMN(MlScoreSig, mlScoreSig, float); //! ML score for signal class +DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); //! Flag for association with wrong collision +} // namespace hf_cand_lb_lite + +DECLARE_SOA_TABLE(HfRedCandLbLites, "AOD", "HFREDCANDLBLITE", //! Table with some Lb properties + // B meson features hf_cand_lb_lite::M, + hf_cand_lb_lite::M, + hf_cand_lb_lite::Pt, + hf_cand_lb_lite::Eta, + hf_cand_lb_lite::Phi, + hf_cand_lb_lite::Y, + hf_cand_lb_lite::Cpa, + hf_cand_lb_lite::CpaXY, + hf_cand::Chi2PCA, + hf_cand_lb_lite::DecayLength, + hf_cand_lb_lite::DecayLengthXY, + hf_cand_lb_lite::DecayLengthNormalised, + hf_cand_lb_lite::DecayLengthXYNormalised, + hf_cand_lb_lite::ImpactParameterProduct, + hf_cand_lb_lite::MaxNormalisedDeltaIP, + hf_cand_lb_lite::MlScoreSig, + hf_sel_candidate_lb::IsSelLbToLcPi, + // D meson features + hf_cand_lb_lite::MLc, + hf_cand_lb_lite::PtLc, + hf_cand_lb_lite::DecayLengthLc, + hf_cand_lb_lite::DecayLengthXYLc, + hf_cand_lb_lite::ImpactParameterLc, + hf_cand_lb_lite::PtLcProngMin, + hf_cand_lb_lite::AbsEtaLcProngMin, + hf_cand_lb_lite::ItsNClsLcProngMin, + hf_cand_lb_lite::TpcNClsCrossedRowsLcProngMin, + hf_cand_lb_lite::TpcChi2NClLcProngMax, + hf_cand_lb_lite::NSigTpcPrLcProng0, + hf_cand_lb_lite::NSigTofPrLcProng0, + hf_cand_lb_lite::NSigTpcTofPrLcProng0, + hf_cand_lb_lite::NSigTpcKaLcProng1, + hf_cand_lb_lite::NSigTofKaLcProng1, + hf_cand_lb_lite::NSigTpcTofKaLcProng1, + hf_cand_lb_lite::NSigTpcPiLcProng2, + hf_cand_lb_lite::NSigTofPiLcProng2, + hf_cand_lb_lite::NSigTpcTofPiLcProng2, + hf_cand_lb_reduced::Prong0MlScoreBkg, + hf_cand_lb_reduced::Prong0MlScorePrompt, + hf_cand_lb_reduced::Prong0MlScoreNonprompt, + // pion features + hf_cand_lb_lite::PtBach, + hf_cand_lb_lite::AbsEtaBach, + hf_cand_lb_lite::ItsNClsBach, + hf_cand_lb_lite::TpcNClsCrossedRowsBach, + hf_cand_lb_lite::TpcChi2NClBach, + hf_cand_lb_lite::ImpactParameterBach, + hf_cand_lb_lite::NSigTpcPiBachelor, + hf_cand_lb_lite::NSigTofPiBachelor, + hf_cand_lb_lite::NSigTpcTofPiBachelor, + // MC truth + hf_cand_3prong::FlagMcMatchRec, + hf_cand_3prong::OriginMcRec, + hf_cand_lb_lite::FlagWrongCollision, + hf_cand_lb_lite::PtGen); + +DECLARE_SOA_TABLE(HfRedLbMcCheck, "AOD", "HFREDLBMCCHECK", //! Table with MC decay type check + hf_cand_3prong::FlagMcMatchRec, + hf_cand_lb_lite::FlagWrongCollision, + hf_cand_lb_lite::MLc, + hf_cand_lb_lite::PtLc, + hf_cand_lb_lite::M, + hf_cand_lb_lite::Pt, + hf_cand_lb_lite::MlScoreSig, + hf_lb_mc::PdgCodeBeautyMother, + hf_lb_mc::PdgCodeCharmMother, + hf_lb_mc::PdgCodeProng0, + hf_lb_mc::PdgCodeProng1, + hf_lb_mc::PdgCodeProng2, + hf_lb_mc::PdgCodeProng3); +} // namespace o2::aod + +/// Lb analysis task +struct HfTaskLbReduced { + Produces hfRedCandLbLite; + Produces hfRedLbMcCheck; + + Configurable selectionFlagLb{"selectionFlagLb", 1, "Selection Flag for Lb"}; + Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen particle rapidity"}; + Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; + Configurable etaTrackMax{"etaTrackMax", 0.8, "max. track pseudo-rapidity for acceptance calculation"}; + Configurable ptTrackMin{"ptTrackMin", 0.1, "min. track transverse momentum for acceptance calculation"}; + Configurable fillHistograms{"fillHistograms", true, "Flag to enable histogram filling"}; + Configurable fillSparses{"fillSparses", false, "Flag to enable sparse filling"}; + Configurable fillTree{"fillTree", false, "Flag to enable tree filling"}; + Configurable fillBackground{"fillBackground", false, "Flag to enable filling of background histograms/sparses/tree (only MC)"}; + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; + Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + + HfHelper hfHelper; + + Filter filterSelectCandidates = (aod::hf_sel_candidate_lb::isSelLbToLcPi >= selectionFlagLb); + + HistogramRegistry registry{"registry"}; + + using TracksPion = soa::Join; + using CandsLc = soa::Join; + + void init(InitContext&) + { + std::array processFuncData{doprocessData, doprocessDataWithLcMl, doprocessDataWithLbMl}; + if ((std::accumulate(processFuncData.begin(), processFuncData.end(), 0)) > 1) { + LOGP(fatal, "Only one process function for data can be enabled at a time."); + } + std::array processFuncMc{doprocessMc, doprocessMcWithDecayTypeCheck, doprocessMcWithLcMl, doprocessMcWithLcMlAndDecayTypeCheck, doprocessMcWithLbMl, doprocessMcWithLbMlAndDecayTypeCheck}; + if ((std::accumulate(processFuncMc.begin(), processFuncMc.end(), 0)) > 1) { + LOGP(fatal, "Only one process function for MC can be enabled at a time."); + } + + const AxisSpec axisMlScore{100, 0.f, 1.f}; + const AxisSpec axisMassLb{300, 4.5f, 6.0f}; + const AxisSpec axisMassLc{300, 2.15f, 2.45f}; + const AxisSpec axisDecayLength{200, 0.f, 0.4f}; + const AxisSpec axisNormDecayLength{100, 0.f, 50.f}; + const AxisSpec axisDca{100, -0.05f, 0.05f}; + const AxisSpec axisCosp{110, 0.f, 1.1f}; + const AxisSpec axisEta{30, -1.5f, 1.5f}; + const AxisSpec axisError{100, 0.f, 1.f}; + const AxisSpec axisImpParProd{100, -1.e-3, 1.e-3}; + const AxisSpec axisPtLb{100, 0.f, 50.f}; + const AxisSpec axisPtLc{100, 0.f, 50.f}; + const AxisSpec axisPtPi{100, 0.f, 10.f}; + + if (doprocessData || doprocessDataWithLcMl || doprocessDataWithLbMl) { + if (fillHistograms) { + registry.add("hMass", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{M} (D#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLb, axisMassLb}}); + registry.add("hDecLength", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hDecLengthXy", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hNormDecLengthXy", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); + registry.add("hDcaProng0", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng1", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hPtProng0", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); + registry.add("hPtProng1", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); + registry.add("hCosp", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hCospXy", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hEta", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hRapidity", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hImpParProd", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); + registry.add("hinvMassLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); + registry.add("hDecLengthLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hCospLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + + // ML scores of D- daughter + if (doprocessDataWithLcMl) { + registry.add("hMlScoreBkgLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + } + + // ML scores of Lb candidate + if (doprocessDataWithLbMl) { + registry.add("hMlScoreSigLb", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong0, #Lambda_{b}^{0} ML signal score;entries", {HistType::kTH2F, {axisPtLb, axisMlScore}}); + } + } + if (fillSparses) { + if (!(doprocessDataWithLcMl || doprocessDataWithLbMl)) { + registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + } else { + registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + } + } + } + + if (doprocessMc || doprocessMcWithDecayTypeCheck || doprocessMcWithLcMl || doprocessMcWithLcMlAndDecayTypeCheck || doprocessMcWithLbMl || doprocessMcWithLbMlAndDecayTypeCheck) { + if (fillHistograms) { + // gen histos + registry.add("hEtaGen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hYGen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hYGenWithProngsInAcceptance", "MC particles (generated-daughters in acceptance);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hPtProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}^{gen}(D^{#minus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); + registry.add("hPtProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}^{gen}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); + registry.add("hYProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(D^{#minus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hYProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#pi^{#plus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hEtaProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(D^{#minus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hEtaProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(#pi^{#plus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + + // reco histos + // signal + registry.add("hMassRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{M} (D#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLb, axisMassLb}}); + registry.add("hDecLengthRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hDecLengthXyRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hNormDecLengthXyRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); + registry.add("hDcaProng0RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng1RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hPtProng0RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); + registry.add("hPtProng1RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); + registry.add("hCospRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hCospXyRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hEtaRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hRapidityRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hImpParProdRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); + registry.add("hinvMassLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); + registry.add("hDecLengthLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthXyLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hCospLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + // background + if (fillBackground) { + registry.add("hMassRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{M} (D#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLb, axisMassLb}}); + registry.add("hDecLengthRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hDecLengthXyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); + registry.add("hNormDecLengthXyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); + registry.add("hDcaProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng1RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hPtProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); + registry.add("hPtProng1RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); + registry.add("hCospRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hCospXyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLb, axisCosp}}); + registry.add("hEtaRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{#eta};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hRapidityRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hImpParProdRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); + registry.add("hinvMassLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); + registry.add("hDecLengthLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthXyLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hCospLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + } + // MC checks + if (doprocessMcWithDecayTypeCheck || doprocessMcWithLbMlAndDecayTypeCheck || doprocessMcWithLcMlAndDecayTypeCheck) { + constexpr uint8_t kNBinsDecayTypeMc = hf_cand_lb::DecayTypeMc::NDecayTypeMc; + TString labels[kNBinsDecayTypeMc]; + labels[hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi] = "#Lambda_{b}^{0} #rightarrow (#Lambda_{c}^{#plus} #rightarrow p K^{#minus} #pi^{#plus}) #pi^{#minus}"; + labels[hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiK] = "#Lambda_{b}^{0} #rightarrow (#Lambda_{c}^{#plus} #rightarrow p K^{#minus} #pi^{#plus}) K^{#minus}"; + labels[hf_cand_lb::DecayTypeMc::PartlyRecoDecay] = "Partly reconstructed decay channel"; + labels[hf_cand_lb::DecayTypeMc::OtherDecay] = "Other decays"; + static const AxisSpec axisDecayType = {kNBinsDecayTypeMc, 0.5, kNBinsDecayTypeMc + 0.5, ""}; + registry.add("hDecayTypeMc", "DecayType", {HistType::kTH3F, {axisDecayType, axisMassLb, axisPtLb}}); + for (uint8_t iBin = 0; iBin < kNBinsDecayTypeMc; ++iBin) { + registry.get(HIST("hDecayTypeMc"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin]); + } + } + // ML scores of Lc daughter + if (doprocessMcWithLcMl || doprocessMcWithLcMlAndDecayTypeCheck) { + // signal + registry.add("hMlScoreBkgLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + // background + registry.add("hMlScoreBkgLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + } + // ML scores of Lb candidate + if (doprocessMcWithLbMl || doprocessMcWithLbMlAndDecayTypeCheck) { + // signal + registry.add("hMlScoreSigLbRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong0, #Lambda_{b}^{0} ML signal score;entries", {HistType::kTH2F, {axisPtLb, axisMlScore}}); + // background + registry.add("hMlScoreSigLbRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong0, #Lambda_{b}^{0} ML signal score;entries", {HistType::kTH2F, {axisPtLb, axisMlScore}}); + } + } + if (fillSparses) { + // gen sparses + registry.add("hPtYGenSig", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}(#Lambda_{b}^{0})", {HistType::kTHnSparseF, {axisPtLb, axisEta}}); + registry.add("hPtYWithProngsInAccepanceGenSig", "#Lambda_{b}^{0} particles (generated-daughters in acceptance);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}(#Lambda_{b}^{0})", {HistType::kTHnSparseF, {axisPtLb, axisEta}}); + + // reco sparses + if (!(doprocessDataWithLcMl || doprocessDataWithLbMl)) { + registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + if (fillBackground) { + registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + } + } else { + registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + if (fillBackground) { + registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + } + } + } + } + } + + /// Selection of Lb daughter in geometrical acceptance + /// \param etaProng is the pseudorapidity of Lb prong + /// \param ptProng is the pT of Lb prong + /// \return true if prong is in geometrical acceptance + template + bool isProngInAcceptance(const T& etaProng, const T& ptProng) + { + return std::abs(etaProng) <= etaTrackMax && ptProng >= ptTrackMin; + } + + /// Fill candidate information at reconstruction level + /// \param doMc is the flag to enable the filling with MC information + /// \param withDecayTypeCheck is the flag to enable MC with decay type check + /// \param withLcMl is the flag to enable the filling with ML scores for the D- daughter + /// \param withLbMl is the flag to enable the filling with ML scores for the Lb candidate + /// \param candidate is the Lb candidate + /// \param candidatesLc is the table with D- candidates + template + void fillCand(Cand const& candidate, + CandsLc const&) + { + auto ptCandLb = candidate.pt(); + auto invMassLb = hfHelper.invMassLbToLcPi(candidate); + auto candLc = candidate.template prong0Lc_as(); + auto ptLc = candidate.ptProng0(); + auto invMassLc = candLc.invMassHypo0(); + std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; + std::array posSvLc{candLc.xSecondaryVertex(), candLc.ySecondaryVertex(), candLc.zSecondaryVertex()}; + std::array momLc{candLc.pVector()}; + auto cospLc = RecoDecay::cpa(posPv, posSvLc, momLc); + auto cospXyLc = RecoDecay::cpaXY(posPv, posSvLc, momLc); + auto decLenLc = RecoDecay::distance(posPv, posSvLc); + auto decLenXyLc = RecoDecay::distanceXY(posPv, posSvLc); + + int8_t flagMcMatchRec = 0; + int8_t flagWrongCollision = 0; + bool isSignal = false; + if constexpr (doMc) { + flagMcMatchRec = candidate.flagMcMatchRec(); + flagWrongCollision = candidate.flagWrongCollision(); + isSignal = TESTBIT(std::abs(flagMcMatchRec), hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi); + } + + if (fillHistograms) { + if constexpr (doMc) { + if (isSignal) { + registry.fill(HIST("hMassRecSig"), ptCandLb, hfHelper.invMassLbToLcPi(candidate)); + registry.fill(HIST("hPtProng0RecSig"), ptCandLb, candidate.ptProng0()); + registry.fill(HIST("hPtProng1RecSig"), ptCandLb, candidate.ptProng1()); + registry.fill(HIST("hImpParProdRecSig"), ptCandLb, candidate.impactParameterProduct()); + registry.fill(HIST("hDecLengthRecSig"), ptCandLb, candidate.decayLength()); + registry.fill(HIST("hDecLengthXyRecSig"), ptCandLb, candidate.decayLengthXY()); + registry.fill(HIST("hNormDecLengthXyRecSig"), ptCandLb, candidate.decayLengthXY() / candidate.errorDecayLengthXY()); + registry.fill(HIST("hDcaProng0RecSig"), ptCandLb, candidate.impactParameter0()); + registry.fill(HIST("hDcaProng1RecSig"), ptCandLb, candidate.impactParameter1()); + registry.fill(HIST("hCospRecSig"), ptCandLb, candidate.cpa()); + registry.fill(HIST("hCospXyRecSig"), ptCandLb, candidate.cpaXY()); + registry.fill(HIST("hEtaRecSig"), ptCandLb, candidate.eta()); + registry.fill(HIST("hRapidityRecSig"), ptCandLb, hfHelper.yLb(candidate)); + registry.fill(HIST("hinvMassLcRecSig"), ptLc, invMassLc); + registry.fill(HIST("hDecLengthLcRecSig"), ptLc, decLenLc); + registry.fill(HIST("hDecLengthXyLcRecSig"), ptLc, decLenXyLc); + registry.fill(HIST("hCospLcRecSig"), ptLc, cospLc); + registry.fill(HIST("hCospXyLcRecSig"), ptLc, cospXyLc); + if constexpr (withDecayTypeCheck) { + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi, invMassLb, ptCandLb); + } + if constexpr (withLcMl) { + registry.fill(HIST("hMlScoreBkgLcRecSig"), ptLc, candidate.prong0MlScoreBkg()); + registry.fill(HIST("hMlScorePromptLcRecSig"), ptLc, candidate.prong0MlScorePrompt()); + registry.fill(HIST("hMlScoreNonPromptLcRecSig"), ptLc, candidate.prong0MlScoreNonprompt()); + } + if constexpr (withLbMl) { + registry.fill(HIST("hMlScoreSigLbRecSig"), ptCandLb, candidate.mlProbLbToLcPi()); + } + } else if (fillBackground) { + registry.fill(HIST("hMassRecBg"), ptCandLb, hfHelper.invMassLbToLcPi(candidate)); + registry.fill(HIST("hPtProng0RecBg"), ptCandLb, candidate.ptProng0()); + registry.fill(HIST("hPtProng1RecBg"), ptCandLb, candidate.ptProng1()); + registry.fill(HIST("hImpParProdRecBg"), ptCandLb, candidate.impactParameterProduct()); + registry.fill(HIST("hDecLengthRecBg"), ptCandLb, candidate.decayLength()); + registry.fill(HIST("hDecLengthXyRecBg"), ptCandLb, candidate.decayLengthXY()); + registry.fill(HIST("hNormDecLengthXyRecBg"), ptCandLb, candidate.decayLengthXY() / candidate.errorDecayLengthXY()); + registry.fill(HIST("hDcaProng0RecBg"), ptCandLb, candidate.impactParameter0()); + registry.fill(HIST("hDcaProng1RecBg"), ptCandLb, candidate.impactParameter1()); + registry.fill(HIST("hCospRecBg"), ptCandLb, candidate.cpa()); + registry.fill(HIST("hCospXyRecBg"), ptCandLb, candidate.cpaXY()); + registry.fill(HIST("hEtaRecBg"), ptCandLb, candidate.eta()); + registry.fill(HIST("hRapidityRecBg"), ptCandLb, hfHelper.yLb(candidate)); + registry.fill(HIST("hinvMassLcRecBg"), ptLc, invMassLc); + registry.fill(HIST("hDecLengthLcRecBg"), ptLc, decLenLc); + registry.fill(HIST("hDecLengthXyLcRecBg"), ptLc, decLenXyLc); + registry.fill(HIST("hCospLcRecBg"), ptLc, cospLc); + registry.fill(HIST("hCospXyLcRecBg"), ptLc, cospXyLc); + if constexpr (withLcMl) { + registry.fill(HIST("hMlScoreBkgLcRecBg"), ptLc, candidate.prong0MlScoreBkg()); + registry.fill(HIST("hMlScorePromptLcRecBg"), ptLc, candidate.prong0MlScorePrompt()); + registry.fill(HIST("hMlScoreNonPromptLcRecBg"), ptLc, candidate.prong0MlScoreNonprompt()); + } + if constexpr (withLbMl) { + registry.fill(HIST("hMlScoreSigLbRecBg"), ptCandLb, candidate.mlProbLbToLcPi()); + } + } else if constexpr (withDecayTypeCheck) { + if (TESTBIT(flagMcMatchRec, hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi)) { // Lb → Lc+ π- → (pK-π+) π- + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiK, invMassLb, ptCandLb); + } else if (TESTBIT(flagMcMatchRec, hf_cand_lb::DecayTypeMc::PartlyRecoDecay)) { // Partly reconstructed decay channel + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::PartlyRecoDecay, invMassLb, ptCandLb); + } else { + registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_lb::DecayTypeMc::OtherDecay, invMassLb, ptCandLb); + } + } + } else { + registry.fill(HIST("hMass"), ptCandLb, invMassLb); + registry.fill(HIST("hPtProng0"), ptCandLb, candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), ptCandLb, candidate.ptProng1()); + registry.fill(HIST("hImpParProd"), ptCandLb, candidate.impactParameterProduct()); + registry.fill(HIST("hDecLength"), ptCandLb, candidate.decayLength()); + registry.fill(HIST("hDecLengthXy"), ptCandLb, candidate.decayLengthXY()); + registry.fill(HIST("hNormDecLengthXy"), ptCandLb, candidate.decayLengthXY() / candidate.errorDecayLengthXY()); + registry.fill(HIST("hDcaProng0"), ptCandLb, candidate.impactParameter0()); + registry.fill(HIST("hDcaProng1"), ptCandLb, candidate.impactParameter1()); + registry.fill(HIST("hCosp"), ptCandLb, candidate.cpa()); + registry.fill(HIST("hCospXy"), ptCandLb, candidate.cpaXY()); + registry.fill(HIST("hEta"), ptCandLb, candidate.eta()); + registry.fill(HIST("hRapidity"), ptCandLb, hfHelper.yLb(candidate)); + registry.fill(HIST("hinvMassLc"), ptLc, invMassLc); + registry.fill(HIST("hDecLengthLc"), ptLc, decLenLc); + registry.fill(HIST("hDecLengthXyLc"), ptLc, decLenXyLc); + registry.fill(HIST("hCospLc"), ptLc, cospLc); + registry.fill(HIST("hCospXyLc"), ptLc, cospXyLc); + + if constexpr (withLcMl) { + registry.fill(HIST("hMlScoreBkgLc"), ptLc, candidate.prong0MlScoreBkg()); + registry.fill(HIST("hMlScorePromptLc"), ptLc, candidate.prong0MlScorePrompt()); + registry.fill(HIST("hMlScoreNonPromptLc"), ptLc, candidate.prong0MlScoreNonprompt()); + } + if constexpr (withLbMl) { + registry.fill(HIST("hMlScoreSigLb"), ptCandLb, candidate.mlProbLbToLcPi()); + } + } + } + if (fillSparses) { + if constexpr (withLcMl) { + if (isSignal) { + if constexpr (withLcMl) { + registry.fill(HIST("hMassPtCutVarsRecSig"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); + } else { + registry.fill(HIST("hMassPtCutVarsRecSig"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); + } + } else if (fillBackground) { + if constexpr (withLcMl) { + registry.fill(HIST("hMassPtCutVarsRecBg"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); + } else { + registry.fill(HIST("hMassPtCutVarsRecBg"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); + } + } + } else { + if constexpr (withLcMl) { + registry.fill(HIST("hMassPtCutVars"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, candidate.prong0MlScoreBkg(), candidate.prong0MlScoreNonprompt()); + } else { + registry.fill(HIST("hMassPtCutVars"), invMassLb, ptCandLb, candidate.decayLength(), candidate.decayLengthXY() / candidate.errorDecayLengthXY(), candidate.impactParameterProduct(), candidate.cpa(), invMassLc, ptLc, decLenLc, cospLc); + } + } + } + if (fillTree) { + float pseudoRndm = ptLc * 1000. - static_cast(ptLc * 1000); + if (flagMcMatchRec != 0 || (((doMc && fillBackground) || !doMc) && (ptCandLb >= ptMaxForDownSample || pseudoRndm < downSampleBkgFactor))) { + float prong0MlScoreBkg = -1.; + float prong0MlScorePrompt = -1.; + float prong0MlScoreNonprompt = -1.; + float candidateMlScoreSig = -1; + if constexpr (withLcMl) { + prong0MlScoreBkg = candidate.prong0MlScoreBkg(); + prong0MlScorePrompt = candidate.prong0MlScorePrompt(); + prong0MlScoreNonprompt = candidate.prong0MlScoreNonprompt(); + } + if constexpr (withLbMl) { + candidateMlScoreSig = candidate.mlProbLbToLcPi(); + } + auto prong1 = candidate.template prong1Track_as(); + + float ptMother = -1.; + if constexpr (doMc) { + ptMother = candidate.ptMother(); + } + + hfRedCandLbLite( + // Lb features + invMassLb, + ptCandLb, + candidate.eta(), + candidate.phi(), + hfHelper.yLb(candidate), + candidate.cpa(), + candidate.cpaXY(), + candidate.chi2PCA(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.decayLengthNormalised(), + candidate.decayLengthXYNormalised(), + candidate.impactParameterProduct(), + candidate.maxNormalisedDeltaIP(), + candidateMlScoreSig, + candidate.isSelLbToLcPi(), + // Lc-baryon features + invMassLc, + ptLc, + decLenLc, + decLenXyLc, + candidate.impactParameter0(), + candLc.ptProngMin(), + candLc.absEtaProngMin(), + candLc.itsNClsProngMin(), + candLc.tpcNClsCrossedRowsProngMin(), + candLc.tpcChi2NClProngMax(), + candLc.tpcNSigmaPrProng0(), + candLc.tofNSigmaPrProng0(), + candLc.tpcTofNSigmaPrProng0(), + candLc.tpcNSigmaKaProng1(), + candLc.tofNSigmaKaProng1(), + candLc.tpcTofNSigmaKaProng1(), + candLc.tpcNSigmaPiProng2(), + candLc.tofNSigmaPiProng2(), + candLc.tpcTofNSigmaPiProng2(), + prong0MlScoreBkg, + prong0MlScorePrompt, + prong0MlScoreNonprompt, + // pion features + candidate.ptProng1(), + std::abs(RecoDecay::eta(prong1.pVector())), + prong1.itsNCls(), + prong1.tpcNClsCrossedRows(), + prong1.tpcChi2NCl(), + candidate.impactParameter1(), + prong1.tpcNSigmaPi(), + prong1.tofNSigmaPi(), + prong1.tpcTofNSigmaPi(), + // MC truth + flagMcMatchRec, + isSignal, + flagWrongCollision, + ptMother); + + if constexpr (withDecayTypeCheck) { + hfRedLbMcCheck( + flagMcMatchRec, + flagWrongCollision, + invMassLc, + ptLc, + invMassLb, + ptCandLb, + candidateMlScoreSig, + candidate.pdgCodeBeautyMother(), + candidate.pdgCodeCharmMother(), + candidate.pdgCodeProng0(), + candidate.pdgCodeProng1(), + candidate.pdgCodeProng2(), + candidate.pdgCodeProng3()); + } + } + } + } + + /// Fill particle histograms (gen MC truth) + void fillCandMcGen(aod::HfMcGenRedLbs::iterator const& particle) + { + auto ptParticle = particle.ptTrack(); + auto yParticle = particle.yTrack(); + auto etaParticle = particle.etaTrack(); + if (yCandGenMax >= 0. && std::abs(yParticle) > yCandGenMax) { + return; + } + std::array ptProngs = {particle.ptProng0(), particle.ptProng1()}; + std::array yProngs = {particle.yProng0(), particle.yProng1()}; + std::array etaProngs = {particle.etaProng0(), particle.etaProng1()}; + bool prongsInAcc = isProngInAcceptance(etaProngs[0], ptProngs[0]) && isProngInAcceptance(etaProngs[1], ptProngs[1]); + + if (fillHistograms) { + registry.fill(HIST("hPtProng0Gen"), ptParticle, ptProngs[0]); + registry.fill(HIST("hPtProng1Gen"), ptParticle, ptProngs[1]); + registry.fill(HIST("hYProng0Gen"), ptParticle, yProngs[0]); + registry.fill(HIST("hYProng1Gen"), ptParticle, yProngs[1]); + registry.fill(HIST("hEtaProng0Gen"), ptParticle, etaProngs[0]); + registry.fill(HIST("hEtaProng1Gen"), ptParticle, etaProngs[1]); + + registry.fill(HIST("hYGen"), ptParticle, yParticle); + registry.fill(HIST("hEtaGen"), ptParticle, etaParticle); + + // generated Lb with daughters in geometrical acceptance + if (prongsInAcc) { + registry.fill(HIST("hYGenWithProngsInAcceptance"), ptParticle, yParticle); + } + } + if (fillSparses) { + registry.fill(HIST("hPtYGenSig"), ptParticle, yParticle); + if (prongsInAcc) { + registry.fill(HIST("hPtYWithProngsInAccepanceGenSig"), ptParticle, yParticle); + } + } + } + + // Process functions + void processData(soa::Filtered> const& candidates, + CandsLc const& candidatesLc, + TracksPion const&) + { + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // candidate loop + } // processData + PROCESS_SWITCH(HfTaskLbReduced, processData, "Process data without ML scores for Lb and Lc daughter", true); + + void processDataWithLcMl(soa::Filtered> const& candidates, + CandsLc const& candidatesLc, + TracksPion const&) + { + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // candidate loop + } // processDataWithLcMl + PROCESS_SWITCH(HfTaskLbReduced, processDataWithLcMl, "Process data with(out) ML scores for Lc daughter (Lb)", false); + + void processDataWithLbMl(soa::Filtered> const& candidates, + CandsLc const& candidatesLc, + TracksPion const&) + { + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // candidate loop + } // processDataWithLbMl + PROCESS_SWITCH(HfTaskLbReduced, processDataWithLbMl, "Process data with(out) ML scores for Lb (Lc daughter)", false); + + void processMc(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMc + PROCESS_SWITCH(HfTaskLbReduced, processMc, "Process MC without ML scores for Lb and Lc daughter", false); + + void processMcWithDecayTypeCheck(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMc + PROCESS_SWITCH(HfTaskLbReduced, processMcWithDecayTypeCheck, "Process MC with decay type check and without ML scores for Lb and D daughter", false); + + void processMcWithLcMl(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMcWithLcMl + PROCESS_SWITCH(HfTaskLbReduced, processMcWithLcMl, "Process MC with(out) ML scores for Lc daughter (Lb)", false); + + void processMcWithLcMlAndDecayTypeCheck(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMc + PROCESS_SWITCH(HfTaskLbReduced, processMcWithLcMlAndDecayTypeCheck, "Process MC with decay type check and with(out) ML scores for Lb (Lc daughter)", false); + + void processMcWithLbMl(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMcWithLbMl + PROCESS_SWITCH(HfTaskLbReduced, processMcWithLbMl, "Process MC with(out) ML scores for Lb (Lc daughter)", false); + + void processMcWithLbMlAndDecayTypeCheck(soa::Filtered> const& candidates, + aod::HfMcGenRedLbs const& mcParticles, + CandsLc const& candidatesLc, + TracksPion const&) + { + // MC rec + for (const auto& candidate : candidates) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yLb(candidate)) > yCandRecoMax) { + continue; + } + fillCand(candidate, candidatesLc); + } // rec + + // MC gen. level + for (const auto& particle : mcParticles) { + fillCandMcGen(particle); + } // gen + } // processMc + PROCESS_SWITCH(HfTaskLbReduced, processMcWithLbMlAndDecayTypeCheck, "Process MC with decay type check and with(out) ML scores for Lb (Lc daughter)", false); +}; // struct + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 8ac973e4df7fe6cf9509670db3cf35ab9ec370e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:53:15 +0200 Subject: [PATCH 09/85] Add files via upload --- .../candidateCreatorLbReduced.cxx | 336 ++++++++++++++++++ .../candidateSelectorLbToLcPiReduced.cxx | 246 +++++++++++++ 2 files changed, 582 insertions(+) create mode 100644 PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx create mode 100644 PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx new file mode 100644 index 00000000000..9d8e777e710 --- /dev/null +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -0,0 +1,336 @@ +// 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 candidateCreatorLbReduced.cxx +/// \brief Reconstruction of Lb candidates +/// +/// \author Biao Zhang , Heidelberg University + +#include + +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/DCA.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/CollisionAssociationTables.h" + +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" +#include "PWGHF/Utils/utilsTrkCandHf.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_trkcandsel; + +/// Reconstruction of Lb candidates +struct HfCandidateCreatorLbReduced { + Produces rowCandidateBase; // table defined in CandidateReconstructionTables.h + Produces rowCandidateProngs; // table defined in ReducedDataModel.h + Produces rowCandidateLcMlScores; // table defined in ReducedDataModel.h + + // vertexing + Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; + Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; + Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; + Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; + Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any Lb is smaller than this"}; + Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + // selection + Configurable invMassWindowLcPiTolerance{"invMassWindowLcPiTolerance", 0.01, "invariant-mass window tolerance for LcPi pair preselections (GeV/c2)"}; + + float myInvMassWindowLcPi{1.}; // variable that will store the value of invMassWindowLcPi + float massPi{0.}; + float massLc{0.}; + float MassLb{0.}; + float bz{0.}; + + o2::vertexing::DCAFitterN<2> df2; // fitter for B vertex (2-prong vertex fitter) + + using HfRedCollisionsWithExtras = soa::Join; + + Preslice> candsLcPerCollision = hf_track_index_reduced::hfRedCollisionId; + Preslice> candsDWithMlPerCollision = hf_track_index_reduced::hfRedCollisionId; + Preslice> tracksPionPerCollision = hf_track_index_reduced::hfRedCollisionId; + + std::shared_ptr hCandidates; + HistogramRegistry registry{"registry"}; + + void init(InitContext const&) + { + std::array doprocess{doprocessData, doprocessDataWithLcMl}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "Only one process function for data should be enabled at a time."); + } + + // invariant-mass window cut + massPi = o2::constants::physics::MassPiPlus; + massLc = o2::constants::physics::MassLambdaCPlus; + MassLb = o2::constants::physics::MassLambdaB0; + + // Initialize fitter + df2.setPropagateToPCA(propagateToPCA); + df2.setMaxR(maxR); + df2.setMaxDZIni(maxDZIni); + df2.setMinParamChange(minParamChange); + df2.setMinRelChi2Change(minRelChi2Change); + df2.setUseAbsDCA(useAbsDCA); + df2.setWeightedFinalPCA(useWeightedFinalPCA); + + // histograms + registry.add("hMassLambdaLbToLcPi", "2-prong candidates;inv. mass (#Lambda_{b}^{0} #rightarrow #Lambda_{c}^{#plus}#pi^{#minus} #rightarrow pK^{#minus}#pi^{#plus}#pi^{#minus}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 3., 8.}}}); + registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}}); + registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("hEvents", "Events;;entries", HistType::kTH1F, {{1, 0.5, 1.5}}); + + /// candidate monitoring + hCandidates = registry.add("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}}); + setLabelHistoCands(hCandidates); + } + + /// Main function to perform Lb candidate creation + /// \param withLcMl is the flag to use the table with ML scores for the D- daughter (only possible if present in the derived data) + /// \param collision the collision + /// \param candsLcThisColl Lc candidates in this collision + /// \param tracksPionThisCollision pion tracks in this collision + /// \param invMass2LcPiMin minimum Lb invariant-mass + /// \param invMass2LcPiMax maximum Lb invariant-mass + template + void runCandidateCreation(Coll const& collision, + Cands const& candsLcThisColl, + Pions const& tracksPionThisCollision, + const float& invMass2LcPiMin, + const float& invMass2LcPiMax) + { + auto primaryVertex = getPrimaryVertex(collision); + auto covMatrixPV = primaryVertex.getCov(); + + // Set the magnetic field from ccdb + bz = collision.bz(); + df2.setBz(bz); + + for (const auto& candLc : candsLcThisColl) { + auto trackParCovD = getTrackParCov(candLc); + std::array pVecLc = candLc.pVector(); + + for (const auto& trackPion : tracksPionThisCollision) { + // this track is among daughters + if (trackPion.trackId() == candLc.prong0Id() || trackPion.trackId() == candLc.prong1Id() || trackPion.trackId() == candLc.prong2Id()) { + continue; + } + + auto trackParCovPi = getTrackParCov(trackPion); + std::array pVecPion = trackPion.pVector(); + + // compute invariant mass square and apply selection + auto invMass2LcPi = RecoDecay::m2(std::array{pVecLc, pVecPion}, std::array{massLc, massPi}); + if ((invMass2LcPi < invMass2LcPiMin) || (invMass2LcPi > invMass2LcPiMax)) { + continue; + } + // --------------------------------- + // reconstruct the 2-prong Lb vertex + hCandidates->Fill(SVFitting::BeforeFit); + try { + if (df2.process(trackParCovD, trackParCovPi) == 0) { + continue; + } + } catch (const std::runtime_error& error) { + LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; + hCandidates->Fill(SVFitting::Fail); + continue; + } + hCandidates->Fill(SVFitting::FitOk); + + // LcPi passed Lb reconstruction + + // calculate relevant properties + const auto& secondaryVertexLb = df2.getPCACandidate(); + auto chi2PCA = df2.getChi2AtPCACandidate(); + auto covMatrixPCA = df2.calcPCACovMatrixFlat(); + registry.fill(HIST("hCovSVXX"), covMatrixPCA[0]); + registry.fill(HIST("hCovPVXX"), covMatrixPV[0]); + + // propagate Lc and Pi to the Lb vertex + df2.propagateTracksToVertex(); + // track.getPxPyPzGlo(pVec) modifies pVec of track + df2.getTrack(0).getPxPyPzGlo(pVecLc); // momentum of Lc at the Lb vertex + df2.getTrack(1).getPxPyPzGlo(pVecPion); // momentum of Pi at the Lb vertex + + registry.fill(HIST("hMassLambdaB0ToLcPi"), std::sqrt(invMass2LcPi)); + + // compute impact parameters of D and Pi + o2::dataformats::DCA dcaLc; + o2::dataformats::DCA dcaPion; + trackParCovD.propagateToDCA(primaryVertex, bz, &dcaLc); + trackParCovPi.propagateToDCA(primaryVertex, bz, &dcaPion); + + // get uncertainty of the decay length + float phi, theta; + // getPointDirection modifies phi and theta + getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexLb, phi, theta); + auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); + auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); + int hfFlag = 1 << hf_cand_lb::DecayType::LbToLcPi; + + // fill the candidate table for the Lb here: + rowCandidateBase(collision.globalIndex(), + collision.posX(), collision.posY(), collision.posZ(), + secondaryVertexLb[0], secondaryVertexLb[1], secondaryVertexLb[2], + errorDecayLength, errorDecayLengthXY, + chi2PCA, + pVecLc[0], pVecLc[1], pVecLc[2], + pVecPion[0], pVecPion[1], pVecPion[2], + dcaLc.getY(), dcaPion.getY(), + std::sqrt(dcaLc.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), candLc.globalIndex(), trackPion.globalIndex(), hfFlag); + + rowCandidateProngs(candLc.globalIndex(), trackPion.globalIndex()); + + if constexpr (withLcMl) { + rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); + } + } // pi loop + } // Lc loop + } + + void processData(HfRedCollisionsWithExtras const& collisions, + soa::Join const& candsLc, + soa::Join const& tracksPion, + aod::HfOrigColCounts const& collisionsCounter, + aod::HfCandLbConfigs const& configs) + { + // LcPi invariant-mass window cut + for (const auto& config : configs) { + myInvMassWindowLcPi = config.myInvMassWindowLcPi(); + } + // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection + // to avoid accepting LcPi pairs that were not formed in LcPi pair creator + float invMass2LcPiMin = (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + + for (const auto& collisionCounter : collisionsCounter) { + registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); + } + + static int ncol = 0; + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); + auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); + runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); + if (ncol % 10000 == 0) { + LOGP(debug, "collisions parsed {}", ncol); + } + ncol++; + } + } // processData + + PROCESS_SWITCH(HfCandidateCreatorLbReduced, processData, "Process data without any ML score", true); + + void processDataWithLcMl(HfRedCollisionsWithExtras const& collisions, + soa::Join const& candsLc, + soa::Join const& tracksPion, + aod::HfOrigColCounts const& collisionsCounter, + aod::HfCandLbConfigs const& configs) + { + // LcPi invariant-mass window cut + for (const auto& config : configs) { + myInvMassWindowLcPi = config.myInvMassWindowLcPi(); + } + // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection + // to avoid accepting LcPi pairs that were not formed in LcPi pair creator + float invMass2LcPiMin = (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + + for (const auto& collisionCounter : collisionsCounter) { + registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); + } + + static int ncol = 0; + for (const auto& collision : collisions) { + auto thisCollId = collision.globalIndex(); + auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); + auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); + runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); + if (ncol % 10000 == 0) { + LOGP(debug, "collisions parsed {}", ncol); + } + ncol++; + } + } // processDataWithLcMl + + PROCESS_SWITCH(HfCandidateCreatorLbReduced, processDataWithLcMl, "Process data with ML scores of D mesons", false); +}; // struct + +/// Extends the table base with expression columns and performs MC matching. +struct HfCandidateCreatorLbReducedExpressions { + Spawns rowCandidateB0; + Spawns rowTracksExt; + Produces rowLbMcRec; + Produces rowLbMcCheck; + + /// Fill candidate information at MC reconstruction level + /// \param checkDecayTypeMc + /// \param rowsLcPiMcRec MC reco information on LcPi pairs + /// \param candsLb prong global indices of Lb candidates + template + void fillLbMcRec(McRec const& rowsLcPiMcRec, HfRedLbProngs const& candsLb) + { + for (const auto& candLb : candsLb) { + bool filledMcInfo{false}; + for (const auto& rowLcPiMcRec : rowsLcPiMcRec) { + if ((rowLcPiMcRec.prong0LcId() != candLb.prong0LcId()) || (rowLcPiMcRec.prong1TrackId() != candLb.prong1TrackId())) { + continue; + } + rowLbMcRec(rowLcPiMcRec.flagMcMatchRec(), rowLcPiMcRec.flagWrongCollision(), rowLcPiMcRec.debugMcRec(), rowLcPiMcRec.ptMother()); + filledMcInfo = true; + if constexpr (checkDecayTypeMc) { + rowLbMcCheck(rowLcPiMcRec.pdgCodeBeautyMother(), + rowLcPiMcRec.pdgCodeCharmMother(), + rowLcPiMcRec.pdgCodeProng0(), + rowLcPiMcRec.pdgCodeProng1(), + rowLcPiMcRec.pdgCodeProng2(), + rowLcPiMcRec.pdgCodeProng3()); + } + break; + } + if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator + rowLbMcRec(0, -1, -1, -1.f); + if constexpr (checkDecayTypeMc) { + rowLbMcCheck(-1, -1, -1, -1, -1, -1); + } + } + } + } + + void processMc(HfMcRecRedLcPis const& rowsLcPiMcRec, HfRedLbProngs const& candsLb) + { + fillLbMcRec(rowsLcPiMcRec, candsLb); + } + PROCESS_SWITCH(HfCandidateCreatorLbReducedExpressions, processMc, "Process MC", false); + + void processMcWithDecayTypeCheck(soa::Join const& rowsLcPiMcRec, HfRedLbProngs const& candsLb) + { + fillLbMcRec(rowsLcPiMcRec, candsLb); + } + PROCESS_SWITCH(HfCandidateCreatorLbReducedExpressions, processMcWithDecayTypeCheck, "Process MC with decay type checks", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx new file mode 100644 index 00000000000..1a4a99a62db --- /dev/null +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -0,0 +1,246 @@ +// 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 candidateSelectorLbToLcPiReduced.cxx +/// \brief Lb → Lc+ π- candidate selector +/// +/// \author Biao Zhang , Heidelberg University + +#include +#include + +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/TrackSelectorPID.h" + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/Core/HfMlResponseLbToLcPi.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::analysis; + +struct HfCandidateSelectorLbToLcPiReduced { + Produces hfSelLbToLcPiCandidate; // table defined in CandidateSelectionTables.h + Produces hfMlLbToLcPiCandidate; // table defined in CandidateSelectionTables.h + + Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; + Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; + // Enable PID + Configurable pionPidMethod{"pionPidMethod", 1, "PID selection method for the bachelor pion (0: none, 1: TPC or TOF, 2: TPC and TOF)"}; + Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; + // TPC PID + Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; + Configurable ptPidTpcMax{"ptPidTpcMax", 20., "Upper bound of track pT for TPC PID"}; + Configurable nSigmaTpcMax{"nSigmaTpcMax", 5., "Nsigma cut on TPC only"}; + Configurable nSigmaTpcCombinedMax{"nSigmaTpcCombinedMax", 5., "Nsigma cut on TPC combined with TOF"}; + // TOF PID + Configurable ptPidTofMin{"ptPidTofMin", 0.15, "Lower bound of track pT for TOF PID"}; + Configurable ptPidTofMax{"ptPidTofMax", 20., "Upper bound of track pT for TOF PID"}; + Configurable nSigmaTofMax{"nSigmaTofMax", 5., "Nsigma cut on TOF only"}; + Configurable nSigmaTofCombinedMax{"nSigmaTofCombinedMax", 5., "Nsigma cut on TOF combined with TPC"}; + // topological cuts + Configurable> binsPt{"binsPt", std::vector{hf_cuts_lb_to_lc_pi::vecBinsPt}, "pT bin limits"}; + Configurable> cuts{"cuts", {hf_cuts_lb_to_lc_pi::Cuts[0], hf_cuts_lb_to_lc_pi::NBinsPt, hf_cuts_lb_to_lc_pi::NCutVars, hf_cuts_lb_to_lc_pi::labelsPt, hf_cuts_lb_to_lc_pi::labelsCutVar}, "Lb candidate selection per pT bin"}; + // D-meson ML cuts + Configurable> binsPtLcMl{"binsPtLcMl", std::vector{hf_cuts_ml::vecBinsPt}, "Lc pT bin limits for ML cuts"}; + Configurable> cutsLcMl{"cutsLcMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsDmesCutScore}, "Lc ML cuts per pT bin"}; + // QA switch + Configurable activateQA{"activateQA", false, "Flag to enable QA histogram"}; + // Lb ML inference + Configurable applyLbMl{"applyLbMl", false, "Flag to apply ML selections"}; + Configurable> binsPtLbMl{"binsPtLbMl", std::vector{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"}; + Configurable> cutDirLbMl{"cutDirLbMl", std::vector{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"}; + Configurable> cutsLbMl{"cutsLbMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"}; + Configurable nClassesLbMl{"nClassesLbMl", static_cast(hf_cuts_ml::NCutScores), "Number of classes in ML model"}; + Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature1", "feature2"}, "Names of ML model input features"}; + // CCDB configuration + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDB{"modelPathsCCDB", std::vector{"path_ccdb/BDT_Lb/"}, "Paths of models on CCDB"}; + Configurable> onnxFileNames{"onnxFileNames", std::vector{"ModelHandler_onnx_LbToLcPi.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + + o2::analysis::HfMlResponseLbToLcPi hfMlResponse; + float outputMlNotPreselected = -1.; + std::vector outputMl = {}; + o2::ccdb::CcdbApi ccdbApi; + + TrackSelectorPi selectorPion; + HfHelper hfHelper; + + using TracksPion = soa::Join; + + HistogramRegistry registry{"registry"}; + + void init(InitContext const&) + { + std::array doprocess{doprocessSelection, doprocessSelectionWithLcMl}; + if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { + LOGP(fatal, "Only one process function for data should be enabled at a time."); + } + + if (pionPidMethod < 0 || pionPidMethod > 2) { + LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); + } + + if (pionPidMethod) { + selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); + selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); + selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); + selectorPion.setRangePtTof(ptPidTofMin, ptPidTofMax); + selectorPion.setRangeNSigmaTof(-nSigmaTofMax, nSigmaTofMax); + selectorPion.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedMax, nSigmaTofCombinedMax); + } + + if (activateQA) { + constexpr int kNBinsSelections = 1 + SelectionStep::NSelectionSteps; + std::string labels[kNBinsSelections]; + labels[0] = "No selection"; + labels[1 + SelectionStep::RecoSkims] = "Skims selection"; + labels[1 + SelectionStep::RecoTopol] = "Skims & Topological selections"; + labels[1 + SelectionStep::RecoPID] = "Skims & Topological & PID selections"; + labels[1 + aod::SelectionStep::RecoMl] = "ML selection"; + 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()); + } + } + + if (applyLbMl) { + hfMlResponse.configure(binsPtLbMl, cutsLbMl, cutDirLbMl, nClassesLbMl); + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + hfMlResponse.setModelPathsCCDB(onnxFileNames, ccdbApi, modelPathsCCDB, timestampCCDB); + } else { + hfMlResponse.setModelPathsLocal(onnxFileNames); + } + hfMlResponse.cacheInputFeaturesIndices(namesInputFeatures); + hfMlResponse.init(); + } + } + + /// Main function to perform Lb candidate selection + /// \param withLcMl is the flag to use the table with ML scores for the Ds- daughter (only possible if present in the derived data) + /// \param hfCandsLb Lb candidates + /// \param pionTracks pion tracks + /// \param configs config inherited from the charm-hadron data creator + template + void runSelection(Cands const& hfCandsLb, + TracksPion const&, + HfCandLbConfigs const&) + { + for (const auto& hfCandLb : hfCandsLb) { + int statusLbToLcPi = 0; + outputMl.clear(); + auto ptCandLb = hfCandLb.pt(); + + SETBIT(statusLbToLcPi, SelectionStep::RecoSkims); // RecoSkims = 0 --> statusLbToLcPi = 1 + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoSkims, ptCandLb); + } + + // topological cuts + if (!hfHelper.selectionLbToLcPiTopol(hfCandLb, cuts, binsPt)) { + hfSelLbToLcPiCandidate(statusLbToLcPi); + if (applyLbMl) { + hfMlLbToLcPiCandidate(outputMlNotPreselected); + } + continue; + } + + if constexpr (withLcMl) { // we include it in the topological selections + if (!hfHelper.selectionDmesMlScoresForBReduced(hfCandLb, cutsLcMl, binsPtLcMl)) { + hfSelLbToLcPiCandidate(statusLbToLcPi); + if (applyLbMl) { + hfMlLbToLcPiCandidate(outputMlNotPreselected); + } + continue; + } + } + + SETBIT(statusLbToLcPi, SelectionStep::RecoTopol); // RecoTopol = 1 --> statusLbToLcPi = 3 + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoTopol, ptCandLb); + } + + // track-level PID selection + auto trackPi = hfCandLb.template prong1Track_as(); + if (pionPidMethod) { + int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; + if (pionPidMethod == 1) { + pidTrackPi = selectorPion.statusTpcOrTof(trackPi); + } else { + pidTrackPi = selectorPion.statusTpcAndTof(trackPi); + } + if (!hfHelper.selectionLbToLcPiPid(pidTrackPi, acceptPIDNotApplicable.value)) { + hfSelLbToLcPiCandidate(statusLbToLcPi); + if (applyLbMl) { + hfMlLbToLcPiCandidate(outputMlNotPreselected); + } + continue; + } + SETBIT(statusLbToLcPi, SelectionStep::RecoPID); // RecoPID = 2 --> statusLbToLcPi = 7 + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoPID, ptCandLb); + } + } + + if (applyLbMl) { + // Lb ML selections + std::vector inputFeatures = hfMlResponse.getInputFeatures(hfCandLb, trackPi); + bool isSelectedMl = hfMlResponse.isSelectedMl(inputFeatures, ptCandLb, outputMl); + hfMlLbToLcPiCandidate(outputMl[1]); + + if (!isSelectedMl) { + hfSelLbToLcPiCandidate(statusLbToLcPi); + continue; + } + SETBIT(statusLbToLcPi, SelectionStep::RecoMl); // RecoML = 3 --> statusLbToLcPi = 15 if pionPidMethod, 11 otherwise + if (activateQA) { + registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoMl, ptCandLb); + } + } + + hfSelLbToLcPiCandidate(statusLbToLcPi); + } + } + + void processSelection(HfRedCandLb const& hfCandsLb, + TracksPion const& pionTracks, + HfCandLbConfigs const& configs) + { + runSelection(hfCandsLb, pionTracks, configs); + } // processSelection + + PROCESS_SWITCH(HfCandidateSelectorLbToLcPiReduced, processSelection, "Process selection without ML scores of Lc", true); + + void processSelectionWithLcMl(soa::Join const& hfCandsLb, + TracksPion const& pionTracks, + HfCandLbConfigs const& configs) + { + runSelection(hfCandsLb, pionTracks, configs); + } // processSelectionwithLcMl + + PROCESS_SWITCH(HfCandidateSelectorLbToLcPiReduced, processSelectionWithLcMl, "Process selection with ML scores of Lc", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 44eccd35bb4dfb4ea085e44041db079afc3418c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:05:58 +0200 Subject: [PATCH 10/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 9d8e777e710..0c1f7bafc16 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -277,10 +277,10 @@ struct HfCandidateCreatorLbReduced { /// Extends the table base with expression columns and performs MC matching. struct HfCandidateCreatorLbReducedExpressions { - Spawns rowCandidateB0; + Spawns rowCandidateLb; Spawns rowTracksExt; - Produces rowLbMcRec; - Produces rowLbMcCheck; + Produces rowLbMcRec; + Produces rowLbMcCheck; /// Fill candidate information at MC reconstruction level /// \param checkDecayTypeMc From 6cf18def60a4a0a594649e961cabd8d25b91a943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:13:04 +0200 Subject: [PATCH 11/85] Update taskLbReduced.cxx --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index f5255a63ef2..16ed38446a4 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -213,7 +213,7 @@ struct HfTaskLbReduced { registry.add("hDecLength", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hDecLengthXy", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hNormDecLengthXy", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); - registry.add("hDcaProng0", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng0", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (#Lambda_{c}^{+}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hDcaProng1", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hPtProng0", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); registry.add("hPtProng1", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); @@ -223,16 +223,16 @@ struct HfTaskLbReduced { registry.add("hRapidity", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hImpParProd", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); registry.add("hinvMassLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); - registry.add("hDecLengthLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); registry.add("hDecLengthXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); - registry.add("hCospLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); - registry.add("hCospXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); // ML scores of D- daughter if (doprocessDataWithLcMl) { - registry.add("hMlScoreBkgLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScorePromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScoreNonPromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreBkgLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); } // ML scores of Lb candidate @@ -242,9 +242,9 @@ struct HfTaskLbReduced { } if (fillSparses) { if (!(doprocessDataWithLcMl || doprocessDataWithLbMl)) { - registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);#Lambda_{c}^{+} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); } else { - registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + registry.add("hMassPtCutVars", "#Lambda_{b}^{0} candidates;#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate ML score bkg;#Lambda_{c}^{+} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); } } } @@ -255,11 +255,11 @@ struct HfTaskLbReduced { registry.add("hEtaGen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hYGen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hYGenWithProngsInAcceptance", "MC particles (generated-daughters in acceptance);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#Lambda_{b}^{0});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); - registry.add("hPtProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}^{gen}(D^{#minus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); + registry.add("hPtProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}^{gen}(#Lambda_{c}^{+}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); registry.add("hPtProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}^{gen}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); - registry.add("hYProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(D^{#minus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hYProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#Lambda_{c}^{+});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hYProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{y}^{gen}(#pi^{#plus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); - registry.add("hEtaProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(D^{#minus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); + registry.add("hEtaProng0Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(#Lambda_{c}^{+});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hEtaProng1Gen", "#Lambda_{b}^{0} particles (generated);#it{p}_{T}^{gen}(#Lambda_{b}^{0}) (GeV/#it{c});#it{#eta}^{gen}(#pi^{#plus});entries", {HistType::kTH2F, {axisPtLb, axisEta}}); // reco histos @@ -268,7 +268,7 @@ struct HfTaskLbReduced { registry.add("hDecLengthRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hDecLengthXyRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hNormDecLengthXyRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); - registry.add("hDcaProng0RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng0RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (#Lambda_{c}^{+}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hDcaProng1RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hPtProng0RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); registry.add("hPtProng1RecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); @@ -278,17 +278,17 @@ struct HfTaskLbReduced { registry.add("hRapidityRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hImpParProdRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); registry.add("hinvMassLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); - registry.add("hDecLengthLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); registry.add("hDecLengthXyLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); - registry.add("hCospLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); - registry.add("hCospXyLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); // background if (fillBackground) { registry.add("hMassRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{M} (D#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLb, axisMassLb}}); registry.add("hDecLengthRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hDecLengthXyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisDecayLength}}); registry.add("hNormDecLengthXyRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate norm. decay length XY (cm);entries", {HistType::kTH2F, {axisPtLb, axisNormDecayLength}}); - registry.add("hDcaProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (D^{#minus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); + registry.add("hDcaProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 0 (#Lambda_{c}^{+}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hDcaProng1RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});prong 1 (#pi^{#plus}) DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {axisPtLb, axisDca}}); registry.add("hPtProng0RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtLc}}); registry.add("hPtProng1RecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#it{p}_{T}(#pi^{#plus}) (GeV/#it{c});entries", {HistType::kTH2F, {axisPtLb, axisPtPi}}); @@ -298,10 +298,10 @@ struct HfTaskLbReduced { registry.add("hRapidityRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate #it{y};entries", {HistType::kTH2F, {axisPtLb, axisEta}}); registry.add("hImpParProdRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate impact parameter product;entries", {HistType::kTH2F, {axisPtLb, axisImpParProd}}); registry.add("hinvMassLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {axisPtLc, axisMassLc}}); - registry.add("hDecLengthLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); + registry.add("hDecLengthLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); registry.add("hDecLengthXyLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});decay length XY (cm);entries", {HistType::kTH2F, {axisPtLc, axisDecayLength}}); - registry.add("hCospLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); - registry.add("hCospXyLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); + registry.add("hCospXyLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); } // MC checks if (doprocessMcWithDecayTypeCheck || doprocessMcWithLbMlAndDecayTypeCheck || doprocessMcWithLcMlAndDecayTypeCheck) { @@ -320,13 +320,13 @@ struct HfTaskLbReduced { // ML scores of Lc daughter if (doprocessMcWithLcMl || doprocessMcWithLcMlAndDecayTypeCheck) { // signal - registry.add("hMlScoreBkgLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScorePromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScoreNonPromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreBkgLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLcRecSig", "#Lambda_{b}^{0} candidates (matched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); // background - registry.add("hMlScoreBkgLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScorePromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); - registry.add("hMlScoreNonPromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, D^{#minus} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreBkgLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScorePromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); + registry.add("hMlScoreNonPromptLcRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML nonprompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); } // ML scores of Lb candidate if (doprocessMcWithLbMl || doprocessMcWithLbMlAndDecayTypeCheck) { @@ -343,14 +343,14 @@ struct HfTaskLbReduced { // reco sparses if (!(doprocessDataWithLcMl || doprocessDataWithLbMl)) { - registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);#Lambda_{c}^{+} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); if (fillBackground) { - registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate decay length (cm);D^{#minus} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); + registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate decay length (cm);#Lambda_{c}^{+} candidate cos(#vartheta_{P})", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisDecayLength, axisCosp}}); } } else { - registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + registry.add("hMassPtCutVarsRecSig", "#Lambda_{b}^{0} candidates (matched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate ML score bkg;#Lambda_{c}^{+} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); if (fillBackground) { - registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});D^{#minus} candidate ML score bkg;D^{#minus} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); + registry.add("hMassPtCutVarsRecBg", "#Lambda_{b}^{0} candidates (unmatched);#it{M} (D#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{b}^{0}) (GeV/#it{c});#Lambda_{b}^{0} candidate decay length (cm);#Lambda_{b}^{0} candidate norm. decay length XY (cm);#Lambda_{b}^{0} candidate impact parameter product (cm);#Lambda_{b}^{0} candidate cos(#vartheta_{P});#it{M} (pK#pi) (GeV/#it{c}^{2});#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate ML score bkg;#Lambda_{c}^{+} candidate ML score nonprompt", {HistType::kTHnSparseF, {axisMassLb, axisPtLb, axisDecayLength, axisNormDecayLength, axisImpParProd, axisCosp, axisMassLc, axisPtLc, axisMlScore, axisMlScore}}); } } } From 2f0b63ffdc2e5c5fa55d3787aa7f8b0448a8920f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:21:14 +0200 Subject: [PATCH 12/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 0c1f7bafc16..cf39a50e567 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -103,7 +103,7 @@ struct HfCandidateCreatorLbReduced { } /// Main function to perform Lb candidate creation - /// \param withLcMl is the flag to use the table with ML scores for the D- daughter (only possible if present in the derived data) + /// \param withLcMl is the flag to use the table with ML scores for the Lc daughter (only possible if present in the derived data) /// \param collision the collision /// \param candsLcThisColl Lc candidates in this collision /// \param tracksPionThisCollision pion tracks in this collision @@ -307,7 +307,7 @@ struct HfCandidateCreatorLbReducedExpressions { } break; } - if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the D-Pi creator + if (!filledMcInfo) { // protection to get same size tables in case something went wrong: we created a candidate that was not preselected in the LcPi creator rowLbMcRec(0, -1, -1, -1.f); if constexpr (checkDecayTypeMc) { rowLbMcCheck(-1, -1, -1, -1, -1, -1); From 04fbe348720f6aa7f4c7cbc97aa29c9af8d2ca75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:26:28 +0200 Subject: [PATCH 13/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index cf39a50e567..a197ffb51f6 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -272,7 +272,7 @@ struct HfCandidateCreatorLbReduced { } } // processDataWithLcMl - PROCESS_SWITCH(HfCandidateCreatorLbReduced, processDataWithLcMl, "Process data with ML scores of D mesons", false); + PROCESS_SWITCH(HfCandidateCreatorLbReduced, processDataWithLcMl, "Process data with ML scores of Lc", false); }; // struct /// Extends the table base with expression columns and performs MC matching. From 5beba24158a30af681927cf4a40693e9ec3697ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:30:53 +0200 Subject: [PATCH 14/85] Update candidateSelectorLbToLcPiReduced.cxx --- PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 1a4a99a62db..d23777aa839 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -56,7 +56,7 @@ struct HfCandidateSelectorLbToLcPiReduced { // topological cuts Configurable> binsPt{"binsPt", std::vector{hf_cuts_lb_to_lc_pi::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_lb_to_lc_pi::Cuts[0], hf_cuts_lb_to_lc_pi::NBinsPt, hf_cuts_lb_to_lc_pi::NCutVars, hf_cuts_lb_to_lc_pi::labelsPt, hf_cuts_lb_to_lc_pi::labelsCutVar}, "Lb candidate selection per pT bin"}; - // D-meson ML cuts + // Lc ML cuts Configurable> binsPtLcMl{"binsPtLcMl", std::vector{hf_cuts_ml::vecBinsPt}, "Lc pT bin limits for ML cuts"}; Configurable> cutsLcMl{"cutsLcMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsDmesCutScore}, "Lc ML cuts per pT bin"}; // QA switch From 9565916121c289f296cf12d81165cbdbc3ee8e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:35:30 +0200 Subject: [PATCH 15/85] Update taskLbReduced.cxx --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index 16ed38446a4..56f29fe53eb 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -228,7 +228,7 @@ struct HfTaskLbReduced { registry.add("hCospLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); registry.add("hCospXyLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});#Lambda_{c}^{+} candidate cos(#vartheta_{P}^{XY});entries", {HistType::kTH2F, {axisPtLc, axisCosp}}); - // ML scores of D- daughter + // ML scores of Lc daughter if (doprocessDataWithLcMl) { registry.add("hMlScoreBkgLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML background score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); registry.add("hMlScorePromptLc", "#Lambda_{b}^{0} candidates;#it{p}_{T}(#Lambda_{c}^{#plus}) (GeV/#it{c});prong0, #Lambda_{c}^{+} ML prompt score;entries", {HistType::kTH2F, {axisPtLc, axisMlScore}}); @@ -370,10 +370,10 @@ struct HfTaskLbReduced { /// Fill candidate information at reconstruction level /// \param doMc is the flag to enable the filling with MC information /// \param withDecayTypeCheck is the flag to enable MC with decay type check - /// \param withLcMl is the flag to enable the filling with ML scores for the D- daughter + /// \param withLcMl is the flag to enable the filling with ML scores for the Lc daughter /// \param withLbMl is the flag to enable the filling with ML scores for the Lb candidate /// \param candidate is the Lb candidate - /// \param candidatesLc is the table with D- candidates + /// \param candidatesLc is the table with Lc candidates template void fillCand(Cand const& candidate, CandsLc const&) From dc63ad6cc41c5c02f88151cd3804fb03e82465f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:46:48 +0200 Subject: [PATCH 16/85] Update dataCreatorCharmHadPiReduced.cxx --- .../dataCreatorCharmHadPiReduced.cxx | 490 +++++++++++++++--- 1 file changed, 407 insertions(+), 83 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 869e037c788..85a923d9bd2 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -16,6 +16,7 @@ /// \author Antonio Palasciano , Università degli Studi di Bari /// \author Fabrizio Grosa , CERN /// \author Fabio Catalano , CERN +/// \author Biao Zhang , Heidelberg University #include #include @@ -62,7 +63,8 @@ enum Event : uint8_t { enum DecayChannel : uint8_t { B0ToDminusPi = 0, BplusToD0barPi, - BsToDsminusPi + BsToDsminusPi, + LbToLcplusPi }; enum WrongCollisionType : uint8_t { @@ -112,27 +114,39 @@ struct HfDataCreatorCharmHadPiReduced { Produces rowHfDsPiMcCheckReduced; Produces rowHfBsMcGenReduced; + Produces rowCandidateConfigLb; + Produces rowHfLcPiMcRecReduced; + Produces rowHfLcPiMcCheckReduced; + Produces rowHfLbMcGenReduced; + // vertexing - // Configurable bz{"bz", 5., "magnetic field"}; - Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; - Configurable useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"}; - Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; - Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; - Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; - Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any B0 is smaller than this"}; - Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + struct : o2::framework::ConfigurableGroup { + // Configurable bz{"bz", 5., "magnetic field"}; + Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; + Configurable useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"}; + Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; + Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; + Configurable maxDZIni{"maxDZIni", 4., "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any B0 is smaller than this"}; + Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + } vertexConfigurations; // selection - Configurable usePionIsGlobalTrackWoDCA{"usePionIsGlobalTrackWoDCA", true, "check isGlobalTrackWoDCA status for pions, for Run3 studies"}; - Configurable ptPionMin{"ptPionMin", 0.5, "minimum pion pT threshold (GeV/c)"}; - Configurable absEtaPionMax{"etaPionMax", 0.8, "maximum pion absolute eta threshold"}; - Configurable> binsPtPion{"binsPtPion", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for pion DCA XY pT-dependent cut"}; - Configurable> cutsTrackPionDCA{"cutsTrackPionDCA", {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 per pT bin for pions"}; + struct : o2::framework::ConfigurableGroup { + Configurable usePionIsGlobalTrackWoDCA{"usePionIsGlobalTrackWoDCA", true, "check isGlobalTrackWoDCA status for pions, for Run3 studies"}; + Configurable ptPionMin{"ptPionMin", 0.5, "minimum pion pT threshold (GeV/c)"}; + Configurable absEtaPionMax{"etaPionMax", 0.8, "maximum pion absolute eta threshold"}; + Configurable> binsPtPion{"binsPtPion", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for pion DCA XY pT-dependent cut"}; + Configurable> cutsTrackPionDCA{"cutsTrackPionDCA", {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 per pT bin for pions"}; + } trackPionConfigurations; Configurable invMassWindowCharmHadPi{"invMassWindowCharmHadPi", 0.3, "invariant-mass window for CharmHad-Pi pair preselections (GeV/c2)"}; - Configurable selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for D+"}; - Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"}; - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + struct : o2::framework::ConfigurableGroup { + Configurable selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for D+"}; + Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"}; + Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; + Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; + } hfflagConfigurations; // magnetic field setting from CCDB Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; @@ -164,7 +178,7 @@ struct HfDataCreatorCharmHadPiReduced { o2::vertexing::DCAFitterN<3> df3; o2::vertexing::DCAFitterN<2> df2; - using TracksPid = soa::Join; // TODO: revert to pion only once the Nsigma variables for the charm-hadron candidate daughters are in the candidate table for 3 prongs too + using TracksPid = soa::Join; // TODO: revert to pion only once the Nsigma variables for the charm-hadron candidate daughters are in the candidate table for 3 prongs too using TracksPidWithSel = soa::Join; using TracksPidWithSelAndMc = soa::Join; @@ -174,14 +188,17 @@ struct HfDataCreatorCharmHadPiReduced { using CandsDsFilteredWithMl = soa::Filtered>; using CandsD0Filtered = soa::Filtered>; using CandsD0FilteredWithMl = soa::Filtered>; + using CandsLcFiltered = soa::Filtered>; + using CandsLcFilteredWithMl = soa::Filtered>; using CollisionsWCent = soa::Join; using CollisionsWCentAndMcLabels = soa::Join; using CollisionsWCentAndQvectors = soa::Join; - Filter filterSelectDplusCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); - Filter filterSelectDsCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); - Filter filterSelectDzeroCandidates = (aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar); + Filter filterSelectDplusCandidates = (aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= hfflagConfigurations.selectionFlagDplus); + Filter filterSelectDsCandidates = (aod::hf_sel_candidate_ds::isSelDsToKKPi >= hfflagConfigurations.selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= hfflagConfigurations.selectionFlagDs); + Filter filterSelectDzeroCandidates = (aod::hf_sel_candidate_d0::isSelD0 >= hfflagConfigurations.selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= hfflagConfigurations.selectionFlagD0bar); + Filter filterSelectLcCandidates = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= hfflagConfigurations.selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= hfflagConfigurations.selectionFlagLc); Preslice candsDplusPerCollision = aod::track_association::collisionId; Preslice candsDplusPerCollisionWithMl = aod::track_association::collisionId; @@ -189,10 +206,12 @@ struct HfDataCreatorCharmHadPiReduced { Preslice candsDsPerCollisionWithMl = aod::track_association::collisionId; Preslice candsD0PerCollision = aod::track_association::collisionId; Preslice candsD0PerCollisionWithMl = aod::track_association::collisionId; + Preslice candsLcPerCollision = aod::track_association::collisionId; + Preslice candsLcPerCollisionWithMl = aod::track_association::collisionId; Preslice trackIndicesPerCollision = aod::track_association::collisionId; PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; - std::shared_ptr hCandidatesD0, hCandidatesDPlus, hCandidatesDs; + std::shared_ptr hCandidatesD0, hCandidatesDPlus, hCandidatesDs, hCandidatesLc; HistogramRegistry registry{"registry"}; std::array arrPDGResonantDsPhiPi = {kPhi, kPiPlus}; // Ds± → Phi π± @@ -200,9 +219,10 @@ struct HfDataCreatorCharmHadPiReduced { void init(InitContext const&) { - std::array doProcess = {doprocessDplusPiData, doprocessDplusPiDataWithMl, doprocessDplusPiMc, doprocessDplusPiMcWithMl, + std::array doProcess = {doprocessDplusPiData, doprocessDplusPiDataWithMl, doprocessDplusPiMc, doprocessDplusPiMcWithMl, doprocessDsPiData, doprocessDsPiDataWithMl, doprocessDsPiMc, doprocessDsPiMcWithMl, - doprocessD0PiData, doprocessD0PiDataWithMl, doprocessD0PiMc, doprocessD0PiMcWithMl}; + doprocessD0PiData, doprocessD0PiDataWithMl, doprocessD0PiMc, doprocessD0PiMcWithMl, + doprocessLcPiData, doprocessLcPiDataWithMl, doprocessLcPiMc, doprocessLcPiMcWithMl}; if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) { LOGP(fatal, "One and only one process function can be enabled at a time, please fix your configuration!"); } @@ -218,29 +238,32 @@ struct HfDataCreatorCharmHadPiReduced { } else if (doprocessD0PiData || doprocessD0PiDataWithMl || doprocessD0PiMc || doprocessD0PiMcWithMl) { massC = MassD0; massB = MassBPlus; + } else if (doprocessLcPiData || doprocessLcPiDataWithMl || doprocessLcPiMc || doprocessLcPiMcWithMl) { + massC = MassLambdaCPlus; + massB = MassLambdaB0; } invMass2ChHadPiMin = (massB - invMassWindowCharmHadPi) * (massB - invMassWindowCharmHadPi); invMass2ChHadPiMax = (massB + invMassWindowCharmHadPi) * (massB + invMassWindowCharmHadPi); // Initialize fitter if (doprocessDplusPiData || doprocessDplusPiDataWithMl || doprocessDplusPiMc || doprocessDplusPiMcWithMl || - doprocessDsPiData || doprocessDsPiDataWithMl || doprocessDsPiMc || doprocessDsPiMcWithMl) { - df3.setPropagateToPCA(propagateToPCA); - df3.setMaxR(maxR); - df3.setMaxDZIni(maxDZIni); - df3.setMinParamChange(minParamChange); - df3.setMinRelChi2Change(minRelChi2Change); - df3.setUseAbsDCA(useAbsDCA); - df3.setWeightedFinalPCA(useWeightedFinalPCA); + doprocessDsPiData || doprocessDsPiDataWithMl || doprocessDsPiMc || doprocessDsPiMcWithMl || doprocessLcPiData || doprocessLcPiDataWithMl || doprocessLcPiMc || doprocessLcPiMcWithMl) { + df3.setPropagateToPCA(vertexConfigurations.propagateToPCA); + df3.setMaxR(vertexConfigurations.maxR); + df3.setMaxDZIni(vertexConfigurations.maxDZIni); + df3.setMinParamChange(vertexConfigurations.minParamChange); + df3.setMinRelChi2Change(vertexConfigurations.minRelChi2Change); + df3.setUseAbsDCA(vertexConfigurations.useAbsDCA); + df3.setWeightedFinalPCA(vertexConfigurations.useWeightedFinalPCA); df3.setMatCorrType(noMatCorr); } else if (doprocessD0PiData || doprocessD0PiDataWithMl || doprocessD0PiMc || doprocessD0PiMcWithMl) { - df2.setPropagateToPCA(propagateToPCA); - df2.setMaxR(maxR); - df2.setMaxDZIni(maxDZIni); - df2.setMinParamChange(minParamChange); - df2.setMinRelChi2Change(minRelChi2Change); - df2.setUseAbsDCA(useAbsDCA); - df2.setWeightedFinalPCA(useWeightedFinalPCA); + df2.setPropagateToPCA(vertexConfigurations.propagateToPCA); + df2.setMaxR(vertexConfigurations.maxR); + df2.setMaxDZIni(vertexConfigurations.maxDZIni); + df2.setMinParamChange(vertexConfigurations.minParamChange); + df2.setMinRelChi2Change(vertexConfigurations.minRelChi2Change); + df2.setUseAbsDCA(vertexConfigurations.useAbsDCA); + df2.setWeightedFinalPCA(vertexConfigurations.useWeightedFinalPCA); df2.setMatCorrType(noMatCorr); } @@ -278,6 +301,10 @@ struct HfDataCreatorCharmHadPiReduced { histMassTitle = "D0"; registry.add("hMassD0", "D^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); registry.add("hMassD0bar", "#overline{D}^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + } else if (doprocessLcPiData || doprocessLcPiDataWithMl || doprocessLcPiMc || doprocessLcPiMcWithMl) { + charmHadTitle = "#Lambda_{c}^{+}"; + histMassTitle = "Lc"; + registry.add("hMassLc", "#Lambda_{c}^{+} candidates; #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); } registry.add(Form("hPt%s", histMassTitle.data()), Form("%s candidates candidates;%s candidate #it{p}_{T} (GeV/#it{c});entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1F, {{100, 0., 10.}}}); @@ -288,9 +315,12 @@ struct HfDataCreatorCharmHadPiReduced { hCandidatesD0 = registry.add("hCandidatesD0", "D0 candidate counter", {HistType::kTH1D, {axisCands}}); hCandidatesDPlus = registry.add("hCandidatesDPlus", "Dplus candidate counter", {HistType::kTH1D, {axisCands}}); hCandidatesDs = registry.add("hCandidatesDs", "Ds candidate counter", {HistType::kTH1D, {axisCands}}); + hCandidatesLc = registry.add("hCandidatesLc", "Lc candidate counter", {HistType::kTH1D, {axisCands}}); + setLabelHistoCands(hCandidatesD0); setLabelHistoCands(hCandidatesDPlus); setLabelHistoCands(hCandidatesDs); + setLabelHistoCands(hCandidatesLc); } /// Pion selection (D Pi <-- B0) @@ -303,11 +333,11 @@ struct HfDataCreatorCharmHadPiReduced { bool isPionSelected(const T1& trackPion, const T2& trackParCovPion, const T3& dcaPion, const std::vector& charmDautracks) { // check isGlobalTrackWoDCA status for pions if wanted - if (usePionIsGlobalTrackWoDCA && !trackPion.isGlobalTrackWoDCA()) { + if (trackPionConfigurations.usePionIsGlobalTrackWoDCA && !trackPion.isGlobalTrackWoDCA()) { return false; } // minimum pT and eta selection - if (trackParCovPion.getPt() < ptPionMin || std::abs(trackParCovPion.getEta()) > absEtaPionMax || !isSelectedTrackDCA(trackParCovPion, dcaPion)) { + if (trackParCovPion.getPt() < trackPionConfigurations.ptPionMin || std::abs(trackParCovPion.getEta()) > trackPionConfigurations.absEtaPionMax || !isSelectedTrackDCA(trackParCovPion, dcaPion)) { return false; } // reject pions that are charm-hadron daughters @@ -327,15 +357,15 @@ struct HfDataCreatorCharmHadPiReduced { template bool isSelectedTrackDCA(const T1& trackPar, const T2& dca) { - auto pTBinTrack = findBin(binsPtPion, trackPar.getPt()); + auto pTBinTrack = findBin(trackPionConfigurations.binsPtPion, trackPar.getPt()); if (pTBinTrack == -1) { return false; } - if (std::abs(dca[0]) < cutsTrackPionDCA->get(pTBinTrack, "min_dcaxytoprimary")) { + if (std::abs(dca[0]) < trackPionConfigurations.cutsTrackPionDCA->get(pTBinTrack, "min_dcaxytoprimary")) { return false; // minimum DCAxy } - if (std::abs(dca[0]) > cutsTrackPionDCA->get(pTBinTrack, "max_dcaxytoprimary")) { + if (std::abs(dca[0]) > trackPionConfigurations.cutsTrackPionDCA->get(pTBinTrack, "max_dcaxytoprimary")) { return false; // maximum DCAxy } return true; @@ -705,6 +735,110 @@ struct HfDataCreatorCharmHadPiReduced { rowHfD0PiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2); } rowHfD0PiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + // Lb → Lc+ π- → (p K- π+) π- + auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + if (indexRec > -1) { + // Lc+ → p K- π+ + // Printf("Checking Lc+ → p K- π+"); + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + if (indexRec > -1) { + flag = sign * BIT(hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiPi); + } else { + debug = 1; + LOGF(debug, "Lb decays in the expected final state but the condition on the intermediate state is not fulfilled"); + } + + auto indexMother = RecoDecay::getMother(particlesMc, vecDaughtersB.back().template mcParticle_as(), Pdg::kLambdaB0, true); + if (indexMother >= 0) { + auto particleMother = particlesMc.rawIteratorAt(indexMother); + motherPt = particleMother.pt(); + checkWrongCollision(particleMother, collision, indexCollisionMaxNumContrib, flagWrongCollision); + } + } + + // additional checks for correlated backgrounds + if (checkDecayTypeMc) { + // Lb → Lc+ K- → (p K- π+) K- + if (!flag) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kKPlus}, true, &sign, 3); + if (indexRec > -1) { + // Lc+ → p K- π+ + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + if (indexRec > -1) { + flag = sign * BIT(hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiK); + } + } + } + // B0 → D- π+ → (π- K+ π-) π+ + if (!flag) { + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + if (indexRec > -1) { + // D- → (π- K+ π- + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2); + if (indexRec > -1) { + flag = sign * BIT(hf_cand_lb::DecayTypeMc::B0ToDplusPiToPiKPiPi); + } + } + } + + // Partly reconstructed decays, i.e. the 4 prongs have a common b-hadron ancestor + // convention: final state particles are prong0,1,2,3 + if (!flag) { + auto particleProng0 = vecDaughtersB[0].mcParticle(); + auto particleProng1 = vecDaughtersB[1].mcParticle(); + auto particleProng2 = vecDaughtersB[2].mcParticle(); + auto particleProng3 = vecDaughtersB[3].mcParticle(); + // b-hadron hypothesis + std::array bHadronMotherHypos = {Pdg::kB0, Pdg::kBS, Pdg::kLambdaB0}; + // c-hadron hypothesis + std::array cHadronMotherHypos = {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus}; + + for (const auto& bHadronMotherHypo : bHadronMotherHypos) { + int index0Mother = RecoDecay::getMother(particlesMc, particleProng0, bHadronMotherHypo, true); + int index1Mother = RecoDecay::getMother(particlesMc, particleProng1, bHadronMotherHypo, true); + int index2Mother = RecoDecay::getMother(particlesMc, particleProng2, bHadronMotherHypo, true); + int index3Mother = RecoDecay::getMother(particlesMc, particleProng3, bHadronMotherHypo, true); + + // look for common b-hadron ancestor + if (index0Mother > -1 && index1Mother > -1 && index2Mother > -1 && index3Mother > -1) { + if (index0Mother == index1Mother && index1Mother == index2Mother && index2Mother == index3Mother) { + flag = BIT(hf_cand_b0::DecayTypeMc::PartlyRecoDecay); + pdgCodeBeautyMother = particlesMc.rawIteratorAt(index0Mother).pdgCode(); + pdgCodeCharmMother = 0; + pdgCodeProng0 = particleProng0.pdgCode(); + pdgCodeProng1 = particleProng1.pdgCode(); + pdgCodeProng2 = particleProng2.pdgCode(); + pdgCodeProng3 = particleProng3.pdgCode(); + // look for common c-hadron mother among prongs 0, 1 and 2 + for (const auto& cHadronMotherHypo : cHadronMotherHypos) { + int8_t depthMax = 2; + if (cHadronMotherHypo == Pdg::kDStar) { // to include D* -> D π0/γ and D* -> D0 π + depthMax += 1; + } + int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); + int index1CharmMother = RecoDecay::getMother(particlesMc, particleProng1, cHadronMotherHypo, true, &sign, depthMax); + int index2CharmMother = RecoDecay::getMother(particlesMc, particleProng2, cHadronMotherHypo, true, &sign, depthMax); + if (index0CharmMother > -1 && index1CharmMother > -1 && index2CharmMother > -1) { + if (index0CharmMother == index1CharmMother && index1CharmMother == index2CharmMother) { + // pdgCodeCharmMother = + // Pdg::kDPlus (if D+ is the mother and does not come from D*+) + // Pdg::kDPlus + Pdg::kDStar (if D+ is the mother and D*+ -> D+ π0/γ) + // Pdg::kDStar (if D*+ is the mother and D*+ -> D0 π+) + // Pdg::kDS (if Ds is the mother) + // Pdg::kLambdaCPlus (if Λc+ is the mother) + pdgCodeCharmMother += std::abs(particlesMc.rawIteratorAt(index0CharmMother).pdgCode()); + } + } + } + break; + } + } + } + } + rowHfLcPiMcCheckReduced(pdgCodeBeautyMother, pdgCodeCharmMother, pdgCodeProng0, pdgCodeProng1, pdgCodeProng2, pdgCodeProng3); + } + rowHfLcPiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); } } @@ -755,11 +889,11 @@ struct HfDataCreatorCharmHadPiReduced { registry.fill(HIST("hCpaDplus"), candC.cpa()); } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { indexHfCandCharm = hfCand3Prong.lastIndex() + 1; - if (candC.isSelDsToKKPi() >= selectionFlagDs) { + if (candC.isSelDsToKKPi() >= hfflagConfigurations.selectionFlagDs) { invMassC0 = hfHelper.invMassDsToKKPi(candC); registry.fill(HIST("hMassDsToKKPi"), invMassC0); } - if (candC.isSelDsToPiKK() >= selectionFlagDs) { + if (candC.isSelDsToPiKK() >= hfflagConfigurations.selectionFlagDs) { invMassC1 = hfHelper.invMassDsToPiKK(candC); registry.fill(HIST("hMassDsToPiKK"), invMassC1); } @@ -767,16 +901,28 @@ struct HfDataCreatorCharmHadPiReduced { registry.fill(HIST("hCpaDs"), candC.cpa()); } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { indexHfCandCharm = hfCand2Prong.lastIndex() + 1; - if (candC.isSelD0() >= selectionFlagD0) { + if (candC.isSelD0() >= hfflagConfigurations.selectionFlagD0) { invMassC0 = hfHelper.invMassD0ToPiK(candC); registry.fill(HIST("hMassD0"), invMassC0); } - if (candC.isSelD0bar() >= selectionFlagD0bar) { + if (candC.isSelD0bar() >= hfflagConfigurations.selectionFlagD0bar) { invMassC1 = hfHelper.invMassD0barToKPi(candC); registry.fill(HIST("hMassD0bar"), invMassC1); } registry.fill(HIST("hPtD0"), candC.pt()); registry.fill(HIST("hCpaD0"), candC.cpa()); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + indexHfCandCharm = hfCand3Prong.lastIndex() + 1; + if (candC.isSelLcToPKPi() >= hfflagConfigurations.selectionFlagLc) { + invMassC0 = hfHelper.invMassLcToPKPi(candC); + registry.fill(HIST("hMassLcToPKPi"), invMassC0); + } + if (candC.isSelLcToPiKP() >= hfflagConfigurations.selectionFlagLc) { + invMassC1 = hfHelper.invMassLcToPiKP(candC); + registry.fill(HIST("hMassLcToPiKP"), invMassC1); + } + registry.fill(HIST("hPtLc"), candC.pt()); + registry.fill(HIST("hCpaLc"), candC.cpa()); } bool fillHfCandCharm = false; @@ -803,7 +949,7 @@ struct HfDataCreatorCharmHadPiReduced { } // third track, if it's a 3-prong - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi) { + if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { charmHadDauTracks.push_back(candC.template prong2_as()); trackParCov2 = getTrackParCov(charmHadDauTracks[2]); pVec2 = charmHadDauTracks[2].pVector(); @@ -818,12 +964,14 @@ struct HfDataCreatorCharmHadPiReduced { // reconstruct charm candidate secondary vertex o2::track::TrackParCov trackParCovCharmHad{}; std::array pVecCharm{}; - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ + if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ if constexpr (decChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::BeforeFit); - } else { + } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::BeforeFit); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + hCandidatesLc->Fill(SVFitting::BeforeFit); } try { @@ -834,15 +982,19 @@ struct HfDataCreatorCharmHadPiReduced { LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; if constexpr (decChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::Fail); - } else { + } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::Fail); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + hCandidatesLc->Fill(SVFitting::Fail); } continue; } if constexpr (decChannel == DecayChannel::B0ToDminusPi) { hCandidatesDPlus->Fill(SVFitting::FitOk); - } else { + } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { hCandidatesDs->Fill(SVFitting::FitOk); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + hCandidatesLc->Fill(SVFitting::FitOk); } auto secondaryVertexCharm = df3.getPCACandidate(); @@ -912,12 +1064,12 @@ struct HfDataCreatorCharmHadPiReduced { } // reject pi D with same sign as D - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ + if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ if (trackPion.sign() * charmHadDauTracks[0].sign() > 0) { continue; } } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ - if (!((candC.isSelD0() >= selectionFlagD0 && trackPion.sign() < 0) || (candC.isSelD0bar() >= selectionFlagD0bar && trackPion.sign() > 0))) { + if (!((candC.isSelD0() >= hfflagConfigurations.selectionFlagD0 && trackPion.sign() < 0) || (candC.isSelD0bar() >= hfflagConfigurations.selectionFlagD0bar && trackPion.sign() > 0))) { continue; } } @@ -966,8 +1118,8 @@ struct HfDataCreatorCharmHadPiReduced { } fillHfCandCharm = true; } // pion loop - if (fillHfCandCharm) { // fill candCplus table only once per D candidate - if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ + if (fillHfCandCharm) { // fill candCplus table only once per D candidate + if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), indexHfReducedCollision, trackParCovCharmHad.getX(), trackParCovCharmHad.getAlpha(), @@ -981,14 +1133,14 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovCharmHad.getSigmaTglSnp(), trackParCovCharmHad.getSigmaTgl2(), trackParCovCharmHad.getSigma1PtY(), trackParCovCharmHad.getSigma1PtZ(), trackParCovCharmHad.getSigma1PtSnp(), trackParCovCharmHad.getSigma1PtTgl(), trackParCovCharmHad.getSigma1Pt2()); - hfCandPidProng0(charmHadDauTracks[0].tpcNSigmaPi(), charmHadDauTracks[0].tofNSigmaPi(), charmHadDauTracks[0].tpcNSigmaKa(), charmHadDauTracks[0].tofNSigmaKa(), charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); - hfCandPidProng1(charmHadDauTracks[1].tpcNSigmaPi(), charmHadDauTracks[1].tofNSigmaPi(), charmHadDauTracks[1].tpcNSigmaKa(), charmHadDauTracks[1].tofNSigmaKa(), charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); - hfCandPidProng2(charmHadDauTracks[2].tpcNSigmaPi(), charmHadDauTracks[2].tofNSigmaPi(), charmHadDauTracks[2].tpcNSigmaKa(), charmHadDauTracks[2].tofNSigmaKa(), charmHadDauTracks[2].hasTOF(), charmHadDauTracks[2].hasTPC()); + hfCandPidProng0(charmHadDauTracks[0].tpcNSigmaPi(), charmHadDauTracks[0].tofNSigmaPi(), charmHadDauTracks[0].tpcNSigmaKa(), charmHadDauTracks[0].tofNSigmaKa(), charmHadDauTracks[0].tpcNSigmaPr(), charmHadDauTracks[0].tofNSigmaPr(), charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); + hfCandPidProng1(charmHadDauTracks[1].tpcNSigmaPi(), charmHadDauTracks[1].tofNSigmaPi(), charmHadDauTracks[1].tpcNSigmaKa(), charmHadDauTracks[1].tofNSigmaKa(), charmHadDauTracks[1].tpcNSigmaPr(), charmHadDauTracks[1].tofNSigmaPr(), charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); + hfCandPidProng2(charmHadDauTracks[2].tpcNSigmaPi(), charmHadDauTracks[2].tofNSigmaPi(), charmHadDauTracks[2].tpcNSigmaKa(), charmHadDauTracks[2].tofNSigmaKa(), charmHadDauTracks[2].tpcNSigmaPr(), charmHadDauTracks[2].tofNSigmaPr(), charmHadDauTracks[2].hasTOF(), charmHadDauTracks[2].hasTPC()); if constexpr (withMl) { + std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; if constexpr (decChannel == DecayChannel::B0ToDminusPi) { hfCand3ProngMl(candC.mlProbDplusToPiKPi()[0], candC.mlProbDplusToPiKPi()[1], candC.mlProbDplusToPiKPi()[2], -1., -1., -1.); - } else { - std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; + } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { if (candC.mlProbDsToKKPi().size() == 3) { std::copy(candC.mlProbDsToKKPi().begin(), candC.mlProbDsToKKPi().end(), mlScores.begin()); } @@ -996,6 +1148,14 @@ struct HfDataCreatorCharmHadPiReduced { std::copy(candC.mlProbDsToPiKK().begin(), candC.mlProbDsToPiKK().end(), mlScores.begin() + 3); } hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); + } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { + if (candC.mlProbLcToPKPi().size() == 3) { + std::copy(candC.mlProbLcToPKPi().begin(), candC.mlProbLcToPKPi().end(), mlScores.begin()); + } + if (candC.mlProbLcToPiKP().size() == 3) { + std::copy(candC.mlProbLcToPiKP().begin(), candC.mlProbLcToPiKP().end(), mlScores.begin() + 3); + } + hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); } } } else if constexpr (decChannel == DecayChannel::BplusToD0barPi) { // D0(bar) → K± π∓ @@ -1012,8 +1172,8 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovCharmHad.getSigmaTglSnp(), trackParCovCharmHad.getSigmaTgl2(), trackParCovCharmHad.getSigma1PtY(), trackParCovCharmHad.getSigma1PtZ(), trackParCovCharmHad.getSigma1PtSnp(), trackParCovCharmHad.getSigma1PtTgl(), trackParCovCharmHad.getSigma1Pt2()); - hfCandPidProng0(candC.nSigTpcPi0(), candC.nSigTofPi0(), candC.nSigTpcKa0(), candC.nSigTofKa0(), charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); - hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); + hfCandPidProng0(candC.nSigTpcPi0(), candC.nSigTofPi0(), candC.nSigTpcKa0(), candC.nSigTofKa0(), 0., 0., charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); + hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), 0., 0., charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); if constexpr (withMl) { std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; if (candC.mlProbD0().size() == 3) { @@ -1200,6 +1360,39 @@ struct HfDataCreatorCharmHadPiReduced { rowHfBpMcGenReduced(flag, ptParticle, yParticle, etaParticle, ptProngs[0], yProngs[0], etaProngs[0], ptProngs[1], yProngs[1], etaProngs[1]); + } else if constexpr (decayChannel == DecayChannel::LbToLcplusPi) { + // Lb → Lc+ π- + if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kLambdaB0, std::array{-static_cast(Pdg::kLambdaCPlus), -kPiPlus}, true)) { + // Match Lc+ → p K- π+ + auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); + // Printf("Checking Lc+ → p K- π+"); + if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, -static_cast(Pdg::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + flag = sign * BIT(hf_cand_lb::DecayType::LbToLcPi); + } + } + + // save information for Lc task + if (!TESTBIT(std::abs(flag), hf_cand_lb::DecayType::LbToLcPi)) { + continue; + } + + auto ptParticle = particle.pt(); + auto yParticle = RecoDecay::y(particle.pVector(), massB); + auto etaParticle = particle.eta(); + + std::array ptProngs; + std::array yProngs; + std::array etaProngs; + int counter = 0; + for (const auto& daught : particle.daughters_as()) { + ptProngs[counter] = daught.pt(); + etaProngs[counter] = daught.eta(); + yProngs[counter] = RecoDecay::y(daught.pVector(), pdg->Mass(daught.pdgCode())); + counter++; + } + rowHfLbMcGenReduced(flag, ptParticle, yParticle, etaParticle, + ptProngs[0], yProngs[0], etaProngs[0], + ptProngs[1], yProngs[1], etaProngs[1]); } } // gen } @@ -1215,7 +1408,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1245,7 +1438,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1275,7 +1468,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1305,7 +1498,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1335,7 +1528,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1365,7 +1558,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1395,7 +1588,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1425,7 +1618,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1455,7 +1648,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1485,7 +1678,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1515,7 +1708,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1545,7 +1738,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1567,6 +1760,66 @@ struct HfDataCreatorCharmHadPiReduced { } PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processD0PiDataWithMlAndQvec, "Process D0Pi without MC info, with ML info, and with Q-vectors", false); + void processLcPiData(CollisionsWCent const& collisions, + CandsLcFiltered const& candsC, + aod::TrackAssoc const& trackIndices, + TracksPidWithSel const& tracks, + aod::BCsWithTimestamps const& bcs) + { + // store configurables needed for Lb workflow + if (!isHfCandBhadConfigFilled) { + rowCandidateConfigLb(hfflagConfigurations.selectionFlagLc.value, invMassWindowCharmHadPi.value); + isHfCandBhadConfigFilled = true; + } + + int zvtxColl{0}; + int sel8Coll{0}; + int zvtxAndSel8Coll{0}; + int zvtxAndSel8CollAndSoftTrig{0}; + int allSelColl{0}; + for (const auto& collision : collisions) { + o2::hf_evsel::checkEvSel(collision, hfEvSel, zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl, ccdb, registry); + + auto thisCollId = collision.globalIndex(); + auto candsCThisColl = candsC.sliceBy(candsLcPerCollision, thisCollId); + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, tracks, -1, bcs); + } + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); + } + PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processLcPiData, "Process LcPi without MC info and without ML info", true); + + void processLcPiDataWithMl(CollisionsWCent const& collisions, + CandsLcFilteredWithMl const& candsC, + aod::TrackAssoc const& trackIndices, + TracksPidWithSel const& tracks, + aod::BCsWithTimestamps const& bcs) + { + // store configurables needed for Lb workflow + if (!isHfCandBhadConfigFilled) { + rowCandidateConfigLb(hfflagConfigurations.selectionFlagLc.value, invMassWindowCharmHadPi.value); + isHfCandBhadConfigFilled = true; + } + + int zvtxColl{0}; + int sel8Coll{0}; + int zvtxAndSel8Coll{0}; + int zvtxAndSel8CollAndSoftTrig{0}; + int allSelColl{0}; + for (const auto& collision : collisions) { + o2::hf_evsel::checkEvSel(collision, hfEvSel, zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl, ccdb, registry); + + auto thisCollId = collision.globalIndex(); + auto candsCThisColl = candsC.sliceBy(candsLcPerCollisionWithMl, thisCollId); + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, tracks, -1, bcs); + } + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); + } + PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processLcPiDataWithMl, "Process LcPi without MC info and with ML info", false); + //////////////////////////////////////////////////////////////////////////////////////////////////// // PROCESS FUNCTIONS FOR MC @@ -1580,7 +1833,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1615,7 +1868,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B0 workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigB0(selectionFlagDplus.value, invMassWindowCharmHadPi.value); + rowCandidateConfigB0(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1650,7 +1903,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1685,7 +1938,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for Bs workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBs(selectionFlagDs.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBs(hfflagConfigurations.selectionFlagDs.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1720,7 +1973,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1755,7 +2008,7 @@ struct HfDataCreatorCharmHadPiReduced { { // store configurables needed for B+ workflow if (!isHfCandBhadConfigFilled) { - rowCandidateConfigBplus(selectionFlagD0.value, selectionFlagD0bar.value, invMassWindowCharmHadPi.value); + rowCandidateConfigBplus(hfflagConfigurations.selectionFlagD0.value, hfflagConfigurations.selectionFlagD0bar.value, invMassWindowCharmHadPi.value); isHfCandBhadConfigFilled = true; } @@ -1779,6 +2032,77 @@ struct HfDataCreatorCharmHadPiReduced { runMcGen(particlesMc); } PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processD0PiMcWithMl, "Process D0Pi with MC info and with ML info", false); + + void processLcPiMc(CollisionsWCentAndMcLabels const& collisions, + CandsLcFiltered const& candsC, + aod::TrackAssoc const& trackIndices, + TracksPidWithSelAndMc const& tracks, + aod::McParticles const& particlesMc, + aod::BCsWithTimestamps const& bcs, + McCollisions const&) + { + // store configurables needed for Lb workflow + if (!isHfCandBhadConfigFilled) { + rowCandidateConfigLb(hfflagConfigurations.selectionFlagDplus.value, invMassWindowCharmHadPi.value); + isHfCandBhadConfigFilled = true; + } + + int zvtxColl{0}; + int sel8Coll{0}; + int zvtxAndSel8Coll{0}; + int zvtxAndSel8CollAndSoftTrig{0}; + int allSelColl{0}; + for (const auto& collision : collisions) { + o2::hf_evsel::checkEvSel(collision, hfEvSel, zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl, ccdb, registry); + + auto thisCollId = collision.globalIndex(); + auto candsCThisColl = candsC.sliceBy(candsLcPerCollision, thisCollId); + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + auto collsSameMcCollision = collisions.sliceBy(colPerMcCollision, collision.mcCollisionId()); + int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); + } + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); + runMcGen(particlesMc); + } + PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processLcPiMc, "Process LcPi with MC info and without ML info", false); + + void processLcPiMcWithMl(CollisionsWCentAndMcLabels const& collisions, + CandsLcFilteredWithMl const& candsC, + aod::TrackAssoc const& trackIndices, + TracksPidWithSelAndMc const& tracks, + aod::McParticles const& particlesMc, + aod::BCsWithTimestamps const& bcs, + McCollisions const&) + { + // store configurables needed for Lb workflow + if (!isHfCandBhadConfigFilled) { + rowCandidateConfigLb(hfflagConfigurations.selectionFlagLc.value, invMassWindowCharmHadPi.value); + isHfCandBhadConfigFilled = true; + } + + int zvtxColl{0}; + int sel8Coll{0}; + int zvtxAndSel8Coll{0}; + int zvtxAndSel8CollAndSoftTrig{0}; + int allSelColl{0}; + for (const auto& collision : collisions) { + o2::hf_evsel::checkEvSel(collision, hfEvSel, zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl, ccdb, registry); + + auto thisCollId = collision.globalIndex(); + auto candsCThisColl = candsC.sliceBy(candsLcPerCollisionWithMl, thisCollId); + auto trackIdsThisCollision = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); + auto collsSameMcCollision = collisions.sliceBy(colPerMcCollision, collision.mcCollisionId()); + int64_t indexCollisionMaxNumContrib = getIndexCollisionMaxNumContrib(collsSameMcCollision); + runDataCreation(collision, candsCThisColl, trackIdsThisCollision, tracks, particlesMc, indexCollisionMaxNumContrib, bcs); + } + // handle normalization by the right number of collisions + hfCollisionCounter(collisions.tableSize(), zvtxColl, sel8Coll, zvtxAndSel8Coll, zvtxAndSel8CollAndSoftTrig, allSelColl); + runMcGen(particlesMc); + } + PROCESS_SWITCH(HfDataCreatorCharmHadPiReduced, processLcPiMcWithMl, "Process LcPi with MC info and with ML info", false); + }; // struct WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From af29198c860e68bf7dddbea37fe96548d26a27e9 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 24 Apr 2025 15:53:05 +0000 Subject: [PATCH 17/85] Please consider the following formatting changes --- PWGHF/Core/HfMlResponseLbToLcPi.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h index db5736ecdd0..f04bcf6905c 100644 --- a/PWGHF/Core/HfMlResponseLbToLcPi.h +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -26,8 +26,8 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_Lb(FEATURE) \ - { \ +#define FILL_MAP_Lb(FEATURE) \ + { \ #FEATURE, static_cast(InputFeaturesLbToLcPi::FEATURE) \ } @@ -35,28 +35,28 @@ // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER from OBJECT -#define CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) \ +#define CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) \ case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ - inputFeatures.emplace_back(OBJECT.GETTER()); \ - break; \ + inputFeatures.emplace_back(OBJECT.GETTER()); \ + break; \ } // Check if the index of mCachedIndices (index associated to a FEATURE) // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the GETTER function taking OBJECT in argument -#define CHECK_AND_FILL_VEC_Lb_FUNC(OBJECT, FEATURE, GETTER) \ +#define CHECK_AND_FILL_VEC_Lb_FUNC(OBJECT, FEATURE, GETTER) \ case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ - inputFeatures.emplace_back(GETTER(OBJECT)); \ - break; \ + inputFeatures.emplace_back(GETTER(OBJECT)); \ + break; \ } // Specific case of CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) // where OBJECT is named candidate and FEATURE = GETTER -#define CHECK_AND_FILL_VEC_Lb(GETTER) \ +#define CHECK_AND_FILL_VEC_Lb(GETTER) \ case static_cast(InputFeaturesLbToLcPi::GETTER): { \ - inputFeatures.emplace_back(candidate.GETTER()); \ - break; \ + inputFeatures.emplace_back(candidate.GETTER()); \ + break; \ } namespace o2::analysis From 29dc5e9c4d7c7cc5a56f282f5357d5e3e04cf62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 18:07:11 +0200 Subject: [PATCH 18/85] Update HfMlResponseLbToLcPi.h --- PWGHF/Core/HfMlResponseLbToLcPi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h index f04bcf6905c..666f698720c 100644 --- a/PWGHF/Core/HfMlResponseLbToLcPi.h +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -13,8 +13,8 @@ /// \brief Class to compute the ML response for Lb → Lc∓ π± analysis selections /// \author Biao Zhang , Heidelberg University -#ifndef PWGHF_CORE_HfMlResponseLBTOLCPI_H_ -#define PWGHF_CORE_HfMlResponseLBTOLCPI_H_ +#ifndef PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ +#define PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ #include #include @@ -194,4 +194,4 @@ class HfMlResponseLbToLcPi : public HfMlResponse #undef CHECK_AND_FILL_VEC_Lb_FUNC #undef CHECK_AND_FILL_VEC_Lb -#endif // PWGHF_CORE_HfMlResponseLBTOLCPI_H_ +#endif // PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ From e16aa2a4d70efe35c4f4c56ab12b28e5ae49e21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 24 Apr 2025 18:18:30 +0200 Subject: [PATCH 19/85] Update CMakeLists.txt --- PWGHF/D2H/TableProducer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 445715d9e4e..b7a9a574ac2 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -53,7 +53,7 @@ o2physics_add_dpl_workflow(candidate-selector-bs-to-ds-pi-reduced PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(candidate-selector-Lb-to-Lc-pi-reduced +o2physics_add_dpl_workflow(candidate-selector-lb-to-lc-pi-reduced SOURCES candidateSelectorLbToLcPiReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore COMPONENT_NAME Analysis) From 4372de174cdcd5308750f1957d6130a9373dfe5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:25:59 +0200 Subject: [PATCH 20/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index a197ffb51f6..048fe7b10e6 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -56,7 +56,7 @@ struct HfCandidateCreatorLbReduced { float myInvMassWindowLcPi{1.}; // variable that will store the value of invMassWindowLcPi float massPi{0.}; float massLc{0.}; - float MassLb{0.}; + float massLb{0.}; float bz{0.}; o2::vertexing::DCAFitterN<2> df2; // fitter for B vertex (2-prong vertex fitter) From 5f4d82cbf7beaf9a85ccd43cbcbe98373d3ed291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:26:11 +0200 Subject: [PATCH 21/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 048fe7b10e6..04f1ea7c089 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -80,7 +80,7 @@ struct HfCandidateCreatorLbReduced { // invariant-mass window cut massPi = o2::constants::physics::MassPiPlus; massLc = o2::constants::physics::MassLambdaCPlus; - MassLb = o2::constants::physics::MassLambdaB0; + massLb = o2::constants::physics::MassLambdaB0; // Initialize fitter df2.setPropagateToPCA(propagateToPCA); From 24851f13cecabde693e4ceac579ae2bd5df0cfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:26:21 +0200 Subject: [PATCH 22/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 04f1ea7c089..696ced678a1 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -195,7 +195,7 @@ struct HfCandidateCreatorLbReduced { pVecLc[0], pVecLc[1], pVecLc[2], pVecPion[0], pVecPion[1], pVecPion[2], dcaLc.getY(), dcaPion.getY(), - std::sqrt(dcaLc.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), candLc.globalIndex(), trackPion.globalIndex(), hfFlag); + std::sqrt(dcaLc.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), candLc.globalIndex(), trackPion.globalIndex()); rowCandidateProngs(candLc.globalIndex(), trackPion.globalIndex()); From f2867b4d412ddf10e3bd5327bd6e91fc440c0580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:26:58 +0200 Subject: [PATCH 23/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 696ced678a1..f8b3cf9db92 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -184,7 +184,6 @@ struct HfCandidateCreatorLbReduced { getPointDirection(std::array{collision.posX(), collision.posY(), collision.posZ()}, secondaryVertexLb, phi, theta); auto errorDecayLength = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, theta) + getRotatedCovMatrixXX(covMatrixPCA, phi, theta)); auto errorDecayLengthXY = std::sqrt(getRotatedCovMatrixXX(covMatrixPV, phi, 0.) + getRotatedCovMatrixXX(covMatrixPCA, phi, 0.)); - int hfFlag = 1 << hf_cand_lb::DecayType::LbToLcPi; // fill the candidate table for the Lb here: rowCandidateBase(collision.globalIndex(), From 6434ab1d7511dcd0c8f97b6a9328bd188f88033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:27:34 +0200 Subject: [PATCH 24/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 85a923d9bd2..5a234fb181a 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1362,7 +1362,7 @@ struct HfDataCreatorCharmHadPiReduced { ptProngs[1], yProngs[1], etaProngs[1]); } else if constexpr (decayChannel == DecayChannel::LbToLcplusPi) { // Lb → Lc+ π- - if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kLambdaB0, std::array{-static_cast(Pdg::kLambdaCPlus), -kPiPlus}, true)) { + if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kLambdaB0, std::array{static_cast(Pdg::kLambdaCPlus), -kPiPlus}, true)) { // Match Lc+ → p K- π+ auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking Lc+ → p K- π+"); From 9e418a253d422c4056988b0a89e953d0655b130b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:27:44 +0200 Subject: [PATCH 25/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 5a234fb181a..cd2bf6dbdb0 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1366,7 +1366,7 @@ struct HfDataCreatorCharmHadPiReduced { // Match Lc+ → p K- π+ auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); // Printf("Checking Lc+ → p K- π+"); - if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, -static_cast(Pdg::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { + if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, static_cast(Pdg::kLambdaCPlus), std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { flag = sign * BIT(hf_cand_lb::DecayType::LbToLcPi); } } From f58f9f020eaa2fee1ee45fdf6eafc71900fcc159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:27:58 +0200 Subject: [PATCH 26/85] Update PWGHF/D2H/Tasks/taskLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index 56f29fe53eb..b6ee089d2c0 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -101,7 +101,7 @@ DECLARE_SOA_TABLE(HfRedCandLbLites, "AOD", "HFREDCANDLBLITE", //! Table with som hf_cand_lb_lite::MaxNormalisedDeltaIP, hf_cand_lb_lite::MlScoreSig, hf_sel_candidate_lb::IsSelLbToLcPi, - // D meson features + // Lc meson features hf_cand_lb_lite::MLc, hf_cand_lb_lite::PtLc, hf_cand_lb_lite::DecayLengthLc, From 5bb7b339bb5577a2dd50aa3c321b0f00f7c446ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:28:40 +0200 Subject: [PATCH 27/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index f8b3cf9db92..46e51ae1e84 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -217,8 +217,8 @@ struct HfCandidateCreatorLbReduced { } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + float invMass2LcPiMin = (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); From 578253669608e5ac49e686f68ac8c61dca9a991a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:29:00 +0200 Subject: [PATCH 28/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index cd2bf6dbdb0..096c1b07f11 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -304,7 +304,7 @@ struct HfDataCreatorCharmHadPiReduced { } else if (doprocessLcPiData || doprocessLcPiDataWithMl || doprocessLcPiMc || doprocessLcPiMcWithMl) { charmHadTitle = "#Lambda_{c}^{+}"; histMassTitle = "Lc"; - registry.add("hMassLc", "#Lambda_{c}^{+} candidates; #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hMassLc", "#Lambda_{c}^{+} candidates; #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); } registry.add(Form("hPt%s", histMassTitle.data()), Form("%s candidates candidates;%s candidate #it{p}_{T} (GeV/#it{c});entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1F, {{100, 0., 10.}}}); From d2253036245422517480ee9f3c3d518785af8352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:35:05 +0200 Subject: [PATCH 29/85] Update dataCreatorCharmHadPiReduced.cxx --- .../dataCreatorCharmHadPiReduced.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 096c1b07f11..b9886c34956 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -290,26 +290,26 @@ struct HfDataCreatorCharmHadPiReduced { if (doprocessDplusPiData || doprocessDplusPiDataWithMl || doprocessDplusPiMc || doprocessDplusPiMcWithMl) { charmHadTitle = "D^{#plus}"; histMassTitle = "Dplus"; - registry.add("hMassDplus", "D^{#plus} candidates; #it{M}(K#pi#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hMassDplus", "D^{#plus} candidates; #it{M}(K#pi#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); } else if (doprocessDsPiData || doprocessDsPiDataWithMl || doprocessDsPiMc || doprocessDsPiMcWithMl) { charmHadTitle = "D_{s}^{#plus}"; histMassTitle = "Ds"; - registry.add("hMassDsToKKPi", "D_{s}^{#plus} to KKpi candidates; #it{M}(KK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); - registry.add("hMassDsToPiKK", "D_{s}^{#plus} to piKK candidates; #it{M}(KK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hMassDsToKKPi", "D_{s}^{#plus} to KKpi candidates; #it{M}(KK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); + registry.add("hMassDsToPiKK", "D_{s}^{#plus} to piKK candidates; #it{M}(KK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); } else if (doprocessD0PiData || doprocessD0PiDataWithMl || doprocessD0PiMc || doprocessD0PiMcWithMl) { charmHadTitle = "D^{0}"; histMassTitle = "D0"; - registry.add("hMassD0", "D^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); - registry.add("hMassD0bar", "#overline{D}^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}); + registry.add("hMassD0", "D^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); + registry.add("hMassD0bar", "#overline{D}^{0} candidates; #it{M}(K#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); } else if (doprocessLcPiData || doprocessLcPiDataWithMl || doprocessLcPiMc || doprocessLcPiMcWithMl) { charmHadTitle = "#Lambda_{c}^{+}"; histMassTitle = "Lc"; registry.add("hMassLc", "#Lambda_{c}^{+} candidates; #it{M}(pK#pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 0., 5.}}}); } - registry.add(Form("hPt%s", histMassTitle.data()), Form("%s candidates candidates;%s candidate #it{p}_{T} (GeV/#it{c});entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}); - registry.add(Form("hCpa%s", histMassTitle.data()), Form("%s candidates;%s cosine of pointing angle;entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add(Form("hPt%s", histMassTitle.data()), Form("%s candidates candidates;%s candidate #it{p}_{T} (GeV/#it{c});entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1D, {{100, 0., 10.}}}); + registry.add("hPtPion", "#pi^{#plus} candidates;#pi^{#plus} candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{100, 0., 10.}}}); + registry.add(Form("hCpa%s", histMassTitle.data()), Form("%s candidates;%s cosine of pointing angle;entries", charmHadTitle.data(), charmHadTitle.data()), {HistType::kTH1D, {{110, -1.1, 1.1}}}); /// candidate monitoring hCandidatesD0 = registry.add("hCandidatesD0", "D0 candidate counter", {HistType::kTH1D, {axisCands}}); From 8af882fdac98ad1fd42b4c67abcc1602a308cd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:35:59 +0200 Subject: [PATCH 30/85] Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 46e51ae1e84..9cf66f7bccb 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -251,8 +251,8 @@ struct HfCandidateCreatorLbReduced { } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + float invMass2LcPiMin = (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); From 8032c02c4abf90f5d2756f6e0cd359cae8511a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:36:20 +0200 Subject: [PATCH 31/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index b9886c34956..7bb6fe82c48 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -737,7 +737,7 @@ struct HfDataCreatorCharmHadPiReduced { rowHfD0PiMcRecReduced(indexHfCandCharm, selectedTracksPion[vecDaughtersB.back().globalIndex()], flag, flagWrongCollision, debug, motherPt); } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { // Lb → Lc+ π- → (p K- π+) π- - auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); + auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kPiPlus}, true, &sign, 3); if (indexRec > -1) { // Lc+ → p K- π+ // Printf("Checking Lc+ → p K- π+"); From 90de7370b02740ed0e850eeb2ae2f624169a69d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:36:40 +0200 Subject: [PATCH 32/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 7bb6fe82c48..0f80cec8f63 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -761,7 +761,7 @@ struct HfDataCreatorCharmHadPiReduced { if (checkDecayTypeMc) { // Lb → Lc+ K- → (p K- π+) K- if (!flag) { - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kKPlus}, true, &sign, 3); + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kKPlus}, true, &sign, 3); if (indexRec > -1) { // Lc+ → p K- π+ indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); From deb11a2565aa637ad94e90f86af00cd0abbbedcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 13:39:08 +0200 Subject: [PATCH 33/85] Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx Co-authored-by: Fabrizio --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 0f80cec8f63..b264bb36c77 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -764,7 +764,7 @@ struct HfDataCreatorCharmHadPiReduced { indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kLambdaB0, std::array{+kProton, -kKPlus, +kPiPlus, -kKPlus}, true, &sign, 3); if (indexRec > -1) { // Lc+ → p K- π+ - indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); if (indexRec > -1) { flag = sign * BIT(hf_cand_lb::DecayTypeMc::LbToLcPiToPKPiK); } From ca09fa2c9b9d6a0ca8ee424edd621b6a9c2356bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:55:45 +0200 Subject: [PATCH 34/85] Update candidateCreatorLbReduced.cxx --- .../D2H/TableProducer/candidateCreatorLbReduced.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 9cf66f7bccb..909e4fedc75 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -199,10 +199,14 @@ struct HfCandidateCreatorLbReduced { rowCandidateProngs(candLc.globalIndex(), trackPion.globalIndex()); if constexpr (withLcMl) { - rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); - } - } // pi loop - } // Lc loop + if (candLc.invMassHypo0() > 0) { + rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); + } else { + rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo1(), candLc.mlScorePromptMassHypo1(), candLc.mlScoreNonpromptMassHypo1()); + } + } // pi loop + } // Lc loop + } } void processData(HfRedCollisionsWithExtras const& collisions, From 0d52e4e0473d4b658b92314bd700484057f7098d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:10:40 +0200 Subject: [PATCH 35/85] Update candidateSelectorLbToLcPiReduced.cxx --- .../TableProducer/candidateSelectorLbToLcPiReduced.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index d23777aa839..3363b4a4c50 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -34,6 +34,12 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::analysis; +enum PidMethod { + NoPid = 0, // none + TpcOrTof, // TPC or TOF + TpcAndTof // TPC and TOF +}; + struct HfCandidateSelectorLbToLcPiReduced { Produces hfSelLbToLcPiCandidate; // table defined in CandidateSelectionTables.h Produces hfMlLbToLcPiCandidate; // table defined in CandidateSelectionTables.h @@ -94,7 +100,7 @@ struct HfCandidateSelectorLbToLcPiReduced { LOGP(fatal, "Only one process function for data should be enabled at a time."); } - if (pionPidMethod < 0 || pionPidMethod > 2) { + if (pionPidMethod < PidMethod::NoPid || pionPidMethod > PidMethod::TpcAndTof) { LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); } From 75cddedc3139dec1bfb73d1bd8fdc72d90031963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:36:32 +0200 Subject: [PATCH 36/85] Update taskLbReduced.cxx --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index b6ee089d2c0..84d24ac7d1c 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -101,7 +101,7 @@ DECLARE_SOA_TABLE(HfRedCandLbLites, "AOD", "HFREDCANDLBLITE", //! Table with som hf_cand_lb_lite::MaxNormalisedDeltaIP, hf_cand_lb_lite::MlScoreSig, hf_sel_candidate_lb::IsSelLbToLcPi, - // Lc meson features + // Lc baryon features hf_cand_lb_lite::MLc, hf_cand_lb_lite::PtLc, hf_cand_lb_lite::DecayLengthLc, @@ -382,7 +382,8 @@ struct HfTaskLbReduced { auto invMassLb = hfHelper.invMassLbToLcPi(candidate); auto candLc = candidate.template prong0Lc_as(); auto ptLc = candidate.ptProng0(); - auto invMassLc = candLc.invMassHypo0(); + auto invMassLc = candLc.invMassHypo0() > 0 ? candLc.invMassHypo0() : candLc.invMassHypo1(); + // TODO: here we are assuming that only one of the two hypotheses is filled, to be checked std::array posPv{candidate.posX(), candidate.posY(), candidate.posZ()}; std::array posSvLc{candLc.xSecondaryVertex(), candLc.ySecondaryVertex(), candLc.zSecondaryVertex()}; std::array momLc{candLc.pVector()}; From e2f2f1442ecfdf3d93d66357116f47e9151a0367 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 25 Apr 2025 14:37:05 +0000 Subject: [PATCH 37/85] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 909e4fedc75..78f769435ee 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -200,9 +200,9 @@ struct HfCandidateCreatorLbReduced { if constexpr (withLcMl) { if (candLc.invMassHypo0() > 0) { - rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); + rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo0(), candLc.mlScorePromptMassHypo0(), candLc.mlScoreNonpromptMassHypo0()); } else { - rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo1(), candLc.mlScorePromptMassHypo1(), candLc.mlScoreNonpromptMassHypo1()); + rowCandidateLcMlScores(candLc.mlScoreBkgMassHypo1(), candLc.mlScorePromptMassHypo1(), candLc.mlScoreNonpromptMassHypo1()); } } // pi loop } // Lc loop From ca0d218c98d0b07ccca6d7891fd3228e6e02b184 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: Mon, 28 Apr 2025 16:07:38 +0200 Subject: [PATCH 38/85] Update ReducedDataModel.h --- PWGHF/D2H/DataModel/ReducedDataModel.h | 52 +++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index f1da63a030a..07fe71a539c 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -364,7 +364,37 @@ DECLARE_SOA_TABLE_VERSIONED(HfRed3ProngsMl_001, "AOD", "HFRED3PRONGML", 1, //! T using HfRed3ProngsMl = HfRed3ProngsMl_001; -DECLARE_SOA_TABLE(HfRedPidDau0s, "AOD", "HFREDPIDDAU0", //! +DECLARE_SOA_TABLE(HfRedPidDau0s_000, "AOD", "HFREDPIDDAU0", //! + hf_track_pid_reduced::TPCNSigmaPiProng0, + hf_track_pid_reduced::TOFNSigmaPiProng0, + hf_track_pid_reduced::TPCNSigmaKaProng0, + hf_track_pid_reduced::TOFNSigmaKaProng0, + hf_track_vars_reduced::HasTOFProng0, + hf_track_vars_reduced::HasTPCProng0, + hf_track_pid_reduced::TPCTOFNSigmaPiProng0, + hf_track_pid_reduced::TPCTOFNSigmaKaProng0); + +DECLARE_SOA_TABLE(HfRedPidDau1s_000, "AOD", "HFREDPIDDAU1", //! + hf_track_pid_reduced::TPCNSigmaPiProng1, + hf_track_pid_reduced::TOFNSigmaPiProng1, + hf_track_pid_reduced::TPCNSigmaKaProng1, + hf_track_pid_reduced::TOFNSigmaKaProng1, + hf_track_vars_reduced::HasTOFProng1, + hf_track_vars_reduced::HasTPCProng1, + hf_track_pid_reduced::TPCTOFNSigmaPiProng1, + hf_track_pid_reduced::TPCTOFNSigmaKaProng1); + +DECLARE_SOA_TABLE(HfRedPidDau2s_000, "AOD", "HFREDPIDDAU2", //! + hf_track_pid_reduced::TPCNSigmaPiProng2, + hf_track_pid_reduced::TOFNSigmaPiProng2, + hf_track_pid_reduced::TPCNSigmaKaProng2, + hf_track_pid_reduced::TOFNSigmaKaProng2, + hf_track_vars_reduced::HasTOFProng2, + hf_track_vars_reduced::HasTPCProng2, + hf_track_pid_reduced::TPCTOFNSigmaPiProng2, + hf_track_pid_reduced::TPCTOFNSigmaKaProng2); + +DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau0s_001, "AOD", "HFREDPIDDAU0", 1, //! hf_track_pid_reduced::TPCNSigmaPiProng0, hf_track_pid_reduced::TOFNSigmaPiProng0, hf_track_pid_reduced::TPCNSigmaKaProng0, @@ -375,9 +405,10 @@ DECLARE_SOA_TABLE(HfRedPidDau0s, "AOD", "HFREDPIDDAU0", //! hf_track_vars_reduced::HasTPCProng0, hf_track_pid_reduced::TPCTOFNSigmaPiProng0, hf_track_pid_reduced::TPCTOFNSigmaKaProng0, - hf_track_pid_reduced::TPCTOFNSigmaPrProng0); + hf_track_pid_reduced::TPCTOFNSigmaPrProng0, + o2::soa::Marker<1>); -DECLARE_SOA_TABLE(HfRedPidDau1s, "AOD", "HFREDPIDDAU1", //! +DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau1s_001, "AOD", "HFREDPIDDAU1", 1, //! hf_track_pid_reduced::TPCNSigmaPiProng1, hf_track_pid_reduced::TOFNSigmaPiProng1, hf_track_pid_reduced::TPCNSigmaKaProng1, @@ -388,9 +419,10 @@ DECLARE_SOA_TABLE(HfRedPidDau1s, "AOD", "HFREDPIDDAU1", //! hf_track_vars_reduced::HasTPCProng1, hf_track_pid_reduced::TPCTOFNSigmaPiProng1, hf_track_pid_reduced::TPCTOFNSigmaKaProng1, - hf_track_pid_reduced::TPCTOFNSigmaPrProng1); + hf_track_pid_reduced::TPCTOFNSigmaPrProng1, + o2::soa::Marker<1>); -DECLARE_SOA_TABLE(HfRedPidDau2s, "AOD", "HFREDPIDDAU2", //! +DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau2s_001, "AOD", "HFREDPIDDAU2", 1, //! hf_track_pid_reduced::TPCNSigmaPiProng2, hf_track_pid_reduced::TOFNSigmaPiProng2, hf_track_pid_reduced::TPCNSigmaKaProng2, @@ -401,8 +433,16 @@ DECLARE_SOA_TABLE(HfRedPidDau2s, "AOD", "HFREDPIDDAU2", //! hf_track_vars_reduced::HasTPCProng2, hf_track_pid_reduced::TPCTOFNSigmaPiProng2, hf_track_pid_reduced::TPCTOFNSigmaKaProng2, - hf_track_pid_reduced::TPCTOFNSigmaPrProng2); + hf_track_pid_reduced::TPCTOFNSigmaPrProng2, + o2::soa::Marker<1>); + +using HfRedPidDau0s = HfRedPidDau0s_001; +using HfRedPidDau1s = HfRedPidDau1s_001; +using HfRedPidDau2s = HfRedPidDau2s_001; +using HfRedPidDau0 = HfRedPidDau0s::iterator; +using HfRedPidDau1 = HfRedPidDau1s::iterator; +using HfRedPidDau2 = HfRedPidDau2s::iterator; // Beauty candidates prongs namespace hf_cand_b0_reduced { From 298088f89f72af6f2862f98b9bdedb3dba4860e2 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: Mon, 28 Apr 2025 16:09:00 +0200 Subject: [PATCH 39/85] Update CMakeLists.txt --- PWGHF/D2H/TableProducer/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index b7a9a574ac2..57a7de3f084 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -76,3 +76,8 @@ o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml SOURCES converterReduced3ProngsMl.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + + o2physics_add_dpl_workflow(converter-reduced-hadron-daus-pid + SOURCES converterReducedHadronDausPid.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) From b762e44c83689a7656a8acdf1129706bc27c7cb4 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: Mon, 28 Apr 2025 16:11:18 +0200 Subject: [PATCH 40/85] Create converterReducedHadronDausPid.cxx --- .../converterReducedHadronDausPid.cxx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx new file mode 100644 index 00000000000..a29b8e93aef --- /dev/null +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -0,0 +1,46 @@ +// 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 converterReducedHadronDausPid.cxx +/// \brief Task for conversion of daughters pid to version 001 +/// +/// \author Biao Zhang , Heidelberg University + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" + +#include "PWGHF/D2H/DataModel/ReducedDataModel.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" + +using namespace o2; +using namespace o2::framework; + +struct HfConverterReducedHadronDausPid { + Produces hfRedPidDau0s; + Produces hfRedPidDau1s; + Produces hfRedPidDau2s; + using HfRedPidDaus = soa::Join; + void process(HfRedPidDaus::iterator const& hfCandPidProngs) + { + + hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + }; +} From c83d1fe3d78dcb52f6a8e3494a805e1fc3b3c6ed Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 28 Apr 2025 14:11:44 +0000 Subject: [PATCH 41/85] Please consider the following formatting changes --- PWGHF/D2H/DataModel/ReducedDataModel.h | 72 +++++++++++++------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 07fe71a539c..7e4042fe96a 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -395,46 +395,46 @@ DECLARE_SOA_TABLE(HfRedPidDau2s_000, "AOD", "HFREDPIDDAU2", //! hf_track_pid_reduced::TPCTOFNSigmaKaProng2); DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau0s_001, "AOD", "HFREDPIDDAU0", 1, //! - hf_track_pid_reduced::TPCNSigmaPiProng0, - hf_track_pid_reduced::TOFNSigmaPiProng0, - hf_track_pid_reduced::TPCNSigmaKaProng0, - hf_track_pid_reduced::TOFNSigmaKaProng0, - hf_track_pid_reduced::TPCNSigmaPrProng0, - hf_track_pid_reduced::TOFNSigmaPrProng0, - hf_track_vars_reduced::HasTOFProng0, - hf_track_vars_reduced::HasTPCProng0, - hf_track_pid_reduced::TPCTOFNSigmaPiProng0, - hf_track_pid_reduced::TPCTOFNSigmaKaProng0, - hf_track_pid_reduced::TPCTOFNSigmaPrProng0, - o2::soa::Marker<1>); + hf_track_pid_reduced::TPCNSigmaPiProng0, + hf_track_pid_reduced::TOFNSigmaPiProng0, + hf_track_pid_reduced::TPCNSigmaKaProng0, + hf_track_pid_reduced::TOFNSigmaKaProng0, + hf_track_pid_reduced::TPCNSigmaPrProng0, + hf_track_pid_reduced::TOFNSigmaPrProng0, + hf_track_vars_reduced::HasTOFProng0, + hf_track_vars_reduced::HasTPCProng0, + hf_track_pid_reduced::TPCTOFNSigmaPiProng0, + hf_track_pid_reduced::TPCTOFNSigmaKaProng0, + hf_track_pid_reduced::TPCTOFNSigmaPrProng0, + o2::soa::Marker<1>); DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau1s_001, "AOD", "HFREDPIDDAU1", 1, //! - hf_track_pid_reduced::TPCNSigmaPiProng1, - hf_track_pid_reduced::TOFNSigmaPiProng1, - hf_track_pid_reduced::TPCNSigmaKaProng1, - hf_track_pid_reduced::TOFNSigmaKaProng1, - hf_track_pid_reduced::TPCNSigmaPrProng1, - hf_track_pid_reduced::TOFNSigmaPrProng1, - hf_track_vars_reduced::HasTOFProng1, - hf_track_vars_reduced::HasTPCProng1, - hf_track_pid_reduced::TPCTOFNSigmaPiProng1, - hf_track_pid_reduced::TPCTOFNSigmaKaProng1, - hf_track_pid_reduced::TPCTOFNSigmaPrProng1, - o2::soa::Marker<1>); + hf_track_pid_reduced::TPCNSigmaPiProng1, + hf_track_pid_reduced::TOFNSigmaPiProng1, + hf_track_pid_reduced::TPCNSigmaKaProng1, + hf_track_pid_reduced::TOFNSigmaKaProng1, + hf_track_pid_reduced::TPCNSigmaPrProng1, + hf_track_pid_reduced::TOFNSigmaPrProng1, + hf_track_vars_reduced::HasTOFProng1, + hf_track_vars_reduced::HasTPCProng1, + hf_track_pid_reduced::TPCTOFNSigmaPiProng1, + hf_track_pid_reduced::TPCTOFNSigmaKaProng1, + hf_track_pid_reduced::TPCTOFNSigmaPrProng1, + o2::soa::Marker<1>); DECLARE_SOA_TABLE_VERSIONED(HfRedPidDau2s_001, "AOD", "HFREDPIDDAU2", 1, //! - hf_track_pid_reduced::TPCNSigmaPiProng2, - hf_track_pid_reduced::TOFNSigmaPiProng2, - hf_track_pid_reduced::TPCNSigmaKaProng2, - hf_track_pid_reduced::TOFNSigmaKaProng2, - hf_track_pid_reduced::TPCNSigmaPrProng2, - hf_track_pid_reduced::TOFNSigmaPrProng2, - hf_track_vars_reduced::HasTOFProng2, - hf_track_vars_reduced::HasTPCProng2, - hf_track_pid_reduced::TPCTOFNSigmaPiProng2, - hf_track_pid_reduced::TPCTOFNSigmaKaProng2, - hf_track_pid_reduced::TPCTOFNSigmaPrProng2, - o2::soa::Marker<1>); + hf_track_pid_reduced::TPCNSigmaPiProng2, + hf_track_pid_reduced::TOFNSigmaPiProng2, + hf_track_pid_reduced::TPCNSigmaKaProng2, + hf_track_pid_reduced::TOFNSigmaKaProng2, + hf_track_pid_reduced::TPCNSigmaPrProng2, + hf_track_pid_reduced::TOFNSigmaPrProng2, + hf_track_vars_reduced::HasTOFProng2, + hf_track_vars_reduced::HasTPCProng2, + hf_track_pid_reduced::TPCTOFNSigmaPiProng2, + hf_track_pid_reduced::TPCTOFNSigmaKaProng2, + hf_track_pid_reduced::TPCTOFNSigmaPrProng2, + o2::soa::Marker<1>); using HfRedPidDau0s = HfRedPidDau0s_001; using HfRedPidDau1s = HfRedPidDau1s_001; From 05d8bc18c57a02dc9bd797c27ce0651635e924a2 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, 30 Apr 2025 14:33:49 +0200 Subject: [PATCH 42/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 78f769435ee..a31528d867c 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -194,7 +194,7 @@ struct HfCandidateCreatorLbReduced { pVecLc[0], pVecLc[1], pVecLc[2], pVecPion[0], pVecPion[1], pVecPion[2], dcaLc.getY(), dcaPion.getY(), - std::sqrt(dcaLc.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), candLc.globalIndex(), trackPion.globalIndex()); + std::sqrt(dcaLc.getSigmaY2()), std::sqrt(dcaPion.getSigmaY2()), candLc.globalIndex(), trackPion.globalIndex(), -999.); rowCandidateProngs(candLc.globalIndex(), trackPion.globalIndex()); From ea1387cbbedb41f57ba7b1ca13209ff5577fae3e 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, 30 Apr 2025 17:15:49 +0200 Subject: [PATCH 43/85] Update HfMlResponseLbToLcPi.h --- PWGHF/Core/HfMlResponseLbToLcPi.h | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h index 666f698720c..c1db76168cb 100644 --- a/PWGHF/Core/HfMlResponseLbToLcPi.h +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -26,7 +26,7 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_Lb(FEATURE) \ +#define FILL_MAP_LB(FEATURE) \ { \ #FEATURE, static_cast(InputFeaturesLbToLcPi::FEATURE) \ } @@ -162,34 +162,34 @@ class HfMlResponseLbToLcPi : public HfMlResponse void setAvailableInputFeatures() { MlResponse::mAvailableInputFeatures = { - FILL_MAP_Lb(ptProng0), - FILL_MAP_Lb(ptProng1), - FILL_MAP_Lb(impactParameter0), - FILL_MAP_Lb(impactParameter1), - FILL_MAP_Lb(impactParameterProduct), - FILL_MAP_Lb(chi2PCA), - FILL_MAP_Lb(decayLength), - FILL_MAP_Lb(decayLengthXY), - FILL_MAP_Lb(decayLengthNormalised), - FILL_MAP_Lb(decayLengthXYNormalised), - FILL_MAP_Lb(cpa), - FILL_MAP_Lb(cpaXY), - FILL_MAP_Lb(maxNormalisedDeltaIP), - FILL_MAP_Lb(prong0MlScoreBkg), - FILL_MAP_Lb(prong0MlScorePrompt), - FILL_MAP_Lb(prong0MlScoreNonprompt), + FILL_MAP_LB(ptProng0), + FILL_MAP_LB(ptProng1), + FILL_MAP_LB(impactParameter0), + FILL_MAP_LB(impactParameter1), + FILL_MAP_LB(impactParameterProduct), + FILL_MAP_LB(chi2PCA), + FILL_MAP_LB(decayLength), + FILL_MAP_LB(decayLengthXY), + FILL_MAP_LB(decayLengthNormalised), + FILL_MAP_LB(decayLengthXYNormalised), + FILL_MAP_LB(cpa), + FILL_MAP_LB(cpaXY), + FILL_MAP_LB(maxNormalisedDeltaIP), + FILL_MAP_LB(prong0MlScoreBkg), + FILL_MAP_LB(prong0MlScorePrompt), + FILL_MAP_LB(prong0MlScoreNonprompt), // TPC PID variable - FILL_MAP_Lb(tpcNSigmaPi1), + FILL_MAP_LB(tpcNSigmaPi1), // TOF PID variable - FILL_MAP_Lb(tofNSigmaPi1), + FILL_MAP_LB(tofNSigmaPi1), // Combined PID variable - FILL_MAP_Lb(tpcTofNSigmaPi1)}; + FILL_MAP_LB(tpcTofNSigmaPi1)}; } }; } // namespace o2::analysis -#undef FILL_MAP_Lb +#undef FILL_MAP_LB #undef CHECK_AND_FILL_VEC_Lb_FULL #undef CHECK_AND_FILL_VEC_Lb_FUNC #undef CHECK_AND_FILL_VEC_Lb From de0e35d971fc87a260d02a78836d2b82aa43822b 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, 30 Apr 2025 17:18:53 +0200 Subject: [PATCH 44/85] Update CMakeLists.txt --- PWGHF/D2H/TableProducer/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index 57a7de3f084..c53dfc7399a 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -26,16 +26,16 @@ o2physics_add_dpl_workflow(candidate-creator-bs-reduced PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) -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-charm-reso-reduced SOURCES candidateCreatorCharmResoReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - + +o2physics_add_dpl_workflow(candidate-creator-lb-reduced + SOURCES candidateCreatorLbReduced.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter + COMPONENT_NAME Analysis) + # Candidate selectors o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi-reduced From 9cbd8ab4acb63329dd5d90537141bed2fe500747 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, 30 Apr 2025 17:27:02 +0200 Subject: [PATCH 45/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 4ef904d4459..def6e5fc2af 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -134,7 +134,7 @@ struct HfDataCreatorCharmHadPiReduced { struct : o2::framework::ConfigurableGroup { Configurable usePionIsGlobalTrackWoDCA{"usePionIsGlobalTrackWoDCA", true, "check isGlobalTrackWoDCA status for pions, for Run3 studies"}; Configurable ptPionMin{"ptPionMin", 0.5, "minimum pion pT threshold (GeV/c)"}; - Configurable absEtaPionMax{"etaPionMax", 0.8, "maximum pion absolute eta threshold"}; + Configurable etaPionMax{"etaPionMax", 0.8, "maximum pion absolute eta threshold"}; Configurable> binsPtPion{"binsPtPion", std::vector{hf_cuts_single_track::vecBinsPtTrack}, "track pT bin limits for pion DCA XY pT-dependent cut"}; Configurable> cutsTrackPionDCA{"cutsTrackPionDCA", {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 per pT bin for pions"}; } trackPionConfigurations; @@ -340,7 +340,7 @@ struct HfDataCreatorCharmHadPiReduced { return false; } // minimum pT and eta selection - if (trackParCovPion.getPt() < trackPionConfigurations.ptPionMin || std::abs(trackParCovPion.getEta()) > trackPionConfigurations.absEtaPionMax || !isSelectedTrackDCA(trackParCovPion, dcaPion)) { + if (trackParCovPion.getPt() < trackPionConfigurations.ptPionMin || std::abs(trackParCovPion.getEta()) > trackPionConfigurations.etaPionMax || !isSelectedTrackDCA(trackParCovPion, dcaPion)) { return false; } // reject pions that are charm-hadron daughters From 27a4c6b345ad22292e8a02f15544216e543bcc95 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, 30 Apr 2025 17:27:48 +0200 Subject: [PATCH 46/85] Update PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index a29b8e93aef..2960374993c 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -28,10 +28,11 @@ struct HfConverterReducedHadronDausPid { Produces hfRedPidDau0s; Produces hfRedPidDau1s; Produces hfRedPidDau2s; + using HfRedPidDaus = soa::Join; + void process(HfRedPidDaus::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); From 4e5e1a162a496aff3ec739072233fdc61c2391ab 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, 30 Apr 2025 17:30:41 +0200 Subject: [PATCH 47/85] Update converterReducedHadronDausPid.cxx --- PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 2960374993c..79ee6ab704d 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -41,7 +41,5 @@ struct HfConverterReducedHadronDausPid { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc), - }; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 97117af453b2b7acb76ec4e68b5dad7af4c28a41 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, 30 Apr 2025 17:56:00 +0200 Subject: [PATCH 48/85] Update candidateSelectorLbToLcPiReduced.cxx --- .../TableProducer/candidateSelectorLbToLcPiReduced.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 3363b4a4c50..628aa199d9a 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -47,7 +47,7 @@ struct HfCandidateSelectorLbToLcPiReduced { Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; // Enable PID - Configurable pionPidMethod{"pionPidMethod", 1, "PID selection method for the bachelor pion (0: none, 1: TPC or TOF, 2: TPC and TOF)"}; + Configurable pionPidMethod{"pionPidMethod", PidMethod::TpcOrTof, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; // TPC PID Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; @@ -104,7 +104,7 @@ struct HfCandidateSelectorLbToLcPiReduced { LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); } - if (pionPidMethod) { + if (pionPidMethod==PidMethod::TpcOrTof || pionPidMethod==PidMethod::TpcAndTof) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); @@ -187,9 +187,9 @@ struct HfCandidateSelectorLbToLcPiReduced { // track-level PID selection auto trackPi = hfCandLb.template prong1Track_as(); - if (pionPidMethod) { + if (pionPidMethod==PidMethod::TpcOrTof || pionPidMethod==PidMethod::TpcAndTof) { int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; - if (pionPidMethod == 1) { + if (pionPidMethod == PidMethod::TpcOrTof) { pidTrackPi = selectorPion.statusTpcOrTof(trackPi); } else { pidTrackPi = selectorPion.statusTpcAndTof(trackPi); From 40c0607aaf3f1907445db3bd53c6ea3b316fd9d0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 30 Apr 2025 15:56:28 +0000 Subject: [PATCH 49/85] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 628aa199d9a..7d8c85a1aa6 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -104,7 +104,7 @@ struct HfCandidateSelectorLbToLcPiReduced { LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); } - if (pionPidMethod==PidMethod::TpcOrTof || pionPidMethod==PidMethod::TpcAndTof) { + if (pionPidMethod == PidMethod::TpcOrTof || pionPidMethod == PidMethod::TpcAndTof) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); @@ -187,7 +187,7 @@ struct HfCandidateSelectorLbToLcPiReduced { // track-level PID selection auto trackPi = hfCandLb.template prong1Track_as(); - if (pionPidMethod==PidMethod::TpcOrTof || pionPidMethod==PidMethod::TpcAndTof) { + if (pionPidMethod == PidMethod::TpcOrTof || pionPidMethod == PidMethod::TpcAndTof) { int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; if (pionPidMethod == PidMethod::TpcOrTof) { pidTrackPi = selectorPion.statusTpcOrTof(trackPi); From a3df623e5c9c043acca12972041b22ea7867d1f3 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, 30 Apr 2025 18:10:29 +0200 Subject: [PATCH 50/85] Update candidateCreatorLbReduced.cxx --- .../candidateCreatorLbReduced.cxx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index a31528d867c..b0c97c2c442 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -32,6 +32,7 @@ using namespace o2; using namespace o2::aod; +using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::hf_trkcandsel; @@ -54,9 +55,6 @@ struct HfCandidateCreatorLbReduced { Configurable invMassWindowLcPiTolerance{"invMassWindowLcPiTolerance", 0.01, "invariant-mass window tolerance for LcPi pair preselections (GeV/c2)"}; float myInvMassWindowLcPi{1.}; // variable that will store the value of invMassWindowLcPi - float massPi{0.}; - float massLc{0.}; - float massLb{0.}; float bz{0.}; o2::vertexing::DCAFitterN<2> df2; // fitter for B vertex (2-prong vertex fitter) @@ -77,11 +75,6 @@ struct HfCandidateCreatorLbReduced { LOGP(fatal, "Only one process function for data should be enabled at a time."); } - // invariant-mass window cut - massPi = o2::constants::physics::MassPiPlus; - massLc = o2::constants::physics::MassLambdaCPlus; - massLb = o2::constants::physics::MassLambdaB0; - // Initialize fitter df2.setPropagateToPCA(propagateToPCA); df2.setMaxR(maxR); @@ -137,7 +130,7 @@ struct HfCandidateCreatorLbReduced { std::array pVecPion = trackPion.pVector(); // compute invariant mass square and apply selection - auto invMass2LcPi = RecoDecay::m2(std::array{pVecLc, pVecPion}, std::array{massLc, massPi}); + auto invMass2LcPi = RecoDecay::m2(std::array{pVecLc, pVecPion}, std::array{MassLambdaCPlus, MassPiPlus}); if ((invMass2LcPi < invMass2LcPiMin) || (invMass2LcPi > invMass2LcPiMax)) { continue; } @@ -221,8 +214,8 @@ struct HfCandidateCreatorLbReduced { } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + float invMass2LcPiMin = (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -255,8 +248,8 @@ struct HfCandidateCreatorLbReduced { } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (massLb - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (massLb + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + float invMass2LcPiMin = (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance); + float invMass2LcPiMax = (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); From ef315b073918f3c64c2cedfd0fad8f04702652db 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, 30 Apr 2025 18:16:56 +0200 Subject: [PATCH 51/85] Update CMakeLists.txt --- PWGHF/D2H/TableProducer/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/CMakeLists.txt b/PWGHF/D2H/TableProducer/CMakeLists.txt index c53dfc7399a..928359768a9 100644 --- a/PWGHF/D2H/TableProducer/CMakeLists.txt +++ b/PWGHF/D2H/TableProducer/CMakeLists.txt @@ -30,12 +30,12 @@ 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-lb-reduced SOURCES candidateCreatorLbReduced.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter COMPONENT_NAME Analysis) - + # Candidate selectors o2physics_add_dpl_workflow(candidate-selector-b0-to-d-pi-reduced From 7555776ef6d00fad53d102bdeb02aa7ef8ec7f7c 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, 30 Apr 2025 18:59:55 +0200 Subject: [PATCH 52/85] Update candidateCreatorLbReduced.cxx --- .../candidateCreatorLbReduced.cxx | 35 ++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index b0c97c2c442..a7e23e3f112 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -95,6 +95,25 @@ struct HfCandidateCreatorLbReduced { setLabelHistoCands(hCandidates); } + template + inline std::pair computeInvMass2LcPiWindow(Config const& configs, + float invMassWindowLcPiTolerance) + { + + myInvMassWindowLcPi = 0.0f; + for (const auto& config : configs) { + myInvMassWindowLcPi = config.myInvMassWindowLcPi(); + } + + float deltaMin = MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance; + float deltaMax = MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance; + + float invMass2LcPiMin = deltaMin * deltaMin; + float invMass2LcPiMax = deltaMax * deltaMax; + + return {invMass2LcPiMin, invMass2LcPiMax}; + } + /// Main function to perform Lb candidate creation /// \param withLcMl is the flag to use the table with ML scores for the Lc daughter (only possible if present in the derived data) /// \param collision the collision @@ -106,8 +125,8 @@ struct HfCandidateCreatorLbReduced { void runCandidateCreation(Coll const& collision, Cands const& candsLcThisColl, Pions const& tracksPionThisCollision, - const float& invMass2LcPiMin, - const float& invMass2LcPiMax) + float invMass2LcPiMin, + float invMass2LcPiMax) { auto primaryVertex = getPrimaryVertex(collision); auto covMatrixPV = primaryVertex.getCov(); @@ -209,13 +228,9 @@ struct HfCandidateCreatorLbReduced { aod::HfCandLbConfigs const& configs) { // LcPi invariant-mass window cut - for (const auto& config : configs) { - myInvMassWindowLcPi = config.myInvMassWindowLcPi(); - } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + auto [invMass2LcPiMin, invMass2LcPiMax] = computeInvMass2LcPiWindow(configs, invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); @@ -243,13 +258,9 @@ struct HfCandidateCreatorLbReduced { aod::HfCandLbConfigs const& configs) { // LcPi invariant-mass window cut - for (const auto& config : configs) { - myInvMassWindowLcPi = config.myInvMassWindowLcPi(); - } // invMassWindowLcPiTolerance is used to apply a slightly tighter cut than in LcPi pair preselection // to avoid accepting LcPi pairs that were not formed in LcPi pair creator - float invMass2LcPiMin = (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance) * (MassLambdaB0 - myInvMassWindowLcPi + invMassWindowLcPiTolerance); - float invMass2LcPiMax = (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance) * (MassLambdaB0 + myInvMassWindowLcPi - invMassWindowLcPiTolerance); + auto [invMass2LcPiMin, invMass2LcPiMax] = computeInvMass2LcPiWindow(configs, invMassWindowLcPiTolerance); for (const auto& collisionCounter : collisionsCounter) { registry.fill(HIST("hEvents"), 1, collisionCounter.originalCollisionCount()); From 15d4e8fa532eac5cbda55c4e739dfbb26e2c23d8 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, 30 Apr 2025 19:23:39 +0200 Subject: [PATCH 53/85] fix Megalinter --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index a7e23e3f112..a39bad808cd 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -15,6 +15,7 @@ /// \author Biao Zhang , Heidelberg University #include +#include #include "CommonConstants/PhysicsConstants.h" #include "DCAFitter/DCAFitterN.h" From e163347d40f2cf5fac6cfc6ab2a3cd2616d1500f 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: Sun, 4 May 2025 22:35:47 +0200 Subject: [PATCH 54/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 775df229c61..82721d7dd7f 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1136,7 +1136,6 @@ struct HfDataCreatorCharmHadPiReduced { trackParCovCharmHad.getSigmaTglSnp(), trackParCovCharmHad.getSigmaTgl2(), trackParCovCharmHad.getSigma1PtY(), trackParCovCharmHad.getSigma1PtZ(), trackParCovCharmHad.getSigma1PtSnp(), trackParCovCharmHad.getSigma1PtTgl(), trackParCovCharmHad.getSigma1Pt2()); - hfCandPidProng0(candC.nSigTpcPi0(), candC.nSigTofPi0(), candC.nSigTpcKa0(), candC.nSigTofKa0(), candC.nSigTpcPr0(), candC.nSigTofPr0(), charmHadDauTracks[0].hasTOF(), charmHadDauTracks[0].hasTPC()); hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), candC.nSigTpcPr1(), candC.nSigTofPr1(), charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); hfCandPidProng2(candC.nSigTpcPi2(), candC.nSigTofPi2(), candC.nSigTpcKa2(), candC.nSigTofKa2(), candC.nSigTpcPr2(), candC.nSigTofPr2(), charmHadDauTracks[2].hasTOF(), charmHadDauTracks[2].hasTPC()); From 76452b44eeccc93c04c1ab8459627d90bcee45eb 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: Mon, 5 May 2025 11:38:45 +0200 Subject: [PATCH 55/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 82721d7dd7f..76663ea0f1d 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -182,14 +182,14 @@ struct HfDataCreatorCharmHadPiReduced { using TracksPidWithSel = soa::Join; using TracksPidWithSelAndMc = soa::Join; - using CandsDplusFiltered = soa::Filtered>; + using CandsDplusFiltered = soa::Filtered>; using CandsDplusFilteredWithMl = soa::Filtered>; using CandsDsFiltered = soa::Filtered>; using CandsDsFilteredWithMl = soa::Filtered>; using CandsD0Filtered = soa::Filtered>; using CandsD0FilteredWithMl = soa::Filtered>; - using CandsLcFiltered = soa::Filtered>; - using CandsLcFilteredWithMl = soa::Filtered>; + using CandsLcFiltered = soa::Filtered>; + using CandsLcFilteredWithMl = soa::Filtered>; using CollisionsWCent = soa::Join; using CollisionsWCentAndMcLabels = soa::Join; From 39bdbdc69784957ef2fcbb6fa36b90cc4209e0d5 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: Mon, 5 May 2025 11:46:08 +0200 Subject: [PATCH 56/85] Update converterReducedHadronDausPid.cxx --- PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 79ee6ab704d..488fc3bfbbc 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -29,13 +29,13 @@ struct HfConverterReducedHadronDausPid { Produces hfRedPidDau1s; Produces hfRedPidDau2s; - using HfRedPidDaus = soa::Join; + using HfRedPidDaus = soa::Join; void process(HfRedPidDaus::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); - hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaPr(), hfCandPidProngs.tofNSigmaPr(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); + hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); } }; From 8709fed0c5e0e53e7b78111d487b756b30bff9d1 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: Mon, 5 May 2025 11:55:28 +0200 Subject: [PATCH 57/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 76663ea0f1d..ddda372ad0f 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -834,7 +834,7 @@ struct HfDataCreatorCharmHadPiReduced { } } } - break; + break; // end of case: all four prongs share same b-hadron mother } } } From 340af3ec8ff45472626cb93ed905096949841fd4 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: Mon, 5 May 2025 11:58:29 +0200 Subject: [PATCH 58/85] Update candidateSelectorLbToLcPiReduced.cxx --- PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 7d8c85a1aa6..fc5ba59faa2 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -47,7 +47,7 @@ struct HfCandidateSelectorLbToLcPiReduced { Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; // Enable PID - Configurable pionPidMethod{"pionPidMethod", PidMethod::TpcOrTof, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; + Configurable pionPidMethod{"pionPidMethod", 1, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; // TPC PID Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; From 99cdf02eb21838ea20af4838b24ce944a2bf63d4 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: Mon, 5 May 2025 12:19:40 +0200 Subject: [PATCH 59/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index ddda372ad0f..6531fec2ead 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -182,7 +182,7 @@ struct HfDataCreatorCharmHadPiReduced { using TracksPidWithSel = soa::Join; using TracksPidWithSelAndMc = soa::Join; - using CandsDplusFiltered = soa::Filtered>; + using CandsDplusFiltered = soa::Filtered>; using CandsDplusFilteredWithMl = soa::Filtered>; using CandsDsFiltered = soa::Filtered>; using CandsDsFilteredWithMl = soa::Filtered>; From a59eabdb1bd65ea9e53666ec64d89a66d850124d 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: Mon, 5 May 2025 13:59:53 +0200 Subject: [PATCH 60/85] re-trigger the alibuild complie --- PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 488fc3bfbbc..ceaaadca157 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file converterReducedHadronDausPid.cxx -/// \brief Task for conversion of daughters pid to version 001 +/// \brief Task for conversion of daughters pid to version 001 /// /// \author Biao Zhang , Heidelberg University From 84e34b6e5a4d6ead98470c11665952ea264a5962 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: Mon, 5 May 2025 15:37:25 +0200 Subject: [PATCH 61/85] Update HfMlResponseLbToLcPi.h --- PWGHF/Core/HfMlResponseLbToLcPi.h | 84 +++++++++++++++---------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h index c1db76168cb..5bb64689012 100644 --- a/PWGHF/Core/HfMlResponseLbToLcPi.h +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -35,7 +35,7 @@ // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the corresponding GETTER from OBJECT -#define CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) \ +#define CHECK_AND_FILL_VEC_LB_FULL(OBJECT, FEATURE, GETTER) \ case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ inputFeatures.emplace_back(OBJECT.GETTER()); \ break; \ @@ -45,15 +45,15 @@ // matches the entry in EnumInputFeatures associated to this FEATURE // if so, the inputFeatures vector is filled with the FEATURE's value // by calling the GETTER function taking OBJECT in argument -#define CHECK_AND_FILL_VEC_Lb_FUNC(OBJECT, FEATURE, GETTER) \ +#define CHECK_AND_FILL_VEC_LB_FUNC(OBJECT, FEATURE, GETTER) \ case static_cast(InputFeaturesLbToLcPi::FEATURE): { \ inputFeatures.emplace_back(GETTER(OBJECT)); \ break; \ } -// Specific case of CHECK_AND_FILL_VEC_Lb_FULL(OBJECT, FEATURE, GETTER) +// Specific case of (OBJECT, FEATURE, GETTER) // where OBJECT is named candidate and FEATURE = GETTER -#define CHECK_AND_FILL_VEC_Lb(GETTER) \ +#define CHECK_AND_FILL_VEC_LB(GETTER) \ case static_cast(InputFeaturesLbToLcPi::GETTER): { \ inputFeatures.emplace_back(candidate.GETTER()); \ break; \ @@ -106,50 +106,50 @@ class HfMlResponseLbToLcPi : public HfMlResponse for (const auto& idx : MlResponse::mCachedIndices) { if constexpr (withDmesMl) { switch (idx) { - CHECK_AND_FILL_VEC_Lb(ptProng0); - CHECK_AND_FILL_VEC_Lb(ptProng1); - CHECK_AND_FILL_VEC_Lb(impactParameter0); - CHECK_AND_FILL_VEC_Lb(impactParameter1); - CHECK_AND_FILL_VEC_Lb(impactParameterProduct); - CHECK_AND_FILL_VEC_Lb(chi2PCA); - CHECK_AND_FILL_VEC_Lb(decayLength); - CHECK_AND_FILL_VEC_Lb(decayLengthXY); - CHECK_AND_FILL_VEC_Lb(decayLengthNormalised); - CHECK_AND_FILL_VEC_Lb(decayLengthXYNormalised); - CHECK_AND_FILL_VEC_Lb(cpa); - CHECK_AND_FILL_VEC_Lb(cpaXY); - CHECK_AND_FILL_VEC_Lb(maxNormalisedDeltaIP); - CHECK_AND_FILL_VEC_Lb(prong0MlScoreBkg); - CHECK_AND_FILL_VEC_Lb(prong0MlScorePrompt); - CHECK_AND_FILL_VEC_Lb(prong0MlScoreNonprompt); + CHECK_AND_FILL_VEC_LB(ptProng0); + CHECK_AND_FILL_VEC_LB(ptProng1); + CHECK_AND_FILL_VEC_LB(impactParameter0); + CHECK_AND_FILL_VEC_LB(impactParameter1); + CHECK_AND_FILL_VEC_LB(impactParameterProduct); + CHECK_AND_FILL_VEC_LB(chi2PCA); + CHECK_AND_FILL_VEC_LB(decayLength); + CHECK_AND_FILL_VEC_LB(decayLengthXY); + CHECK_AND_FILL_VEC_LB(decayLengthNormalised); + CHECK_AND_FILL_VEC_LB(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_LB(cpa); + CHECK_AND_FILL_VEC_LB(cpaXY); + CHECK_AND_FILL_VEC_LB(maxNormalisedDeltaIP); + CHECK_AND_FILL_VEC_LB(prong0MlScoreBkg); + CHECK_AND_FILL_VEC_LB(prong0MlScorePrompt); + CHECK_AND_FILL_VEC_LB(prong0MlScoreNonprompt); // TPC PID variable - CHECK_AND_FILL_VEC_Lb_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + (prong1, tpcNSigmaPi1, tpcNSigmaPi); // TOF PID variable - CHECK_AND_FILL_VEC_Lb_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + CHECK_AND_FILL_VEC_LB_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); // Combined PID variables - CHECK_AND_FILL_VEC_Lb_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + CHECK_AND_FILL_VEC_LB_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); } } else { switch (idx) { - CHECK_AND_FILL_VEC_Lb(ptProng0); - CHECK_AND_FILL_VEC_Lb(ptProng1); - CHECK_AND_FILL_VEC_Lb(impactParameter0); - CHECK_AND_FILL_VEC_Lb(impactParameter1); - CHECK_AND_FILL_VEC_Lb(impactParameterProduct); - CHECK_AND_FILL_VEC_Lb(chi2PCA); - CHECK_AND_FILL_VEC_Lb(decayLength); - CHECK_AND_FILL_VEC_Lb(decayLengthXY); - CHECK_AND_FILL_VEC_Lb(decayLengthNormalised); - CHECK_AND_FILL_VEC_Lb(decayLengthXYNormalised); - CHECK_AND_FILL_VEC_Lb(cpa); - CHECK_AND_FILL_VEC_Lb(cpaXY); - CHECK_AND_FILL_VEC_Lb(maxNormalisedDeltaIP); + CHECK_AND_FILL_VEC_LB(ptProng0); + CHECK_AND_FILL_VEC_LB(ptProng1); + CHECK_AND_FILL_VEC_LB(impactParameter0); + CHECK_AND_FILL_VEC_LB(impactParameter1); + CHECK_AND_FILL_VEC_LB(impactParameterProduct); + CHECK_AND_FILL_VEC_LB(chi2PCA); + CHECK_AND_FILL_VEC_LB(decayLength); + CHECK_AND_FILL_VEC_LB(decayLengthXY); + CHECK_AND_FILL_VEC_LB(decayLengthNormalised); + CHECK_AND_FILL_VEC_LB(decayLengthXYNormalised); + CHECK_AND_FILL_VEC_LB(cpa); + CHECK_AND_FILL_VEC_LB(cpaXY); + CHECK_AND_FILL_VEC_LB(maxNormalisedDeltaIP); // TPC PID variable - CHECK_AND_FILL_VEC_Lb_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); + CHECK_AND_FILL_VEC_LB_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); // TOF PID variable - CHECK_AND_FILL_VEC_Lb_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); + CHECK_AND_FILL_VEC_LB_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); // Combined PID variables - CHECK_AND_FILL_VEC_Lb_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); + CHECK_AND_FILL_VEC_LB_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); } } } @@ -190,8 +190,8 @@ class HfMlResponseLbToLcPi : public HfMlResponse } // namespace o2::analysis #undef FILL_MAP_LB -#undef CHECK_AND_FILL_VEC_Lb_FULL -#undef CHECK_AND_FILL_VEC_Lb_FUNC -#undef CHECK_AND_FILL_VEC_Lb +#undef CHECK_AND_FILL_VEC_LB_FULL +#undef CHECK_AND_FILL_VEC_LB_FUNC +#undef CHECK_AND_FILL_VEC_LB #endif // PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ From 6cd4ecc690137f3ddc84c395ce5795e5a1827fbd 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: Mon, 5 May 2025 15:43:49 +0200 Subject: [PATCH 62/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index a39bad808cd..c47d2754758 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -238,12 +238,13 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; + static constexpr int printFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % 10000 == 0) { + if (ncol % printFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; @@ -268,12 +269,13 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; + static constexpr int printFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % 10000 == 0) { + if (ncol % printFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; From 5cbd0a434d3521841f911149a0e1a1e2ea883fb2 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: Mon, 5 May 2025 16:00:50 +0200 Subject: [PATCH 63/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 6531fec2ead..26590fee207 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -545,6 +545,7 @@ struct HfDataCreatorCharmHadPiReduced { } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ → (K- K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); + constexpr size_t kNumDsDaughters = 2; if (indexRec > -1) { // Ds- → K- K+ π- indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); @@ -552,7 +553,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == 2) { + if (arrDaughDsIndex.size() == kNumDsDaughters) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); @@ -589,7 +590,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == 2) { + if (arrDaughDsIndex.size() == kNumDsDaughters) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); @@ -712,7 +713,7 @@ struct HfDataCreatorCharmHadPiReduced { // look for common c-hadron mother among prongs 0, 1 and 2 for (const auto& cHadronMotherHypo : cHadronMotherHypos) { int8_t depthMax = 2; - if (cHadronMotherHypo == Pdg::kDStar || cHadronMotherHypo == 423 || cHadronMotherHypo == Pdg::kDSStar) { // to include D* -> D π0/γ, D* -> D0 π, and Ds* -> Ds π0/γ + if (cHadronMotherHypo == Pdg::kDStar || cHadronMotherHypo == Pdg::kDStar0 || cHadronMotherHypo == Pdg::kDSStar) { // to include D* -> D π0/γ, D* -> D0 π, and Ds* -> Ds π0/γ depthMax += 1; } int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax); From 54f43357619aeaa34031e366c0d9994d379476e0 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: Mon, 5 May 2025 16:13:18 +0200 Subject: [PATCH 64/85] Update dataCreatorCharmHadPiReduced.cxx --- .../TableProducer/dataCreatorCharmHadPiReduced.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 26590fee207..5cec4febda3 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -545,7 +545,7 @@ struct HfDataCreatorCharmHadPiReduced { } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ → (K- K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); - constexpr size_t kNumDsDaughters = 2; + constexpr std::size_t NDaughtersDs{2u}; if (indexRec > -1) { // Ds- → K- K+ π- indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); @@ -553,7 +553,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == kNumDsDaughters) { + if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); @@ -590,7 +590,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == kNumDsDaughters) { + if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) { auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]); arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode()); @@ -1258,6 +1258,7 @@ struct HfDataCreatorCharmHadPiReduced { ptProngs[1], yProngs[1], etaProngs[1]); } else if constexpr (decayChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ + constexpr std::size_t NDaughtersDs{2u}; if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBS, std::array{-static_cast(Pdg::kDS), +kPiPlus}, true)) { // Match Ds- -> π- K+ π- auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); @@ -1265,7 +1266,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == 2) { + if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]); arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode()); @@ -1291,7 +1292,7 @@ struct HfDataCreatorCharmHadPiReduced { std::vector arrDaughDsIndex; std::array arrPDGDaughDs; RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1); - if (arrDaughDsIndex.size() == 2) { + if (arrDaughDsIndex.size() == NDaughtersDs) { for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) { auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]); arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode()); From 3ff0bc231d192fd0115ffae4c366e59e8f15e3bc Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 5 May 2025 14:13:44 +0000 Subject: [PATCH 65/85] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 5cec4febda3..7b8853244e5 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1258,7 +1258,7 @@ struct HfDataCreatorCharmHadPiReduced { ptProngs[1], yProngs[1], etaProngs[1]); } else if constexpr (decayChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ - constexpr std::size_t NDaughtersDs{2u}; + constexpr std::size_t NDaughtersDs{2u}; if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBS, std::array{-static_cast(Pdg::kDS), +kPiPlus}, true)) { // Match Ds- -> π- K+ π- auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); From 4eee2c2bf92909453ae467fbf260aa71384be6b8 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: Mon, 5 May 2025 16:19:31 +0200 Subject: [PATCH 66/85] Update dataCreatorCharmHadPiReduced.cxx --- .../TableProducer/dataCreatorCharmHadPiReduced.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 7b8853244e5..ce597b6abdb 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1123,6 +1123,7 @@ struct HfDataCreatorCharmHadPiReduced { fillHfCandCharm = true; } // pion loop if (fillHfCandCharm) { // fill candCplus table only once per D candidate + constexpr std::size_t NSizeMLScore{3u}; if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), indexHfReducedCollision, @@ -1145,18 +1146,18 @@ struct HfDataCreatorCharmHadPiReduced { if constexpr (decChannel == DecayChannel::B0ToDminusPi) { hfCand3ProngMl(candC.mlProbDplusToPiKPi()[0], candC.mlProbDplusToPiKPi()[1], candC.mlProbDplusToPiKPi()[2], -1., -1., -1.); } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { - if (candC.mlProbDsToKKPi().size() == 3) { + if (candC.mlProbDsToKKPi().size() == NSizeMLScore) { std::copy(candC.mlProbDsToKKPi().begin(), candC.mlProbDsToKKPi().end(), mlScores.begin()); } - if (candC.mlProbDsToPiKK().size() == 3) { + if (candC.mlProbDsToPiKK().size() == NSizeMLScore) { std::copy(candC.mlProbDsToPiKK().begin(), candC.mlProbDsToPiKK().end(), mlScores.begin() + 3); } hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); } else if constexpr (decChannel == DecayChannel::LbToLcplusPi) { - if (candC.mlProbLcToPKPi().size() == 3) { + if (candC.mlProbLcToPKPi().size() == NSizeMLScore) { std::copy(candC.mlProbLcToPKPi().begin(), candC.mlProbLcToPKPi().end(), mlScores.begin()); } - if (candC.mlProbLcToPiKP().size() == 3) { + if (candC.mlProbLcToPiKP().size() == NSizeMLScore) { std::copy(candC.mlProbLcToPiKP().begin(), candC.mlProbLcToPiKP().end(), mlScores.begin() + 3); } hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); @@ -1180,10 +1181,10 @@ struct HfDataCreatorCharmHadPiReduced { hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), 0., 0., charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC()); if constexpr (withMl) { std::array mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f}; - if (candC.mlProbD0().size() == 3) { + if (candC.mlProbD0().size() == NSizeMLScore) { std::copy(candC.mlProbD0().begin(), candC.mlProbD0().end(), mlScores.begin()); } - if (candC.mlProbD0bar().size() == 3) { + if (candC.mlProbD0bar().size() == NSizeMLScore) { std::copy(candC.mlProbD0bar().begin(), candC.mlProbD0bar().end(), mlScores.begin() + 3); } hfCand2ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]); From e7c84299295c3d892628c40560a0327d16383dde 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: Mon, 5 May 2025 16:22:30 +0200 Subject: [PATCH 67/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index c47d2754758..1f339a54bc7 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -238,13 +238,13 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; - static constexpr int printFrequency = 10000; + static constexpr int nPrintFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % printFrequency == 0) { + if (ncol % nPrintFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; @@ -269,13 +269,13 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; - static constexpr int printFrequency = 10000; + static constexpr int nPrintFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % printFrequency == 0) { + if (ncol % nPrintFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; From 2151e73802b0015b0d0ac6a2be19936b42fe86b4 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 5 May 2025 14:22:56 +0000 Subject: [PATCH 68/85] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index ce597b6abdb..0118f91d5a1 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1122,7 +1122,7 @@ struct HfDataCreatorCharmHadPiReduced { } fillHfCandCharm = true; } // pion loop - if (fillHfCandCharm) { // fill candCplus table only once per D candidate + if (fillHfCandCharm) { // fill candCplus table only once per D candidate constexpr std::size_t NSizeMLScore{3u}; if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), From f35afc048ebfe837e9327f7623859427c258afe4 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: Mon, 5 May 2025 16:31:57 +0200 Subject: [PATCH 69/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index 1f339a54bc7..e10030dc388 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -238,7 +238,7 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; - static constexpr int nPrintFrequency = 10000; + static constexpr int PrintFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); @@ -269,7 +269,7 @@ struct HfCandidateCreatorLbReduced { } static int ncol = 0; - static constexpr int nPrintFrequency = 10000; + static constexpr int PrintFrequency = 10000; for (const auto& collision : collisions) { auto thisCollId = collision.globalIndex(); auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); From 6099103fb44a6fc9ddfd176d0c5bd82525087f5f 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: Mon, 5 May 2025 16:42:48 +0200 Subject: [PATCH 70/85] fix linter warning --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index 84d24ac7d1c..624f1d05917 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -41,8 +41,8 @@ DECLARE_SOA_COLUMN(AbsEtaBach, absEtaBach, float); DECLARE_SOA_COLUMN(ItsNClsBach, itsNClsBach, int); //! Number of ITS clusters of bachelor pion DECLARE_SOA_COLUMN(TpcNClsCrossedRowsBach, tpcNClsCrossedRowsBach, int); //! Number of TPC crossed rows of prongs of bachelor pion DECLARE_SOA_COLUMN(TpcChi2NClBach, tpcChi2NClBach, float); //! Maximum TPC chi2 of prongs of Lc-baryon daughter candidate -DECLARE_SOA_COLUMN(PtLcProngMin, ptProngLcMin, float); //! Minimum pT of prongs of Lc-baryon daughter candidate (GeV/c) -DECLARE_SOA_COLUMN(AbsEtaLcProngMin, absEtaProngLcMin, float); //! Minimum absolute pseudorapidity of prongs of Lc-baryon daughter candidate +DECLARE_SOA_COLUMN(PtLcProngMin, ptLcProngMin, float); //! Minimum pT of prongs of Lc-baryon daughter candidate (GeV/c) +DECLARE_SOA_COLUMN(EtaLcProngMin, etaLcProngMin, float); //! Minimum absolute pseudorapidity of prongs of Lc-baryon daughter candidate DECLARE_SOA_COLUMN(ItsNClsLcProngMin, itsNClsLcProngMin, int); //! Minimum number of ITS clusters of prongs of Lc-baryon daughter candidate DECLARE_SOA_COLUMN(TpcNClsCrossedRowsLcProngMin, tpcNClsCrossedRowsLcProngMin, int); //! Minimum number of TPC crossed rows of prongs of Lc-baryon daughter candidate DECLARE_SOA_COLUMN(TpcChi2NClLcProngMax, tpcChi2NClLcProngMax, float); //! Maximum TPC chi2 of prongs of Lc-baryon daughter candidate @@ -108,7 +108,7 @@ DECLARE_SOA_TABLE(HfRedCandLbLites, "AOD", "HFREDCANDLBLITE", //! Table with som hf_cand_lb_lite::DecayLengthXYLc, hf_cand_lb_lite::ImpactParameterLc, hf_cand_lb_lite::PtLcProngMin, - hf_cand_lb_lite::AbsEtaLcProngMin, + hf_cand_lb_lite::EtaLcProngMin, hf_cand_lb_lite::ItsNClsLcProngMin, hf_cand_lb_lite::TpcNClsCrossedRowsLcProngMin, hf_cand_lb_lite::TpcChi2NClLcProngMax, @@ -175,12 +175,11 @@ struct HfTaskLbReduced { HfHelper hfHelper; - Filter filterSelectCandidates = (aod::hf_sel_candidate_lb::isSelLbToLcPi >= selectionFlagLb); - HistogramRegistry registry{"registry"}; using TracksPion = soa::Join; using CandsLc = soa::Join; + Filter filterSelectCandidates = (aod::hf_sel_candidate_lb::isSelLbToLcPi >= selectionFlagLb); void init(InitContext&) { From c789ba0094d55708d1becd22e32fefdc4e6b9d47 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: Mon, 5 May 2025 16:49:59 +0200 Subject: [PATCH 71/85] fix linter warning --- PWGHF/D2H/Tasks/taskLbReduced.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLbReduced.cxx b/PWGHF/D2H/Tasks/taskLbReduced.cxx index 624f1d05917..fb6cf1432d8 100644 --- a/PWGHF/D2H/Tasks/taskLbReduced.cxx +++ b/PWGHF/D2H/Tasks/taskLbReduced.cxx @@ -175,11 +175,10 @@ struct HfTaskLbReduced { HfHelper hfHelper; - HistogramRegistry registry{"registry"}; - using TracksPion = soa::Join; using CandsLc = soa::Join; Filter filterSelectCandidates = (aod::hf_sel_candidate_lb::isSelLbToLcPi >= selectionFlagLb); + HistogramRegistry registry{"registry"}; void init(InitContext&) { From 7aa380a50f1c424ec9a4ca1a82f860a1c0652d11 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: Mon, 5 May 2025 16:54:50 +0200 Subject: [PATCH 72/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index 0118f91d5a1..dcb3d03915c 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -171,7 +171,7 @@ struct HfDataCreatorCharmHadPiReduced { double invMass2ChHadPiMin{0.}; double invMass2ChHadPiMax{0.}; double bz{0.}; - + constexpr std::size_t NDaughtersDs{2u}; bool isHfCandBhadConfigFilled = false; // Fitter to redo D-vertex to get extrapolated daughter tracks (2/3-prong vertex filter) @@ -545,7 +545,6 @@ struct HfDataCreatorCharmHadPiReduced { } else if constexpr (decChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ → (K- K+ π-) π+ auto indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kKPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 3); - constexpr std::size_t NDaughtersDs{2u}; if (indexRec > -1) { // Ds- → K- K+ π- indexRec = RecoDecay::getMatchedMCRec(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, -Pdg::kDS, std::array{-kKPlus, +kKPlus, -kPiPlus}, true, &sign, 2); @@ -1122,7 +1121,7 @@ struct HfDataCreatorCharmHadPiReduced { } fillHfCandCharm = true; } // pion loop - if (fillHfCandCharm) { // fill candCplus table only once per D candidate + if (fillHfCandCharm) { // fill candCplus table only once per D candidate constexpr std::size_t NSizeMLScore{3u}; if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), @@ -1259,7 +1258,6 @@ struct HfDataCreatorCharmHadPiReduced { ptProngs[1], yProngs[1], etaProngs[1]); } else if constexpr (decayChannel == DecayChannel::BsToDsminusPi) { // Bs → Ds- π+ - constexpr std::size_t NDaughtersDs{2u}; if (RecoDecay::isMatchedMCGen(particlesMc, particle, Pdg::kBS, std::array{-static_cast(Pdg::kDS), +kPiPlus}, true)) { // Match Ds- -> π- K+ π- auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front()); From d3d6fa0cf41879fc1cd62c62acb746872997ef20 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 5 May 2025 14:55:17 +0000 Subject: [PATCH 73/85] Please consider the following formatting changes --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index dcb3d03915c..b1cb84bf8e7 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1121,7 +1121,7 @@ struct HfDataCreatorCharmHadPiReduced { } fillHfCandCharm = true; } // pion loop - if (fillHfCandCharm) { // fill candCplus table only once per D candidate + if (fillHfCandCharm) { // fill candCplus table only once per D candidate constexpr std::size_t NSizeMLScore{3u}; if constexpr (decChannel == DecayChannel::B0ToDminusPi || decChannel == DecayChannel::BsToDsminusPi || decChannel == DecayChannel::LbToLcplusPi) { // D∓ → π∓ K± π∓ and Ds∓ → K∓ K± π∓ and Lc∓ → p∓ K± π∓ hfCand3Prong(charmHadDauTracks[0].globalIndex(), charmHadDauTracks[1].globalIndex(), charmHadDauTracks[2].globalIndex(), From e2e62ce87b9d562852553bae87fd80a1c57c749e 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: Mon, 5 May 2025 18:08:44 +0200 Subject: [PATCH 74/85] Update dataCreatorCharmHadPiReduced.cxx --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index b1cb84bf8e7..bc431ccaf9a 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -834,7 +834,7 @@ struct HfDataCreatorCharmHadPiReduced { } } } - break; // end of case: all four prongs share same b-hadron mother + break; // Early exit: found a valid decay chain with common b-hadron mother } } } From 317391d12b79fef01d8ecb9bc58aa691c6a45f40 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: Mon, 5 May 2025 18:37:25 +0200 Subject: [PATCH 75/85] fix the PidMethod configuration --- .../candidateSelectorLbToLcPiReduced.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index fc5ba59faa2..9f197edfb4d 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -47,7 +47,7 @@ struct HfCandidateSelectorLbToLcPiReduced { Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; // Enable PID - Configurable pionPidMethod{"pionPidMethod", 1, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; + Configurable PidMethod{"PidMethod", 1, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; // TPC PID Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; @@ -100,11 +100,11 @@ struct HfCandidateSelectorLbToLcPiReduced { LOGP(fatal, "Only one process function for data should be enabled at a time."); } - if (pionPidMethod < PidMethod::NoPid || pionPidMethod > PidMethod::TpcAndTof) { + if (PidMethod < PidMethod::NoPid || PidMethod > PidMethod::TpcAndTof) { LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); } - if (pionPidMethod == PidMethod::TpcOrTof || pionPidMethod == PidMethod::TpcAndTof) { + if (PidMethod == PidMethod::TpcOrTof || PidMethod == PidMethod::TpcAndTof) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); @@ -187,9 +187,9 @@ struct HfCandidateSelectorLbToLcPiReduced { // track-level PID selection auto trackPi = hfCandLb.template prong1Track_as(); - if (pionPidMethod == PidMethod::TpcOrTof || pionPidMethod == PidMethod::TpcAndTof) { + if (PidMethod == PidMethod::TpcOrTof || PidMethod == PidMethod::TpcAndTof) { int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; - if (pionPidMethod == PidMethod::TpcOrTof) { + if (PidMethod == PidMethod::TpcOrTof) { pidTrackPi = selectorPion.statusTpcOrTof(trackPi); } else { pidTrackPi = selectorPion.statusTpcAndTof(trackPi); @@ -217,7 +217,7 @@ struct HfCandidateSelectorLbToLcPiReduced { hfSelLbToLcPiCandidate(statusLbToLcPi); continue; } - SETBIT(statusLbToLcPi, SelectionStep::RecoMl); // RecoML = 3 --> statusLbToLcPi = 15 if pionPidMethod, 11 otherwise + SETBIT(statusLbToLcPi, SelectionStep::RecoMl); // RecoML = 3 --> statusLbToLcPi = 15 if PidMethod, 11 otherwise if (activateQA) { registry.fill(HIST("hSelections"), 2 + SelectionStep::RecoMl, ptCandLb); } From ffe731885f9766dbb21201a971deb8421a7c18bf 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: Mon, 5 May 2025 21:19:00 +0200 Subject: [PATCH 76/85] Update candidateCreatorLbReduced.cxx --- PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx index e10030dc388..2c4917c1c94 100644 --- a/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx @@ -244,7 +244,7 @@ struct HfCandidateCreatorLbReduced { auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % nPrintFrequency == 0) { + if (ncol % PrintFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; @@ -275,7 +275,7 @@ struct HfCandidateCreatorLbReduced { auto candsLcThisColl = candsLc.sliceBy(candsLcPerCollision, thisCollId); auto tracksPionThisCollision = tracksPion.sliceBy(tracksPionPerCollision, thisCollId); runCandidateCreation(collision, candsLcThisColl, tracksPionThisCollision, invMass2LcPiMin, invMass2LcPiMax); - if (ncol % nPrintFrequency == 0) { + if (ncol % PrintFrequency == 0) { LOGP(debug, "collisions parsed {}", ncol); } ncol++; From a59227fec2933f2fec3bd2a6a0352dbdbd77af5d 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: Mon, 5 May 2025 21:23:53 +0200 Subject: [PATCH 77/85] fix linter warning --- .../TableProducer/candidateSelectorLbToLcPiReduced.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx index 9f197edfb4d..40e3cb4c8c6 100644 --- a/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/candidateSelectorLbToLcPiReduced.cxx @@ -47,7 +47,7 @@ struct HfCandidateSelectorLbToLcPiReduced { Configurable ptCandMin{"ptCandMin", 0., "Lower bound of candidate pT"}; Configurable ptCandMax{"ptCandMax", 50., "Upper bound of candidate pT"}; // Enable PID - Configurable PidMethod{"PidMethod", 1, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; + Configurable pidMethod{"pidMethod", 1, "PID selection method for the bachelor pion (PidMethod::NoPid: none, PidMethod::TpcOrTof: TPC or TOF, PidMethod::TpcAndTof: TPC and TOF)"}; Configurable acceptPIDNotApplicable{"acceptPIDNotApplicable", true, "Switch to accept Status::NotApplicable [(NotApplicable for one detector) and (NotApplicable or Conditional for the other)] in PID selection"}; // TPC PID Configurable ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"}; @@ -100,11 +100,11 @@ struct HfCandidateSelectorLbToLcPiReduced { LOGP(fatal, "Only one process function for data should be enabled at a time."); } - if (PidMethod < PidMethod::NoPid || PidMethod > PidMethod::TpcAndTof) { + if (pidMethod < PidMethod::NoPid || pidMethod > PidMethod::TpcAndTof) { LOGP(fatal, "Invalid PID option in configurable, please set 0 (no PID), 1 (TPC or TOF), or 2 (TPC and TOF)"); } - if (PidMethod == PidMethod::TpcOrTof || PidMethod == PidMethod::TpcAndTof) { + if (pidMethod == PidMethod::TpcOrTof || pidMethod == PidMethod::TpcAndTof) { selectorPion.setRangePtTpc(ptPidTpcMin, ptPidTpcMax); selectorPion.setRangeNSigmaTpc(-nSigmaTpcMax, nSigmaTpcMax); selectorPion.setRangeNSigmaTpcCondTof(-nSigmaTpcCombinedMax, nSigmaTpcCombinedMax); @@ -187,9 +187,9 @@ struct HfCandidateSelectorLbToLcPiReduced { // track-level PID selection auto trackPi = hfCandLb.template prong1Track_as(); - if (PidMethod == PidMethod::TpcOrTof || PidMethod == PidMethod::TpcAndTof) { + if (pidMethod == PidMethod::TpcOrTof || pidMethod == PidMethod::TpcAndTof) { int pidTrackPi{TrackSelectorPID::Status::NotApplicable}; - if (PidMethod == PidMethod::TpcOrTof) { + if (pidMethod == PidMethod::TpcOrTof) { pidTrackPi = selectorPion.statusTpcOrTof(trackPi); } else { pidTrackPi = selectorPion.statusTpcAndTof(trackPi); From 8c68ba2cc5033f57b2a68abdddc764e8b49f2f34 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: Mon, 5 May 2025 21:43:45 +0200 Subject: [PATCH 78/85] fix a typo --- PWGHF/Core/HfMlResponseLbToLcPi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Core/HfMlResponseLbToLcPi.h b/PWGHF/Core/HfMlResponseLbToLcPi.h index 5bb64689012..a421f9019d4 100644 --- a/PWGHF/Core/HfMlResponseLbToLcPi.h +++ b/PWGHF/Core/HfMlResponseLbToLcPi.h @@ -123,7 +123,7 @@ class HfMlResponseLbToLcPi : public HfMlResponse CHECK_AND_FILL_VEC_LB(prong0MlScorePrompt); CHECK_AND_FILL_VEC_LB(prong0MlScoreNonprompt); // TPC PID variable - (prong1, tpcNSigmaPi1, tpcNSigmaPi); + CHECK_AND_FILL_VEC_LB_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); // TOF PID variable CHECK_AND_FILL_VEC_LB_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); // Combined PID variables From 51cee7bc60a7d70126fb846895a3f0e6fa462435 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, 6 May 2025 11:18:26 +0200 Subject: [PATCH 79/85] fix a typo --- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index bc431ccaf9a..2b8fe679e1d 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -171,7 +171,7 @@ struct HfDataCreatorCharmHadPiReduced { double invMass2ChHadPiMin{0.}; double invMass2ChHadPiMax{0.}; double bz{0.}; - constexpr std::size_t NDaughtersDs{2u}; + static constexpr std::size_t NDaughtersDs{2u}; bool isHfCandBhadConfigFilled = false; // Fitter to redo D-vertex to get extrapolated daughter tracks (2/3-prong vertex filter) From 519a4104037f407f3e42103f222f396ea4b21674 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, 6 May 2025 11:35:17 +0200 Subject: [PATCH 80/85] Update HfHelper.h based on vit's comment --- PWGHF/Core/HfHelper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/Core/HfHelper.h b/PWGHF/Core/HfHelper.h index 3d417bfc50a..929fd2ba256 100644 --- a/PWGHF/Core/HfHelper.h +++ b/PWGHF/Core/HfHelper.h @@ -967,8 +967,8 @@ class HfHelper bool selectionLbToLcPiTopol(const T1& candLb, const T2& cuts, const T3& binsPt) { auto ptCandLb = candLb.pt(); - auto ptLc = RecoDecay::pt(candLb.pxProng0(), candLb.pyProng0()); - auto ptPi = RecoDecay::pt(candLb.pxProng1(), candLb.pyProng1()); + auto ptLc = candLb.ptProng0(); + auto ptPi = candLb.ptProng1(); int pTBin = o2::analysis::findBin(binsPt, ptCandLb); if (pTBin == -1) { From 178ee310acbbfa0c491c7357f23282d943bbffee 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, 6 May 2025 18:19:33 +0200 Subject: [PATCH 81/85] remove unnecessary lines --- PWGHF/D2H/DataModel/ReducedDataModel.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 7e4042fe96a..c53be707ca6 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -803,8 +803,6 @@ DECLARE_SOA_TABLE(HfMcRecRedLcPis, "AOD", "HFMCRECREDLCPI", //! Table with recon hf_cand_lb::DebugMcRec, hf_lb_mc::PtMother); -// try with extended table ? -// DECLARE_SOA_EXTENDED_TABLE_USER(ExTable, Tracks, "EXTABLE", DECLARE_SOA_TABLE(HfMcCheckLcPis, "AOD", "HFMCCHECKLCPI", //! Table with reconstructed MC information on LcPi(<-Lb) pairs for MC checks in reduced workflow hf_lb_mc::PdgCodeBeautyMother, hf_lb_mc::PdgCodeCharmMother, From 80185a5aaf8ed46635c34bb9e856150d0b54fe0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 8 May 2025 13:32:25 +0200 Subject: [PATCH 82/85] Update converterReducedHadronDausPid.cxx --- .../converterReducedHadronDausPid.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index ceaaadca157..426ff5d507f 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -29,16 +29,25 @@ struct HfConverterReducedHadronDausPid { Produces hfRedPidDau1s; Produces hfRedPidDau2s; - using HfRedPidDaus = soa::Join; + using HfRedPidDaus2Prong = soa::Join; + using HfRedPidDaus3Prong = soa::Join; - void process(HfRedPidDaus::iterator const& hfCandPidProngs) + void process2Prongs(HfRedPidDaus2Prong::iterator const& hfCandPidProngs) { hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); - hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); } + PROCESS_SWITCH(HfConverterReducedHadronDausPid, process2Prongs, "Produce PID tables for 2-prong candidates", true); }; +void process3Prongs(HfRedPidDaus3Prong::iterator const& hfCandPidProngs) +{ + hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); +} +PROCESS_SWITCH(HfConverterReducedHadronDausPid, process3Prongs, "Produce PID tables for 3-prong candidates", true); + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From 4a97f562510936ccb80e3df8eb220d79af9f7723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 8 May 2025 13:45:27 +0200 Subject: [PATCH 83/85] Update converterReducedHadronDausPid.cxx --- .../TableProducer/converterReducedHadronDausPid.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 426ff5d507f..0e8155faf38 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -34,17 +34,17 @@ struct HfConverterReducedHadronDausPid { void process2Prongs(HfRedPidDaus2Prong::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); } PROCESS_SWITCH(HfConverterReducedHadronDausPid, process2Prongs, "Produce PID tables for 2-prong candidates", true); }; void process3Prongs(HfRedPidDaus3Prong::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.tpcNSigmaPiProng0(), hfCandPidProngs.tofNSigmaPiProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.tpcNSigmaKaProng0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.tpcNSigmaPiProng1(), hfCandPidProngs.tofNSigmaPiProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.tpcNSigmaKaProng1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); - hfRedPidDau2s(hfCandPidProngs.tpcNSigmaPiProng2(), hfCandPidProngs.tofNSigmaPiProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.tpcNSigmaKaProng2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); + hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.nSigTpcPi2(), hfCandPidProngs.nSigTofPi2(), hfCandPidProngs.nSigTpcKa2(), hfCandPidProngs.nSigTofKa2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); } PROCESS_SWITCH(HfConverterReducedHadronDausPid, process3Prongs, "Produce PID tables for 3-prong candidates", true); From 6dcf70049614c5da0f994dd894b53aa0c10aebd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 8 May 2025 14:09:20 +0200 Subject: [PATCH 84/85] Update converterReducedHadronDausPid.cxx --- .../converterReducedHadronDausPid.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 0e8155faf38..741789bdd7d 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -38,16 +38,15 @@ struct HfConverterReducedHadronDausPid { hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); } PROCESS_SWITCH(HfConverterReducedHadronDausPid, process2Prongs, "Produce PID tables for 2-prong candidates", true); -}; - -void process3Prongs(HfRedPidDaus3Prong::iterator const& hfCandPidProngs) -{ - hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); - hfRedPidDau2s(hfCandPidProngs.nSigTpcPi2(), hfCandPidProngs.nSigTofPi2(), hfCandPidProngs.nSigTpcKa2(), hfCandPidProngs.nSigTofKa2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); -} -PROCESS_SWITCH(HfConverterReducedHadronDausPid, process3Prongs, "Produce PID tables for 3-prong candidates", true); + void process3Prongs(HfRedPidDaus3Prong::iterator const& hfCandPidProngs) + { + hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.nSigTpcPi2(), hfCandPidProngs.nSigTofPi2(), hfCandPidProngs.nSigTpcKa2(), hfCandPidProngs.nSigTofKa2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); + } + PROCESS_SWITCH(HfConverterReducedHadronDausPid, process3Prongs, "Produce PID tables for 3-prong candidates", true); +}; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; From aa38d27ed32f0a9f084cc7ba515cc399aa333085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 8 May 2025 14:43:31 +0200 Subject: [PATCH 85/85] Update PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx Co-authored-by: Fabrizio --- .../TableProducer/converterReducedHadronDausPid.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx index 741789bdd7d..219c9a5d6e9 100644 --- a/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx +++ b/PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx @@ -34,16 +34,16 @@ struct HfConverterReducedHadronDausPid { void process2Prongs(HfRedPidDaus2Prong::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), -999.f, -999.f, hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), -999.f, -999.f, hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); } PROCESS_SWITCH(HfConverterReducedHadronDausPid, process2Prongs, "Produce PID tables for 2-prong candidates", true); void process3Prongs(HfRedPidDaus3Prong::iterator const& hfCandPidProngs) { - hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), hfCandPidProngs.nSigTpcPr0(), hfCandPidProngs.nSigTofPr0(), hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); - hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), hfCandPidProngs.nSigTpcPr1(), hfCandPidProngs.nSigTofPr1(), hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); - hfRedPidDau2s(hfCandPidProngs.nSigTpcPi2(), hfCandPidProngs.nSigTofPi2(), hfCandPidProngs.nSigTpcKa2(), hfCandPidProngs.nSigTofKa2(), hfCandPidProngs.nSigTpcPr2(), hfCandPidProngs.nSigTofPr2(), hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); + hfRedPidDau0s(hfCandPidProngs.nSigTpcPi0(), hfCandPidProngs.nSigTofPi0(), hfCandPidProngs.nSigTpcKa0(), hfCandPidProngs.nSigTofKa0(), -999.f, -999.f, hfCandPidProngs.hasTOFProng0(), hfCandPidProngs.hasTPCProng0()); + hfRedPidDau1s(hfCandPidProngs.nSigTpcPi1(), hfCandPidProngs.nSigTofPi1(), hfCandPidProngs.nSigTpcKa1(), hfCandPidProngs.nSigTofKa1(), -999.f, -999.f, hfCandPidProngs.hasTOFProng1(), hfCandPidProngs.hasTPCProng1()); + hfRedPidDau2s(hfCandPidProngs.nSigTpcPi2(), hfCandPidProngs.nSigTofPi2(), hfCandPidProngs.nSigTpcKa2(), hfCandPidProngs.nSigTofKa2(), -999.f, -999.f, hfCandPidProngs.hasTOFProng2(), hfCandPidProngs.hasTPCProng2()); } PROCESS_SWITCH(HfConverterReducedHadronDausPid, process3Prongs, "Produce PID tables for 3-prong candidates", true); };