ATLAS Offline Software
Loading...
Searching...
No Matches
CryostatConstructionTBEC.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5// CryostatConstructionTBEC
6
8
9#include "GeoModelKernel/GeoElement.h"
10#include "GeoModelKernel/GeoMaterial.h"
11#include "GeoModelKernel/GeoFullPhysVol.h"
12#include "GeoModelKernel/GeoPhysVol.h"
13#include "GeoModelKernel/GeoVPhysVol.h"
14#include "GeoModelKernel/GeoLogVol.h"
15#include "GeoModelKernel/GeoPcon.h"
16#include "GeoModelKernel/GeoBox.h"
17#include "GeoModelKernel/GeoTube.h"
18#include "GeoModelKernel/GeoTubs.h"
19#include "GeoModelKernel/GeoCons.h"
20#include "GeoModelKernel/GeoTrd.h"
21#include "GeoModelKernel/GeoNameTag.h"
22#include "GeoModelKernel/GeoTransform.h"
23#include "GeoModelKernel/GeoAlignableTransform.h"
24#include "GeoModelKernel/GeoIdentifierTag.h"
25#include "GeoModelKernel/GeoDefinitions.h"
27#include "GeoModelKernel/GeoShapeUnion.h"
28#include "GeoModelKernel/GeoShapeShift.h"
29
31#include "GaudiKernel/MsgStream.h"
32#include "GaudiKernel/Bootstrap.h"
33#include "GaudiKernel/SystemOfUnits.h"
35
36#include <string>
37#include <cmath>
38
39GeoIntrusivePtr<GeoVFullPhysVol> LArGeo::CryostatConstructionTBEC::GetEnvelope()
40{
41
43
44 // Get access to the material manager:
45 MsgStream log(Athena::getMessageSvc(), "LArGeo::CryostatConstructionTBEC");
46
47 log << MSG::INFO << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
48 log << MSG::INFO << "+ +" << endmsg;
49 log << MSG::INFO << "+ HELLO from LArGeo::CryostatConstructionTBEC +" << endmsg;
50 log << MSG::INFO << "+ +" << endmsg;
51 log << MSG::INFO << "++++++++++++++++++++++++++++++++++++++++++++++++++++" << endmsg;
52
53
54 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service("DetectorStore")};
55 if(!detStore.isValid()) {
56 throw std::runtime_error("Error in CryostatConstructionTBEC, cannot access DetectorStore");
57 }
58
59 // Get the materials from the material manager:-----------------------------------------------------//
60 // //
61 StoredMaterialManager* materialManager = nullptr;
62 if (StatusCode::SUCCESS != detStore->retrieve(materialManager, std::string("MATERIALS"))) return nullptr;
63
64 const GeoMaterial *Air = materialManager->getMaterial("std::Air");
65 if (!Air) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Air is not found.");
66
67 const GeoMaterial *Al = materialManager->getMaterial("std::Aluminium");
68 if (!Al) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Aluminium is not found.");
69
70 const GeoMaterial *LAr = materialManager->getMaterial("std::LiquidArgon");
71 if (!LAr) throw std::runtime_error("Error in CryostatConstructionTBEC, std::LiquidArgon is not found.");
72
73 const GeoMaterial *Iron = materialManager->getMaterial("std::Iron");
74 if (!Iron) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Iron is not found.");
75
76 const GeoMaterial *Gten = materialManager->getMaterial("LAr::G10");
77 if (!Gten) throw std::runtime_error("Error in CryostatConstructionTBEC, LAr::G10 is not found.");
78
79 const GeoMaterial *Vacuum = materialManager->getMaterial("LAr::Vacuum");
80 if (!Vacuum) throw std::runtime_error("Error in CryostatConstructionTBEC, std::Vacuum is not found.");
81
82 // //
83 //-------------------------------------------------------------------------------------------------//
84
85
87 // Define geometry
89
90 // Set up strings for volume names.
91 std::string baseName = "LAr::TBEC::Cryostat";
92
93 // Define the mother volume for the endcap cryostat. Everything
94 // else in the endcap (cryostat walls, detectors, etc.) should be
95 // placed inside here.
96
97 // The position of this volume may change if the thickness of the
98 // cabling in front of the endcaps changes. Therefore, we must get
99 // the z-shift from the database and adjust the volume geometry
100 // accordingly.
101
102 std::string cryoMotherName = baseName + "::MotherVolume";
103 GeoBox* cryoMotherShape = new GeoBox( 152.*Gaudi::Units::cm, 195.*Gaudi::Units::cm, 60.09*Gaudi::Units::cm );
104 const GeoLogVol* cryoMotherLogical = new GeoLogVol( cryoMotherName, cryoMotherShape, Air );
105 //GeoIntrusivePtr<GeoFullPhysVol> m_cryoEnvelopePhysical = new GeoFullPhysVol( cryoMotherLogical );
106 m_cryoEnvelopePhysical = new GeoFullPhysVol( cryoMotherLogical );
107
108 // Cryostat walls
109
110 std::string ExtWallName = baseName + "::ExternalWarmWall";
111 GeoBox* ExtWallShape = new GeoBox( 152.*Gaudi::Units::cm, 195.*Gaudi::Units::cm, 60.09*Gaudi::Units::cm );
112 const GeoLogVol* ExtWallLogical = new GeoLogVol( ExtWallName, ExtWallShape, Al );
113 GeoIntrusivePtr<GeoPhysVol> ExtWallPhysical = new GeoPhysVol( ExtWallLogical );
114
115 std::string WallName = baseName + "::WarmWallInterval";
116 GeoBox* WallShape = new GeoBox( ( 152. - 0.8 )*Gaudi::Units::cm, ( 195. - 0.8 )*Gaudi::Units::cm, ( 60.09 - 0.8 )*Gaudi::Units::cm );
117 const GeoLogVol* WallLogical = new GeoLogVol( WallName, WallShape, Vacuum );
118 GeoIntrusivePtr<GeoPhysVol> WallPhysical = new GeoPhysVol( WallLogical );
119
120 std::string IntWallName = baseName + "::InternalWarmWall";
121 GeoBox* IntWallShape = new GeoBox( 148.4*Gaudi::Units::cm, 191.6*Gaudi::Units::cm, 46.8*Gaudi::Units::cm );
122 const GeoLogVol* IntWallLogical = new GeoLogVol( IntWallName, IntWallShape, Al );
123 GeoIntrusivePtr<GeoPhysVol> IntWallPhysical = new GeoPhysVol( IntWallLogical );
124
125 std::string VacuumName = baseName + "::Vacuum";
126 GeoBox* VacuumShape = new GeoBox( ( 148.4 - 0.8 )*Gaudi::Units::cm, ( 191.6 - 0.8 )*Gaudi::Units::cm, ( 46.8 - 0.8 )*Gaudi::Units::cm );
127 const GeoLogVol* VacuumLogical = new GeoLogVol( VacuumName, VacuumShape, Vacuum );
128 GeoIntrusivePtr<GeoPhysVol> VacuumPhysical = new GeoPhysVol( VacuumLogical );
129
130 std::string ColdWallName = baseName + "::ColdWall";
131 GeoBox* ColdWallShape = new GeoBox( 142.5*Gaudi::Units::cm, 184.85*Gaudi::Units::cm, 38.*Gaudi::Units::cm );
132 const GeoLogVol* ColdWallLogical = new GeoLogVol( ColdWallName, ColdWallShape, Iron );
133 GeoIntrusivePtr<GeoPhysVol> ColdWallPhysical = new GeoPhysVol( ColdWallLogical );
134
135 std::string LArName = baseName + "::LiquidArgon";
136 GeoBox* LArShape = new GeoBox( ( 142.5 - .5 )*Gaudi::Units::cm, ( 184.85 - .5 )*Gaudi::Units::cm, ( 38. - .5 )*Gaudi::Units::cm );
137 const GeoLogVol* LArLogical = new GeoLogVol( LArName, LArShape, LAr );
138 // GeoIntrusivePtr<GeoPhysVol> m_LArPhysical = new GeoPhysVol( LArLogical );
139 m_LArPhysical = new GeoPhysVol( LArLogical );
140
141 ColdWallPhysical->add( new GeoIdentifierTag( 1 ) );
142 ColdWallPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
143 ColdWallPhysical->add( m_LArPhysical );
144
145 VacuumPhysical->add( new GeoIdentifierTag( 1 ) );
146 VacuumPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
147 VacuumPhysical->add( ColdWallPhysical );
148
149 IntWallPhysical->add( new GeoIdentifierTag( 1 ) );
150 IntWallPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
151 IntWallPhysical->add( VacuumPhysical );
152
153 WallPhysical->add( new GeoIdentifierTag( 1 ) );
154 WallPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
155 WallPhysical->add( IntWallPhysical );
156
157 ExtWallPhysical->add( new GeoIdentifierTag( 1 ) );
158 ExtWallPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
159 ExtWallPhysical->add( WallPhysical );
160
161 m_cryoEnvelopePhysical->add( new GeoIdentifierTag( 1 ) );
162 m_cryoEnvelopePhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
163 m_cryoEnvelopePhysical->add( ExtWallPhysical );
164
165 // Pressure cone
166
167 std::string PConeName = baseName + "::PressureCone::Mother";
168 GeoTubs* PConeShape = new GeoTubs( 0.*Gaudi::Units::cm, 6.5*Gaudi::Units::cm, 4.*Gaudi::Units::cm, 0.*Gaudi::Units::deg, 360.*Gaudi::Units::deg );
169 const GeoLogVol* PConeLogical = new GeoLogVol( PConeName, PConeShape, Vacuum );
170 GeoIntrusivePtr<GeoPhysVol> PConePhysical = new GeoPhysVol( PConeLogical );
171
172 std::string IntFlangeName = baseName + "::PressureCone::InternalFlange";
173 GeoTubs* IntFlangeShape = new GeoTubs( 0.*Gaudi::Units::cm, 4.9*Gaudi::Units::cm, 0.4*Gaudi::Units::cm, 0.*Gaudi::Units::deg, 360.*Gaudi::Units::deg );
174 const GeoLogVol* IntFlangeLogical = new GeoLogVol( IntFlangeName, IntFlangeShape, Gten );
175 GeoIntrusivePtr<GeoPhysVol> IntFlangePhysical = new GeoPhysVol( IntFlangeLogical );
176
177 std::string ExtFlangeName = baseName + "::PressureCone::ExternalFlange";
178 GeoTubs* ExtFlangeShape = new GeoTubs( 5.*Gaudi::Units::cm, 6.5*Gaudi::Units::cm, 0.4*Gaudi::Units::cm, 0.*Gaudi::Units::deg, 360.*Gaudi::Units::deg );
179 const GeoLogVol* ExtFlangeLogical = new GeoLogVol( ExtFlangeName, ExtFlangeShape, Gten );
180 GeoIntrusivePtr<GeoPhysVol> ExtFlangePhysical = new GeoPhysVol( ExtFlangeLogical );
181
182 std::string ConeName = baseName + "::PressureCone::Cone";
183 GeoCons* ConeShape = new GeoCons( 5.4*Gaudi::Units::cm, 4.5*Gaudi::Units::cm, 5.5*Gaudi::Units::cm, 4.6*Gaudi::Units::cm, 3.2*Gaudi::Units::cm, 0.*Gaudi::Units::deg, 360.*Gaudi::Units::deg );
184 const GeoLogVol* ConeLogical = new GeoLogVol( ConeName, ConeShape, Gten );
185 GeoIntrusivePtr<GeoPhysVol> ConePhysical = new GeoPhysVol( ConeLogical );
186
187 PConePhysical->add( new GeoIdentifierTag( 1 ) );
188 PConePhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 3.6*Gaudi::Units::cm ) ) );
189 PConePhysical->add( IntFlangePhysical );
190
191 PConePhysical->add( new GeoIdentifierTag( 1 ) );
192 PConePhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, -3.6*Gaudi::Units::cm ) ) );
193 PConePhysical->add( ExtFlangePhysical );
194
195 PConePhysical->add( new GeoIdentifierTag( 1 ) );
196 PConePhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm ) ) );
197 PConePhysical->add( ConePhysical );
198
199 for ( int i = 0; i < 3; i++ ) for ( int j = 0; j < 13; j++ ) {
200 double x = 135.1*Gaudi::Units::cm - 19.3*( j + 1 )*Gaudi::Units::cm;
201 double y = 19.3*( i - 1 )*Gaudi::Units::cm;
202 VacuumPhysical->add( new GeoIdentifierTag( 1 + i*13 + j ) );
203 VacuumPhysical->add( new GeoTransform( GeoTrf::Translate3D( x, y, -42.*Gaudi::Units::cm ) ) );
204 VacuumPhysical->add( PConePhysical );
205 }
206
207 // Zig-zag structure
208
209 std::string ZigZagMotherName = baseName + "::ZigZag::Mother";
210 GeoBox* ZigZagMotherShape = new GeoBox( 130.*Gaudi::Units::cm, 15.*Gaudi::Units::cm, 6.45*Gaudi::Units::cm );
211 const GeoLogVol* ZigZagMotherLogical = new GeoLogVol( ZigZagMotherName, ZigZagMotherShape, Vacuum );
212 GeoIntrusivePtr<GeoPhysVol> ZigZagMotherPhysical = new GeoPhysVol( ZigZagMotherLogical );
213
214 std::string ZigZagStrAName = baseName + "::ZigZag::StrA";
215 GeoBox* ZigZagStrAShape = new GeoBox( 2.45*Gaudi::Units::cm, 5.*Gaudi::Units::cm, .4*Gaudi::Units::cm );
216 const GeoLogVol* ZigZagStrALogical = new GeoLogVol( ZigZagStrAName, ZigZagStrAShape, Al );
217 GeoIntrusivePtr<GeoPhysVol> ZigZagStrAPhysical = new GeoPhysVol( ZigZagStrALogical );
218
219 std::string ZigZagStrBName = baseName + "::ZigZag::StrB";
220 GeoBox* ZigZagStrBShape = new GeoBox( 8.53*Gaudi::Units::cm, 5.*Gaudi::Units::cm, .4*Gaudi::Units::cm );
221 const GeoLogVol* ZigZagStrBLogical = new GeoLogVol( ZigZagStrBName, ZigZagStrBShape, Al );
222 GeoIntrusivePtr<GeoPhysVol> ZigZagStrBPhysical = new GeoPhysVol( ZigZagStrBLogical );
223
224 std::string ZigZagStrCName = baseName + "::ZigZag::StrC";
225 GeoTrd* ZigZagStrCShape = new GeoTrd( 1.03*Gaudi::Units::cm, .453*Gaudi::Units::cm, 5.*Gaudi::Units::cm, 5.*Gaudi::Units::cm, .283*Gaudi::Units::cm );
226 const GeoLogVol* ZigZagStrCLogical = new GeoLogVol( ZigZagStrCName, ZigZagStrCShape, Al );
227 GeoIntrusivePtr<GeoPhysVol> ZigZagStrCPhysical = new GeoPhysVol( ZigZagStrCLogical );
228
229 std::string ZigZagStrDName = baseName + "::ZigZag::StrD";
230 GeoTrd* ZigZagStrDShape = new GeoTrd( .005*Gaudi::Units::cm, .31*Gaudi::Units::cm, 5.*Gaudi::Units::cm, 5.*Gaudi::Units::cm, .365*Gaudi::Units::cm );
231 const GeoLogVol* ZigZagStrDLogical = new GeoLogVol( ZigZagStrDName, ZigZagStrDShape, Al );
232 GeoIntrusivePtr<GeoPhysVol> ZigZagStrDPhysical = new GeoPhysVol( ZigZagStrDLogical );
233
234 int StrAIdTag = 1;
235
236 for ( int i = 0; i < 9; i++ ) {
237 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrAIdTag ) );
238 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Translate3D( ( 124.4 - 31.1*i )*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 6.05*Gaudi::Units::cm ) ) );
239 ZigZagMotherPhysical->add( ZigZagStrAPhysical );
240 StrAIdTag++;
241 }
242 for ( int j = 0; j < 2; j++ ) for ( int i = 0; i < 8; i++ ) {
243 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrAIdTag ) );
244 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Translate3D( ( 108.85 - 31.1*i )*Gaudi::Units::cm, ( 2*j - 1 )*10.*Gaudi::Units::cm, 6.05*Gaudi::Units::cm ) ) );
245 ZigZagMotherPhysical->add( ZigZagStrAPhysical );
246 StrAIdTag++;
247 }
248
249 int StrBIdTag = 1;
250 const double xB1[ 2 ] = { ( -6.77 + 108.85 )*Gaudi::Units::cm, ( 6.77 + 108.85 )*Gaudi::Units::cm };
251 const double xB2[ 2 ] = { ( -6.77 + 124.4 )*Gaudi::Units::cm, ( 6.77 + 93.3 )*Gaudi::Units::cm };
252 const double alpha[ 2 ] = { 45.*Gaudi::Units::deg, -45.*Gaudi::Units::deg };
253
254 for ( int k = 0; k < 2; k++ ) for ( int i = 0; i < 8; i++ ) {
255 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrBIdTag ) );
256 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D(GeoTrf::Translate3D( xB1[ k ] - 31.1*i*Gaudi::Units::cm, 0.*Gaudi::Units::cm, -.1*Gaudi::Units::cm )*GeoTrf::RotateY3D( alpha[ k ] ) ) ) );
257 ZigZagMotherPhysical->add( ZigZagStrBPhysical );
258 StrBIdTag++;
259
260 for ( int j = 0; j < 2; j++ ) {
261 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrBIdTag ) );
262 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translate3D( xB2[ k ] - 31.1*i*Gaudi::Units::cm, ( -10. + 20.*j )*Gaudi::Units::cm, -.1*Gaudi::Units::cm ) *GeoTrf::RotateY3D( alpha[ k ] )) ) );
263 ZigZagMotherPhysical->add( ZigZagStrBPhysical );
264 StrBIdTag++;
265 }
266 }
267
268 int StrCIdTag = 1;
269
270 for ( int i = 0; i < 9; i++ ) {
271 if ( i < 8 ) {
272 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrCIdTag ) );
273 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Translate3D( ( 108.85 - 31.1*i )*Gaudi::Units::cm, 0.*Gaudi::Units::cm, -6.15*Gaudi::Units::cm ) ) );
274 ZigZagMotherPhysical->add( ZigZagStrCPhysical );
275 StrCIdTag++;
276 }
277 for ( int j = 0; j < 2; j++ ) {
278 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrCIdTag ) );
279 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Translate3D( ( 124.4 - 31.1*i )*Gaudi::Units::cm, ( -10. + 20.*j )*Gaudi::Units::cm, -6.15*Gaudi::Units::cm ) ) );
280 ZigZagMotherPhysical->add( ZigZagStrCPhysical );
281 StrCIdTag++;
282 }
283 }
284
285 int StrDIdTag = 1;
286 const double xD1[ 2 ] = { ( -2.598 + 124.4 )*Gaudi::Units::cm, ( 2.598 + 124.4 )*Gaudi::Units::cm };
287 const double xD2[ 2 ] = { ( -2.598 + 108.85 )*Gaudi::Units::cm, ( 2.598 + 108.85 )*Gaudi::Units::cm };
288 const double beta[ 2 ] = { -22.5*Gaudi::Units::deg, 22.5*Gaudi::Units::deg };
289
290 for ( int k = 0; k < 2; k++ ) for ( int i = 0; i < 9; i++ ) {
291 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrDIdTag ) );
292 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translate3D( xD1[ k ] - 31.1*i*Gaudi::Units::cm, 0.*Gaudi::Units::cm, 5.995*Gaudi::Units::cm ) *GeoTrf::RotateY3D( beta[ k ] )) ) );
293 ZigZagMotherPhysical->add( ZigZagStrDPhysical );
294 StrDIdTag++;
295
296 if ( i < 8 ) for ( int j = 0; j < 2; j++ ) {
297 ZigZagMotherPhysical->add( new GeoIdentifierTag( StrDIdTag ) );
298 ZigZagMotherPhysical->add( new GeoTransform( GeoTrf::Transform3D( GeoTrf::Translate3D( xD2[ k ] - 31.1*i*Gaudi::Units::cm, ( -10. +20.*j )*Gaudi::Units::cm, 5.995*Gaudi::Units::cm ) *GeoTrf::RotateY3D( beta[ k ] )) ) );
299 ZigZagMotherPhysical->add( ZigZagStrDPhysical );
300 StrDIdTag++;
301 }
302 }
303
304 WallPhysical->add( new GeoIdentifierTag( 1 ) );
305 WallPhysical->add( new GeoTransform( GeoTrf::Translate3D( 0.*Gaudi::Units::cm, 0.*Gaudi::Units::cm, -53.2*Gaudi::Units::cm ) ) );
306 WallPhysical->add( ZigZagMotherPhysical );
307
309}
310
312{
313 return m_LArPhysical;
314}
#define endmsg
#define y
#define x
GeoIntrusivePtr< GeoVFullPhysVol > GetEnvelope()
GeoIntrusivePtr< GeoPhysVol > GetLArPhysical()
This class holds one or more material managers and makes them storeable, under StoreGate.
virtual const GeoMaterial * getMaterial(const std::string &name)=0
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)