Skip to content
Merged
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
33 changes: 23 additions & 10 deletions Common/Tools/Multiplicity/MultModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@
internalOpts.mEnabledTables.resize(nTablesConst, 0);

LOGF(info, "Configuring tables to generate");
LOGF(info, "Metadata information: isMC? %i", metadataInfo.isMC());
const auto& workflows = context.services().template get<o2::framework::RunningWorkflowInfo const>();

TString listOfRequestors[nTablesConst];
Expand Down Expand Up @@ -505,16 +506,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 +579,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 582 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 584 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 +685,7 @@
auto amplitude = fv0.amplitude()[ii];
auto channel = fv0.channel()[ii];
mults.multFV0A += amplitude;
if (channel > 7) {

Check failure on line 688 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 +762,7 @@
//_______________________________________________________________________
// vertex-Z equalized signals
if (internalOpts.mEnabledTables[kFV0MultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 765 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 +770,7 @@
cursors.tableFV0Zeqs(mults.multFV0AZeq);
}
if (internalOpts.mEnabledTables[kFT0MultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 773 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 +780,7 @@
cursors.tableFT0Zeqs(mults.multFT0AZeq, mults.multFT0CZeq);
}
if (internalOpts.mEnabledTables[kFDDMultZeqs]) {
if (std::fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check failure on line 783 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 +807,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 810 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 812 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 +844,10 @@
}
mults.multNbrContribsEta10GlobalTrackWoDCA++;

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

Check failure on line 847 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 850 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 +1136,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 +1263,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 +1352,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