From 0c07600b2cecd0818c8754c8bdfd9b2749edf658 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Tue, 3 Dec 2024 16:13:08 +0100 Subject: [PATCH] Make framework alg properly take into account configuration --- framework/k4SimDelphes/src/k4SimDelphesAlg.cpp | 10 +++++----- framework/k4SimDelphes/src/k4SimDelphesAlg.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/framework/k4SimDelphes/src/k4SimDelphesAlg.cpp b/framework/k4SimDelphes/src/k4SimDelphesAlg.cpp index 509f1bc..1313473 100644 --- a/framework/k4SimDelphes/src/k4SimDelphesAlg.cpp +++ b/framework/k4SimDelphes/src/k4SimDelphesAlg.cpp @@ -38,10 +38,10 @@ StatusCode k4SimDelphesAlg::initialize() { m_eventDataSvc.retrieve().ignore(); m_podioDataSvc = dynamic_cast(m_eventDataSvc.get()); - const auto branches = getBranchSettings(m_confReader->GetParam("TreeWriter::Branch")); - const auto outputSettings = getEDM4hepOutputSettings(m_DelphesOutputSettings.value().c_str()); - m_edm4hepConverter = std::make_unique( - branches, outputSettings, m_confReader->GetDouble("ParticlePropagator::Bz", 0)); + const auto branches = getBranchSettings(m_confReader->GetParam("TreeWriter::Branch")); + m_outputConfig = getEDM4hepOutputSettings(m_DelphesOutputSettings.value().c_str()); + m_edm4hepConverter = std::make_unique( + branches, m_outputConfig, m_confReader->GetDouble("ParticlePropagator::Bz", 0)); return StatusCode::SUCCESS; } @@ -70,7 +70,7 @@ StatusCode k4SimDelphesAlg::execute(const EventContext&) const { auto collections = m_edm4hepConverter->getCollections(); for (auto& c : collections) { - if (c.first == "MCRecoAssociations") { + if (c.first == m_outputConfig.RecoMCParticleLinkCollectionName) { auto new_c = m_edm4hepConverter->createExternalRecoMCLinks(mapSimDelphes); DataWrapper* wrapper = new DataWrapper(); wrapper->setData(new_c); diff --git a/framework/k4SimDelphes/src/k4SimDelphesAlg.h b/framework/k4SimDelphes/src/k4SimDelphesAlg.h index fa0b456..9f2826c 100644 --- a/framework/k4SimDelphes/src/k4SimDelphesAlg.h +++ b/framework/k4SimDelphes/src/k4SimDelphesAlg.h @@ -48,6 +48,7 @@ class k4SimDelphesAlg : public Gaudi::Algorithm { Gaudi::Property m_DelphesOutputSettings{ this, "DelphesOutputSettings", "", "Name of config file with k4simdelphes specific output settings"}; + k4SimDelphes::OutputSettings m_outputConfig{}; std::unique_ptr m_Delphes{nullptr}; std::unique_ptr m_confReader{nullptr}; std::unique_ptr m_edm4hepConverter{nullptr};