diff --git a/DDG4/python/DDSim/Helper/Action.py b/DDG4/python/DDSim/Helper/Action.py index 0070cd2ee9e6ead498cd05aca80127d03054d494..2d17c9b05c495661a9fa68515f5748f546239467 100644 --- a/DDG4/python/DDSim/Helper/Action.py +++ b/DDG4/python/DDSim/Helper/Action.py @@ -160,8 +160,15 @@ or # creates: [ { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } ] val = [val] if isinstance(val, list): - # assumes: [ { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } ] - return val + if not val: + # empty list + return [] + if isinstance(val[0], str): + # assumes: [ "Geant4TestEventAction", "Geant4TestEventAction" ] + return [dict(name=v) for v in val] + if isinstance(val[0], dict): + # assumes: [ { "name": "Geant4TestEventAction", "parameter": {"Property_int": 10} } ] + return val raise RuntimeError("Commandline setting of action is not successful for: %s " % val) @property