ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileG4
TileAncillary
MuonWall
python
MuonWallConfig.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.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
7
def
MuonWallSDCfg
(flags, name="MuonWallSD", **kwargs):
8
result = ComponentAccumulator()
9
kwargs.setdefault(
"LogicalVolumeNames"
, [
'MuonWall::MuScintillatorLayer'
,
'S1::S1'
,
'S2::S2'
,
'S3::S3'
])
10
kwargs.setdefault(
"OutputCollectionNames"
, [
"TileTBHits"
])
11
result.setPrivateTools(CompFactory.MuonWallSDTool(name, **kwargs))
12
return
result
13
14
15
def
MuonWallToolCfg
(flags, name="MuonWall", **kwargs):
16
result = ComponentAccumulator()
17
kwargs.setdefault(
"DetectorName"
,
"MuonWall"
)
18
kwargs.setdefault(
"ZLength"
, 200.)
19
kwargs.setdefault(
"YLength"
, 400.)
20
kwargs.setdefault(
"XLength"
, 20.)
21
eta=0
22
theta=3.1415926
23
delta=0.0
24
zmax=2380.22441662
25
r=5115.0
26
z=0.0
27
import
math
28
if
(math.fabs(theta)<1.57):
29
z=r*math.tan(-theta)-delta
30
elif
(eta!=0):
31
z=r/math.tan(2*math.atan(math.exp(-eta)))
32
if
(z>zmax):
33
z=zmax
34
elif
(z<-zmax):
35
z=-zmax
36
kwargs.setdefault(
"OffsetX"
, r)
37
kwargs.setdefault(
"OffsetY"
, 0.0)
38
kwargs.setdefault(
"OffsetZ"
, z)
39
result.setPrivateTools(CompFactory.MuonWallTool(name, **kwargs))
40
return
result
41
42
43
def
MuonWallTileTBCfg
(flags, name="MuonWallTileTB", **kwargs):
44
# Check the consistency of the flags
45
if
flags.TestBeam.Eta !=
'NONE'
and
(flags.TestBeam.Theta !=
'NONE'
or
flags.TestBeam.Z !=
'NONE'
):
46
raise
ValueError(
'THE ETA PARAMETER CAN NOT BE SET TOGETHER WITH THETA AND Z'
)
47
elif
(flags.TestBeam.Theta ==
'NONE'
or
flags.TestBeam.Z ==
'NONE'
)
and
flags.TestBeam.Eta ==
'NONE'
:
48
raise
ValueError(
'THETA AND Z ARE NOT SET'
)
49
import
math
50
from
AthenaCommon
import
PhysicalConstants
51
if
flags.TestBeam.Eta !=
'NONE'
:
52
# Mode 1 -> User enters only eta
53
eta=flags.TestBeam.Eta
54
ThetaY=-(PhysicalConstants.pi*0.5)+2*math.atan(math.exp(-eta))
55
DeltaF=0.0
56
elif
not
(flags.TestBeam.Theta ==
'NONE'
or
flags.TestBeam.Z ==
'NONE'
):
57
theta=flags.TestBeam.Theta
58
z=flags.TestBeam.Z
59
eta=0.0
60
if
abs(theta) < 70.01:
61
# Mode 2 -> User enters theta!=+/-90 and Z
62
# Z is the distance from center of the module to the desired
63
# entrace point calculated at R=2290 (start of tilecal
64
# module)
65
ThetaY=math.radians(theta)
66
DeltaF=(2290.0*math.tan(-ThetaY)-z)
67
elif
abs(abs(theta)-90.0) < 0.01:
68
# Mode 3 -> User enters theta=(+/-)90 and Z
69
# Z is the distance from ATLAS center to corresponding
70
# tilerow
71
# e.g center of first tile row is at 2300 + 100/2 = 2350
72
sign=int(theta>0)*2-1
73
ThetaY=sign*math.radians(90.0)
74
DeltaF=0.0
75
else
:
76
print
(
'Tile table rotation: ERROR unknown rotation mode'
)
77
raise
ValueError(
'UNKNOWN MODE - NEITHER ETA NOR THETA AND Z ARE SET'
)
78
zmax=2380.22441662
79
r=5115.0
80
z=0.0
81
if
(math.fabs(ThetaY)<1.57):
82
z=r*math.tan(-ThetaY)-DeltaF
83
elif
(eta!=0):
84
z=r/math.tan(2*math.atan(math.exp(-eta)))
85
if
(z>zmax):
86
z=zmax
87
elif
(z<-zmax):
88
z=-zmax
89
kwargs.setdefault(
"OffsetX"
, r)
90
kwargs.setdefault(
"OffsetY"
, 0.0)
91
kwargs.setdefault(
"OffsetZ"
, z)
92
return
MuonWallToolCfg
(flags, name, **kwargs)
93
MuonWallConfig.MuonWallTileTBCfg
MuonWallTileTBCfg(flags, name="MuonWallTileTB", **kwargs)
Definition
MuonWallConfig.py:43
MuonWallConfig.MuonWallSDCfg
MuonWallSDCfg(flags, name="MuonWallSD", **kwargs)
Definition
MuonWallConfig.py:7
MuonWallConfig.MuonWallToolCfg
MuonWallToolCfg(flags, name="MuonWall", **kwargs)
Definition
MuonWallConfig.py:15
Generated on
for ATLAS Offline Software by
1.17.0