Skip to content
Snippets Groups Projects
Commit 54dcf463 authored by Andre Sailer's avatar Andre Sailer
Browse files

HepMCFileReader: set_run_info only in latest HepMC

parent 76f24549
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "DDG4/RunParameters.h" #include "DDG4/RunParameters.h"
#include <HepMC3/ReaderFactory.h> #include <HepMC3/ReaderFactory.h>
#include <HepMC3/Version.h>
/// Namespace for the AIDA detector description toolkit /// Namespace for the AIDA detector description toolkit
namespace dd4hep { namespace dd4hep {
...@@ -127,6 +128,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam) ...@@ -127,6 +128,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam)
{ {
printout(INFO,"HEPMC3FileReader","Created file reader. Try to open input %s", nam.c_str()); printout(INFO,"HEPMC3FileReader","Created file reader. Try to open input %s", nam.c_str());
m_reader = HepMC3::deduce_reader(nam); 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 // to get the runInfo in the Ascii reader we have to force HepMC to read the first event
m_reader->skip(1); m_reader->skip(1);
// then we get the run info (shared pointer) // then we get the run info (shared pointer)
...@@ -137,6 +139,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam) ...@@ -137,6 +139,7 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam)
m_reader = HepMC3::deduce_reader(nam); m_reader = HepMC3::deduce_reader(nam);
// and set the run info object now // and set the run info object now
m_reader->set_run_info(runInfo); m_reader->set_run_info(runInfo);
#endif
m_directAccess = false; m_directAccess = false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment