Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix parameter conversion
Browse files Browse the repository at this point in the history
jmcarcell committed Jan 30, 2025
1 parent 7f7e4de commit 62689ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
#include <k4FWCore/DataHandle.h>
#include <k4FWCore/MetaDataHandle.h>
#include <k4FWCore/PodioDataSvc.h>
#include <k4FWCore/FunctionalUtils.h>

#include "GaudiKernel/AnyDataWrapper.h"

@@ -149,8 +150,14 @@ StatusCode Lcio2EDM4hepTool::convertCollections(lcio::LCEventImpl* the_event) {
if (m_podioDataSvc) {
LCIO2EDM4hepConv::convertObjectParameters(the_event, m_podioDataSvc->m_eventframe);
} else {
LCIO2EDM4hepConv::convertObjectParameters(
the_event, [](const std::string& key, const auto& value) { k4FWCore::putParameter(key, value); });
DataObject* p;
StatusCode code = m_eventDataSvc->retrieveObject("/Event" + k4FWCore::frameLocation, p);
if (code.isSuccess()) {
auto* frameWrapper = dynamic_cast<AnyDataWrapper<podio::Frame>*>(p);
LCIO2EDM4hepConv::convertObjectParameters(the_event, frameWrapper->getData());
} else {
warning() << "Could not retrieve the event frame; event parameters will not be converted" << endmsg;
}
}

// Convert Event Header outside the collections loop

0 comments on commit 62689ed

Please sign in to comment.