Skip to content

Commit 002ece4

Browse files
committed
Please consider the following formatting changes
1 parent 763c0b3 commit 002ece4

3 files changed

Lines changed: 77 additions & 76 deletions

File tree

‎PWGHF/D2H/TableProducer/dplusCombinatorics.cxx‎

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
#include "Common/DataModel/Multiplicity.h"
6262
#include "Common/DataModel/PIDResponseTPC.h"
6363
#include "Common/DataModel/TrackSelectionTables.h"
64-
6564
#include "Tools/ML/MlResponse.h"
6665

6766
#include <CCDB/BasicCCDBManager.h>
@@ -126,7 +125,7 @@ DECLARE_SOA_COLUMN(ScorePionDzero, scorePionDzero, float); //! ML score, pion-fr
126125
DECLARE_SOA_COLUMN(ScoreKaonDzero, scoreKaonDzero, float); //! ML score, kaon-from-D0 class
127126
DECLARE_SOA_COLUMN(IsSelPionDzero, isSelPionDzero, bool); //! passes the D0 pion-score threshold
128127
DECLARE_SOA_COLUMN(IsSelKaonDzero, isSelKaonDzero, bool); //! passes the D0 kaon-score threshold
129-
// D+ -> K pi pi model
128+
// D+ -> K pi pi model
130129
DECLARE_SOA_COLUMN(ScoreBkgDplus, scoreBkgDplus, float); //! ML score, background class
131130
DECLARE_SOA_COLUMN(ScorePionDplus, scorePionDplus, float); //! ML score, pion-from-D+ class
132131
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
145144
DECLARE_SOA_COLUMN(IsSelPionDstar, isSelPionDstar, bool); //! passes the D* pion-score threshold
146145
DECLARE_SOA_COLUMN(IsSelKaonDstar, isSelKaonDstar, bool); //! passes the D* kaon-score threshold
147146
// common
148-
DECLARE_SOA_COLUMN(IsPositive, isPositive, bool); //! charge sign of the track
149-
DECLARE_SOA_COLUMN(IsSelAny, isSelAny, bool); //! passes at least one of the four selections
147+
DECLARE_SOA_COLUMN(IsPositive, isPositive, bool); //! charge sign of the track
148+
DECLARE_SOA_COLUMN(IsSelAny, isSelAny, bool); //! passes at least one of the four selections
150149
} // namespace hf_skim_track_sel
151150

152151
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
176175
namespace hf_skim_track_sel_mask
177176
{
178177
DECLARE_SOA_COLUMN(CollIdx, collIdx, int); //! global index of the collision the association refers to
179-
DECLARE_SOA_COLUMN(SelMask, selMask, uint16_t); //! bit0 -> pi(D0)
180-
//! bit1 -> K(D0)
181-
//! bit2 -> pi(D+)
182-
//! bit3 -> K(D+)
183-
//! bit4 -> pi(Ds)
184-
//! bit5 -> K(Ds)
185-
//! bit6 -> pi(D*)
186-
//! bit7 -> K(D*)
187-
//! bit8 -> positive charge
178+
DECLARE_SOA_COLUMN(SelMask, selMask, uint16_t); //! bit0 -> pi(D0)
179+
//! bit1 -> K(D0)
180+
//! bit2 -> pi(D+)
181+
//! bit3 -> K(D+)
182+
//! bit4 -> pi(Ds)
183+
//! bit5 -> K(Ds)
184+
//! bit6 -> pi(D*)
185+
//! bit7 -> K(D*)
186+
//! bit8 -> positive charge
188187
} // namespace hf_skim_track_sel_mask
189188

