3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
13 kwargs.setdefault(
"DetectorName",
"BEAMPIPE1")
14 kwargs.setdefault(
"InnerRadius", 0.*mm)
15 kwargs.setdefault(
"OuterRadius", 100.*mm)
17 kwargs.setdefault(
"dZ", dz)
18 kwargs.setdefault(
"Material",
'Vacuum')
19 kwargs.setdefault(
"OffsetX",-12080.*mm-dz)
21 kwargs.setdefault(
"RotateY", math.radians(-90.))
22 result.setPrivateTools(CompFactory.CylindricalEnvelope(name, **kwargs))
28 kwargs.setdefault(
"DetectorName",
"BEAMPIPE2")
29 kwargs.setdefault(
"InnerRadius", 0.*mm)
30 kwargs.setdefault(
"OuterRadius", 100.*mm)
32 kwargs.setdefault(
"dZ", dz)
33 kwargs.setdefault(
"Material",
'Vacuum')
34 kwargs.setdefault(
"OffsetX",1945.*mm-dz)
36 kwargs.setdefault(
"RotateY", math.radians(-90.))
37 result.setPrivateTools(CompFactory.CylindricalEnvelope(name, **kwargs))
43 kwargs.setdefault(
"DetectorName",
"MYLAREQUIV")
44 kwargs.setdefault(
"InnerRadius", 0.*mm)
45 kwargs.setdefault(
"OuterRadius", 100.*mm)
47 kwargs.setdefault(
"dZ", dz)
48 kwargs.setdefault(
"Material",
'Mylar')
49 kwargs.setdefault(
"OffsetX",-12080*mm+dz)
51 kwargs.setdefault(
"RotateY", math.radians(-90.))
52 result.setPrivateTools(CompFactory.CylindricalEnvelope(name, **kwargs))
58 kwargs.setdefault(
"DetectorName",
"S1")
59 kwargs.setdefault(
"dX", 5.*mm)
60 kwargs.setdefault(
"dY", 52.5*mm)
61 kwargs.setdefault(
"dZ", 50.*mm)
62 kwargs.setdefault(
"Material",
'Scintillator')
63 kwargs.setdefault(
"OffsetX",-12074.6*mm)
64 result.setPrivateTools(CompFactory.BoxEnvelope(name, **kwargs))
70 kwargs.setdefault(
"DetectorName",
"S2")
71 kwargs.setdefault(
"dX", 10.*mm)
72 kwargs.setdefault(
"dY", 40.*mm)
73 kwargs.setdefault(
"dZ", 27.5*mm)
74 kwargs.setdefault(
"Material",
'Scintillator')
75 kwargs.setdefault(
"OffsetX",-11294.6*mm)
76 result.setPrivateTools(CompFactory.BoxEnvelope(name, **kwargs))
82 kwargs.setdefault(
"DetectorName",
"S3")
83 kwargs.setdefault(
"dX", 10.*mm)
84 kwargs.setdefault(
"dY", 40.*mm)
85 kwargs.setdefault(
"dZ", 27.5*mm)
86 kwargs.setdefault(
"Material",
'Scintillator')
87 kwargs.setdefault(
"OffsetX",-10994.6*mm)
88 result.setPrivateTools(CompFactory.BoxEnvelope(name, **kwargs))
97 kwargs.setdefault(
"DetectorName",
"CALO")
99 kwargs.setdefault(
"StartPhi", math.radians(-27))
100 kwargs.setdefault(
"DeltaPhi", math.radians(60))
101 kwargs.setdefault(
"NSurfaces", 3)
102 kwargs.setdefault(
"InnerRadii", [2269.*mm,950.*mm,950.*mm])
103 kwargs.setdefault(
"OuterRadii", [5145.*mm,5145.*mm,5145.*mm])
104 kwargs.setdefault(
"ZSurfaces", [-3400.*mm,-1050.*mm,6600.*mm])
106 if flags.TestBeam.Eta !=
'NONE' and (flags.TestBeam.Theta !=
'NONE' or flags.TestBeam.Z !=
'NONE'):
107 raise ValueError(
'THE ETA PARAMETER CAN NOT BE SET TOGETHER WITH THETA AND Z')
108 elif (flags.TestBeam.Theta ==
'NONE' or flags.TestBeam.Z ==
'NONE')
and flags.TestBeam.Eta ==
'NONE':
109 raise ValueError(
'THETA AND Z ARE NOT SET')
111 from AthenaCommon
import PhysicalConstants
113 if flags.TestBeam.Y !=
'NONE' :
114 DeltaY=-flags.TestBeam.Y
116 if flags.TestBeam.Phi !=
'NONE':
117 PhiZ=-math.radians(flags.TestBeam.Phi)
118 if flags.TestBeam.Eta !=
'NONE':
120 eta=flags.TestBeam.Eta
121 ThetaY=-(PhysicalConstants.pi*0.5)+2*math.atan(math.exp(-eta))
122 DeltaX=
float(2298-6208)/math.cosh(eta)+6208
125 elif not (flags.TestBeam.Theta ==
'NONE' or flags.TestBeam.Z ==
'NONE'):
126 theta=flags.TestBeam.Theta
129 if abs(theta) < 70.01:
134 ThetaY=math.radians(theta)
135 DeltaX=2298.0+3910.0*(1.0-math.cos(ThetaY))
136 DeltaF=(2290.0*math.tan(-ThetaY)-z)
137 DeltaZ=DeltaF*math.cos(ThetaY)
138 elif abs(abs(theta)-90.0) < 0.01:
143 sign=
int(theta>0)*2-1
144 ThetaY=sign*math.radians(90.0)
145 DeltaX=2298.0+2290.0+5640.0/2
147 DeltaZ=-sign*math.fabs(z)
149 print (
'Tile table rotation: ERROR unknown rotation mode')
150 raise ValueError(
'UNKNOWN MODE - NEITHER ETA NOR THETA AND Z ARE SET')
151 kwargs.setdefault(
"RotateZ",PhiZ)
152 kwargs.setdefault(
"RotateY",ThetaY)
153 kwargs.setdefault(
"OffsetX",DeltaX)
154 kwargs.setdefault(
"OffsetY",DeltaY)
155 kwargs.setdefault(
"OffsetZ",DeltaZ)
157 if flags.Detector.GeometryCalo:
158 from G4AtlasTools.G4GeometryToolConfig
import TileGeoDetectorToolCfg
160 SubDetectorList += [ toolTile ]
161 from MuonWall.MuonWallConfig
import MuonWallTileTBCfg
163 SubDetectorList += [muonWallTool]
164 kwargs.setdefault(
"SubDetectors", SubDetectorList)
165 result.setPrivateTools(CompFactory.PolyconicalEnvelope(name, **kwargs))
171 kwargs.setdefault(
"DetectorName",
"CTB")
172 kwargs.setdefault(
"dX", 600000.*mm)
173 kwargs.setdefault(
"dY", 5000.*mm)
174 kwargs.setdefault(
"dZ", 10000.*mm)
176 if flags.Detector.GeometryCalo:
178 SubDetectorList += [tbCaloTool]
180 SubDetectorList += [bp1Tool]
182 SubDetectorList += [bp2Tool]
184 SubDetectorList += [s1Tool]
186 SubDetectorList += [s2Tool]
188 SubDetectorList += [s3Tool]
192 kwargs.setdefault(
"SubDetectors", SubDetectorList)
193 result.setPrivateTools(CompFactory.BoxEnvelope(name, **kwargs))