Skip to content

Commit 24d38a4

Browse files
committed
Remove cfg
1 parent 5efe381 commit 24d38a4

File tree

2 files changed

+28
-57
lines changed

2 files changed

+28
-57
lines changed

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,6 @@ struct OnTheFlyRichPid {
133133
Configurable<float> bRICHPixelSize{"bRICHPixelSize", 0.1, "barrel RICH pixel size (cm)"};
134134
Configurable<float> bRichGapRefractiveIndex{"bRichGapRefractiveIndex", 1.000283, "barrel RICH gap refractive index"};
135135

136-
struct : ConfigurableGroup {
137-
Configurable<std::string> lutEl{"lutEl", "inherit", "LUT for electrons (if inherit, inherits from otf tracker task)"};
138-
Configurable<std::string> lutMu{"lutMu", "inherit", "LUT for muons (if inherit, inherits from otf tracker task)"};
139-
Configurable<std::string> lutPi{"lutPi", "inherit", "LUT for pions (if inherit, inherits from otf tracker task)"};
140-
Configurable<std::string> lutKa{"lutKa", "inherit", "LUT for kaons (if inherit, inherits from otf tracker task)"};
141-
Configurable<std::string> lutPr{"lutPr", "inherit", "LUT for protons (if inherit, inherits from otf tracker task)"};
142-
Configurable<std::string> lutDe{"lutDe", "inherit", "LUT for deuterons (if inherit, inherits from otf tracker task)"};
143-
Configurable<std::string> lutTr{"lutTr", "inherit", "LUT for tritons (if inherit, inherits from otf tracker task)"};
144-
Configurable<std::string> lutHe3{"lutHe3", "inherit", "LUT for helions (if inherit, inherits from otf tracker task)"};
145-
} simConfig;
146-
147136
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
148137

149138
// Track smearer (here used to get relative pt and eta uncertainties)
@@ -312,28 +301,23 @@ struct OnTheFlyRichPid {
312301
// Load LUT for pt and eta smearing
313302
if (flagIncludeTrackAngularRes && flagRICHLoadDelphesLUTs) {
314303
mSmearer.setCcdbManager(ccdb.operator->());
315-
auto loadLUT = [&](int pdg, Configurable<std::string>& lut) {
316-
if (lut.value != "inherit") {
317-
return;
318-
}
319-
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", lut, false)) {
320-
LOG(fatal) << "Could not get " << lut.name << " from on-the-fly-tracker task";
304+
auto loadLUT = [&](int pdg, std::string cfgNameToInherit) {
305+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", cfgNameToInherit, false)) {
306+
LOG(fatal) << "Could not get " << cfgNameToInherit << " from on-the-fly-tracker task";
321307
}
322-
std::string lutFile = lut.value;
323-
324-
bool success = mSmearer.loadTable(pdg, lutFile.c_str());
325-
if (!success && !lutFile.empty()) {
326-
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile;
308+
bool success = mSmearer.loadTable(pdg, cfgNameToInherit.c_str());
309+
if (!success && !cfgNameToInherit.empty()) {
310+
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << cfgNameToInherit;
327311
}
328312
};
329-
loadLUT(11, simConfig.lutEl);
330-
loadLUT(13, simConfig.lutMu);
331-
loadLUT(211, simConfig.lutPi);
332-
loadLUT(321, simConfig.lutKa);
333-
loadLUT(2212, simConfig.lutPr);
334-
loadLUT(1000010020, simConfig.lutDe);
335-
loadLUT(1000010030, simConfig.lutTr);
336-
loadLUT(1000020030, simConfig.lutHe3);
313+
loadLUT(11, "lutEl");
314+
loadLUT(13, "lutMu");
315+
loadLUT(211, "lutPi");
316+
loadLUT(321, "lutKa");
317+
loadLUT(2212, "lutPr");
318+
loadLUT(1000010020, "lutDe");
319+
loadLUT(1000010030, "lutTr");
320+
loadLUT(1000020030, "lutHe3");
337321
}
338322

339323
if (doQAplots) {

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,6 @@ struct OnTheFlyTofPid {
9999
Configurable<float> multiplicityEtaRange{"multiplicityEtaRange", 0.800000012, "eta range to compute the multiplicity"};
100100
Configurable<bool> flagIncludeTrackTimeRes{"flagIncludeTrackTimeRes", true, "flag to include or exclude track time resolution"};
101101
Configurable<bool> flagTOFLoadDelphesLUTs{"flagTOFLoadDelphesLUTs", false, "flag to load Delphes LUTs for tracking correction (use recoTrack parameters if false)"};
102-
Configurable<std::string> lutEl{"lutEl", "inherit", "LUT for electrons (if inherit, inherits from otf tracker task)"};
103-
Configurable<std::string> lutMu{"lutMu", "inherit", "LUT for muons (if inherit, inherits from otf tracker task)"};
104-
Configurable<std::string> lutPi{"lutPi", "inherit", "LUT for pions (if inherit, inherits from otf tracker task)"};
105-
Configurable<std::string> lutKa{"lutKa", "inherit", "LUT for kaons (if inherit, inherits from otf tracker task)"};
106-
Configurable<std::string> lutPr{"lutPr", "inherit", "LUT for protons (if inherit, inherits from otf tracker task)"};
107-
Configurable<std::string> lutDe{"lutDe", "inherit", "LUT for deuterons (if inherit, inherits from otf tracker task)"};
108-
Configurable<std::string> lutTr{"lutTr", "inherit", "LUT for tritons (if inherit, inherits from otf tracker task)"};
109-
Configurable<std::string> lutHe3{"lutHe3", "inherit", "LUT for helions (if inherit, inherits from otf tracker task)"};
110102
} simConfig;
111103

112104
struct : ConfigurableGroup {
@@ -159,28 +151,23 @@ struct OnTheFlyTofPid {
159151
// Load LUT for pt and eta smearing
160152
if (simConfig.flagIncludeTrackTimeRes && simConfig.flagTOFLoadDelphesLUTs) {
161153
mSmearer.setCcdbManager(ccdb.operator->());
162-
auto loadLUT = [&](int pdg, Configurable<std::string>& lut) {
163-
if (lut.value != "inherit") {
164-
return;
154+
auto loadLUT = [&](int pdg, std::string cfgNameToInherit) {
155+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", cfgNameToInherit, false)) {
156+
LOG(fatal) << "Could not get " << cfgNameToInherit << " from on-the-fly-tracker task";
165157
}
166-
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", lut, false)) {
167-
LOG(fatal) << "Could not get " << lut.name << " from on-the-fly-tracker task";
168-
}
169-
std::string lutFile = lut.value;
170-
171-
bool success = mSmearer.loadTable(pdg, lutFile.c_str());
172-
if (!success && !lutFile.empty()) {
173-
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lutFile;
158+
bool success = mSmearer.loadTable(pdg, cfgNameToInherit.c_str());
159+
if (!success && !cfgNameToInherit.empty()) {
160+
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << cfgNameToInherit;
174161
}
175162
};
176-
loadLUT(11, simConfig.lutEl);
177-
loadLUT(13, simConfig.lutMu);
178-
loadLUT(211, simConfig.lutPi);
179-
loadLUT(321, simConfig.lutKa);
180-
loadLUT(2212, simConfig.lutPr);
181-
loadLUT(1000010020, simConfig.lutDe);
182-
loadLUT(1000010030, simConfig.lutTr);
183-
loadLUT(1000020030, simConfig.lutHe3);
163+
loadLUT(11, "lutEl");
164+
loadLUT(13, "lutMu");
165+
loadLUT(211, "lutPi");
166+
loadLUT(321, "lutKa");
167+
loadLUT(2212, "lutPr");
168+
loadLUT(1000010020, "lutDe");
169+
loadLUT(1000010030, "lutTr");
170+
loadLUT(1000020030, "lutHe3");
184171
}
185172

186173
if (plotsConfig.doQAplots) {

0 commit comments

Comments
 (0)