Skip to content

Commit 00d0894

Browse files
committed
[PWGHF] Fix clang-tidy diagnostics in HFC femtoscopy workflows
Include cstddef directly for std::size_t, use std::array for event labels, and explicitly pass the first ML cut element to LabeledArray. Reject unsupported mixing policies in the generated-particle workflow with a fatal diagnostic.
1 parent a79cf1d commit 00d0894

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
#include <array>
7171
#include <chrono>
7272
#include <cmath>
73+
#include <cstddef>
7374
#include <cstdint>
7475
#include <numeric>
7576
#include <string>
@@ -207,7 +208,7 @@ struct HfProducerCharmHadronsTrackFemtoDream {
207208
Configurable<int> applyMlMode{"applyMlMode", 1, "None: 0, BDT model from candidate selector: 1, New BDT model on Top of candidate selector: 2"};
208209
Configurable<std::vector<double>> binsPtMl{"binsPtMl", std::vector<double>{hf_cuts_ml::vecBinsPt}, "pT bin limits for ML application"};
209210
Configurable<std::vector<int>> cutDirMl{"cutDirMl", std::vector<int>{hf_cuts_ml::vecCutDir}, "Whether to reject score values greater or smaller than the threshold"};
210-
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"};
211+
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"};
211212
Configurable<int> nClassesMl{"nClassesMl", static_cast<int>(hf_cuts_ml::NCutScores), "Number of classes in ML model"};
212213
Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"feature1", "feature2"}, "Names of ML model input features"};
213214
} mlCfg;
@@ -309,7 +310,7 @@ struct HfProducerCharmHadronsTrackFemtoDream {
309310

310311
// event QA histograms
311312
constexpr int EventTypes = PairSelected + 1;
312-
std::string labels[EventTypes];
313+
std::array<std::string, EventTypes> labels;
313314
labels[Event::All] = "All events";
314315
labels[Event::RejEveSel] = "rejected by event selection";
315316
labels[Event::RejNoTracksAndCharm] = "rejected by no tracks and charm";

‎PWGHF/HFC/Tasks/taskCharmHadronsTrackFemtoDream.cxx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,8 @@ struct HfTaskCharmHadronsTrackFemtoDream {
16741674
case femtodreamcollision::kMultMultPercentile:
16751675
mixEvents(colBinningMultMultPercentile);
16761676
break;
1677+
default:
1678+
LOGP(fatal, "Invalid mixing bin policy: {}", mixSetting.mixingBinPolicy.value);
16771679
}
16781680
}
16791681
}

0 commit comments

Comments
 (0)