190189
/// 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
198197
namespace hf_skim_track_train
199198
{
200199
// features
201-
DECLARE_SOA_COLUMN(Pt, pt, float); //!
202-
DECLARE_SOA_COLUMN(Eta, eta, float); //!
203-
DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); //!
204-
DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); //!
205-
DECLARE_SOA_COLUMN(SigmaDcaXY, sigmaDcaXY, float); //!
206-
DECLARE_SOA_COLUMN(SigmaDcaZ, sigmaDcaZ, float); //!
207-
DECLARE_SOA_COLUMN(NormDcaXY, normDcaXY, float); //!
208-
DECLARE_SOA_COLUMN(NormDcaZ, normDcaZ, float); //!
209-
DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float); //!
210-
DECLARE_SOA_COLUMN(Tgl, tgl, float); //!
211-
DECLARE_SOA_COLUMN(Sign, sign, float); //!
212-
DECLARE_SOA_COLUMN(IsPvContributor, isPvContributor, float); //!
213-
DECLARE_SOA_COLUMN(ItsNCls, itsNCls, float); //!
214-
DECLARE_SOA_COLUMN(ItsNClsInnerBarrel, itsNClsInnerBarrel, float); //!
215-
DECLARE_SOA_COLUMN(ItsChi2NCl, itsChi2NCl, float); //!
216-
DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, float); //!
217-
DECLARE_SOA_COLUMN(TpcNClsCrossedRows, tpcNClsCrossedRows, float); //!
200+
DECLARE_SOA_COLUMN(Pt, pt, float); //!
201+
DECLARE_SOA_COLUMN(Eta, eta, float); //!
202+
DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); //!
203+
DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); //!
204+
DECLARE_SOA_COLUMN(SigmaDcaXY, sigmaDcaXY, float); //!
205+
DECLARE_SOA_COLUMN(SigmaDcaZ, sigmaDcaZ, float); //!
206+
DECLARE_SOA_COLUMN(NormDcaXY, normDcaXY, float); //!
207+
DECLARE_SOA_COLUMN(NormDcaZ, normDcaZ, float); //!
208+
DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float); //!
209+
DECLARE_SOA_COLUMN(Tgl, tgl, float); //!
210+
DECLARE_SOA_COLUMN(Sign, sign, float); //!
211+
DECLARE_SOA_COLUMN(IsPvContributor, isPvContributor, float); //!
212+
DECLARE_SOA_COLUMN(ItsNCls, itsNCls, float); //!
213+
DECLARE_SOA_COLUMN(ItsNClsInnerBarrel, itsNClsInnerBarrel, float); //!
214+
DECLARE_SOA_COLUMN(ItsChi2NCl, itsChi2NCl, float); //!
215+
DECLARE_SOA_COLUMN(TpcNClsFound, tpcNClsFound, float); //!
216+
DECLARE_SOA_COLUMN(TpcNClsCrossedRows, tpcNClsCrossedRows, float); //!
218217
DECLARE_SOA_COLUMN(TpcCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, float); //!
219-
DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //!
220-
DECLARE_SOA_COLUMN(TpcFractionSharedCls, tpcFractionSharedCls, float); //!
221-
DECLARE_SOA_COLUMN(TpcNSigmaPi, tpcNSigmaPi, float); //!
222-
DECLARE_SOA_COLUMN(TpcNSigmaKa, tpcNSigmaKa, float); //!
223-
DECLARE_SOA_COLUMN(Centrality, centrality, float); //!
218+
DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //!
219+
DECLARE_SOA_COLUMN(TpcFractionSharedCls, tpcFractionSharedCls, float); //!
220+
DECLARE_SOA_COLUMN(TpcNSigmaPi, tpcNSigmaPi, float); //!
221+
DECLARE_SOA_COLUMN(TpcNSigmaKa, tpcNSigmaKa, float); //!
222+
DECLARE_SOA_COLUMN(Centrality, centrality, float); //!
224223
// labels and auxiliary information, not meant to be used as features
225-
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
226-
DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! MC label quality mask (bit 15 = fake track)
224+
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
225+
DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! MC label quality mask (bit 15 = fake track)
227226
DECLARE_SOA_COLUMN(HasCharmBeautyAncestor, hasCharmBeautyAncestor, bool); //! any charm/beauty hadron in the ancestry
228227
// Selection outcomes
229228
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;
291290
/// Resonant sub-channels recorded next to the training label, so that the signal definition can be
292291
/// narrowed offline without re-running the workflow.
293292
enum Channels : int {
294-
kNone = -1, ///< no mother found, or mother not in the list of interest
293+
kNone = -1, ///< no mother found, or mother not in the list of interest
295294
kDzeroDirect,
296295
kDplusDirect,
297296
kDplusKstar,
@@ -408,11 +407,11 @@ enum HfAncestryWalkOutcome : int {
408407
/// Counter bins of hf-dplus-combinatorics.
409408
enum CounterCombinatorics : int {
410409
CountCollisions = 0,
411-
CountTriplets, ///< triplets whose hypothesis mask is non-empty, i.e. reaching the preselection
412-
CountTripletsPresel,///< triplets passing the mass/pT preselection, i.e. reaching the 3-prong fitter
410+
CountTriplets, ///< triplets whose hypothesis mask is non-empty, i.e. reaching the preselection
411+
CountTripletsPresel, ///< triplets passing the mass/pT preselection, i.e. reaching the 3-prong fitter
413412
CountFit2Prong,
414413
CountFit3Prong,
415-
CountRows, ///< rows written to aod::Hf3Prongs
414+
CountRows, ///< rows written to aod::Hf3Prongs
416415
CountRowsDplus,
417416
CountRowsDs,
418417
CountRowsBoth,
@@ -1505,8 +1504,8 @@ struct HfDplusTrackSelMl {
15051504
int pdgMother{-1};
15061505
int8_t isPrompt{-1}, channel{Channels::kNone};
15071506
const int8_t label = getTrainingLabel(
1508-
track, mcParticles, pdgMother, keepIfBackground,
1509-
pt, isPrompt, channel);
1507+
track, mcParticles, pdgMother, keepIfBackground,
1508+
pt, isPrompt, channel);
15101509

15111510
if (label < 0) { // usable for neither model
15121511
continue;

‎PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx‎

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -131,23 +131,21 @@ constexpr int NMassHypos = 2; // mass hypotheses per channel, i.e. the two order
131131
/// The ordering of the channels should strictly follow Channels2Prong
132132
constexpr TrackMlRole trackRoles2Prongs[NChannels2Prong][NMassHypos][N2Prongs] = {
133133
{
134-
{RolePionD0, RoleKaonD0}, // D0 → π± K∓
135-
{RoleKaonD0, RolePionD0} // D0 → π± K∓
136-
}
137-
};
134+
{RolePionD0, RoleKaonD0}, // D0 → π± K∓
135+
{RoleKaonD0, RolePionD0} // D0 → π± K∓
136+
}};
138137

139138
/// Role of each track in the candidate, per channel and mass hypothesis.
140139
/// The ordering of the channels should strictly follow Channels3Prong
141140
constexpr TrackMlRole trackRoles3Prongs[NChannels3Prong][NMassHypos][N3Prongs] = {
142141
{
143-
{RolePionDplus, RoleKaonDplus, RolePionDplus}, // D± → π± K∓ π±
144-
{RolePionDplus, RoleKaonDplus, RolePionDplus} // D± → π± K∓ π± (swapped, no effect for D+)
142+
{RolePionDplus, RoleKaonDplus, RolePionDplus}, // D± → π± K∓ π±
143+
{RolePionDplus, RoleKaonDplus, RolePionDplus} // D± → π± K∓ π± (swapped, no effect for D+)
145144
},
146145
{
147146
{RoleKaonDs, RoleKaonDs, RolePionDs}, // D_s± → K± K∓ π±
148147
{RolePionDs, RoleKaonDs, RoleKaonDs} // D_s± → K± K∓ π± (swapped)
149-
}
150-
};
148+
}};
151149

