ATLAS Offline Software
TestBeamConfigFlags.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.AthConfigFlags import AthConfigFlags
4 
5 #todo? add in the explanatory text from previous implementation
6 
8  tbcf = AthConfigFlags()
9  tbcf.addFlag("TestBeam.Eta", 'NONE')
10  tbcf.addFlag("TestBeam.Theta", 'NONE')
11  tbcf.addFlag("TestBeam.Phi", 'NONE')
12  tbcf.addFlag("TestBeam.Y", 'NONE')
13  tbcf.addFlag("TestBeam.Z", 'NONE')
14  tbcf.addFlag("TestBeam.Layout", 'tb_Tile2000_2003_5B')
15  # Test Beam beam properties
16  tbcf.addFlag("TestBeam.BeamPID", 11)
17  tbcf.addFlag("TestBeam.BeamEnergy", 100000) # Just use Beam.Energy?
18  tbcf.addFlag("TestBeam.Ybeam", [-20,20])
19  tbcf.addFlag("TestBeam.Zbeam", [-15,15])
20 
21  return tbcf
22 
23 
24 def testBeamRunArgsToFlags(runArgs, flags):
25  if hasattr(runArgs,"Eta") and ( hasattr(runArgs,"Theta") or hasattr(runArgs,"Z") ):
26  raise RuntimeError("Eta cannot be specified at the same time as Theta and Z.")
27 
28  if hasattr(runArgs,"Eta"):
29  flags.TestBeam.Eta = runArgs.Eta
30 
31  if hasattr(runArgs,"Theta") or hasattr(runArgs,"Z"):
32  if hasattr(runArgs,"Theta"):
33  flags.TestBeam.Theta = runArgs.Theta
34  else:
35  # Z specified on the commmand-line without Theta
36  flags.TestBeam.Theta=90
37 
38  if hasattr(runArgs,"Z"):
39  flags.TestBeam.Z = runArgs.Z
40  else:
41  # Theta specified on the commmand-line without Z
42  flags.TestBeam.Z = 2550.0
43 
44  if hasattr(runArgs,"Phi"):
45  flags.TestBeam.Phi=runArgs.Phi
46 
47  if hasattr(runArgs,"Y"):
48  flags.TestBeam.Y=runArgs.Y
python.TestBeamConfigFlags.testBeamRunArgsToFlags
def testBeamRunArgsToFlags(runArgs, flags)
Definition: TestBeamConfigFlags.py:24
python.TestBeamConfigFlags.createTestBeamConfigFlags
def createTestBeamConfigFlags()
Definition: TestBeamConfigFlags.py:7