From 5c82aad8c12ea65c190bf133b6fe74417b0606cb Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Mon, 11 Jan 2016 15:19:02 +0000
Subject: [PATCH] DDSim: use different name for different GenAction when the
 same kind of inputfile is used multiple times

---
 DDSim/DD4hepSimulation.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/DDSim/DD4hepSimulation.py b/DDSim/DD4hepSimulation.py
index 720e978bb..85f5e263b 100644
--- a/DDSim/DD4hepSimulation.py
+++ b/DDSim/DD4hepSimulation.py
@@ -327,19 +327,19 @@ class DD4hepSimulation(object):
 
     for index,inputFile in enumerate(self.inputFiles, start=2):
       if inputFile.endswith(".slcio"):
-        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/LCIO1")
+        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/LCIO%d" % index)
         gen.Input="LCIOFileReader|"+inputFile
       elif inputFile.endswith(".stdhep"):
-        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/STDHEP1")
+        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/STDHEP%d" % index)
         gen.Input="LCIOStdHepReader|"+inputFile
       elif inputFile.endswith(".HEPEvt"):
-        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/HEPEvt1")
+        gen = DDG4.GeneratorAction(kernel,"LCIOInputAction/HEPEvt%d" % index)
         gen.Input="Geant4EventReaderHepEvtShort|"+inputFile
       elif inputFile.endswith(".hepevt"):
-        gen = DDG4.GeneratorAction(kernel,"Geant4InputAction/hepevt1")
+        gen = DDG4.GeneratorAction(kernel,"Geant4InputAction/hepevt%d" % index)
         gen.Input="Geant4EventReaderHepEvtLong|"+inputFile
       elif inputFile.endswith(".hepmc"):
-        gen = DDG4.GeneratorAction(kernel,"Geant4InputAction/hepmc1")
+        gen = DDG4.GeneratorAction(kernel,"Geant4InputAction/hepmc%d" % index)
         gen.Input="Geant4EventReaderHepMC|"+inputFile
       else:
         ##this should never happen because we already check at the top, but in case of some LogicError...
-- 
GitLab