2 from G4AtlasServices.G4AtlasServicesConfig
import DetectorGeometrySvcCfg, PhysicsListSvcCfg
3 from ISF_Services.ISF_ServicesConfig
import TruthServiceCfg, InputConverterCfg
4 from ISF_Services.ISF_ServicesCoreConfig
import GeoIDSvcCfg
5 from G4AtlasTools.G4AtlasToolsConfig
import SensitiveDetectorMasterToolCfg, FastSimulationMasterToolCfg, SimHitContainerListCfg, InputContainerListCfg
6 from G4AtlasServices.G4AtlasUserActionConfig
import UserActionSvcCfg
7 from SimulationConfig.SimulationMetadata
import writeSimulationParametersMetadata, readSimulationParameters
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
13 """Return ComponentAccumulator configured for Atlas G4 simulation, without output"""
16 from SimulationConfig.SimEnums
import LArParameterization
17 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
20 result.addEventAlgo(CompFactory.G4AtlasAlg(name, **kwargs))
21 kwargs.setdefault(
"UseShadowEvent", flags.Sim.UseShadowEvent)
22 if flags.Sim.UseShadowEvent
and "TruthPreselectionTool" not in kwargs:
23 from ISF_HepMC_Tools.ISF_HepMC_ToolsConfig
import TruthPreselectionToolCfg
28 kwargs.setdefault(
"InputTruthCollection",
"BeamTruthEvent")
29 kwargs.setdefault(
"OutputTruthCollection",
"TruthEvent")
33 kwargs.setdefault(
"ReleaseGeoModel", flags.Sim.ReleaseGeoModel)
38 if flags.Sim.LArParameterization
is LArParameterization.FastCaloSim
and flags.Sim.SimplifiedGeoPath:
39 kwargs.setdefault(
"SimplifiedGeoPath", flags.Sim.SimplifiedGeoPath)
42 kwargs.setdefault(
"RecordFlux", flags.Sim.RecordFlux)
44 if flags.Sim.FlagAbortedEvents:
46 kwargs.setdefault(
"FlagAbortedEvents", flags.Sim.FlagAbortedEvents)
47 if flags.Sim.FlagAbortedEvents
and flags.Sim.KillAbortedEvents:
48 print(
"WARNING When G4AtlasAlg.FlagAbortedEvents is True G4AtlasAlg.KillAbortedEvents should be False. Setting G4AtlasAlg.KillAbortedEvents = False now.")
49 kwargs.setdefault(
"KillAbortedEvents",
False)
52 kwargs.setdefault(
"KillAbortedEvents", flags.Sim.KillAbortedEvents)
54 from RngComps.RngCompsConfig
import AthRNGSvcCfg
55 kwargs.setdefault(
"AtRndmGenSvc",
58 kwargs.setdefault(
"RandomGenerator",
"athena")
61 is_hive = flags.Concurrency.NumThreads > 0
62 kwargs.setdefault(
"MultiThreading", is_hive)
64 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
66 kwargs.setdefault(
"TruthRecordService", result.getPrimaryAndMerge(
TruthServiceCfg(flags)).name)
67 kwargs.setdefault(
"GeoIDSvc", result.getPrimaryAndMerge(
GeoIDSvcCfg(flags)).name)
70 kwargs.setdefault(
"InputConverter", result.getPrimaryAndMerge(
InputConverterCfg(flags)).name)
71 if flags.Sim.ISF.Simulator.isQuasiStable():
72 from BeamEffects.BeamEffectsAlgConfig
import ZeroLifetimePositionerCfg
86 kwargs.setdefault(
"UserActionSvc", result.getPrimaryAndMerge(
UserActionSvcCfg(flags)).name)
89 kwargs.setdefault(
"PhysicsListSvc", result.getPrimaryAndMerge(
PhysicsListSvcCfg(flags)).name)
95 verbosities=dict(foo=
"bar")
96 kwargs.setdefault(
"Verbosities", verbosities)
97 kwargs.setdefault(
"QuietMode", flags.Exec.QuietMode)
100 kwargs.setdefault(
"G4Commands", flags.Sim.G4Commands)
101 from SimulationConfig.SimEnums
import CalibrationRun
102 if flags.Sim.CalibrationRun
in [CalibrationRun.LAr, CalibrationRun.LArTile, CalibrationRun.LArTileZDC]:
104 kwargs.setdefault(
"ExtraOutputs", [(
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitActive_DEAD' ), (
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitDeadMaterial_DEAD' ), (
'CaloCalibrationHitContainer' ,
'StoreGateSvc+LArCalibrationHitInactive_DEAD' )])
105 result.addEventAlgo(CompFactory.G4AtlasAlg(name, **kwargs))