Skip to content

Commit a11fc96

Browse files
authored
[PWGHF] Add more input features for Xic0 KF selection (#18349)
1 parent dc12526 commit a11fc96

3 files changed

Lines changed: 128 additions & 51 deletions

File tree

‎PWGHF/Core/HfMlResponseXic0ToXiPiKf.h‎

Lines changed: 104 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "PWGHF/Core/HfMlResponse.h"
2020

21+
#include "Common/Core/RecoDecay.h"
2122
#include "Tools/ML/MlResponse.h"
2223

2324
#include <cstdint>
@@ -26,18 +27,17 @@
2627
// Fill the map of available input features
2728
// the key is the feature's name (std::string)
2829
// the value is the corresponding value in EnumInputFeatures
29-
#define FILL_MAP_XIC0TOXIPIKF(FEATURE) \
30-
{ \
31-
#FEATURE, static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE) \
32-
}
30+
#define FILL_MAP_XIC0TOXIPIKF(FEATURE) \
31+
{ \
32+
#FEATURE, static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE)}
3333

3434
// Check if the index of mCachedIndices (index associated to a FEATURE)
3535
// matches the entry in EnumInputFeatures associated to this FEATURE
3636
// if so, the inputFeatures vector is filled with the FEATURE's value
3737
// by calling the corresponding GETTER from OBJECT
3838
#define CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(OBJECT, FEATURE, GETTER) \
3939
case static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE): { \
40-
inputFeatures.emplace_back(OBJECT.GETTER()); \
40+
inputFeatures.emplace_back((OBJECT).GETTER()); \
4141
break; \
4242
}
4343

@@ -48,10 +48,20 @@
4848
break; \
4949
}
5050

51+
#define CHECK_AND_FILL_VEC_XIC0TOXIPIKF_VALUE(FEATURE, VALUE) \
52+
case static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE): { \
53+
inputFeatures.emplace_back(VALUE); \
54+
break; \
55+
}
56+
57+
#define FILL_MAP_XIC0TOXIPIKF_AS(NAME, FEATURE) \
58+
{NAME, static_cast<uint8_t>(InputFeaturesXic0ToXiPiKf::FEATURE)}
59+
5160
namespace o2::analysis
5261
{
5362

5463
enum class InputFeaturesXic0ToXiPiKf : uint8_t {
64+
// Existing feature keys retained for backwards compatibility.
5565
tpcNSigmaPiFromLambda,
5666
tpcNSigmaPiFromCasc,
5767
tpcNSigmaPiFromCharmBaryon,
@@ -65,7 +75,24 @@ enum class InputFeaturesXic0ToXiPiKf : uint8_t {
6575
chi2TopoCascToPv,
6676
chi2TopoCascToXic,
6777
cosPaCascToXic,
68-
decayLenXYCasc
78+
decayLenXYCasc,
79+
// Remaining features used by the local PbPb Transformer.
80+
decayLenXYXic,
81+
chi2TopoXicToPv,
82+
chi2TopoPiFromXicToPv,
83+
kfptPiFromXic,
84+
cosPaCascToPv,
85+
dcaXYToPvCascDau,
86+
decayLenXYLambda,
87+
v0Chi2OverNdf,
88+
chi2TopoV0ToPv,
89+
chi2TopoV0ToCasc,
90+
cosPaV0ToPv,
91+
cosPaV0ToCasc,
92+
dcaV0Dau,
93+
dcaXYToPvV0Dau0,
94+
dcaXYToPvV0Dau1,
95+
tpcNSigmaPrFromLambda
6996
};
7097

7198
template <typename TypeOutputScore = float>
@@ -81,34 +108,50 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
81108
/// \param candidate is the Xic0 candidate
82109
/// \return inputFeatures vector
83110
template <typename T1, typename T2, typename T3>
84-
// std::vector<float> getInputFeatures(T1 const& candidate)
85-
std::vector<float> getInputFeatures(T1 const& candidate, T2 const& lamProngPi, T2 const& cascProngPi, T3 const& charmBaryonProngPi)
111+
std::vector<float> getInputFeatures(T1 const& candidate, T2 const& lamProngPi, T2 const& lamProngPr,
112+
T2 const& cascProngPi, T3 const& charmBaryonProngPi)
86113
{
87114
std::vector<float> inputFeatures;
115+
inputFeatures.reserve(MlResponse<TypeOutputScore>::mCachedIndices.size());
88116

89117
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
90118
switch (idx) {
91-
// PID variables
92-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(lamProngPi, tpcNSigmaPiFromLambda, tpcNSigmaPi);
93-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(cascProngPi, tpcNSigmaPiFromCasc, tpcNSigmaPi);
94-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(charmBaryonProngPi, tpcNSigmaPiFromCharmBaryon, tpcNSigmaPi);
95-
// DCA
96-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaCascDau);
119+
// Xic candidate topology.
120+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(decayLenXYXic);
121+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(xicChi2OverNdf);
122+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoXicToPv);
97123
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaCharmBaryonDau);
124+
// Bachelor pion from Xic.
98125
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(kfDcaXYPiFromXic);
99-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(kfDcaXYCascToPv);
100-
// Chi2Geo
126+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoPiFromXicToPv);
127+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_VALUE(kfptPiFromXic, RecoDecay::sqrtSumOfSquares(candidate.pxBachFromCharmBaryon(), candidate.pyBachFromCharmBaryon()));
128+
// Cascade.
129+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(decayLenXYCasc);
101130
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cascChi2OverNdf);
102-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(xicChi2OverNdf);
103-
// ldl
104-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cascldl);
105-
// Chi2Topo
106131
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoCascToPv);
107132
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoCascToXic);
108-
// CosPa
133+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(candidate, cosPaCascToPv, cosPACasc);
109134
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cosPaCascToXic);
110-
// Decay length
111-
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(decayLenXYCasc);
135+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaCascDau);
136+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(kfDcaXYCascToPv);
137+
// Pion from cascade.
138+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(cascProngPi, tpcNSigmaPiFromCasc, tpcNSigmaPi);
139+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaXYToPvCascDau);
140+
// Lambda and its charged daughters. The selector passes sign-corrected prongs.
141+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(decayLenXYLambda);
142+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(v0Chi2OverNdf);
143+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoV0ToPv);
144+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(chi2TopoV0ToCasc);
145+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(candidate, cosPaV0ToPv, cosPAV0);
146+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cosPaV0ToCasc);
147+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaV0Dau);
148+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaXYToPvV0Dau0);
149+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(dcaXYToPvV0Dau1);
150+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(lamProngPr, tpcNSigmaPrFromLambda, tpcNSigmaPr);
151+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(lamProngPi, tpcNSigmaPiFromLambda, tpcNSigmaPi);
152+
// Legacy features that are not part of the local 28-feature model.
153+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL(charmBaryonProngPi, tpcNSigmaPiFromCharmBaryon, tpcNSigmaPi);
154+
CHECK_AND_FILL_VEC_XIC0TOXIPIKF(cascldl);
112155
}
113156
}
114157

