Skip to content

Commit

Permalink
Make framework alg properly take into account configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Dec 3, 2024
1 parent 25a7e82 commit 0c07600
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions framework/k4SimDelphes/src/k4SimDelphesAlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ StatusCode k4SimDelphesAlg::initialize() {
m_eventDataSvc.retrieve().ignore();
m_podioDataSvc = dynamic_cast<PodioDataSvc*>(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<k4SimDelphes::DelphesEDM4HepConverter>(
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<k4SimDelphes::DelphesEDM4HepConverter>(
branches, m_outputConfig, m_confReader->GetDouble("ParticlePropagator::Bz", 0));

return StatusCode::SUCCESS;
}
Expand Down Expand Up @@ -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<podio::CollectionBase>* wrapper = new DataWrapper<podio::CollectionBase>();
wrapper->setData(new_c);
Expand Down
1 change: 1 addition & 0 deletions framework/k4SimDelphes/src/k4SimDelphesAlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class k4SimDelphesAlg : public Gaudi::Algorithm {
Gaudi::Property<std::string> m_DelphesOutputSettings{
this, "DelphesOutputSettings", "", "Name of config file with k4simdelphes specific output settings"};

k4SimDelphes::OutputSettings m_outputConfig{};
std::unique_ptr<Delphes> m_Delphes{nullptr};
std::unique_ptr<ExRootConfReader> m_confReader{nullptr};
std::unique_ptr<k4SimDelphes::DelphesEDM4HepConverter> m_edm4hepConverter{nullptr};
Expand Down

0 comments on commit 0c07600

Please sign in to comment.