Beispiel #1
0
######################################################################
#
#  standard steering file for ILD simulation
#
#
#
######################################################################
from DDSim.DD4hepSimulation import DD4hepSimulation
from g4units import m, mm, GeV, MeV, rad
import os

SIM = DD4hepSimulation()

## The compact XML file
SIM.compactFile = ""
## Lorentz boost for the crossing angle, in radian!
SIM.crossingAngleBoost = 7.e-3 * rad
SIM.enableDetailedShowerMode = True
SIM.enableG4GPS = False
SIM.enableG4Gun = False
SIM.enableGun = False
## InputFiles for simulation .stdhep, .slcio, .HEPEvt, .hepevt, .hepmc, .pairs files are supported
SIM.inputFiles = []
## Macro file to execute for runType 'run' or 'vis'
SIM.macroFile = ""
## number of events to simulate, used in batch mode
SIM.numberOfEvents = 3
## Outputfile from the simulation,only lcio output is supported
SIM.outputFile = "dummyOutput.slcio"
## Physics list to use in simulation
SIM.physicsList = None
Beispiel #2
0
DD4hep simulation with some argument parsing
Based on M. Frank and F. Gaede runSim.py
   @author  A.Sailer
   @version 0.1

"""
from __future__ import absolute_import, unicode_literals
import logging
import sys

from DDSim.DD4hepSimulation import DD4hepSimulation

if __name__ == "__main__":
    logging.basicConfig(format='%(name)-16s %(levelname)s %(message)s',
                        level=logging.INFO,
                        stream=sys.stdout)
    logger = logging.getLogger('DDSim')

    RUNNER = DD4hepSimulation()
    RUNNER.parseOptions()

    try:
        RUNNER.run()
    except NameError as e:
        if "global name" in str(e):
            globalToSet = str(e).split("'")[1]
            logger.fatal(
                "Unknown global variable, please add\nglobal %s\nto your steeringFile"
                % globalToSet)