Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
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
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:22
RHadronsConfig.RHadronsCfg
def RHadronsCfg(flags)
Definition: RHadronsConfig.py:52