Skip to content

Commit ae9c1a0

Browse files
committed
Remove redundant D0 ML implementation
1 parent 2d49026 commit ae9c1a0

File tree

3 files changed

+8
-40
lines changed

3 files changed

+8
-40
lines changed

PWGHF/Core/HfMlResponseDstarToD0Pi.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -221,28 +221,6 @@ class HfMlResponseDstarToD0Pi : public HfMlResponse<TypeOutputScore>
221221
return inputFeatures;
222222
}
223223

224-
/// Method to get the input features used for D0 in HF triggers
225-
/// \param candidate is the D* candidate
226-
/// \return inputFeatures vector
227-
template <typename T1>
228-
std::vector<float> getInputFeaturesTrigger(T1 const& candidate)
229-
{
230-
std::vector<float> inputFeatures;
231-
232-
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
233-
switch (idx) {
234-
CHECK_AND_FILL_VEC_DSTAR(ptProng0);
235-
CHECK_AND_FILL_VEC_DSTAR_GETTER(impactParameterXY0, impactParameter0);
236-
CHECK_AND_FILL_VEC_DSTAR(impactParameterZ0);
237-
CHECK_AND_FILL_VEC_DSTAR(ptProng1);
238-
CHECK_AND_FILL_VEC_DSTAR_GETTER(impactParameterXY1, impactParameter1);
239-
CHECK_AND_FILL_VEC_DSTAR(impactParameterZ1);
240-
}
241-
}
242-
243-
return inputFeatures;
244-
}
245-
246224
protected:
247225
/// Method to fill the map of available input features
248226
void setAvailableInputFeatures()

PWGHF/DataModel/CandidateReconstructionTables.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,6 @@ enum DecayType { DplusToPiKPi = 0,
982982
XicToPKPi,
983983
N3ProngDecays }; // always keep N3ProngDecays at the end
984984

985-
static constexpr int DstarToPiKPiBkg = DecayType::N3ProngDecays;
986-
987985
// Ds± → K± K∓ π± or D± → K± K∓ π±
988986

989987
enum DecayChannelDToKKPi {

PWGHF/TableProducer/candidateSelectorDstarToD0Pi.cxx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ struct HfCandidateSelectorDstarToD0Pi {
9797
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"};
9898
Configurable<int> nClassesMl{"nClassesMl", static_cast<int>(hf_cuts_ml::NCutScores), "Number of classes in ML model"};
9999
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"feature1", "feature2"}, "Names of ML model input features"};
100-
// ML inference D0
101-
Configurable<bool> applyMlD0Daug{"applyMlD0Daug", false, "Flag to apply ML selections on D0 daughter"};
102100

103101
// CCDB configuration
104102
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -149,14 +147,14 @@ struct HfCandidateSelectorDstarToD0Pi {
149147
registry.get<TH2>(HIST("QA/hSelections"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data());
150148
}
151149

152-
if (applyMl || applyMlD0Daug) {
150+
if (applyMl) {
153151
registry.add("QA/hBdtScore1VsStatus", ";BDT score", {HistType::kTH1F, {axisBdtScore}});
154152
registry.add("QA/hBdtScore2VsStatus", ";BDT score", {HistType::kTH1F, {axisBdtScore}});
155153
registry.add("QA/hBdtScore3VsStatus", ";BDT score", {HistType::kTH1F, {axisBdtScore}});
156154
}
157155
}
158156

159-
if (applyMl || applyMlD0Daug) {
157+
if (applyMl) {
160158
hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl);
161159
if (loadModelsFromCCDB) {
162160
ccdbApi.init(ccdbUrl);
@@ -368,7 +366,7 @@ struct HfCandidateSelectorDstarToD0Pi {
368366

369367
if (!TESTBIT(candDstar.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) {
370368
hfSelDstarCandidate(statusDstar, statusD0Flag, statusTopol, statusCand, statusPID);
371-
if (applyMl || applyMlD0Daug) {
369+
if (applyMl) {
372370
hfMlDstarCandidate(outputMlDstarToD0Pi);
373371
}
374372
if (activateQA) {
@@ -384,7 +382,7 @@ struct HfCandidateSelectorDstarToD0Pi {
384382

385383
if (!selectionDstar(candDstar)) {
386384
hfSelDstarCandidate(statusDstar, statusD0Flag, statusTopol, statusCand, statusPID);
387-
if (applyMl || applyMlD0Daug) {
385+
if (applyMl) {
388386
hfMlDstarCandidate(outputMlDstarToD0Pi);
389387
}
390388
continue;
@@ -397,7 +395,7 @@ struct HfCandidateSelectorDstarToD0Pi {
397395
bool topoDstar = selectionTopolConjugate(candDstar);
398396
if (!topoDstar) {
399397
hfSelDstarCandidate(statusDstar, statusD0Flag, statusTopol, statusCand, statusPID);
400-
if (applyMl || applyMlD0Daug) {
398+
if (applyMl) {
401399
hfMlDstarCandidate(outputMlDstarToD0Pi);
402400
}
403401
continue;
@@ -445,7 +443,7 @@ struct HfCandidateSelectorDstarToD0Pi {
445443

446444
if (pidDstar == 0) {
447445
hfSelDstarCandidate(statusDstar, statusD0Flag, statusTopol, statusCand, statusPID);
448-
if (applyMl || applyMlD0Daug) {
446+
if (applyMl) {
449447
hfMlDstarCandidate(outputMlDstarToD0Pi);
450448
}
451449
continue;
@@ -460,16 +458,10 @@ struct HfCandidateSelectorDstarToD0Pi {
460458
}
461459
statusPID = true;
462460

463-
if (applyMl || applyMlD0Daug) {
461+
if (applyMl) {
464462
// ML selections
465463
bool isSelectedMlDstar = false;
466-
467-
std::vector<float> inputFeatures{};
468-
if (applyMlD0Daug) {
469-
inputFeatures = hfMlResponse.getInputFeaturesTrigger(candDstar);
470-
} else {
471-
inputFeatures = hfMlResponse.getInputFeatures(candDstar);
472-
}
464+
std::vector<float> inputFeatures = hfMlResponse.getInputFeatures(candDstar);
473465
isSelectedMlDstar = hfMlResponse.isSelectedMl(inputFeatures, ptCand, outputMlDstarToD0Pi);
474466

475467
hfMlDstarCandidate(outputMlDstarToD0Pi);

0 commit comments

Comments
 (0)