ATLAS Offline Software
RHadronsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 
6 def SG_StepNtupleTool(flags, name="G4UA::SG_StepNtupleTool", **kwargs):
7  result = ComponentAccumulator()
8  if flags.Concurrency.NumThreads >1:
9  from AthenaCommon import Logging
10  log=Logging.logging.getLogger(name)
11  log.fatal(' Attempt to run '+name+' with more than one thread, which is not supported')
12  return False
13  # Get the PDG IDs for RHadrons
14  from RHadronMasses import offset_options
15  kwargs.setdefault('RHadronPDGIDList',offset_options.keys())
16 
19  result.setPrivateTools( CompFactory.G4UA__SG_StepNtupleTool(name, **kwargs) )
20  return result
21 
22 
23 def RHadronsPhysicsToolCfg(flags, name='RHadronsPhysicsTool', **kwargs):
24  result = ComponentAccumulator()
25  result.setPrivateTools( CompFactory.RHadronsPhysicsTool(name,**kwargs) )
26  return result
27 
28 
29 def RHadronsPreInclude(flags):
30  print ("Start of RHadronsPreInclude")
31  if 'Py8' not in flags.Input.GeneratorsInfo and 'Pythia8' not in flags.Input.GeneratorsInfo:
32  raise RuntimeError('Pythia8 not found in generator metadata - will abort')
33 
34 
37  from RHadrons.GeneratePythiaCommands_RHadrons import generatePythia8Commands
39  #buildGeneratorConfigurationFiles(flags)
40 
41  # Check for the presence of the other files needed at run-time
42  import os
43  if not os.path.isfile('ProcessList.txt'):
44  raise RuntimeError('ProcessList.txt (needed by G4ProcessHelper) is missing - will abort')
45  if not os.path.isfile('PhysicsConfiguration.txt'):
46  raise RuntimeError('PhysicsConfiguration.txt (needed by G4ProcessHelper) is missing - will abort')
47  if not os.path.isfile('PYTHIA8_COMMANDS.TXT'):
48  raise RuntimeError('PYTHIA8_COMMANDS.TXT (needed by Pythia8ForDecays) is missing - will abort')
49  print ("End of RHadronsPreInclude")
50 
51 
52 def RHadronsCfg(flags):
53  result = ComponentAccumulator()
54  print("Running RHadronsCfg")
55 
56  from AthenaConfiguration.Enums import ProductionStep
57  if flags.Common.ProductionStep == ProductionStep.Simulation:
58  from G4AtlasServices.G4AtlasServicesConfig import PhysicsListSvcCfg
59  result.merge(PhysicsListSvcCfg(flags))
60  physicsOptions = [ result.popToolsAndMerge(RHadronsPhysicsToolCfg(flags)) ]
61  result.getService("PhysicsListSvc").PhysOption += physicsOptions
62  return result
63 
64 def RHadrons_VerboseSelectorCfg(flags, name="G4UA::VerboseSelectorTool", **kwargs):
65  kwargs.setdefault('TargetEvent',1)
66  kwargs.setdefault('VerboseLevel',1)
67  kwargs.setdefault('TargetPdgIDs',
68  [
69  1000612,1000622,1000632,1000642,1000652,1006113,1006211,1006213,1006223,1006311,1006313,1006321,1006323,1006333,-1000612,-1000622,-1000632,-1000642,-1000652,-1006113,-1006211,-1006213,-1006223,-1006311,-1006313,-1006321,-1006323,-1006333
70  ])
71  from G4DebuggingTools.G4DebuggingToolsConfig import VerboseSelectorToolCfg
72  return VerboseSelectorToolCfg(flags, name, **kwargs)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.G4DebuggingToolsConfig.VerboseSelectorToolCfg
def VerboseSelectorToolCfg(flags, name="G4UA::VerboseSelectorTool", **kwargs)
Definition: G4DebuggingToolsConfig.py:9
RHadronsConfig.RHadronsPreInclude
def RHadronsPreInclude(flags)
Definition: RHadronsConfig.py:29
RHadronsConfig.SG_StepNtupleTool
def SG_StepNtupleTool(flags, name="G4UA::SG_StepNtupleTool", **kwargs)
Definition: RHadronsConfig.py:6
RHadronsConfig.RHadronsPhysicsToolCfg
def RHadronsPhysicsToolCfg(flags, name='RHadronsPhysicsTool', **kwargs)
Definition: RHadronsConfig.py:23
RHadronsConfig.RHadrons_VerboseSelectorCfg
def RHadrons_VerboseSelectorCfg(flags, name="G4UA::VerboseSelectorTool", **kwargs)
Definition: RHadronsConfig.py:64
GeneratePythiaCommands_RHadrons.generatePythia8Commands
def generatePythia8Commands(flags)
Definition: GeneratePythiaCommands_RHadrons.py:354
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
G4AtlasServicesConfig.PhysicsListSvcCfg
def PhysicsListSvcCfg(flags, name="PhysicsListSvc", **kwargs)
Definition: G4AtlasServicesConfig.py:14
RHadronsConfig.RHadronsCfg
def RHadronsCfg(flags)
Definition: RHadronsConfig.py:52