Skip to content
Snippets Groups Projects
ddsim 762 B
Newer Older
#!/usr/bin/env python
"""

DD4hep simulation with some argument parsing
Based on M. Frank and F. Gaede runSim.py
   @author  A.Sailer
   @version 0.1

"""
from DDSim.DD4hepSimulation import DD4hepSimulation
#------------------------------------------------
Marko Petric's avatar
Marko Petric committed
from __future__ import absolute_import, unicode_literals

import logging

logging.basicConfig(format='%(levelname)s: %(message)s')
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

if __name__ == "__main__":
  RUNNER = DD4hepSimulation()
  RUNNER.parseOptions()
  try:
    RUNNER.run()
  except NameError as e:
    if "global name" in str(e):
      globalToSet = str(e).split("'")[1]
Marko Petric's avatar
Marko Petric committed
      logger.fatal("Unknown global variable, please add global %s to your steeringFile" % globalToSet)