diff --git a/packages/dd4hep/HepMC3FileReader-XRootD.patch b/packages/dd4hep/HepMC3FileReader-XRootD.patch deleted file mode 100644 index 8515d67e..00000000 --- a/packages/dd4hep/HepMC3FileReader-XRootD.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/DDG4/hepmc/HepMC3FileReader.cpp b/DDG4/hepmc/HepMC3FileReader.cpp -index b94897ab..07b5505f 100644 ---- a/DDG4/hepmc/HepMC3FileReader.cpp -+++ b/DDG4/hepmc/HepMC3FileReader.cpp -@@ -129,16 +129,18 @@ 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) -- auto runInfo = m_reader->run_info(); -- // and close the reader -- m_reader->close(); -- // so we can open the file again from the start -- m_reader = HepMC3::deduce_reader(nam); -- // and set the run info object now -- m_reader->set_run_info(runInfo); -+ if (nam.rfind(".root") != nam.size() - 5) { -+ // 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) -+ auto runInfo = m_reader->run_info(); -+ // and close the reader -+ m_reader->close(); -+ // so we can open the file again from the start -+ m_reader = HepMC3::deduce_reader(nam); -+ // and set the run info object now -+ m_reader->set_run_info(runInfo); -+ } - #endif - m_directAccess = false; - } diff --git a/packages/dd4hep/package.py b/packages/dd4hep/package.py index c24af7eb..1631acdb 100644 --- a/packages/dd4hep/package.py +++ b/packages/dd4hep/package.py @@ -6,7 +6,13 @@ class Dd4hep(BuiltinDd4hep): variant("frames", default=True, description="Use podio frames", when="@1.25.1") variant("frames", default=True, description="Use podio frames", when="@1.24") patch( - "HepMC3FileReader-XRootD.patch", + "https://github.com/AIDASoft/DD4hep/pull/1157/commits/1c79b1492373dd66b17ea2530a63ec434396afa9.patch?full_index=1", + sha256="e544cc11c7e1ac9ccacf6688f3d966e912b1a2e1a7460f7c16212a0a4df5b05e", + when="@=1.26", + ) + patch( + "https://github.com/AIDASoft/DD4hep/pull/1158/commits/fecf99a2732a3f6aafc5fbf0f4a05af5bac196f8.patch?full_index=1", + sha256="ecc8e5534a5c7e9a4e3008508e17646a578ce7a44897df514dfd2c9a449968b1", when="@=1.26", ) patch(