Skip to content

Commit

Permalink
Make EDM4hep output work with optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored and andresailer committed May 16, 2024
1 parent 9c40e89 commit 973dba9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DDG4/edm4hep/Geant4Output2EDM4hep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,11 @@ void Geant4Output2EDM4hep::saveEvent(OutputContext<G4Event>& ctxt) {
parameters->extractParameters(m_frame);
#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 16, 2)
// This functionality is only present in podio > 0.16.2
#if PODIO_BUILD_VERSION > PODIO_VERSION(0, 99, 0)
eventWeight = m_frame.getParameter<double>("EventWeights").value_or(0.0);
#else
eventWeight = m_frame.getParameter<double>("EventWeights");
#endif
#endif
} else { // ... or from DD4hep framework
runNumber = m_runNo + runNumberOffset;
Expand Down

0 comments on commit 973dba9

Please sign in to comment.