152150
constexpr double PtMaxModel = 1.e10;
153151

@@ -439,7 +437,7 @@ struct HfTrackSelectorTagSelTracks {
439437
/// \param features are the input feature names, in the order the model expects
440438
/// \param thrPion, thrKaon are the score thresholds
441439
/// \param name is used in the log message
442-
template<bool IsBinaryModel = false>
440+
template <bool IsBinaryModel = false>
443441
void configureModel(HfTrackModel& model,
444442
std::string const& onnxFile,
445443
std::string const& ccdbPath,
@@ -485,15 +483,15 @@ struct HfTrackSelectorTagSelTracks {
485483

486484
if (config.applyMlD0) {
487485
configureModel<false>(models2Prong[ChannelD0ToPiK], config.onnxFileNameD0, config.mlModelPathCcdbD0, config.inputFeaturesD0,
488-
config.thresholdScorePionD0, config.thresholdScoreKaonD0, "D0 track model");
486+
config.thresholdScorePionD0, config.thresholdScoreKaonD0, "D0 track model");
489487
}
490488
if (config.applyMlDplus) {
491489
configureModel<false>(models3Prong[ChannelDplusToPiKPi], config.onnxFileNameDplus, config.mlModelPathCcdbDplus, config.inputFeaturesDplus,
492-
config.thresholdScorePionDplus, config.thresholdScoreKaonDplus, "D+ track model");
490+
config.thresholdScorePionDplus, config.thresholdScoreKaonDplus, "D+ track model");
493491
}
494492
if (config.applyMlDs) {
495493
configureModel<false>(models3Prong[ChannelDsToKKPi], config.onnxFileNameDs, config.mlModelPathCcdbDs, config.inputFeaturesDs,
496-
config.thresholdScorePionDs, config.thresholdScoreKaonDs, "Ds track model");
494+
config.thresholdScorePionDs, config.thresholdScoreKaonDs, "Ds track model");
497495
}
498496
if (config.applyMlDstar) {
499497
double thresholdScoreKaonDstar = 0; // D* model has no kaon score, but the configureModel() function expects a value
@@ -614,7 +612,7 @@ struct HfTrackSelectorTagSelTracks {
614612
/// \param scores is filled with (background, pion-role, kaon-role); -1 if not evaluated
615613
/// \param isSelPion, isSelKaon are filled with the threshold decisions
616614
/// \return true if the model was actually evaluated
617-
template<size_t NClasses>
615+
template <size_t NClasses>
618616
bool evaluateModel(HfTrackModel& model, HfTrackMlFeatures const& features,
619617
std::array<float, NClasses>& scores, bool& isSelPion, bool& isSelKaon)
620618
{
@@ -921,7 +919,7 @@ struct HfMlBasedTrackSelector {
921919
struct HfProngCandidate {
922920
o2::track::TrackParCov parCov;
923921
std::array<float, 3> pVec{};
924-
std::array<float, 2> dcaInfo{}; ///< DCA (xy, z) to the primary vertex
922+
std::array<float, 2> dcaInfo{}; ///< DCA (xy, z) to the primary vertex
925923
uint32_t mask{}; ///< aod::HfSelTrack::isIdentifiedPid
926924
int64_t globalIndex{}; ///< index in the track table, written to the skim
927925
};
@@ -953,9 +951,9 @@ struct HfMlBasedTrackSelector {
953951
// filter collisions
954952
Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast<o2::hf_evsel::HfCollisionRejectionMask>(0));
955953
// filter track indices
956-
Filter filterSelectTrackIds = ( (aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::Cand2Prong))) != 0u ||
957-
(aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::Cand3Prong))) != 0u ||
958-
(aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::CandDstar))) != 0u );
954+
Filter filterSelectTrackIds = ((aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::Cand2Prong))) != 0u ||
955+
(aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::Cand3Prong))) != 0u ||
956+
(aod::hf_sel_track::isSelProng & static_cast<uint32_t>(BIT(CandidateType::CandDstar))) != 0u);
959957

