Skip to content

Commit cc45089

Browse files
authored
[PWGHF] add protection in case of non filled metadata (#8304)
1 parent 159c23d commit cc45089

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

PWGHF/TableProducer/mcPidTof.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
/// \brief Task to produce PID tables for TOF split for pi, K, p, copied from https://github.com/AliceO2Group/O2Physics/blob/master/Common/TableProducer/PID/pidTofMerge.cxx
1616
/// It works only for MC and adds the possibility to apply postcalibrations for MC.
1717
///
18+
19+
#include <map>
1820
#include <utility>
1921
#include <vector>
2022
#include <string>
@@ -822,7 +824,12 @@ struct mcPidTof {
822824
void retrieveMcPostCalibFromCcdb(int64_t timestamp)
823825
{
824826
std::map<std::string, std::string> metadata;
825-
metadata["RecoPassName"] = metadataInfo.get("AnchorPassName");
827+
if (metadataInfo.isFullyDefined()) {
828+
metadata["RecoPassName"] = metadataInfo.get("AnchorPassName");
829+
} else {
830+
LOGP(error, "Impossible to read metadata! Using default calibrations (2022 apass7)");
831+
metadata["RecoPassName"] = "";
832+
}
826833
auto calibList = ccdb->getSpecific<TList>(mcRecalib.ccdbPath, timestamp, metadata);
827834
std::vector<int> updatedSpecies{};
828835
for (auto const& pidId : mEnabledParticles) { // Loop on enabled particle hypotheses (tiny)

0 commit comments

Comments
 (0)