diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index 52ae2e2ebf4..6738cab46b9 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -737,6 +737,10 @@ struct mcPidTof { Configurable ccdbPath{"ccdbPath", "Users/f/fgrosa/RecalibmcPidTof/", "path for MC recalibration objects in CCDB"}; } mcRecalib; + // list of productions for which the postcalibrations must be turned off (FT0 digitisation fixed) + const std::vector prodNoPostCalib = {"LHC24h1c"}; + bool enableMcRecalib{false}; + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Running variables @@ -793,6 +797,8 @@ struct mcPidTof { } hnSigmaFull[iSpecie] = histos.add(Form("nSigmaFull/%s", particleNames[iSpecie].c_str()), Form("N_{#sigma}^{TOF}(%s)", particleNames[iSpecie].c_str()), kTH2F, {pAxis, nSigmaAxis}); } + + enableMcRecalib = mcRecalib.enable; } // Reserves an empty table for the given particle ID with size of the given track table @@ -870,6 +876,10 @@ struct mcPidTof { std::map metadata; if (metadataInfo.isFullyDefined()) { metadata["RecoPassName"] = metadataInfo.get("AnchorPassName"); + if (std::find(prodNoPostCalib.begin(), prodNoPostCalib.end(), metadataInfo.get("LPMProductionTag")) != prodNoPostCalib.end()) { + enableMcRecalib = false; + LOGP(warn, "Nsigma postcalibrations turned off for {} (new MC productions have FT0 digitisation fixed)", metadataInfo.get("LPMProductionTag")); + } } else { LOGP(error, "Impossible to read metadata! Using default calibrations (2022 apass7)"); metadata["RecoPassName"] = ""; @@ -956,7 +966,7 @@ struct mcPidTof { continue; } - if (mcRecalib.enable) { + if (enableMcRecalib) { auto runNumber = trk.collision().bc_as().runNumber(); if (runNumber != currentRun) { // update postcalibration files @@ -970,7 +980,7 @@ struct mcPidTof { switch (pidId) { case idxPi: { nSigma = responsePi.GetSeparation(mRespParamsV3, trk); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kPiPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); } @@ -980,7 +990,7 @@ struct mcPidTof { } case idxKa: { nSigma = responseKa.GetSeparation(mRespParamsV3, trk); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kKPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); } @@ -990,7 +1000,7 @@ struct mcPidTof { } case idxPr: { nSigma = responsePr.GetSeparation(mRespParamsV3, trk); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kProton) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); } @@ -1012,7 +1022,7 @@ struct mcPidTof { case idxPi: { resolution = responsePi.GetExpectedSigma(mRespParamsV3, trk); nSigma = responsePi.GetSeparation(mRespParamsV3, trk); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kPiPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); } @@ -1023,7 +1033,7 @@ struct mcPidTof { case idxKa: { resolution = responseKa.GetExpectedSigma(mRespParamsV3, trk); nSigma = responseKa.GetSeparation(mRespParamsV3, trk, resolution); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kKPlus) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); } @@ -1034,7 +1044,7 @@ struct mcPidTof { case idxPr: { resolution = responsePr.GetExpectedSigma(mRespParamsV3, trk); nSigma = responsePr.GetSeparation(mRespParamsV3, trk, resolution); - if (mcRecalib.enable && trk.has_mcParticle()) { + if (enableMcRecalib && trk.has_mcParticle()) { if (std::abs(trk.mcParticle().pdgCode()) == kProton) { // we rescale only true signal nSigma = applyMcRecalib(pidId, trk.pt(), nSigma); }