Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion PWGEM/Dilepton/TableProducer/filterEoI.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -31,6 +31,7 @@
#include <TH1.h>

#include <cstdint>
#include <string>

using namespace o2;
using namespace o2::framework;
Expand All @@ -49,12 +50,14 @@
Configurable<bool> inheritFromOtherTask{"inheritFromOtherTask", true, "Flag to iherit all common configurables from skimmerPrimaryElectron or skimmerPrimaryMuon"};
Configurable<int> minNelectron{"minNelectron", -1, "min number of electron candidates per collision"};
Configurable<int> minNmuon{"minNmuon", -1, "min number of muon candidates per collision"};
Configurable<std::string> taskNameForNelectron{"taskNameForNelectron", "skimmer-primary-electron", "task name where minNelectron is defined."};
Configurable<std::string> varNameForNelectron{"varNameForNelectron", "minNelectron", "variable name for minNelectron"};

HistogramRegistry fRegistry{"output"};
void init(o2::framework::InitContext& initContext)
{
if (inheritFromOtherTask.value) { // Inheriting from other task
getTaskOptionValue(initContext, "skimmer-primary-electron", "minNelectron", minNelectron.value, true);
getTaskOptionValue(initContext, taskNameForNelectron.value, varNameForNelectron.value, minNelectron.value, true);
getTaskOptionValue(initContext, "skimmer-primary-muon", "minNmuon", minNmuon.value, true);
}

Expand Down Expand Up @@ -111,7 +114,7 @@
}
if constexpr (static_cast<bool>(system & kElectronFromDalitz)) {
auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex());
if (electronsda_coll.size() >= 2) {

Check failure on line 117 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
does_electronda_exist = true;
}
}
Expand Down Expand Up @@ -188,5 +191,5 @@
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<filterEoI>(cfgc, TaskName{"filter-eoi"})};

Check failure on line 194 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names filter-eoi and filter-eo-i generated from the specified task name filter-eoi and from the struct name filterEoI, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to FilterEoi and removing TaskName.
}
8 changes: 4 additions & 4 deletions PWGEM/Dilepton/Utils/ElectronModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
o2::framework::Configurable<bool> usePIDML{"usePIDML", false, "Flag to use PID ML"};
o2::framework::Configurable<std::vector<std::string>> onnxFileNames{"onnxFileNames", std::vector<std::string>{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"};
o2::framework::Configurable<std::vector<std::string>> onnxPathsCCDB{"onnxPathsCCDB", std::vector<std::string>{"path"}, "Paths of models on CCDB"};
o2::framework::Configurable<std::vector<double>> binsMl{"binsMl", std::vector<double>{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20}, "Bin limits for ML application"};
o2::framework::Configurable<std::vector<double>> cutsMl{"cutsMl", std::vector<double>{0.95, 0.95, 0.7, 0.7, 0.8, 0.8, 0.7, 0.7}, "ML cuts per bin"};
o2::framework::Configurable<std::vector<double>> binsMl{"binsMl", std::vector<double>{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 4.0, 20}, "Bin limits for ML application"};
o2::framework::Configurable<std::vector<double>> cutsMl{"cutsMl", std::vector<double>{0.9, 0.9, 0.9, 0.7, 0.8, 0.8, 0.7, 0.7, 0.7}, "ML cuts per bin"};
o2::framework::Configurable<std::vector<std::string>> namesInputFeatures{"namesInputFeatures", std::vector<std::string>{"tpcInnerParam", "tpcNClsFound", "tpcChi2NCl", "tpcNSigmaEl", "tofNSigmaEl", "meanClusterSizeITSobCosTgl"}, "Names of ML model input features"};
o2::framework::Configurable<std::string> nameBinningFeature{"nameBinningFeature", "tpcInnerParam", "Names of ML model binning feature"};
o2::framework::Configurable<bool> loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"};
Expand Down Expand Up @@ -162,8 +162,8 @@
o2::framework::Configurable<float> maxMeanITSClusterSize{"maxMeanITSClusterSize", 16, "max <ITS cluster size> x cos(lambda)"};

// configuration for PID ML
o2::framework::Configurable<std::vector<double>> binsMl{"binsMl", std::vector<double>{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20}, "Bin limits for ML application"};
o2::framework::Configurable<std::vector<double>> cutsMl{"cutsMl", std::vector<double>{0.9, 0.9, 0.65, 0.65, 0.75, 0.75, 0.65, 0.65}, "ML cuts per bin"};
o2::framework::Configurable<std::vector<double>> binsMl{"binsMl", std::vector<double>{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 4.0, 20}, "Bin limits for ML application"};
o2::framework::Configurable<std::vector<double>> cutsMl{"cutsMl", std::vector<double>{0.85, 0.85, 0.85, 0.65, 0.75, 0.75, 0.65, 0.65, 0.65}, "ML cuts per bin"};

// for pair
o2::framework::Configurable<float> slope{"slope", 0.0185, "slope for m vs. phiv"};
Expand Down Expand Up @@ -719,7 +719,7 @@
candidate.tpcNSigmaEl = track.tpcNSigmaEl();
candidate.tofNSigmaEl = fMapTOFNsigmaElReassociated[std::make_pair(collision.globalIndex(), track.globalIndex())];
int total_cluster_size_ob = 0, nl_ob = 0;
for (unsigned int layer = 3; layer < 7; layer++) {

Check failure on line 722 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int cluster_size_per_layer = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl_ob++;
Expand All @@ -734,7 +734,7 @@
int pbin = lower_bound(fElectronCut.binsMl.value.begin(), fElectronCut.binsMl.value.end(), binningFeature) - fElectronCut.binsMl.value.begin() - 1;
if (pbin < 0) {
pbin = 0;
} else if (static_cast<int>(fElectronCut.binsMl.value.size()) - 2 < pbin) {

Check failure on line 737 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
pbin = static_cast<int>(fElectronCut.binsMl.value.size()) - 2;
}

Expand All @@ -754,7 +754,7 @@
}
if (fElectronCut.storeOnlyTrueElectronMC) {
const auto& mcParticle = track.template mcParticle_as<aod::McParticles>();
if (std::abs(mcParticle.pdgCode()) != 11) {

Check failure on line 757 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 757 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
}
}
Expand Down Expand Up @@ -825,7 +825,7 @@
}

int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 828 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int cluster_size_per_layer = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl++;
Expand Down Expand Up @@ -903,7 +903,7 @@
}

int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 906 in PWGEM/Dilepton/Utils/ElectronModule.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
int cluster_size_per_layer = track.itsClsSizeInLayer(layer);
if (cluster_size_per_layer > 0) {
nl++;
Expand Down
Loading