1 """Geant4 services 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 AthenaConfiguration.Enums
import LHCPeriod
8 from ISF_Geant4Tools.ISF_Geant4ToolsConfig
import (
9 Geant4ToolCfg, FullGeant4ToolCfg, PassBackGeant4ToolCfg,
17 G4_DDDBEnvelopeDefSvc = CompFactory.DetDescrDBEnvelopeSvc(
"G4EnvelopeDefSvc")
18 G4_DDDBEnvelopeDefSvc.DBBeamPipeNode =
"BPipeEnvelopeG4"
19 G4_DDDBEnvelopeDefSvc.DBInDetNode =
"InDetEnvelopeG4" if flags.GeoModel.Run < LHCPeriod.Run4
else "ITkEnvelopeG4"
20 G4_DDDBEnvelopeDefSvc.DBCaloNode =
"CaloEnvelopeG4"
21 G4_DDDBEnvelopeDefSvc.DBMSNode =
"MuonEnvelopeG4"
22 G4_DDDBEnvelopeDefSvc.DBCavernNode =
"CavernEnvelopeG4"
23 result.addService(G4_DDDBEnvelopeDefSvc)
25 if "SimulatorTool" not in kwargs:
26 kwargs.setdefault(
"SimulatorTool", result.addPublicTool(result.popToolsAndMerge(
Geant4ToolCfg(flags))))
27 kwargs.setdefault(
"Identifier",
"Geant4")
28 result.addService(CompFactory.iGeant4.Geant4SimSvc(name, **kwargs), primary =
True)
34 if "SimulatorTool" not in kwargs:
35 kwargs.setdefault(
"SimulatorTool", result.addPublicTool(result.popToolsAndMerge(
FullGeant4ToolCfg(flags))))
36 svc = result.getPrimaryAndMerge(
Geant4SimCfg(flags, name, **kwargs))
37 result.addService(svc, primary =
True)
43 if "SimulatorTool" not in kwargs:
44 kwargs.setdefault(
"SimulatorTool", result.addPublicTool(result.popToolsAndMerge(
PassBackGeant4ToolCfg(flags))))
45 svc = result.getPrimaryAndMerge(
Geant4SimCfg(flags, name, **kwargs))
46 result.addService(svc, primary =
True)
52 kwargs.setdefault(
"SimulatorTool", result.addPublicTool(result.popToolsAndMerge(
ATLFAST_Geant4ToolCfg(flags))))
54 result.addService(svc, primary =
True)