Skip to content

Commit 249226b

Browse files
author
David Dobrigkeit Chinellato
committed
[Common] Sanitize power-law mapping in corner cases
1 parent 6740c4e commit 249226b

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

Common/Tools/Multiplicity/MultModule.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -505,16 +505,6 @@ class MultModule
505505
listOfRequestors[kPVMults].Append(Form("%s ", "dependency check"));
506506
}
507507

508-
// capture the need for PYTHIA calibration in Pb-Pb runs
509-
if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) {
510-
internalOpts.generatorName.value = "PYTHIA";
511-
}
512-
513-
// capture the need for PYTHIA calibration in light ion runs automatically
514-
if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) {
515-
internalOpts.generatorName.value = "PYTHIA";
516-
}
517-
518508
// list enabled tables
519509
for (int i = 0; i < nTablesConst; i++) {
520510
// printout to be improved in the future
@@ -1145,6 +1135,20 @@ class MultModule
11451135
{
11461136
if (bc.runNumber() != mRunNumberCentrality) {
11471137
mRunNumberCentrality = bc.runNumber(); // mark that this run has been attempted already regardless of outcome
1138+
LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber());
1139+
1140+
// capture the need for PYTHIA calibration in Pb-Pb runs
1141+
if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) {
1142+
LOGF(info, "This is MC for Pb-Pb. Setting generatorName automatically to PYTHIA");
1143+
internalOpts.generatorName.value = "PYTHIA";
1144+
}
1145+
1146+
// capture the need for PYTHIA calibration in light ion runs automatically
1147+
if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) {
1148+
LOGF(info, "This is MC for light ion runs. Setting generatorName automatically to PYTHIA");
1149+
internalOpts.generatorName.value = "PYTHIA";
1150+
}
1151+
11481152
LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber());
11491153
TList* callst = nullptr;
11501154
// Check if the ccdb path is a root file
@@ -1258,6 +1262,10 @@ class MultModule
12581262
auto populateTable = [&](auto& table, struct CalibrationInfo& estimator, float multiplicity, bool isInelGt0) {
12591263
const bool assignOutOfRange = internalOpts.embedINELgtZEROselection && !isInelGt0;
12601264
auto scaleMC = [](float x, const float pars[6]) {
1265+
float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4];
1266+
if(core<0.0f){
1267+
return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN
1268+
}
12611269
return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]);
12621270
};
12631271

@@ -1343,6 +1351,10 @@ class MultModule
13431351
ConfigureCentralityRun2(ccdb, metadataInfo, firstbc);
13441352

13451353
auto scaleMC = [](float x, const float pars[6]) {
1354+
float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4];
1355+
if(core<0.0f){
1356+
return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN
1357+
}
13461358
return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]);
13471359
};
13481360

0 commit comments

Comments
 (0)