ATLAS Offline Software
G4AtlasServicesConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
5 
6 from ExtraParticles.ExtraParticlesConfig import ExtraParticlesPhysicsToolCfg
7 from SimulationConfig.SimEnums import CavernBackground
8 from G4AtlasTools.G4GeometryToolConfig import G4AtlasDetectorConstructionToolCfg
9 from G4ExtraProcesses.G4ExtraProcessesConfig import G4EMProcessesPhysicsToolCfg
10 from G4StepLimitation.G4StepLimitationConfig import G4StepLimitationToolCfg
11 from TRT_TR_Process.TRT_TR_ProcessConfig import TRTPhysicsToolCfg
12 
13 
14 def DetectorGeometrySvcCfg(flags, name="DetectorGeometrySvc", **kwargs):
15  result = ComponentAccumulator()
16  kwargs.setdefault("DetectorConstruction", result.addPublicTool(result.popToolsAndMerge(G4AtlasDetectorConstructionToolCfg(flags))))
17  result.addService(CompFactory.DetectorGeometrySvc(name, **kwargs), primary = True)
18  return result
19 
20 
21 @AccumulatorCache
22 def PhysicsListSvcCfg(flags, name="PhysicsListSvc", **kwargs):
23  result = ComponentAccumulator()
24  PhysOptionList = [ result.popToolsAndMerge(G4StepLimitationToolCfg(flags)) ]
25  if flags.Sim.ISF.Simulator.isQuasiStable():
26  #Quasi stable particle simulation
27  PhysOptionList += [ result.popToolsAndMerge(ExtraParticlesPhysicsToolCfg(flags)) ] # FIXME more configuration required in this method
28  PhysOptionList += [ result.popToolsAndMerge(G4EMProcessesPhysicsToolCfg(flags)) ]
29  #PhysOptionList += flags.Sim.PhysicsOptions # FIXME Missing functionality
30  if flags.Detector.GeometryTRT:
31  PhysOptionList +=[ result.popToolsAndMerge(TRTPhysicsToolCfg(flags)) ]
32  if flags.Detector.GeometryLucid or flags.Detector.GeometryAFP or flags.Detector.GeometryZDC:
33  from LUCID_OpProcess.LUCID_OpProcessConfig import LucidPhysicsToolCfg
34  PhysOptionList +=[result.popToolsAndMerge(LucidPhysicsToolCfg(flags))]
35  kwargs.setdefault("PhysOption", PhysOptionList)
36  PhysDecaysList = []
37  kwargs.setdefault("PhysicsDecay", PhysDecaysList)
38  kwargs.setdefault("PhysicsList", flags.Sim.PhysicsList)
39  if 'PhysicsList' in kwargs:
40  if kwargs['PhysicsList'].endswith('_EMV') or kwargs['PhysicsList'].endswith('_EMX'):
41  raise RuntimeError( 'PhysicsList not allowed: '+kwargs['PhysicsList'] )
42 
43  kwargs.setdefault("GeneralCut", 1.)
44  if flags.Sim.CavernBackground not in [CavernBackground.Read, CavernBackground.Write]:
45  kwargs.setdefault("NeutronTimeCut", flags.Sim.NeutronTimeCut)
46  kwargs.setdefault("NeutronEnergyCut", flags.Sim.NeutronEnergyCut)
47  kwargs.setdefault("ApplyEMCuts", flags.Sim.ApplyEMCuts)
48  kwargs.setdefault("QuietMode", flags.Exec.QuietMode)
49 
52  """ --- ATLASSIM-3967 ---
53  these two options are replaced by SetNumberOfBinsPerDecade
54  which now controls both values.
55  """
56 
58  if flags.Sim.ISF.Simulator.usesFatras():
59  kwargs.setdefault("UnstableAntiNeutrons", True) # Fix for ATLASSIM-6634 - consider fixing for FullG4 also
60  result.addService(CompFactory.PhysicsListSvc(name, **kwargs), primary = True)
61  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
G4AtlasServicesConfig.DetectorGeometrySvcCfg
def DetectorGeometrySvcCfg(flags, name="DetectorGeometrySvc", **kwargs)
Definition: G4AtlasServicesConfig.py:14
G4ExtraProcessesConfig.G4EMProcessesPhysicsToolCfg
def G4EMProcessesPhysicsToolCfg(flags, name="G4EMProcessesPhysicsTool", **kwargs)
Definition: G4ExtraProcessesConfig.py:6
ExtraParticlesConfig.ExtraParticlesPhysicsToolCfg
def ExtraParticlesPhysicsToolCfg(flags, name="ExtraParticlesPhysicsTool", **kwargs)
Definition: ExtraParticlesConfig.py:9
G4AtlasServicesConfig.PhysicsListSvcCfg
def PhysicsListSvcCfg(flags, name="PhysicsListSvc", **kwargs)
Definition: G4AtlasServicesConfig.py:22
TRT_TR_ProcessConfig.TRTPhysicsToolCfg
def TRTPhysicsToolCfg(flags, name="TRTPhysicsTool", **kwargs)
Definition: TRT_TR_ProcessConfig.py:6
G4GeometryToolConfig.G4AtlasDetectorConstructionToolCfg
def G4AtlasDetectorConstructionToolCfg(flags, name="G4AtlasDetectorConstructionTool", **kwargs)
Definition: G4GeometryToolConfig.py:702
LUCID_OpProcessConfig.LucidPhysicsToolCfg
def LucidPhysicsToolCfg(flags, name="LucidPhysicsTool", **kwargs)
Definition: LUCID_OpProcessConfig.py:5
G4StepLimitationConfig.G4StepLimitationToolCfg
def G4StepLimitationToolCfg(flags, name="G4StepLimitationTool", **kwargs)
Definition: G4StepLimitationConfig.py:6