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 G4AtlasTools.G4AtlasToolsConfig import FastSimulationConstructorToolCfg
7 from ExtraParticles.ExtraParticlesConfig import ExtraParticlesPhysicsToolCfg
8 from SimulationConfig.SimEnums import CavernBackground
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 @AccumulatorCache
15 def PhysicsListSvcCfg(flags, name="PhysicsListSvc", **kwargs):
16  result = ComponentAccumulator()
17  PhysOptionList = [ result.popToolsAndMerge(G4StepLimitationToolCfg(flags)) ]
18  if flags.Sim.ISF.Simulator.isQuasiStable():
19  #Quasi stable particle simulation
20  PhysOptionList += [ result.popToolsAndMerge(ExtraParticlesPhysicsToolCfg(flags)) ] # FIXME more configuration required in this method
21  PhysOptionList += [ result.popToolsAndMerge(G4EMProcessesPhysicsToolCfg(flags)) ]
22  #PhysOptionList += flags.Sim.PhysicsOptions # FIXME Missing functionality
23  if flags.Detector.GeometryTRT:
24  PhysOptionList +=[ result.popToolsAndMerge(TRTPhysicsToolCfg(flags)) ]
25  if flags.Detector.GeometryLucid or flags.Detector.GeometryAFP or flags.Detector.GeometryZDC:
26  from LUCID_OpProcess.LUCID_OpProcessConfig import LucidPhysicsToolCfg
27  PhysOptionList +=[result.popToolsAndMerge(LucidPhysicsToolCfg(flags))]
28  kwargs.setdefault("PhysOption", PhysOptionList)
29  PhysDecaysList = []
30  kwargs.setdefault("PhysicsDecay", PhysDecaysList)
31  kwargs.setdefault("PhysicsList", flags.Sim.PhysicsList)
32  if 'PhysicsList' in kwargs:
33  if kwargs['PhysicsList'].endswith('_EMV') or kwargs['PhysicsList'].endswith('_EMX'):
34  raise RuntimeError( 'PhysicsList not allowed: '+kwargs['PhysicsList'] )
35 
36  kwargs.setdefault("GeneralCut", 1.)
37  if flags.Sim.CavernBackground not in [CavernBackground.Read, CavernBackground.Write]:
38  kwargs.setdefault("NeutronTimeCut", flags.Sim.NeutronTimeCut)
39  kwargs.setdefault("NeutronEnergyCut", flags.Sim.NeutronEnergyCut)
40  kwargs.setdefault("ApplyEMCuts", flags.Sim.ApplyEMCuts)
41  kwargs.setdefault("QuietMode", flags.Exec.QuietMode)
42 
43  #fast simulation constructor tool
44  kwargs.setdefault("FastSimConstructor", result.popToolsAndMerge(FastSimulationConstructorToolCfg(flags)))
45 
46 
49  """ --- ATLASSIM-3967 ---
50  these two options are replaced by SetNumberOfBinsPerDecade
51  which now controls both values.
52  """
53 
55  if flags.Sim.ISF.Simulator.usesFatras():
56  kwargs.setdefault("UnstableAntiNeutrons", True) # Fix for ATLASSIM-6634 - consider fixing for FullG4 also
57  result.addService(CompFactory.PhysicsListSvc(name, **kwargs), primary = True)
58  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
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:15
TRT_TR_ProcessConfig.TRTPhysicsToolCfg
def TRTPhysicsToolCfg(flags, name="TRTPhysicsTool", **kwargs)
Definition: TRT_TR_ProcessConfig.py:6
G4AtlasToolsConfig.FastSimulationConstructorToolCfg
def FastSimulationConstructorToolCfg(flags, **kwargs)
Definition: G4AtlasToolsConfig.py:74
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