|
21 | 21 | #include "Tools/ML/MlResponse.h" |
22 | 22 |
|
23 | 23 | #include <cstdint> |
| 24 | +#include <map> |
| 25 | +#include <string> |
24 | 26 | #include <vector> |
25 | 27 |
|
26 | 28 | // Fill the map of available input features |
27 | 29 | // the key is the feature's name (std::string) |
28 | 30 | // 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)} |
33 | 34 |
|
34 | 35 | // Check if the index of mCachedIndices (index associated to a FEATURE) |
35 | 36 | // matches the entry in EnumInputFeatures associated to this FEATURE |
@@ -88,10 +89,31 @@ enum class InputFeaturesXicToXiPiPi : uint8_t { |
88 | 89 | nSigTofPiFromXicPlus1, |
89 | 90 | nSigTofBachelorPi, |
90 | 91 | 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 |
92 | 114 | }; |
93 | 115 |
|
94 | | -template <typename TypeOutputScore = float> |
| 116 | +template <typename TypeOutputScore = float, aod::hf_cand::VertexerType ReconstructionType = aod::hf_cand::VertexerType::DCAFitter> |
95 | 117 | class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore> |
96 | 118 | { |
97 | 119 | public: |
@@ -147,6 +169,30 @@ class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore> |
147 | 169 | CHECK_AND_FILL_VEC_XICTOXIPIPI(nSigTofPiFromLambda); |
148 | 170 | CHECK_AND_FILL_VEC_XICTOXIPIPI(nSigTofPrFromLambda); |
149 | 171 | } |
| 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 | + } |
150 | 196 | } |
151 | 197 |
|
152 | 198 | return inputFeatures; |
@@ -193,6 +239,30 @@ class HfMlResponseXicToXiPiPi : public HfMlResponse<TypeOutputScore> |
193 | 239 | FILL_MAP_XICTOXIPIPI(nSigTofBachelorPi), |
194 | 240 | FILL_MAP_XICTOXIPIPI(nSigTofPiFromLambda), |
195 | 241 | 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 | + } |
196 | 266 | } |
197 | 267 | }; |
198 | 268 |
|
|
0 commit comments