960958
Preslice<FilteredTrackAssocSel> trackIndicesPerCollision = aod::track_association::collisionId;
961959

@@ -1702,7 +1700,7 @@ struct HfMlBasedTrackSelector {
17021700
}
17031701

17041702
// D* -> D0 pi+ candidates
1705-
const auto tStartDstar = tickIf(doTiming);
1703+
const auto tStartDstar = tickIf(doTiming);
17061704
if (storeDstar &&
17071705
lastFilledD0 != rowTrackIndexProng2.lastIndex()) { // we have a new D0 candidate, so we can try to form a D* candidate
17081706

@@ -1747,8 +1745,12 @@ struct HfMlBasedTrackSelector {
17471745
timing[TimeProcessDstar] += elapsedSeconds(tStartDstar);
17481746
}
17491747

1750-
if (!config.do3Prongs) { continue; }
1751-
if (!canBe3Prong) { continue; }
1748+
if (!config.do3Prongs) {
1749+
continue;
1750+
}
1751+
if (!canBe3Prong) {
1752+
continue;
1753+
}
17521754
if (!isTwoProngVtxGoodFor3Prongs) {
17531755
++counters[CountPairsRejected2P];
17541756
continue;
@@ -1761,9 +1763,9 @@ struct HfMlBasedTrackSelector {
17611763
}
17621764
++counters[CountTripletsEnumerated];
17631765
processTriplet(collision, prong1.parCov, prongOpp.parCov, prong2.parCov,
1764-
prong1.pVec, prongOpp.pVec, prong2.pVec,
1765-
prong1.mask, prongOpp.mask, prong2.mask,
1766-
prong1.globalIndex, prongOpp.globalIndex, prong2.globalIndex);
1766+
prong1.pVec, prongOpp.pVec, prong2.pVec,
1767+
prong1.mask, prongOpp.mask, prong2.mask,
1768+
prong1.globalIndex, prongOpp.globalIndex, prong2.globalIndex);
17671769
}
17681770
}
17691771
}

‎PWGHF/TableProducer/candidateCreatorDstar.cxx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,24 +394,24 @@ struct HfCandidateCreatorDstar {
394394
massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]},
395395
std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
396396
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
397-
std::array{constants::physics::MassPiPlus,
398-
constants::physics::MassPiPlus,
399-
constants::physics::MassKPlus});
397+
std::array{constants::physics::MassPiPlus,
398+
constants::physics::MassPiPlus,
399+
constants::physics::MassKPlus});
400400
massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
401401
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
402-
std::array{constants::physics::MassPiPlus,
403-
constants::physics::MassKPlus});
402+
std::array{constants::physics::MassPiPlus,
403+
constants::physics::MassKPlus});
404404
} else {
405405
massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]},
406406
std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
407407
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
408-
std::array{constants::physics::MassPiPlus,
409-
constants::physics::MassKPlus,
410-
constants::physics::MassPiPlus});
408+
std::array{constants::physics::MassPiPlus,
409+
constants::physics::MassKPlus,
410+
constants::physics::MassPiPlus});
411411
massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
412412
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
413-
std::array{constants::physics::MassKPlus,
414-
constants::physics::MassPiPlus});
413+
std::array{constants::physics::MassKPlus,
414+
constants::physics::MassPiPlus});
415415
}
416416
auto deltaMass = std::abs(massDstar - massD0);
417417
registry.fill(HIST("QA/hDeltaMassDStar"), deltaMass);

0 commit comments

Comments
 (0)