1 """Geant4 tools config for ISF with ComponentAccumulator
3 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from RngComps.RngCompsConfig
import AthRNGSvcCfg
8 from G4AtlasServices.G4AtlasServicesConfig
import (
9 DetectorGeometrySvcCfg, PhysicsListSvcCfg
11 from G4AtlasServices.G4AtlasUserActionConfig
import (
12 ISFUserActionSvcCfg, ISFFullUserActionSvcCfg,
13 ISFPassBackUserActionSvcCfg, ISF_ATLFAST_UserActionSvcCfg,
15 from G4AtlasTools.G4AtlasToolsConfig
import (
16 SensitiveDetectorMasterToolCfg, FastSimulationMasterToolCfg
18 from ISF_Services.ISF_ServicesConfig
import (
25 acc.setPrivateTools(CompFactory.iGeant4.G4RunManagerHelper(name, **kwargs))
33 kwargs.setdefault(
"RandomNumberService", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
36 if "InputConverter" not in kwargs.keys():
37 kwargs.setdefault(
"InputConverter", acc.getPrimaryAndMerge(
InputConverterCfg(flags)).name)
39 if "UserActionSvc" not in kwargs.keys():
42 kwargs.setdefault(
"RecordFlux", flags.Sim.RecordFlux)
44 kwargs.setdefault(
"QuietMode", flags.Exec.QuietMode)
46 kwargs.setdefault(
"MultiThreading", flags.Concurrency.NumThreads > 0)
48 kwargs.setdefault(
"G4Commands", flags.Sim.G4Commands)
49 kwargs.setdefault(
"PrintTimingInfo", flags.Sim.ISF.DoTimeMonitoring)
50 if "SenDetMasterTool" not in kwargs:
52 if "FastSimMasterTool" not in kwargs:
56 kwargs.setdefault(
"PhysicsListSvc", acc.getPrimaryAndMerge(
PhysicsListSvcCfg(flags)).name)
59 from SimulationConfig.SimEnums
import SimulationFlavour
60 if flags.Sim.ISF.Simulator
in [SimulationFlavour.ATLFAST3F_ACTSMT, SimulationFlavour.FullG4MT, SimulationFlavour.FullG4MT_QS, SimulationFlavour.PassBackG4MT, SimulationFlavour.ATLFAST3MT, SimulationFlavour.ATLFAST3MT_QS]:
61 acc.setPrivateTools(CompFactory.iGeant4.G4TransportTool(name, **kwargs))
63 kwargs.setdefault(
"G4RunManagerHelper", acc.addPublicTool(acc.popToolsAndMerge(
G4RunManagerHelperCfg(flags))))
64 acc.setPrivateTools(CompFactory.iGeant4.G4LegacyTransportTool(name, **kwargs))
71 FullGeant4Tool = acc.popToolsAndMerge(
Geant4ToolCfg(flags, name, **kwargs))
72 acc.setPrivateTools(FullGeant4Tool)
79 PassBackGeant4Tool = acc.popToolsAndMerge(
Geant4ToolCfg(flags, name, **kwargs))
80 acc.setPrivateTools(PassBackGeant4Tool)
87 PassBackGeant4Tool = acc.popToolsAndMerge(
Geant4ToolCfg(flags, name, **kwargs))
88 acc.setPrivateTools(PassBackGeant4Tool)