diff --git a/DDG4/hepmc/HepMC3FileReader.cpp b/DDG4/hepmc/HepMC3FileReader.cpp index 9e0f36daf..d2711c817 100644 --- a/DDG4/hepmc/HepMC3FileReader.cpp +++ b/DDG4/hepmc/HepMC3FileReader.cpp @@ -130,7 +130,8 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& 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 - m_reader->skip(1); + HepMC3::GenEvent dummy; + m_reader->read_event(dummy); // then we get the run info (shared pointer) auto runInfo = m_reader->run_info(); // and deallocate the reader