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"
31 #include "GaudiKernel/MsgStream.h"
32 #include "GaudiKernel/Bootstrap.h"
33 #include "GaudiKernel/SystemOfUnits.h"
39 m_cryoEnvelopePhysical(nullptr),
40 m_LArPhysical(nullptr)
48 if (m_cryoEnvelopePhysical)
return m_cryoEnvelopePhysical;
52 ISvcLocator *svcLocator = Gaudi::svcLocator();
54 if (svcLocator->service(
"MessageSvc",
msgSvc,
true )==StatusCode::FAILURE) {
55 throw std::runtime_error(
"Error in CryostatConstructionTBEC, cannot access MessageSvc");
58 MsgStream
log(
msgSvc,
"LArGeo::CryostatConstructionTBEC");
60 log <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
61 log <<
"+ +" << std::endl;
62 log <<
"+ HELLO from LArGeo::CryostatConstructionTBEC +" << std::endl;
63 log <<
"+ +" << std::endl;
64 log <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
68 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
69 throw std::runtime_error(
"Error in CryostatConstructionTBEC, cannot access DetectorStore");
75 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
77 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
78 if (!Air)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, std::Air is not found.");
80 const GeoMaterial *Al = materialManager->
getMaterial(
"std::Aluminium");
81 if (!Al)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, std::Aluminium is not found.");
83 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
84 if (!
LAr)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, std::LiquidArgon is not found.");
86 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
87 if (!Iron)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, std::Iron is not found.");
89 const GeoMaterial *Gten = materialManager->
getMaterial(
"LAr::G10");
90 if (!Gten)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, LAr::G10 is not found.");
92 const GeoMaterial *Vacuum = materialManager->
getMaterial(
"LAr::Vacuum");
93 if (!Vacuum)
throw std::runtime_error(
"Error in CryostatConstructionTBEC, std::Vacuum is not found.");
104 std::string baseName =
"LAr::TBEC::Cryostat";
115 std::string cryoMotherName = baseName +
"::MotherVolume";
117 const GeoLogVol* cryoMotherLogical =
new GeoLogVol( cryoMotherName, cryoMotherShape, Air );
119 m_cryoEnvelopePhysical =
new GeoFullPhysVol( cryoMotherLogical );
123 std::string ExtWallName = baseName +
"::ExternalWarmWall";
125 const GeoLogVol* ExtWallLogical =
new GeoLogVol( ExtWallName, ExtWallShape, Al );
126 GeoIntrusivePtr<GeoPhysVol> ExtWallPhysical =
new GeoPhysVol( ExtWallLogical );
128 std::string WallName = baseName +
"::WarmWallInterval";
130 const GeoLogVol* WallLogical =
new GeoLogVol( WallName, WallShape, Vacuum );
131 GeoIntrusivePtr<GeoPhysVol> WallPhysical =
new GeoPhysVol( WallLogical );
133 std::string IntWallName = baseName +
"::InternalWarmWall";
135 const GeoLogVol* IntWallLogical =
new GeoLogVol( IntWallName, IntWallShape, Al );
136 GeoIntrusivePtr<GeoPhysVol> IntWallPhysical =
new GeoPhysVol( IntWallLogical );
138 std::string VacuumName = baseName +
"::Vacuum";
140 const GeoLogVol* VacuumLogical =
new GeoLogVol( VacuumName, VacuumShape, Vacuum );
141 GeoIntrusivePtr<GeoPhysVol> VacuumPhysical =
new GeoPhysVol( VacuumLogical );
143 std::string ColdWallName = baseName +
"::ColdWall";
145 const GeoLogVol* ColdWallLogical =
new GeoLogVol( ColdWallName, ColdWallShape, Iron );
146 GeoIntrusivePtr<GeoPhysVol> ColdWallPhysical =
new GeoPhysVol( ColdWallLogical );
148 std::string LArName = baseName +
"::LiquidArgon";
150 const GeoLogVol* LArLogical =
new GeoLogVol( LArName, LArShape,
LAr );
152 m_LArPhysical =
new GeoPhysVol( LArLogical );
154 ColdWallPhysical->add(
new GeoIdentifierTag( 1 ) );
156 ColdWallPhysical->add( m_LArPhysical );
158 VacuumPhysical->add(
new GeoIdentifierTag( 1 ) );
160 VacuumPhysical->add( ColdWallPhysical );
162 IntWallPhysical->add(
new GeoIdentifierTag( 1 ) );
164 IntWallPhysical->add( VacuumPhysical );
166 WallPhysical->add(
new GeoIdentifierTag( 1 ) );
168 WallPhysical->add( IntWallPhysical );
170 ExtWallPhysical->add(
new GeoIdentifierTag( 1 ) );
172 ExtWallPhysical->add( WallPhysical );
174 m_cryoEnvelopePhysical->add(
new GeoIdentifierTag( 1 ) );
176 m_cryoEnvelopePhysical->add( ExtWallPhysical );
180 std::string PConeName = baseName +
"::PressureCone::Mother";
182 const GeoLogVol* PConeLogical =
new GeoLogVol( PConeName, PConeShape, Vacuum );
183 GeoIntrusivePtr<GeoPhysVol> PConePhysical =
new GeoPhysVol( PConeLogical );
185 std::string IntFlangeName = baseName +
"::PressureCone::InternalFlange";
187 const GeoLogVol* IntFlangeLogical =
new GeoLogVol( IntFlangeName, IntFlangeShape, Gten );
188 GeoIntrusivePtr<GeoPhysVol> IntFlangePhysical =
new GeoPhysVol( IntFlangeLogical );
190 std::string ExtFlangeName = baseName +
"::PressureCone::ExternalFlange";
192 const GeoLogVol* ExtFlangeLogical =
new GeoLogVol( ExtFlangeName, ExtFlangeShape, Gten );
193 GeoIntrusivePtr<GeoPhysVol> ExtFlangePhysical =
new GeoPhysVol( ExtFlangeLogical );
195 std::string ConeName = baseName +
"::PressureCone::Cone";
197 const GeoLogVol* ConeLogical =
new GeoLogVol( ConeName, ConeShape, Gten );
198 GeoIntrusivePtr<GeoPhysVol> ConePhysical =
new GeoPhysVol( ConeLogical );
200 PConePhysical->add(
new GeoIdentifierTag( 1 ) );
202 PConePhysical->add( IntFlangePhysical );
204 PConePhysical->add(
new GeoIdentifierTag( 1 ) );
206 PConePhysical->add( ExtFlangePhysical );
208 PConePhysical->add(
new GeoIdentifierTag( 1 ) );
210 PConePhysical->add( ConePhysical );
212 for (
int i = 0;
i < 3;
i++ )
for (
int j = 0; j < 13; j++ ) {
215 VacuumPhysical->add(
new GeoIdentifierTag( 1 +
i*13 + j ) );
216 VacuumPhysical->add(
new GeoTransform( GeoTrf::Translate3D(
x,
y, -42.*
Gaudi::Units::cm ) ) );
217 VacuumPhysical->add( PConePhysical );
222 std::string ZigZagMotherName = baseName +
"::ZigZag::Mother";
224 const GeoLogVol* ZigZagMotherLogical =
new GeoLogVol( ZigZagMotherName, ZigZagMotherShape, Vacuum );
225 GeoIntrusivePtr<GeoPhysVol> ZigZagMotherPhysical =
new GeoPhysVol( ZigZagMotherLogical );
227 std::string ZigZagStrAName = baseName +
"::ZigZag::StrA";
229 const GeoLogVol* ZigZagStrALogical =
new GeoLogVol( ZigZagStrAName, ZigZagStrAShape, Al );
230 GeoIntrusivePtr<GeoPhysVol> ZigZagStrAPhysical =
new GeoPhysVol( ZigZagStrALogical );
232 std::string ZigZagStrBName = baseName +
"::ZigZag::StrB";
234 const GeoLogVol* ZigZagStrBLogical =
new GeoLogVol( ZigZagStrBName, ZigZagStrBShape, Al );
235 GeoIntrusivePtr<GeoPhysVol> ZigZagStrBPhysical =
new GeoPhysVol( ZigZagStrBLogical );
237 std::string ZigZagStrCName = baseName +
"::ZigZag::StrC";
239 const GeoLogVol* ZigZagStrCLogical =
new GeoLogVol( ZigZagStrCName, ZigZagStrCShape, Al );
240 GeoIntrusivePtr<GeoPhysVol> ZigZagStrCPhysical =
new GeoPhysVol( ZigZagStrCLogical );
242 std::string ZigZagStrDName = baseName +
"::ZigZag::StrD";
244 const GeoLogVol* ZigZagStrDLogical =
new GeoLogVol( ZigZagStrDName, ZigZagStrDShape, Al );
245 GeoIntrusivePtr<GeoPhysVol> ZigZagStrDPhysical =
new GeoPhysVol( ZigZagStrDLogical );
249 for (
int i = 0;
i < 9;
i++ ) {
250 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrAIdTag ) );
252 ZigZagMotherPhysical->add( ZigZagStrAPhysical );
255 for (
int j = 0; j < 2; j++ )
for (
int i = 0;
i < 8;
i++ ) {
256 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrAIdTag ) );
258 ZigZagMotherPhysical->add( ZigZagStrAPhysical );
267 for (
int k = 0;
k < 2;
k++ )
for (
int i = 0;
i < 8;
i++ ) {
268 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrBIdTag ) );
270 ZigZagMotherPhysical->add( ZigZagStrBPhysical );
273 for (
int j = 0; j < 2; j++ ) {
274 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrBIdTag ) );
276 ZigZagMotherPhysical->add( ZigZagStrBPhysical );
283 for (
int i = 0;
i < 9;
i++ ) {
285 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrCIdTag ) );
287 ZigZagMotherPhysical->add( ZigZagStrCPhysical );
290 for (
int j = 0; j < 2; j++ ) {
291 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrCIdTag ) );
293 ZigZagMotherPhysical->add( ZigZagStrCPhysical );
303 for (
int k = 0;
k < 2;
k++ )
for (
int i = 0;
i < 9;
i++ ) {
304 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrDIdTag ) );
306 ZigZagMotherPhysical->add( ZigZagStrDPhysical );
309 if (
i < 8 )
for (
int j = 0; j < 2; j++ ) {
310 ZigZagMotherPhysical->add(
new GeoIdentifierTag( StrDIdTag ) );
312 ZigZagMotherPhysical->add( ZigZagStrDPhysical );
317 WallPhysical->add(
new GeoIdentifierTag( 1 ) );
319 WallPhysical->add( ZigZagMotherPhysical );
321 return m_cryoEnvelopePhysical;
326 return m_LArPhysical;