Skip to content

Commit c9a7cd3

Browse files
committed
add KF-specific features to HfMlResponseXicToXiPiPi
1 parent 5c9b8d0 commit c9a7cd3

1 file changed

Lines changed: 76 additions & 6 deletions

File tree

‎PWGHF/Core/HfMlResponseXicToXiPiPi.h‎

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
#include "Tools/ML/MlResponse.h"
2222

2323
#include <cstdint>
24+
#include <map>
25+
#include <string>
2426
#include <vector>
2527

2628
// Fill the map of available input features
2729
// the key is the feature's name (std::string)
2830
// the value is the corresponding value in EnumInputFeatures
29-
#define FILL_MAP_XICTOXIPIPI(FEATURE) \
30-
{ \
31-
#FEATURE, static_cast<uint8_t>(InputFeaturesXicToXiPiPi::FEATURE) \
32-
}
31+
#define FILL_MAP_XICTOXIPIPI(FEATURE) \
32+
{ \
33+
#FEATURE, static_cast<uint8_t>(InputFeaturesXicToXiPiPi::FEATURE)}
3334

3435
// Check if the index of mCachedIndices (index associated to a FEATURE)
3536
// matches the entry in EnumInputFeatures associated to this FEATURE
@@ -88,10 +89,31 @@ enum class InputFeaturesXicToXiPiPi : uint8_t {
8889
nSigTofPiFromXicPlus1,
8990
nSigTofBachelorPi,
9091
nSigTofPiFromLambda,
91-
nSigTofPrFromLambda
92+
nSigTofPrFromLambda,
93+
// kf-specific variables
94+
kfDecayLength,
95+
kfDecayLengthNormalised,
96+
kfDecayLengthXY,
97+
kfDecayLengthXYNormalised,
98+
kfCascadechi2,
99+
kfV0Chi2,
100+
chi2XicPlusToPV,
101+
chi2TopoXicPlusToPV,
102+
chi2XiToPV,
103+
chi2Pi0ToPV,
104+
chi2Pi1ToPV,
105+
chi2DevPi0Pi1,
106+
chi2DevPi0Xi,
107+
chi2DevPi1Xi,
108+
dcaPi0Pi1,
109+
dcaPi0Xi,
110+
dcaPi1Xi,
111+
dcaXYPi0Pi1,
112+
dcaXYPi0Xi,
113+
dcaXYPi1Xi
92114
};
93115

94-
template <typename TypeOutputScore = float>
116+
template <typename TypeOutputScore = float, aod::hf_cand::VertexerType ReconstructionType = aod::hf_cand::VertexerType::DCAFitter>
95117
class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore>
96118
{
97119
public:
@@ -147,6 +169,30 @@ class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore>
147169
CHECK_AND_FILL_VEC_XICTOXIPIPI(nSigTofPiFromLambda);
148170
CHECK_AND_FILL_VEC_XICTOXIPIPI(nSigTofPrFromLambda);
149171
}
172+
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
173+
switch (idx) {
174+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfDecayLength);
175+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfDecayLengthNormalised);
176+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfDecayLengthXY);
177+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfDecayLengthXYNormalised);
178+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfCascadechi2);
179+
CHECK_AND_FILL_VEC_XICTOXIPIPI(kfV0Chi2);
180+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2XicPlusToPV);
181+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2TopoXicPlusToPV);
182+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2XiToPV);
183+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2Pi0ToPV);
184+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2Pi1ToPV);
185+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2DevPi0Pi1);
186+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2DevPi0Xi);
187+
CHECK_AND_FILL_VEC_XICTOXIPIPI(chi2DevPi1Xi);
188+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaPi0Pi1);
189+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaPi0Xi);
190+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaPi1Xi);
191+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaXYPi0Pi1);
192+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaXYPi0Xi);
193+
CHECK_AND_FILL_VEC_XICTOXIPIPI(dcaXYPi1Xi);
194+
}
195+
}
150196
}
151197

152198
return inputFeatures;
@@ -193,6 +239,30 @@ class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore>
193239
FILL_MAP_XICTOXIPIPI(nSigTofBachelorPi),
194240
FILL_MAP_XICTOXIPIPI(nSigTofPiFromLambda),
195241
FILL_MAP_XICTOXIPIPI(nSigTofPrFromLambda)};
242+
if constexpr (ReconstructionType == aod::hf_cand::VertexerType::KfParticle) {
243+
std::map<std::string, uint8_t> mapKfFeatures{
244+
FILL_MAP_XICTOXIPIPI(kfDecayLength),
245+
FILL_MAP_XICTOXIPIPI(kfDecayLengthNormalised),
246+
FILL_MAP_XICTOXIPIPI(kfDecayLengthXY),
247+
FILL_MAP_XICTOXIPIPI(kfDecayLengthXYNormalised),
248+
FILL_MAP_XICTOXIPIPI(kfCascadechi2),
249+
FILL_MAP_XICTOXIPIPI(kfV0Chi2),
250+
FILL_MAP_XICTOXIPIPI(chi2XicPlusToPV),
251+
FILL_MAP_XICTOXIPIPI(chi2TopoXicPlusToPV),
252+
FILL_MAP_XICTOXIPIPI(chi2XiToPV),
253+
FILL_MAP_XICTOXIPIPI(chi2Pi0ToPV),
254+
FILL_MAP_XICTOXIPIPI(chi2Pi1ToPV),
255+
FILL_MAP_XICTOXIPIPI(chi2DevPi0Pi1),
256+
FILL_MAP_XICTOXIPIPI(chi2DevPi0Xi),
257+
FILL_MAP_XICTOXIPIPI(chi2DevPi1Xi),
258+
FILL_MAP_XICTOXIPIPI(dcaPi0Pi1),
259+
FILL_MAP_XICTOXIPIPI(dcaPi0Xi),
260+
FILL_MAP_XICTOXIPIPI(dcaPi1Xi),
261+
FILL_MAP_XICTOXIPIPI(dcaXYPi0Pi1),
262+
FILL_MAP_XICTOXIPIPI(dcaXYPi0Xi),
263+
FILL_MAP_XICTOXIPIPI(dcaXYPi1Xi)};
264+
MlResponse<TypeOutputScore>::mAvailableInputFeatures.insert(mapKfFeatures.begin(), mapKfFeatures.end());
265+
}
196266
}
197267
};
198268

0 commit comments

Comments
 (0)