@@ -120,28 +163,58 @@ class HfMlResponseXic0ToXiPiKf : public HfMlResponse<TypeOutputScore>
120163
void setAvailableInputFeatures()
121164
{
122165
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
123-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromLambda),
124-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCasc),
125-
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCharmBaryon),
126-
FILL_MAP_XIC0TOXIPIKF(dcaCascDau),
166+
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYXic", decayLenXYXic),
167+
FILL_MAP_XIC0TOXIPIKF(xicChi2OverNdf),
168+
FILL_MAP_XIC0TOXIPIKF_AS("fXicChi2OverNdf", xicChi2OverNdf),
169+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoXicToPv", chi2TopoXicToPv),
127170
FILL_MAP_XIC0TOXIPIKF(dcaCharmBaryonDau),
171+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaCharmBaryonDau", dcaCharmBaryonDau),
128172
FILL_MAP_XIC0TOXIPIKF(kfDcaXYPiFromXic),
129-
FILL_MAP_XIC0TOXIPIKF(kfDcaXYCascToPv),
173+
FILL_MAP_XIC0TOXIPIKF_AS("fKfDcaXYPiFromXic", kfDcaXYPiFromXic),
174+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoPiFromXicToPv", chi2TopoPiFromXicToPv),
175+
FILL_MAP_XIC0TOXIPIKF_AS("fKfptPiFromXic", kfptPiFromXic),
176+
FILL_MAP_XIC0TOXIPIKF(decayLenXYCasc),
177+
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYCasc", decayLenXYCasc),
130178
FILL_MAP_XIC0TOXIPIKF(cascChi2OverNdf),
131-
FILL_MAP_XIC0TOXIPIKF(xicChi2OverNdf),
132-
FILL_MAP_XIC0TOXIPIKF(cascldl),
179+
FILL_MAP_XIC0TOXIPIKF_AS("fCascChi2OverNdf", cascChi2OverNdf),
133180
FILL_MAP_XIC0TOXIPIKF(chi2TopoCascToPv),
181+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoCascToPv", chi2TopoCascToPv),
134182
FILL_MAP_XIC0TOXIPIKF(chi2TopoCascToXic),
183+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoCascToXic", chi2TopoCascToXic),
184+
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaCascToPv", cosPaCascToPv),
135185
FILL_MAP_XIC0TOXIPIKF(cosPaCascToXic),
136-
FILL_MAP_XIC0TOXIPIKF(decayLenXYCasc),
186+
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaCascToXic", cosPaCascToXic),
187+
FILL_MAP_XIC0TOXIPIKF(dcaCascDau),
188+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaCascDau", dcaCascDau),
189+
FILL_MAP_XIC0TOXIPIKF(kfDcaXYCascToPv),
190+
FILL_MAP_XIC0TOXIPIKF_AS("fKfDcaXYCascToPv", kfDcaXYCascToPv),
191+
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCasc),
192+
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPiFromCasc", tpcNSigmaPiFromCasc),
193+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvCascDau", dcaXYToPvCascDau),
194+
FILL_MAP_XIC0TOXIPIKF_AS("fDecayLenXYLambda", decayLenXYLambda),
195+
FILL_MAP_XIC0TOXIPIKF_AS("fV0Chi2OverNdf", v0Chi2OverNdf),
196+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoV0ToPv", chi2TopoV0ToPv),
197+
FILL_MAP_XIC0TOXIPIKF_AS("fChi2TopoV0ToCasc", chi2TopoV0ToCasc),
198+
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaV0ToPv", cosPaV0ToPv),
199+
FILL_MAP_XIC0TOXIPIKF_AS("fCosPaV0ToCasc", cosPaV0ToCasc),
200+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaV0Dau", dcaV0Dau),
201+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvV0Dau0", dcaXYToPvV0Dau0),
202+
FILL_MAP_XIC0TOXIPIKF_AS("fDcaXYToPvV0Dau1", dcaXYToPvV0Dau1),
203+
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPrFromLambda", tpcNSigmaPrFromLambda),
204+
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromLambda),
205+
FILL_MAP_XIC0TOXIPIKF_AS("fTpcNSigmaPiFromLambda", tpcNSigmaPiFromLambda),
206+
FILL_MAP_XIC0TOXIPIKF(tpcNSigmaPiFromCharmBaryon),
207+
FILL_MAP_XIC0TOXIPIKF(cascldl),
137208
};
138209
}
139210
};
140211

