From b41b02297be406d3fbb41dadee720bb86c887c60 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 13 Jun 2024 14:35:10 +0200 Subject: [PATCH] Fix internal usage of deprecated labels --- utils/src/ParticleIDUtils.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/utils/src/ParticleIDUtils.cc b/utils/src/ParticleIDUtils.cc index 154b6b61d..15442c700 100644 --- a/utils/src/ParticleIDUtils.cc +++ b/utils/src/ParticleIDUtils.cc @@ -132,41 +132,44 @@ void PIDHandler::setAlgoInfo(podio::Frame& metadata, edm4hep::ParticleIDCollecti void PIDHandler::setAlgoInfo(podio::Frame& metadata, const std::string& collName, const edm4hep::utils::ParticleIDMeta& pidMetaInfo) { - metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoName), pidMetaInfo.algoName); - metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoType), pidMetaInfo.algoType()); - metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::pidParameterNames), pidMetaInfo.paramNames); + metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoName), pidMetaInfo.algoName); + metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoType), pidMetaInfo.algoType()); + metadata.putParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDParameterNames), + pidMetaInfo.paramNames); } std::optional PIDHandler::getAlgoInfo(const podio::Frame& metadata, const std::string& collName) { #if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0) - auto maybeAlgoName = metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoName)); + auto maybeAlgoName = + metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoName)); if (!maybeAlgoName.has_value()) { return std::nullopt; } ParticleIDMeta pidInfo{ std::move(maybeAlgoName.value()), - metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoType)).value(), + metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoType)).value(), metadata - .getParameter>(podio::collMetadataParamName(collName, edm4hep::pidParameterNames)) + .getParameter>( + podio::collMetadataParamName(collName, edm4hep::labels::PIDParameterNames)) .value()}; #else const auto& algoName = - metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoName)); + metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoName)); // Use the algoName as proxy to see whether we could actually get the // information from the metadata if (algoName.empty()) { return std::nullopt; } - ParticleIDMeta pidInfo{algoName, - metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::pidAlgoType)), - metadata.getParameter>( - podio::collMetadataParamName(collName, edm4hep::pidParameterNames))}; + ParticleIDMeta pidInfo{ + algoName, metadata.getParameter(podio::collMetadataParamName(collName, edm4hep::labels::PIDAlgoType)), + metadata.getParameter>( + podio::collMetadataParamName(collName, edm4hep::labels::PIDParameterNames))}; #endif return pidInfo;