Skip to content

Commit 4bccd5b

Browse files
authored
[PWGHF] Add input features for Xic0 KF online ML inference (#18497)
1 parent f638924 commit 4bccd5b

1 file changed

Lines changed: 15 additions & 25 deletions

File tree

‎PWGHF/Core/HfMlResponseXic0ToXiPiKf.h‎

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@
2424
#include <cstdint>
2525
#include <vector>
2626

27-
// Fill the map of available input features
28-
// the key is the feature's name (std::string)
29-
// the value is the corresponding value in EnumInputFeatures
30-
#define FILL_MAP_XIC0TOXIPIKF(FEATURE) \
31-
{ \
32-
#FEATURE, static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE)}
33-
27+
// Feature names are registered explicitly with the training-tree branch names.
3428
// Check if the index of mCachedIndices (index associated to a FEATURE)
3529
// matches the entry in EnumInputFeatures associated to this FEATURE
3630
// if so, the inputFeatures vector is filled with the FEATURE's value
@@ -61,7 +55,7 @@ namespace o2::analysis
6155
{
6256

6357
enum class InputFeaturesXic0ToXiPiKf : uint8_t {
64-
// Existing feature keys retained for backwards compatibility.
58+
// Internal feature identifiers; configuration names are registered below.
6559
tpcNSigmaPiFromLambda,
6660
tpcNSigmaPiFromCasc,
6761
tpcNSigmaPiFromCharmBaryon,
@@ -92,7 +86,10 @@ enum class InputFeaturesXic0ToXiPiKf : uint8_t {
9286
dcaV0Dau,
9387
dcaXYToPvV0Dau0,
9488
dcaXYToPvV0Dau1,
95-
tpcNSigmaPrFromLambda
89+
tpcNSigmaPrFromLambda,
90+
chi2GeoXic,
91+
cTauXic,
92+
chi2GeoCasc
9693
};
9794

9895
template <typename TypeOutputScore = float>
@@ -121,13 +118,16 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
121118
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(xicChi2OverNdf);
122119
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoXicToPv);
123120
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaCharmBaryonDau);
121+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2GeoXic);
122+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cTauXic);
124123
// Bachelor pion from Xic.
125124
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(kfDcaXYPiFromXic);
126125
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoPiFromXicToPv);
127126
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_VALUE(kfptPiFromXic, RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()));
128127
// Cascade.
129128
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(decayLenXYCasc);
130129
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cascChi2OverNdf);
130+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2GeoCasc);
131131
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoCascToPv);
132132
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoCascToXic);
133133
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(candidate, cosPaCascToPv, cosPACasc);
@@ -149,7 +149,7 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
149149
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaXYToPvV0Dau1);
150150
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(lamProngPr, tpcNSigmaPrFromLambda, tpcNSigmaPr);
151151
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(lamProngPi, tpcNSigmaPiFromLambda, tpcNSigmaPi);
152-
// Legacy features that are not part of the local 28-feature model.
152+
// Additional supported features.
153153
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(charmBaryonProngPi, tpcNSigmaPiFromCharmBaryon, tpcNSigmaPi);
154154
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cascldl);
155155
}
@@ -164,31 +164,23 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
164164
{
165165
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
166166
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYXic", decayLenXYXic),
167-
FILL_MAP_XIC0TOXIPIKF(xicChi2OverNdf),
168167
FILL_MAP_XIC0TOXIPIKF_AS("fXicChi2OverNdf", xicChi2OverNdf),
169168
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoXicToPv", chi2TopoXicToPv),
170-
FILL_MAP_XIC0TOXIPIKF(dcaCharmBaryonDau),
171169
FILL_MAP_XIC0TOXIPIKF_AS("fDcaCharmBaryonDau", dcaCharmBaryonDau),
172-
FILL_MAP_XIC0TOXIPIKF(kfDcaXYPiFromXic),
170+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2GeoXic", chi2GeoXic),
171+
FILL_MAP_XIC0TOXIPIKF_AS("fCtXic", cTauXic),
173172
FILL_MAP_XIC0TOXIPIKF_AS("fKfDcaXYPiFromXic", kfDcaXYPiFromXic),
174173
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoPiFromXicToPv", chi2TopoPiFromXicToPv),
175174
FILL_MAP_XIC0TOXIPIKF_AS("fKfptPiFromXic", kfptPiFromXic),
176-
FILL_MAP_XIC0TOXIPIKF(decayLenXYCasc),
177175
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYCasc", decayLenXYCasc),
178-
FILL_MAP_XIC0TOXIPIKF(cascChi2OverNdf),
179176
FILL_MAP_XIC0TOXIPIKF_AS("fCascChi2OverNdf", cascChi2OverNdf),
180-
FILL_MAP_XIC0TOXIPIKF(chi2TopoCascToPv),
177+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2GeoCasc", chi2GeoCasc),
181178
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoCascToPv", chi2TopoCascToPv),
182-
FILL_MAP_XIC0TOXIPIKF(chi2TopoCascToXic),
183179
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoCascToXic", chi2TopoCascToXic),
184180
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaCascToPv", cosPaCascToPv),
185-
FILL_MAP_XIC0TOXIPIKF(cosPaCascToXic),
186181
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaCascToXic", cosPaCascToXic),
187-
FILL_MAP_XIC0TOXIPIKF(dcaCascDau),
188182
FILL_MAP_XIC0TOXIPIKF_AS("fDcaCascDau", dcaCascDau),
189-
FILL_MAP_XIC0TOXIPIKF(kfDcaXYCascToPv),
190183
FILL_MAP_XIC0TOXIPIKF_AS("fKfDcaXYCascToPv", kfDcaXYCascToPv),
191-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCasc),
192184
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPiFromCasc", tpcNSigmaPiFromCasc),
193185
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvCascDau", dcaXYToPvCascDau),
194186
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYLambda", decayLenXYLambda),
@@ -201,17 +193,15 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
201193
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvV0Dau0", dcaXYToPvV0Dau0),
202194
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvV0Dau1", dcaXYToPvV0Dau1),
203195
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPrFromLambda", tpcNSigmaPrFromLambda),
204-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromLambda),
205196
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPiFromLambda", tpcNSigmaPiFromLambda),
206-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCharmBaryon),
207-
FILL_MAP_XIC0TOXIPIKF(cascldl),
197+
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPiFromCharmBaryon", tpcNSigmaPiFromCharmBaryon),
198+
FILL_MAP_XIC0TOXIPIKF_AS("fCascldl", cascldl),
208199
};
209200
}
210201
};
211202

212203
} // namespace o2::analysis
213204

214-
#undef FILL_MAP_XIC0TOXIPIKF
215205
#undef FILL_MAP_XIC0TOXIPIKF_AS
216206
#undef CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL
217207
#undef CHECK_AND_FILL_VEC_XIC0TOXIPIKF

0 commit comments

Comments
 (0)