Beispiel #1
0
savehisttool.genVertices.Path = "SimVertices"
geant_output_tool_list += [savehisttool]

from Configurables import SimG4SaveTrackerHits
savetrackertool = SimG4SaveTrackerHits("saveTrackerHits")
savetrackertool.readoutNames = [
    "TrackerBarrelReadout",
    "TrackerEndcapReadout",
]
savetrackertool.positionedTrackHits.Path = "TrackerHitsPosition"
savetrackertool.trackHits.Path = "TrackerHits"
savetrackertool.digiTrackHits.Path = "TrackerHitsDigiPostPoint"
geant_output_tool_list += [savetrackertool]

from Configurables import SimG4FullSimActions
actions = SimG4FullSimActions()
actions.enableHistory = True

# set up output tools for included detectors
# the algorithm itself is configured in the sim file
from Configurables import SimG4Alg
geantsim = SimG4Alg("SimG4Alg")
geantsim.outputs += geant_output_tool_list

from Configurables import SimG4ConstantMagneticFieldTool
field = SimG4ConstantMagneticFieldTool("bField")
field.FieldOn = True
field.FieldZMax = 20 * units.m
field.IntegratorStepper = "ClassicalRK4"

from Configurables import SimG4DD4hepDetector
Beispiel #2
0
    'Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
    'Detector/DetFCChhTrackerTkLayout/compact/Tracker.xml',
]
geoservice.detectors = [os.path.join(path_to_detectors, d) for d in detectors]
geoservice.OutputLevel = INFO
ApplicationMgr().ExtSvc += [geoservice]

# Geant4 service
# Configures the Geant simulation: geometry, physics list and user actions
from Configurables import SimG4Svc
# giving the names of tools will initialize the tools of that type
geantservice = SimG4Svc("SimG4Svc")
geantservice.detector = "SimG4DD4hepDetector"
geantservice.physicslist = "SimG4FtfpBert"
from Configurables import SimG4FullSimActions
geantservice.actions = SimG4FullSimActions()
geantservice.actions.enableHistory = True
from Configurables import SimG4ConstantMagneticFieldTool
geantservice.magneticField = SimG4ConstantMagneticFieldTool(
    "SimG4ConstantMagneticFieldTool")
geantservice.magneticField.FieldOn = True
geantservice.magneticField.IntegratorStepper = "ClassicalRK4"

ApplicationMgr().ExtSvc += [geantservice]

# Geant4 algorithm
# Translates EDM to G4Event, passes the event to G4, writes out outputs via tools
from Configurables import SimG4Alg
geantsim = SimG4Alg("SimG4Alg")
from Configurables import SimG4SaveParticleHistory
savehisttool = SimG4SaveParticleHistory("saveHistory")