From 5adea1f0b27d670befabdd56e54fa6406979ddff Mon Sep 17 00:00:00 2001 From: Andre Sailer Date: Fri, 21 Jul 2023 11:35:37 +0200 Subject: [PATCH] HepMCFileReader: set_run_info only in latest HepMC --- DDG4/hepmc/HepMC3FileReader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DDG4/hepmc/HepMC3FileReader.cpp b/DDG4/hepmc/HepMC3FileReader.cpp index c723e394c..5df6ec6c8 100644 --- a/DDG4/hepmc/HepMC3FileReader.cpp +++ b/DDG4/hepmc/HepMC3FileReader.cpp @@ -30,6 +30,7 @@ #include "DDG4/RunParameters.h" #include +#include /// Namespace for the AIDA detector description toolkit namespace dd4hep { @@ -127,6 +128,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam) { printout(INFO,"HEPMC3FileReader","Created file reader. Try to open input %s", nam.c_str()); m_reader = HepMC3::deduce_reader(nam); +#if HEPMC3_VERSION_CODE >= 3002006 // to get the runInfo in the Ascii reader we have to force HepMC to read the first event m_reader->skip(1); // then we get the run info (shared pointer) @@ -137,6 +139,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam) m_reader = HepMC3::deduce_reader(nam); // and set the run info object now m_reader->set_run_info(runInfo); +#endif m_directAccess = false; }