ATLAS Offline Software
TestBeamConfigFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 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.Xbeam", -27500)
19  tbcf.addFlag("TestBeam.Ybeam", [-20,20])
20  tbcf.addFlag("TestBeam.Zbeam", [-15,15])
21  tbcf.addFlag("TestBeam.Tbeam", -27500)
22 
23  return tbcf
24 
25 
26 def testBeamRunArgsToFlags(runArgs, flags):
27  if hasattr(runArgs,"Eta") and ( hasattr(runArgs,"Theta") or hasattr(runArgs,"Z") ):
28  raise RuntimeError("Eta cannot be specified at the same time as Theta and Z.")
29 
30  if hasattr(runArgs,"Eta"):
31  flags.TestBeam.Eta = runArgs.Eta
32 
33  if hasattr(runArgs,"Theta") or hasattr(runArgs,"Z"):
34  if hasattr(runArgs,"Theta"):
35  flags.TestBeam.Theta = runArgs.Theta
36  else:
37  # Z specified on the commmand-line without Theta
38  flags.TestBeam.Theta=90
39 
40  if hasattr(runArgs,"Z"):
41  flags.TestBeam.Z = runArgs.Z
42  else:
43  # Theta specified on the commmand-line without Z
44  flags.TestBeam.Z = 2550.0
45 
46  if hasattr(runArgs,"Phi"):
47  flags.TestBeam.Phi=runArgs.Phi
48 
49  if hasattr(runArgs,"Y"):
50  flags.TestBeam.Y=runArgs.Y
python.TestBeamConfigFlags.testBeamRunArgsToFlags
def testBeamRunArgsToFlags(runArgs, flags)
Definition: TestBeamConfigFlags.py:26
python.TestBeamConfigFlags.createTestBeamConfigFlags
def createTestBeamConfigFlags()
Definition: TestBeamConfigFlags.py:7