Skip to content

Commit e5b1a99

Browse files
authored
PWGHF: Fix application of postcalibrations for TOF Nsigma in MC (#8239)
1 parent 0014797 commit e5b1a99

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

PWGHF/TableProducer/mcPidTof.cxx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -747,11 +747,6 @@ struct mcPidTof {
747747
}
748748
hnSigmaFull[iSpecie] = histos.add<TH2>(Form("nSigmaFull/%s", particleNames[iSpecie].c_str()), Form("N_{#sigma}^{TOF}(%s)", particleNames[iSpecie].c_str()), kTH2F, {pAxis, nSigmaAxis});
749749
}
750-
751-
if (mcRecalib.enable && mTOFCalibConfig.collisionSystem() != CollisionSystemType::kCollSyspp) {
752-
LOGP(info, "Disabling MC recalibration, only available for pp");
753-
mcRecalib.enable.value = false;
754-
}
755750
}
756751

757752
// Reserves an empty table for the given particle ID with size of the given track table
@@ -829,7 +824,16 @@ struct mcPidTof {
829824
std::map<std::string, std::string> metadata;
830825
metadata["RecoPassName"] = metadataInfo.get("AnchorPassName");
831826
auto calibList = ccdb->getSpecific<TList>(mcRecalib.ccdbPath, timestamp, metadata);
832-
for (auto const& pidId : mEnabledParticles) { // Loop on enabled particle hypotheses
827+
std::vector<int> updatedSpecies{};
828+
for (auto const& pidId : mEnabledParticles) { // Loop on enabled particle hypotheses (tiny)
829+
gMcPostCalibMean[pidId] = reinterpret_cast<TGraph*>(calibList->FindObject(Form("Mean%s", particleNames[pidId].data())));
830+
gMcPostCalibSigma[pidId] = reinterpret_cast<TGraph*>(calibList->FindObject(Form("Sigma%s", particleNames[pidId].data())));
831+
updatedSpecies.push_back(pidId);
832+
}
833+
for (auto const& pidId : mEnabledParticlesFull) { // Loop on enabled particle hypotheses (full)
834+
if (std::find(updatedSpecies.begin(), updatedSpecies.end(), pidId) != updatedSpecies.end()) {
835+
continue;
836+
}
833837
gMcPostCalibMean[pidId] = reinterpret_cast<TGraph*>(calibList->FindObject(Form("Mean%s", particleNames[pidId].data())));
834838
gMcPostCalibSigma[pidId] = reinterpret_cast<TGraph*>(calibList->FindObject(Form("Sigma%s", particleNames[pidId].data())));
835839
}
@@ -887,6 +891,9 @@ struct mcPidTof {
887891
continue;
888892
}
889893
mTOFCalibConfig.processSetup(mRespParamsV3, ccdb, coll.bc_as<aod::BCsWithTimestamps>()); // Update the calibration parameters
894+
if (mcRecalib.enable && mTOFCalibConfig.collisionSystem() != CollisionSystemType::kCollSyspp) {
895+
LOGP(fatal, "MC recalibration only available for pp! Change the mcRecalib.enable configurable to 0 and rerun");
896+
}
890897
break;
891898
}
892899

0 commit comments

Comments
 (0)