141212
} // namespace o2::analysis
142213

143214
#undef FILL_MAP_XIC0TOXIPIKF
215+
#undef FILL_MAP_XIC0TOXIPIKF_AS
144216
#undef CHECK_AND_FILL_VEC_XIC0TOXIPIKF_FULL
145217
#undef CHECK_AND_FILL_VEC_XIC0TOXIPIKF
218+
#undef CHECK_AND_FILL_VEC_XIC0TOXIPIKF_VALUE
146219

147220
#endif // PWGHF_CORE_HFMLRESPONSEXIC0TOXIPIKF_H_

‎PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ struct HfCandidateSelectorToXiPiQa {
7878

7979
// cuts from SelectorCuts.h - pT dependent cuts
8080
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_xic_to_xi_pi::vecBinsPt}, "pT bin limits"};
81-
Configurable<LabeledArray<double>> cuts{"cuts", {hf_cuts_xic_to_xi_pi::Cuts[0], hf_cuts_xic_to_xi_pi::NBinsPt, hf_cuts_xic_to_xi_pi::NCutVars, hf_cuts_xic_to_xi_pi::labelsPt, hf_cuts_xic_to_xi_pi::labelsCutVar}, "Xic0 candidate selection per Pt Bin"};
81+
Configurable<LabeledArray<double>> cuts{"cuts", {&hf_cuts_xic_to_xi_pi::Cuts[0][0], hf_cuts_xic_to_xi_pi::NBinsPt, hf_cuts_xic_to_xi_pi::NCutVars, hf_cuts_xic_to_xi_pi::labelsPt, hf_cuts_xic_to_xi_pi::labelsCutVar}, "Xic0 candidate selection per Pt Bin"};
8282
// ML inference
8383
Configurable<bool> applyMl{"applyMl", false, "Flag to apply ML selections"};
8484
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
8585
Configurable<std::vector<int>> cutDirMl{"cutDirMl", std::vector<int>{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"};
86-
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
86+
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {&hf_cuts_ml::Cuts[0][0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
8787
Configurable<int> nClassesMl{"nClassesMl", static_cast<int>(hf_cuts_ml::NCutScores), "Number of classes in ML model"};
8888
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"feature1", "feature2"}, "Names of ML model input features"};
8989
// CCDB configuration
@@ -144,7 +144,7 @@ struct HfCandidateSelectorToXiPiQa {
144144

145145
o2::analysis::HfMlResponseXic0ToXiPi<float> hfMlResponseDca;
146146
o2::analysis::HfMlResponseXic0ToXiPiKf<float> hfMlResponseKf;
147-
std::vector<float> outputMlXic0ToXiPi = {};
147+
std::vector<float> outputMlXic0ToXiPi;
148148
o2::ccdb::CcdbApi ccdbApi;
149149

150150
TrackSelectorPi selectorPion;
@@ -718,12 +718,11 @@ struct HfCandidateSelectorToXiPiQa {
718718
// ML BDT selection if required
719719
if (applyMl) {
720720
bool isSelectedMlXic0 = false;
721-
std::vector<float> inputFeaturesXic0 = {};
722721
if constexpr (svReco == doDcaFitter) {
723-
inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
722+
auto inputFeaturesXic0 = hfMlResponseDca.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
724723
isSelectedMlXic0 = hfMlResponseDca.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
725724
} else {
726-
inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
725+
auto inputFeaturesXic0 = hfMlResponseKf.getInputFeatures(candidate, trackPiFromLam, trackPrFromLam, trackPiFromCasc, trackPiFromCharm);
727726
isSelectedMlXic0 = hfMlResponseKf.isSelectedMl(inputFeaturesXic0, ptCandXic0, outputMlXic0ToXiPi);
728727
}
729728

@@ -767,8 +766,8 @@ struct HfCandidateSelectorToXiPiQa {
767766

768767
}; // end struct
769768

770-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
769+
WorkflowSpec defineDataProcessing(ConfigContext const& context)
771770
{
772771
return WorkflowSpec{
773-
adaptAnalysisTask<HfCandidateSelectorToXiPiQa>(cfgc)};
772+
adaptAnalysisTask<HfCandidateSelectorToXiPiQa>(context)};
774773
}

‎PWGHF/TableProducer/candidateSelectorXic0ToXiPiKf.cxx‎

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,23 @@ struct HfCandidateSelectorXic0ToXiPiKf {
120120

121121
// topological cuts
122122
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_xic_to_xi_pi::vecBinsPt}, "pT bin limits"};
123-
Configurable<LabeledArray<double>> cuts{"cuts", {hf_cuts_xic_to_xi_pi::Cuts[0], hf_cuts_xic_to_xi_pi::NBinsPt, hf_cuts_xic_to_xi_pi::NCutVars, hf_cuts_xic_to_xi_pi::labelsPt, hf_cuts_xic_to_xi_pi::labelsCutVar}, "Xic0 candidate selection per pT bin"};
123+
Configurable<LabeledArray<double>> cuts{"cuts", {&hf_cuts_xic_to_xi_pi::Cuts[0][0], hf_cuts_xic_to_xi_pi::NBinsPt, hf_cuts_xic_to_xi_pi::NCutVars, hf_cuts_xic_to_xi_pi::labelsPt, hf_cuts_xic_to_xi_pi::labelsCutVar}, "Xic0 candidate selection per pT bin"};
124124

125125
// ML inference
126126
Configurable<bool> applyMl{"applyMl", true, "Flag to apply ML selections"};
127127
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
128128
Configurable<std::vector<int>> cutDirMl{"cutDirMl", std::vector<int>{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"};
129-
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {hf_cuts_ml::Cuts[0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
129+
Configurable<LabeledArray<double>> cutsMl{"cutsMl", {&hf_cuts_ml::Cuts[0][0], hf_cuts_ml::NBinsPt, hf_cuts_ml::NCutScores, hf_cuts_ml::labelsPt, hf_cuts_ml::labelsCutScore}, "ML selections per pT bin"};
130130
Configurable<int> nClassesMl{"nClassesMl", static_cast<int>(hf_cuts_ml::NCutScores), "Number of classes in ML model"};
131-
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"feature1", "feature2"}, "Names of ML model input features"};
131+
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures",
132+
std::vector<std::string>{"fDecayLenXYXic", "fXicChi2OverNdf", "fChi2TopoXicToPv", "fDcaCharmBaryonDau",
133+
"fKfDcaXYPiFromXic", "fChi2TopoPiFromXicToPv", "fKfptPiFromXic", "fDecayLenXYCasc",
134+
"fCascChi2OverNdf", "fChi2TopoCascToPv", "fChi2TopoCascToXic", "fCosPaCascToPv",
135+
"fCosPaCascToXic", "fDcaCascDau", "fKfDcaXYCascToPv", "fTpcNSigmaPiFromCasc",
136+
"fDcaXYToPvCascDau", "fDecayLenXYLambda", "fV0Chi2OverNdf", "fChi2TopoV0ToPv",
137+
"fChi2TopoV0ToCasc", "fCosPaV0ToPv", "fCosPaV0ToCasc", "fDcaV0Dau",
138+
"fDcaXYToPvV0Dau0", "fDcaXYToPvV0Dau1", "fTpcNSigmaPrFromLambda", "fTpcNSigmaPiFromLambda"},
139+
"Names of ML model input features"};
132140

133141
// CCDB configuration
134142
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -224,14 +232,11 @@ struct HfCandidateSelectorXic0ToXiPiKf {
224232
auto trackPiFromCasc = lfTracks.rawIteratorAt(trackPiFromCascId);
225233
auto trackPiFromCharm = tracks.rawIteratorAt(trackPiFromCharmId);
226234

227-
auto trackPiFromLam = trackV0NegDau;
228-
auto trackPrFromLam = trackV0PosDau;
229-
230235
int8_t const signDecay = candidate.signDecay(); // sign of pi <- cascade
236+
auto const trackPiFromLam = signDecay > 0 ? trackV0PosDau : trackV0NegDau;
237+
auto const trackPrFromLam = signDecay > 0 ? trackV0NegDau : trackV0PosDau;
231238

232239
if (signDecay > 0) {
233-
trackPiFromLam = trackV0PosDau;
234-
trackPrFromLam = trackV0NegDau;
235240
registry.fill(HIST("hSelSignDec"), 1); // anti-particle decay
236241
} else if (signDecay < 0) {
237242
registry.fill(HIST("hSelSignDec"), 0); // particle decay
@@ -418,7 +423,7 @@ struct HfCandidateSelectorXic0ToXiPiKf {
418423
// ML selections
419424
if (applyMl) {
420425
bool isSelectedMlXic0 = false;
421-
std::vector<float> inputFeaturesXic0 = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackPiFromCasc, trackPiFromCharm);
426+
std::vector<float> inputFeaturesXic0 = hfMlResponse.getInputFeatures(candidate, trackPiFromLam, trackPrFromLam, trackPiFromCasc, trackPiFromCharm);
422427
if (!resultSelections) {
423428
hfMlToXiPi(outputMlXic0ToXiPiKf);
424429
} else {
@@ -526,7 +531,7 @@ struct HfCandidateSelectorXic0ToXiPiKf {
526531
}
527532

528533
// dcaXY v0 daughters to PV cut
529-
if (std::abs(candidate.dcaXYToPvV0Dau0()) < cuts->get(pTBin, "dcaXYToPvV0Dau0") || std::abs(candidate.dcaXYToPvV0Dau1()) < cuts->get(pTBin, "dcaXYToPvV0Dau0")) {
534+
if (std::abs(candidate.dcaXYToPvV0Dau0()) < cuts->get(pTBin, "dcaXYToPvV0Dau0") || std::abs(candidate.dcaXYToPvV0Dau1()) < cuts->get(pTBin, "dcaXYToPvV0Dau1")) {
530535
return false;
531536
}
532537

@@ -597,8 +602,8 @@ struct HfCandidateSelectorXic0ToXiPiKf {
597602

598603
}; // end struct
599604

600-
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
605+
WorkflowSpec defineDataProcessing(ConfigContext const& context)
601606
{
602607
return WorkflowSpec{
603-
adaptAnalysisTask<HfCandidateSelectorXic0ToXiPiKf>(cfgc)};
608+
adaptAnalysisTask<HfCandidateSelectorXic0ToXiPiKf>(context)};
604609
}

0 commit comments

Comments
 (0)