From cc4c4c54d68052f37352b2ef9f0a867be37f0e85 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Thu, 10 Nov 2022 09:15:13 -0600
Subject: [PATCH] fix: __checkFileFormat for any hepmc3 filenames

---
 DDG4/python/DDSim/DD4hepSimulation.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDG4/python/DDSim/DD4hepSimulation.py b/DDG4/python/DDSim/DD4hepSimulation.py
index 6643aaac7..6f8815498 100644
--- a/DDG4/python/DDSim/DD4hepSimulation.py
+++ b/DDG4/python/DDSim/DD4hepSimulation.py
@@ -527,7 +527,7 @@ class DD4hepSimulation(object):
       fileNames = [fileNames]
     if not all(fileName.endswith(extensions) for fileName in fileNames):
       self._errorMessages.append("ERROR: Unknown fileformat for file: %s" % fileNames)
-    if not self.hepmc3.useHepMC3 and fileName.endswith(".hepmc3"):
+    if not self.hepmc3.useHepMC3 and any(fileName.endswith(".hepmc3") for fileName in fileNames):
       self._errorMessages.append("ERROR: HepMC3 files require the use of HepMC3 library")
     return fileNames
 
-- 
GitLab