Skip to content
Closed
Changes from 2 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
32 changes: 22 additions & 10 deletions Common/Tools/Multiplicity/MultModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,6 @@
listOfRequestors[kPVMults].Append(Form("%s ", "dependency check"));
}

// capture the need for PYTHIA calibration in Pb-Pb runs
if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) {
internalOpts.generatorName.value = "PYTHIA";
}

// capture the need for PYTHIA calibration in light ion runs automatically
if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) {
internalOpts.generatorName.value = "PYTHIA";
}

// list enabled tables
for (int i = 0; i < nTablesConst; i++) {
// printout to be improved in the future
Expand Down Expand Up @@ -588,9 +578,9 @@
if (internalOpts.mEnabledTables[kPVMults]) {
if (std::abs(track.eta()) < 1.0) {
mults.multNContribsEta1++; // pvmults
if (std::abs(track.eta()) < 0.8) {

Check failure on line 581 in Common/Tools/Multiplicity/MultModule.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.
mults.multNContribs++; // pvmults
if (std::abs(track.eta()) < 0.5) {

Check failure on line 583 in Common/Tools/Multiplicity/MultModule.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.
mults.multNContribsEtaHalf++; // pvmults
}
}
Expand Down Expand Up @@ -694,7 +684,7 @@
auto amplitude = fv0.amplitude()[ii];
auto channel = fv0.channel()[ii];
mults.multFV0A += amplitude;
if (channel > 7) {

Check failure on line 687 in Common/Tools/Multiplicity/MultModule.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.
mults.multFV0AOuter += amplitude;
}
}
Expand Down Expand Up @@ -771,7 +761,7 @@
//_______________________________________________________________________
// vertex-Z equalized signals
if (internalOpts.mEnabledTables[kFV0MultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 764 in Common/Tools/Multiplicity/MultModule.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.
mults.multFV0AZeq = hVtxZFV0A->Interpolate(0.0) * mults.multFV0A / hVtxZFV0A->Interpolate(collision.posZ());
} else {
mults.multFV0AZeq = 0.0f;
Expand All @@ -779,7 +769,7 @@
cursors.tableFV0Zeqs(mults.multFV0AZeq);
}
if (internalOpts.mEnabledTables[kFT0MultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 772 in Common/Tools/Multiplicity/MultModule.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.
mults.multFT0AZeq = hVtxZFT0A->Interpolate(0.0) * mults.multFT0A / hVtxZFT0A->Interpolate(collision.posZ());
mults.multFT0CZeq = hVtxZFT0C->Interpolate(0.0) * mults.multFT0C / hVtxZFT0C->Interpolate(collision.posZ());
} else {
Expand All @@ -789,7 +779,7 @@
cursors.tableFT0Zeqs(mults.multFT0AZeq, mults.multFT0CZeq);
}
if (internalOpts.mEnabledTables[kFDDMultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 782 in Common/Tools/Multiplicity/MultModule.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.
mults.multFDDAZeq = hVtxZFDDA->Interpolate(0.0) * mults.multFDDA / hVtxZFDDA->Interpolate(collision.posZ());
mults.multFDDCZeq = hVtxZFDDC->Interpolate(0.0) * mults.multFDDC / hVtxZFDDC->Interpolate(collision.posZ());
} else {
Expand All @@ -816,9 +806,9 @@
if (track.isPVContributor()) {
if (std::abs(track.eta()) < 1.0) {
mults.multNContribsEta1++; // pvmults
if (std::abs(track.eta()) < 0.8) {

Check failure on line 809 in Common/Tools/Multiplicity/MultModule.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.
mults.multNContribs++; // pvmults
if (std::abs(track.eta()) < 0.5) {

Check failure on line 811 in Common/Tools/Multiplicity/MultModule.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.
mults.multNContribsEtaHalf++; // pvmults
}
}
Expand Down Expand Up @@ -853,10 +843,10 @@
}
mults.multNbrContribsEta10GlobalTrackWoDCA++;

if (std::abs(track.eta()) < 0.8) {

Check failure on line 846 in Common/Tools/Multiplicity/MultModule.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.
mults.multNbrContribsEta08GlobalTrackWoDCA++;
}
if (std::abs(track.eta()) < 0.5) {

Check failure on line 849 in Common/Tools/Multiplicity/MultModule.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.
mults.multNbrContribsEta05GlobalTrackWoDCA++;
}
}
Expand Down Expand Up @@ -1145,6 +1135,20 @@
{
if (bc.runNumber() != mRunNumberCentrality) {
mRunNumberCentrality = bc.runNumber(); // mark that this run has been attempted already regardless of outcome
LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber());

// capture the need for PYTHIA calibration in Pb-Pb runs
if (metadataInfo.isMC() && mRunNumber >= 544013 && mRunNumber <= 545367) {
LOGF(info, "This is MC for Pb-Pb. Setting generatorName automatically to PYTHIA");
internalOpts.generatorName.value = "PYTHIA";
}

// capture the need for PYTHIA calibration in light ion runs automatically
if (metadataInfo.isMC() && mRunNumber >= 564250 && mRunNumber <= 564472) {
LOGF(info, "This is MC for light ion runs. Setting generatorName automatically to PYTHIA");
internalOpts.generatorName.value = "PYTHIA";
}

LOGF(info, "centrality loading procedure for timestamp=%llu, run number=%d", bc.timestamp(), bc.runNumber());
TList* callst = nullptr;
// Check if the ccdb path is a root file
Expand Down Expand Up @@ -1258,6 +1262,10 @@
auto populateTable = [&](auto& table, struct CalibrationInfo& estimator, float multiplicity, bool isInelGt0) {
const bool assignOutOfRange = internalOpts.embedINELgtZEROselection && !isInelGt0;
auto scaleMC = [](float x, const float pars[6]) {
float core = ((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4];
if (core < 0.0f) {
return 0.0f; // this should be marked as low multiplicity and not mapped, core^pars[5] would be NaN
}
return std::pow(((pars[0] + pars[1] * std::pow(x, pars[2])) - pars[3]) / pars[4], 1.0f / pars[5]);
};

Expand Down Expand Up @@ -1343,6 +1351,10 @@
ConfigureCentralityRun2(ccdb, metadataInfo, firstbc);

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

Expand Down
Loading