From ddd4984b22ee648ea72709c8eb4d4ffce879840b Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Wed, 18 Dec 2024 15:19:03 +0100 Subject: [PATCH] ReadEDM4hep: simplify ingestion functions --- DDG4/edm4hep/EDM4hepFileReader.cpp | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/DDG4/edm4hep/EDM4hepFileReader.cpp b/DDG4/edm4hep/EDM4hepFileReader.cpp index cf81ac8c7..f21441fef 100644 --- a/DDG4/edm4hep/EDM4hepFileReader.cpp +++ b/DDG4/edm4hep/EDM4hepFileReader.cpp @@ -46,44 +46,34 @@ namespace dd4hep::sim { /// get the parameters from the GenericParameters of the input EDM4hep frame and store them in the EventParameters /// extension template void EventParameters::ingestParameters(T const& source) { - auto const& intKeys = source.template getKeys(); - for(auto const& key: intKeys) { + for(auto const& key: source.template getKeys()) { m_intValues[key] = source.template get>(key).value(); } - auto const& floatKeys = source.template getKeys(); - for(auto const& key: floatKeys) { + for(auto const& key: source.template getKeys()) { m_fltValues[key] = source.template get>(key).value(); } - auto const& doubleKeys = source.template getKeys(); - for(auto const& key: doubleKeys) { + for(auto const& key: source.template getKeys()) { m_dblValues[key] = source.template get>(key).value(); } - using std::string; - auto const& stringKeys = source.template getKeys(); - for(auto const& key: stringKeys) { - m_strValues[key] = source.template get>(key).value(); + for(auto const& key: source.template getKeys()) { + m_strValues[key] = source.template get>(key).value(); } } /// get the parameters from the GenericParameters of the input EDM4hep run frame and store them in the RunParameters /// extension template void RunParameters::ingestParameters(T const& source) { - auto const& intKeys = source.template getKeys(); - for(auto const& key: intKeys) { + for(auto const& key: source.template getKeys()) { m_intValues[key] = source.template get>(key).value(); } - auto const& floatKeys = source.template getKeys(); - for(auto const& key: floatKeys) { + for(auto const& key: source.template getKeys()) { m_fltValues[key] = source.template get>(key).value(); } - auto const& doubleKeys = source.template getKeys(); - for(auto const& key: doubleKeys) { + for(auto const& key: source.template getKeys()) { m_dblValues[key] = source.template get>(key).value(); } - using std::string; - auto const& stringKeys = source.template getKeys(); - for(auto const& key: stringKeys) { - m_strValues[key] = source.template get>(key).value(); + for(auto const& key: source.template getKeys()) { + m_strValues[key] = source.template get>(key).value(); } }