From 002ece4a1b97ea073537866c2c47131e94eb6e43 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 27 Oct 2026 09:12:45 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../D2H/TableProducer/dplusCombinatorics.cxx | 85 +++++++++---------- .../TableProducer/mlBasedTrackSelector.cxx | 48 ++++++----- PWGHF/TableProducer/candidateCreatorDstar.cxx | 20 ++--- 3 files changed, 77 insertions(+), 76 deletions(-) diff --git a/PWGHF/D2H/TableProducer/dplusCombinatorics.cxx b/PWGHF/D2H/TableProducer/dplusCombinatorics.cxx index c0be83ee581..349512519c9 100644 --- a/PWGHF/D2H/TableProducer/dplusCombinatorics.cxx +++ b/PWGHF/D2H/TableProducer/dplusCombinatorics.cxx @@ -61,7 +61,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" - #include "Tools/ML/MlResponse.h" #include @@ -126,7 +125,7 @@ DECLARE_SOA_COLUMN(ScorePionDzero, scorePionDzero, float); //! ML score, pion-fr DECLARE_SOA_COLUMN(ScoreKaonDzero, scoreKaonDzero, float); //! ML score, kaon-from-D0 class DECLARE_SOA_COLUMN(IsSelPionDzero, isSelPionDzero, bool); //! passes the D0 pion-score threshold DECLARE_SOA_COLUMN(IsSelKaonDzero, isSelKaonDzero, bool); //! passes the D0 kaon-score threshold - // D+ -> K pi pi model + // D+ -> K pi pi model DECLARE_SOA_COLUMN(ScoreBkgDplus, scoreBkgDplus, float); //! ML score, background class DECLARE_SOA_COLUMN(ScorePionDplus, scorePionDplus, float); //! ML score, pion-from-D+ class DECLARE_SOA_COLUMN(ScoreKaonDplus, scoreKaonDplus, float); //! ML score, kaon-from-D+ class @@ -145,8 +144,8 @@ DECLARE_SOA_COLUMN(ScoreKaonDstar, scoreKaonDstar, float); //! ML score, kaon-fr DECLARE_SOA_COLUMN(IsSelPionDstar, isSelPionDstar, bool); //! passes the D* pion-score threshold DECLARE_SOA_COLUMN(IsSelKaonDstar, isSelKaonDstar, bool); //! passes the D* kaon-score threshold // common -DECLARE_SOA_COLUMN(IsPositive, isPositive, bool); //! charge sign of the track -DECLARE_SOA_COLUMN(IsSelAny, isSelAny, bool); //! passes at least one of the four selections +DECLARE_SOA_COLUMN(IsPositive, isPositive, bool); //! charge sign of the track +DECLARE_SOA_COLUMN(IsSelAny, isSelAny, bool); //! passes at least one of the four selections } // namespace hf_skim_track_sel DECLARE_SOA_TABLE(HfSkimTrackSels, "AOD", "HFSKIMTRKSEL", //! Track-level ML selection, aligned with aod::TrackAssoc @@ -176,15 +175,15 @@ DECLARE_SOA_TABLE(HfSkimTrackSels, "AOD", "HFSKIMTRKSEL", //! Track-level ML sel namespace hf_skim_track_sel_mask { DECLARE_SOA_COLUMN(CollIdx, collIdx, int); //! global index of the collision the association refers to -DECLARE_SOA_COLUMN(SelMask, selMask, uint16_t); //! bit0 -> pi(D0) - //! bit1 -> K(D0) - //! bit2 -> pi(D+) - //! bit3 -> K(D+) - //! bit4 -> pi(Ds) - //! bit5 -> K(Ds) - //! bit6 -> pi(D*) - //! bit7 -> K(D*) - //! bit8 -> positive charge +DECLARE_SOA_COLUMN(SelMask, selMask, uint16_t); //! bit0 -> pi(D0) + //! bit1 -> K(D0) + //! bit2 -> pi(D+) + //! bit3 -> K(D+) + //! bit4 -> pi(Ds) + //! bit5 -> K(Ds) + //! bit6 -> pi(D*) + //! bit7 -> K(D*) + //! bit8 -> positive charge } // namespace hf_skim_track_sel_mask /// One row per *selected* (track, collision) association. This is the smallest object from which @@ -198,32 +197,32 @@ DECLARE_SOA_TABLE(HfSkimTrackMasks, "AOD", "HFSKIMTRKMASK", //! Compact dump of namespace hf_skim_track_train { // features -DECLARE_SOA_COLUMN(Pt, pt, float); //! -DECLARE_SOA_COLUMN(Eta, eta, float); //! -DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); //! -DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); //! -DECLARE_SOA_COLUMN(SigmaDcaXY, sigmaDcaXY, float); //! -DECLARE_SOA_COLUMN(SigmaDcaZ, sigmaDcaZ, float); //! -DECLARE_SOA_COLUMN(NormDcaXY, normDcaXY, float); //! -DECLARE_SOA_COLUMN(NormDcaZ, normDcaZ, float); //! -DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float); //! -DECLARE_SOA_COLUMN(Tgl, tgl, float); //! -DECLARE_SOA_COLUMN(Sign, sign, float); //! -DECLARE_SOA_COLUMN(IsPvContributor, isPvContributor, float); //! -DECLARE_SOA_COLUMN(ItsNCls, itsNCls, float); //! -DECLARE_SOA_COLUMN(ItsNClsInnerBarrel, itsNClsInnerBarrel, float); //! -DECLARE_SOA_COLUMN(ItsChi2NCl, itsChi2NCl, float); //! -DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, float); //! -DECLARE_SOA_COLUMN(TpcNClsCrossedRows, tpcNClsCrossedRows, float); //! +DECLARE_SOA_COLUMN(Pt, pt, float); //! +DECLARE_SOA_COLUMN(Eta, eta, float); //! +DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); //! +DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); //! +DECLARE_SOA_COLUMN(SigmaDcaXY, sigmaDcaXY, float); //! +DECLARE_SOA_COLUMN(SigmaDcaZ, sigmaDcaZ, float); //! +DECLARE_SOA_COLUMN(NormDcaXY, normDcaXY, float); //! +DECLARE_SOA_COLUMN(NormDcaZ, normDcaZ, float); //! +DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float); //! +DECLARE_SOA_COLUMN(Tgl, tgl, float); //! +DECLARE_SOA_COLUMN(Sign, sign, float); //! +DECLARE_SOA_COLUMN(IsPvContributor, isPvContributor, float); //! +DECLARE_SOA_COLUMN(ItsNCls, itsNCls, float); //! +DECLARE_SOA_COLUMN(ItsNClsInnerBarrel, itsNClsInnerBarrel, float); //! +DECLARE_SOA_COLUMN(ItsChi2NCl, itsChi2NCl, float); //! +DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, float); //! +DECLARE_SOA_COLUMN(TpcNClsCrossedRows, tpcNClsCrossedRows, float); //! DECLARE_SOA_COLUMN(TpcCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, float); //! -DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //! -DECLARE_SOA_COLUMN(TpcFractionSharedCls, tpcFractionSharedCls, float); //! -DECLARE_SOA_COLUMN(TpcNSigmaPi, tpcNSigmaPi, float); //! -DECLARE_SOA_COLUMN(TpcNSigmaKa, tpcNSigmaKa, float); //! -DECLARE_SOA_COLUMN(Centrality, centrality, float); //! +DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //! +DECLARE_SOA_COLUMN(TpcFractionSharedCls, tpcFractionSharedCls, float); //! +DECLARE_SOA_COLUMN(TpcNSigmaPi, tpcNSigmaPi, float); //! +DECLARE_SOA_COLUMN(TpcNSigmaKa, tpcNSigmaKa, float); //! +DECLARE_SOA_COLUMN(Centrality, centrality, float); //! // labels and auxiliary information, not meant to be used as features -DECLARE_SOA_COLUMN(TrackIndex, trackIndex, int64_t); //! global index of the track: the same track can be associated to several collisions, and therefore appear more than once, so the train/test split has to group by it -DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! MC label quality mask (bit 15 = fake track) +DECLARE_SOA_COLUMN(TrackIndex, trackIndex, int64_t); //! global index of the track: the same track can be associated to several collisions, and therefore appear more than once, so the train/test split has to group by it +DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! MC label quality mask (bit 15 = fake track) DECLARE_SOA_COLUMN(HasCharmBeautyAncestor, hasCharmBeautyAncestor, bool); //! any charm/beauty hadron in the ancestry // Selection outcomes DECLARE_SOA_COLUMN(Label, label, int8_t); //! D+ model: -1 = not usable, 0 = bkg, 1 = pion from D+, 2 = kaon from D+ @@ -291,7 +290,7 @@ constexpr int NPionsDstarToD0Pi = 1; /// Resonant sub-channels recorded next to the training label, so that the signal definition can be /// narrowed offline without re-running the workflow. enum Channels : int { - kNone = -1, ///< no mother found, or mother not in the list of interest + kNone = -1, ///< no mother found, or mother not in the list of interest kDzeroDirect, kDplusDirect, kDplusKstar, @@ -408,11 +407,11 @@ enum HfAncestryWalkOutcome : int { /// Counter bins of hf-dplus-combinatorics. enum CounterCombinatorics : int { CountCollisions = 0, - CountTriplets, ///< triplets whose hypothesis mask is non-empty, i.e. reaching the preselection - CountTripletsPresel,///< triplets passing the mass/pT preselection, i.e. reaching the 3-prong fitter + CountTriplets, ///< triplets whose hypothesis mask is non-empty, i.e. reaching the preselection + CountTripletsPresel, ///< triplets passing the mass/pT preselection, i.e. reaching the 3-prong fitter CountFit2Prong, CountFit3Prong, - CountRows, ///< rows written to aod::Hf3Prongs + CountRows, ///< rows written to aod::Hf3Prongs CountRowsDplus, CountRowsDs, CountRowsBoth, @@ -1505,8 +1504,8 @@ struct HfDplusTrackSelMl { int pdgMother{-1}; int8_t isPrompt{-1}, channel{Channels::kNone}; const int8_t label = getTrainingLabel( - track, mcParticles, pdgMother, keepIfBackground, - pt, isPrompt, channel); + track, mcParticles, pdgMother, keepIfBackground, + pt, isPrompt, channel); if (label < 0) { // usable for neither model continue; diff --git a/PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx b/PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx index 1fa246b96d6..9600525084d 100644 --- a/PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx +++ b/PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx @@ -131,23 +131,21 @@ constexpr int NMassHypos = 2; // mass hypotheses per channel, i.e. the two order /// The ordering of the channels should strictly follow Channels2Prong constexpr TrackMlRole trackRoles2Prongs[NChannels2Prong][NMassHypos][N2Prongs] = { { - {RolePionD0, RoleKaonD0}, // D0 → π± K∓ - {RoleKaonD0, RolePionD0} // D0 → π± K∓ - } -}; + {RolePionD0, RoleKaonD0}, // D0 → π± K∓ + {RoleKaonD0, RolePionD0} // D0 → π± K∓ + }}; /// Role of each track in the candidate, per channel and mass hypothesis. /// The ordering of the channels should strictly follow Channels3Prong constexpr TrackMlRole trackRoles3Prongs[NChannels3Prong][NMassHypos][N3Prongs] = { { - {RolePionDplus, RoleKaonDplus, RolePionDplus}, // D± → π± K∓ π± - {RolePionDplus, RoleKaonDplus, RolePionDplus} // D± → π± K∓ π± (swapped, no effect for D+) + {RolePionDplus, RoleKaonDplus, RolePionDplus}, // D± → π± K∓ π± + {RolePionDplus, RoleKaonDplus, RolePionDplus} // D± → π± K∓ π± (swapped, no effect for D+) }, { {RoleKaonDs, RoleKaonDs, RolePionDs}, // D_s± → K± K∓ π± {RolePionDs, RoleKaonDs, RoleKaonDs} // D_s± → K± K∓ π± (swapped) - } -}; + }}; constexpr double PtMaxModel = 1.e10; @@ -439,7 +437,7 @@ struct HfTrackSelectorTagSelTracks { /// \param features are the input feature names, in the order the model expects /// \param thrPion, thrKaon are the score thresholds /// \param name is used in the log message - template + template void configureModel(HfTrackModel& model, std::string const& onnxFile, std::string const& ccdbPath, @@ -485,15 +483,15 @@ struct HfTrackSelectorTagSelTracks { if (config.applyMlD0) { configureModel(models2Prong[ChannelD0ToPiK], config.onnxFileNameD0, config.mlModelPathCcdbD0, config.inputFeaturesD0, - config.thresholdScorePionD0, config.thresholdScoreKaonD0, "D0 track model"); + config.thresholdScorePionD0, config.thresholdScoreKaonD0, "D0 track model"); } if (config.applyMlDplus) { configureModel(models3Prong[ChannelDplusToPiKPi], config.onnxFileNameDplus, config.mlModelPathCcdbDplus, config.inputFeaturesDplus, - config.thresholdScorePionDplus, config.thresholdScoreKaonDplus, "D+ track model"); + config.thresholdScorePionDplus, config.thresholdScoreKaonDplus, "D+ track model"); } if (config.applyMlDs) { configureModel(models3Prong[ChannelDsToKKPi], config.onnxFileNameDs, config.mlModelPathCcdbDs, config.inputFeaturesDs, - config.thresholdScorePionDs, config.thresholdScoreKaonDs, "Ds track model"); + config.thresholdScorePionDs, config.thresholdScoreKaonDs, "Ds track model"); } if (config.applyMlDstar) { double thresholdScoreKaonDstar = 0; // D* model has no kaon score, but the configureModel() function expects a value @@ -614,7 +612,7 @@ struct HfTrackSelectorTagSelTracks { /// \param scores is filled with (background, pion-role, kaon-role); -1 if not evaluated /// \param isSelPion, isSelKaon are filled with the threshold decisions /// \return true if the model was actually evaluated - template + template bool evaluateModel(HfTrackModel& model, HfTrackMlFeatures const& features, std::array& scores, bool& isSelPion, bool& isSelKaon) { @@ -921,7 +919,7 @@ struct HfMlBasedTrackSelector { struct HfProngCandidate { o2::track::TrackParCov parCov; std::array pVec{}; - std::array dcaInfo{}; ///< DCA (xy, z) to the primary vertex + std::array dcaInfo{}; ///< DCA (xy, z) to the primary vertex uint32_t mask{}; ///< aod::HfSelTrack::isIdentifiedPid int64_t globalIndex{}; ///< index in the track table, written to the skim }; @@ -953,9 +951,9 @@ struct HfMlBasedTrackSelector { // filter collisions Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); // filter track indices - Filter filterSelectTrackIds = ( (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand2Prong))) != 0u || - (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand3Prong))) != 0u || - (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandDstar))) != 0u ); + Filter filterSelectTrackIds = ((aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand2Prong))) != 0u || + (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand3Prong))) != 0u || + (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandDstar))) != 0u); Preslice trackIndicesPerCollision = aod::track_association::collisionId; @@ -1702,7 +1700,7 @@ struct HfMlBasedTrackSelector { } // D* -> D0 pi+ candidates - const auto tStartDstar = tickIf(doTiming); + const auto tStartDstar = tickIf(doTiming); if (storeDstar && lastFilledD0 != rowTrackIndexProng2.lastIndex()) { // we have a new D0 candidate, so we can try to form a D* candidate @@ -1747,8 +1745,12 @@ struct HfMlBasedTrackSelector { timing[TimeProcessDstar] += elapsedSeconds(tStartDstar); } - if (!config.do3Prongs) { continue; } - if (!canBe3Prong) { continue; } + if (!config.do3Prongs) { + continue; + } + if (!canBe3Prong) { + continue; + } if (!isTwoProngVtxGoodFor3Prongs) { ++counters[CountPairsRejected2P]; continue; @@ -1761,9 +1763,9 @@ struct HfMlBasedTrackSelector { } ++counters[CountTripletsEnumerated]; processTriplet(collision, prong1.parCov, prongOpp.parCov, prong2.parCov, - prong1.pVec, prongOpp.pVec, prong2.pVec, - prong1.mask, prongOpp.mask, prong2.mask, - prong1.globalIndex, prongOpp.globalIndex, prong2.globalIndex); + prong1.pVec, prongOpp.pVec, prong2.pVec, + prong1.mask, prongOpp.mask, prong2.mask, + prong1.globalIndex, prongOpp.globalIndex, prong2.globalIndex); } } } diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 4e5b65122d6..f8839d1790a 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -394,24 +394,24 @@ struct HfCandidateCreatorDstar { massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]}, std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]}, std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}}, - std::array{constants::physics::MassPiPlus, - constants::physics::MassPiPlus, - constants::physics::MassKPlus}); + std::array{constants::physics::MassPiPlus, + constants::physics::MassPiPlus, + constants::physics::MassKPlus}); massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]}, std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}}, - std::array{constants::physics::MassPiPlus, - constants::physics::MassKPlus}); + std::array{constants::physics::MassPiPlus, + constants::physics::MassKPlus}); } else { massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]}, std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]}, std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}}, - std::array{constants::physics::MassPiPlus, - constants::physics::MassKPlus, - constants::physics::MassPiPlus}); + std::array{constants::physics::MassPiPlus, + constants::physics::MassKPlus, + constants::physics::MassPiPlus}); massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]}, std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}}, - std::array{constants::physics::MassKPlus, - constants::physics::MassPiPlus}); + std::array{constants::physics::MassKPlus, + constants::physics::MassPiPlus}); } auto deltaMass = std::abs(massDstar - massD0); registry.fill(HIST("QA/hDeltaMassDStar"), deltaMass);