Skip to content

Commit c5c542c

Browse files
committed
Add array with momentum threshold values
1 parent 0908236 commit c5c542c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Tools/PIDML/qaPidML.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ struct pidml {
4747
// available particles: 211, 2212, 321
4848
static constexpr int particlesPdgCode[numParticles] = {211, 2212, 321};
4949

50+
// values of track momentum when to switch from only TPC signal to combined TPC and TOF signal
51+
// i-th momentum corresponds to the i-th particle
52+
static constexpr float pSwitchValue[numParticles] = {0.5, 0.8, 0.5};
53+
5054
HistogramRegistry histReg{
5155
"allHistograms",
5256
{{"MC/211", "MC #pi^{+};p_{T} (GeV/c);Counts", {HistType::kTH1F, {{binsNb, 0, maxP}}}},
@@ -322,14 +326,14 @@ struct pidml {
322326
void pidML(const T& track, const int pdgCodeMC)
323327
{
324328
float pidLogits[3];
325-
if (track.p() <= 0.5) {
329+
if (track.p() <= pSwitchValue[i]) {
326330
pidLogits[3] = {model211TPC.applyModel(track), model2212TPC.applyModel(track), model321TPC.applyModel(track)};
327331
} else {
328332
pidLogits[3] = {model211All.applyModel(track), model2212All.applyModel(track), model321All.applyModel(track)};
329333
}
330334
int pid = getParticlePdg(pidLogits);
331335
// condition for sign: we want to work only with pi, p and K, without antiparticles
332-
if ((pid == particlesPdgCode[i]) & (track.sign() == 1)) {
336+
if (pid == particlesPdgCode[i] && track.sign() == 1) {
333337
if (pdgCodeMC == particlesPdgCode[i]) {
334338
fillPidHistos<i>(track, pdgCodeMC, true);
335339
} else {
@@ -342,12 +346,11 @@ struct pidml {
342346
PidONNXModel model211All;
343347
PidONNXModel model2212All;
344348
PidONNXModel model321All;
345-
// Model with only TPC model
349+
// Model with only TPC signal model
346350
PidONNXModel model211TPC;
347351
PidONNXModel model2212TPC;
348352
PidONNXModel model321TPC;
349353

350-
// Configurable<bool> cfgUseTOF{"useTOF", true, "Use ML model with TOF signal"};
351354
Configurable<std::string> cfgModelDir{"model-dir", "http://alice-ccdb.cern.ch/Users/m/mkabus/pidml/onnx_models", "base path to the directory with ONNX models"};
352355
Configurable<std::string> cfgScalingParamsFile{"scaling-params", "http://alice-ccdb.cern.ch/Users/m/mkabus/pidml/onnx_models/train_208_mc_with_beta_and_sigmas_scaling_params.json", "base path to the ccdb JSON file with scaling parameters from training"};
353356

0 commit comments

Comments
 (0)