14 #include "GeoModelKernel/GeoElement.h"
15 #include "GeoModelKernel/GeoMaterial.h"
16 #include "GeoModelKernel/GeoFullPhysVol.h"
17 #include "GeoModelKernel/GeoPhysVol.h"
18 #include "GeoModelKernel/GeoVPhysVol.h"
19 #include "GeoModelKernel/GeoLogVol.h"
20 #include "GeoModelKernel/GeoPcon.h"
21 #include "GeoModelKernel/GeoTubs.h"
22 #include "GeoModelKernel/GeoTransform.h"
23 #include "GeoModelKernel/GeoDefinitions.h"
24 #include "GeoModelKernel/Units.h"
27 #include "GaudiKernel/MsgStream.h"
28 #include "GaudiKernel/Bootstrap.h"
29 #include "GaudiKernel/PhysicalConstants.h"
44 #define BUILD_LARMODULE
45 #define BUILD_PRESAMPLER
47 #define BUILD_SUPPORTRING
53 cryoMotherPhysical(nullptr)
62 if (cryoMotherPhysical)
return cryoMotherPhysical;
67 log << MSG::INFO <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++i++" <<
endmsg;
69 log << MSG::INFO <<
"+ HELLO from LArGeo::TBBarrelCryostatConstruction +" <<
endmsg;
71 log << MSG::INFO <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++" <<
endmsg;
74 SmartIF<StoreGateSvc>
detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
76 throw std::runtime_error(
"Error in LArDetectorFactory, cannot access DetectorStore");
83 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
85 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
87 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Air is not found.");
90 const GeoMaterial *Aluminium = materialManager->
getMaterial(
"std::Aluminium");
92 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Aluminium is not found.");
95 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
97 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::LiquidArgon is not found.");
100 const GeoMaterial* Iron = materialManager->
getMaterial(
"std::Iron");
102 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Iron is not found.");
105 const GeoElement* Hydrogen = materialManager->
getElement(
"Hydrogen");
107 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, hydrogen not found.");
110 const GeoElement* Carbon = materialManager->
getElement(
"Carbon");
112 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, carbon not found.");
115 const GeoElement* Oxygen = materialManager->
getElement(
"Oxygen");
117 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, oxygen not found.");
121 Vacuum->add(Hydrogen,1.);
128 GeoMaterial* Foam =
new GeoMaterial(
"Foam", density);
129 double fraction=8*1.01/(5*12.01+8*1.01+2.*16.0);
130 Foam->add(Hydrogen,fraction);
131 fraction=5.*12.01/(5*12.01+8*1.01+2.*16.0);
132 Foam->add(Carbon,fraction);
133 fraction=2.*16.0/(5*12.01+8*1.01+2.*16.0);
134 Foam->add(Oxygen,fraction);
137 std::cout <<
" Foam density,rad length from GeoModel " << density <<
" " << Foam->getRadLength() << std::endl;
141 std::string baseName =
"LAr::TBBarrel::Cryostat::";
149 double zp[3] ={-1050.,0.,3810.};
150 double ri[3] ={965.,965.,965.};
151 double ro[3] ={2270.,2270.,2270.};
153 std::cout <<
" " << std::endl;
154 std::cout <<
" Pcone volume for overall envelope " << std::endl;
155 std::cout <<
" phi0=-25deg, Dphi=50deg " << std::endl;
156 for (
int i=0;
i<3;
i++) {
157 std::cout <<
" Plane zp/ri/ro " << zp[
i] <<
" " << ri[
i] <<
" " << ro[
i] << std::endl;
161 for (
int i=0;
i < 3;
i++) Em_pcone->addPlane(zp[
i],ri[
i],ro[
i]);
163 const GeoLogVol* cryoMotherLogical =
164 new GeoLogVol(baseName+
"Envelope",Em_pcone, Air);
166 cryoMotherPhysical =
new GeoFullPhysVol(cryoMotherLogical);
186 double Dz_end_tot = Dz_end_warm + Dz_end_vac + Dz_end_cold;
189 double Cryo_Xcent = 3363.;
191 double Cryo_Rmax_C = 2326.;
192 double Cryo_Rmin_C = Cryo_Rmax_C - DeltaR_cold;
194 double Cryo_Rmax_W = 2396.;
195 double Cryo_Rmin_W = Cryo_Rmax_W - DeltaR_warm;
200 double Rmin_mother = Cryo_Xcent-Cryo_Rmax_W;
201 double Rmax_mother = 2270.;
216 std::cout <<
" " << std::endl;
217 std::cout <<
"** Mother Volume for TB cryostat (Tubs) " << std::endl;
218 std::cout <<
" (matter = foam) " << std::endl;
219 std::cout <<
" Rmin/Rmax " << Rmin_mother <<
" " << Rmax_mother << std::endl;
220 std::cout <<
" Dz/2 " << Cryo_Distz/2. << std::endl;
225 GeoTubs* Cent_tube =
new GeoTubs(Rmin_mother,
230 GeoLogVol* Cent_log =
new GeoLogVol(baseName+
"Mother",Cent_tube,Foam);
232 double zpos = Cryo_Distz/2.-Cryo_z0;
235 GeoIntrusivePtr<GeoPhysVol> Cent_phys =
new GeoPhysVol(Cent_log);
236 cryoMotherPhysical->add(
new GeoTransform(GeoTrf::RotateZ3D(phi)));
237 cryoMotherPhysical->add(
new GeoTransform(GeoTrf::TranslateZ3D(zpos)));
238 cryoMotherPhysical->add(Cent_phys);
248 std::cout <<
" " << std::endl;
249 std::cout <<
" ** Cryostat before LAr (shape=Tubs)" << std::endl;
250 std::cout <<
" center in x = " << Cryo_Xcent << std::endl;
251 std::cout <<
" angle 180-11 deg, span = 14 deg" << std::endl;
252 std::cout <<
" R warm vessel " << Cryo_Rmin_W <<
" "
253 << Cryo_Rmax_W << std::endl;
254 std::cout <<
" R vacuum " << Cryo_Rmax_C <<
" "
255 << Cryo_Rmin_W << std::endl;
256 std::cout <<
" R cold vessel " << Cryo_Rmin_C <<
" "
257 << Cryo_Rmax_C << std::endl;
258 std::cout <<
" Half size in z " << (Cryo_Distz-Dz_end_tot)/2. << std::endl;
259 std::cout <<
" position in z in mother " << -Dz_end_tot/2. << std::endl;
262 GeoTubs* CryoW_tube =
new GeoTubs(
265 (Cryo_Distz-Dz_end_tot)/2.,
269 GeoLogVol* CryoW_log =
new GeoLogVol(baseName+
"WarmTube",
273 GeoIntrusivePtr<GeoPhysVol> CryoW_phys =
new GeoPhysVol(CryoW_log);
274 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
275 Cent_phys->add(CryoW_phys);
279 GeoTubs* CryoV_tube =
new GeoTubs(
282 (Cryo_Distz-Dz_end_tot)/2.,
286 GeoLogVol *CryoV_log =
new GeoLogVol(baseName+
"VacTube",
290 GeoIntrusivePtr<GeoPhysVol> CryoV_phys =
new GeoPhysVol(CryoV_log);
291 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
292 Cent_phys->add(CryoV_phys);
296 GeoTubs* CryoC_tube =
new GeoTubs(
299 (Cryo_Distz-Dz_end_tot)/2.,
303 GeoLogVol *CryoC_log =
new GeoLogVol(baseName+
"ColdTube",
307 GeoIntrusivePtr<GeoPhysVol> CryoC_phys =
new GeoPhysVol(CryoC_log);
308 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
309 Cent_phys->add(CryoC_phys);
321 double LAr_outer_radius=Rmax_mother-DeltaRout_warm-DeltaRout_cold
324 double LAr_z_max = Cryo_Distz-Dz_end_tot;
327 std::cout <<
" " << std::endl;
328 std::cout <<
" *** LAr volume (tubs put in foam)" << std::endl;
329 std::cout <<
"Rmin/Rmax " << LAr_inner_radius <<
" "
330 << LAr_outer_radius << std::endl;
333 std::cout <<
"DeltaZ/2 " << LAr_z_max/2. << std::endl;
334 std::cout <<
"Position in z in mother " << (LAr_z_max-Cryo_Distz)/2. << std::endl;
339 GeoTubs* moth_tube =
new GeoTubs( LAr_inner_radius,
345 GeoLogVol* moth_log =
new GeoLogVol(baseName+
"LAr",moth_tube,
LAr);
347 GeoIntrusivePtr<GeoPhysVol> moth_phys =
new GeoPhysVol(moth_log);
349 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D((LAr_z_max-Cryo_Distz)/2.)));
350 Cent_phys->add(moth_phys);
388 for (
int ilar=0;ilar<5;ilar++) {
389 double r1=LAr_inner_radius-delta_LAr[ilar];
390 double r2=LAr_inner_radius;
393 std::cout <<
" Ar additionnal volume before PS " << r1 <<
" "
397 GeoTubs* lar_tube =
new GeoTubs(r1,
403 GeoLogVol* lar_log =
new GeoLogVol(baseName+
"LAr2",lar_tube,
LAr);
405 GeoIntrusivePtr<GeoPhysVol> lar_phys =
new GeoPhysVol(lar_log);
406 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D((LAr_z_max-Cryo_Distz)/2.)));
407 Cent_phys->add(lar_phys);
416 #ifdef BUILD_SUPPORTRING
418 double R_ring = 2003.6;
419 double DeltaR1_ring = 12.0;
420 double DeltaZ1_ring = 80.0;
421 double DeltaR2_ring = 75.7;
422 double DeltaZ2_ring = 10.0;
423 double DeltaR3_ring = 12.0;
424 double DeltaZ3_ring = 80.0;
427 std::cout <<
" " << std::endl;
428 std::cout <<
" *** Support Ring1: R/DR/DZ " << R_ring <<
" "
429 << DeltaR1_ring <<
" " << DeltaZ1_ring << std::endl;
430 std::cout <<
" Ring2: R/DR/DZ " << R_ring+DeltaR1_ring <<
" "
431 << DeltaR2_ring <<
" " << DeltaZ2_ring << std::endl;
432 std::cout <<
" Ring3: R/DR/DZ " << R_ring+DeltaR1_ring+DeltaR2_ring <<
" "
433 << DeltaR3_ring <<
" " << DeltaZ3_ring << std::endl;
437 GeoTubs* ring1_shape =
new GeoTubs(
443 GeoLogVol* ring1_log =
new GeoLogVol(baseName+
"Ring1",ring1_shape,Iron);
444 GeoIntrusivePtr<GeoPhysVol> ring1_phys =
new GeoPhysVol(ring1_log);
446 GeoTubs* ring2_shape =
new GeoTubs(
448 R_ring+DeltaR1_ring+DeltaR2_ring,
452 GeoLogVol* ring2_log =
new GeoLogVol(baseName+
"Ring2",ring2_shape,Iron);
453 GeoIntrusivePtr<GeoPhysVol> ring2_phys =
new GeoPhysVol(ring2_log);
455 GeoTubs* ring3_shape =
new GeoTubs(
456 R_ring+DeltaR1_ring+DeltaR2_ring,
457 R_ring+DeltaR1_ring+DeltaR2_ring+DeltaR3_ring,
461 GeoLogVol* ring3_log =
new GeoLogVol(baseName+
"Ring3",ring3_shape,Iron);
462 GeoIntrusivePtr<GeoPhysVol> ring3_phys =
new GeoPhysVol(ring3_log);
464 static const double zring[6] = {397.,805.,1255.,1750.,2316.,2868.};
465 for (
int iring=0; iring < 6; iring++)
467 double Zcd = zring[iring]-LAr_z_max/2.+Cryo_z0;
469 std::cout <<
" Position ring in LAr mother volume at z = "
470 << Zcd <<
" (z atlas= " << zring[iring] << std::endl;
472 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
473 moth_phys->add(ring1_phys);
474 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
475 moth_phys->add(ring2_phys);
476 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
477 moth_phys->add(ring3_phys);
488 rmin = LAr_outer_radius;
489 rmax = LAr_outer_radius + DeltaRout_cold;
491 std::cout <<
" " << std::endl;
492 std::cout <<
"** Cryostat after calo " << std::endl;
493 std::cout <<
"cold vessel from " << rmin <<
" to " << rmax << std::endl;
494 std::cout <<
" position in mother in z " << -Dz_end_tot/2. << std::endl;
496 GeoTubs * CryoC2_tube =
new GeoTubs(
499 (Cryo_Distz-Dz_end_tot)/2.,
502 GeoLogVol* CryoC2_log =
new GeoLogVol(baseName+
"ColdTube2",CryoC2_tube,Aluminium);
503 GeoIntrusivePtr<GeoPhysVol> CryoC2_phys =
new GeoPhysVol(CryoC2_log);
504 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
505 Cent_phys->add(CryoC2_phys);
509 rmax = rmin + DeltaRout_vac;
511 std::cout <<
"vacuum from " << rmin <<
" to " << rmax << std::endl;
513 GeoTubs* CryoV2_tube =
new GeoTubs(
516 (Cryo_Distz-Dz_end_tot)/2.,
519 GeoLogVol* CryoV2_log =
new GeoLogVol(baseName+
"VacTube2",CryoV2_tube,Vacuum);
520 GeoIntrusivePtr<GeoPhysVol> CryoV2_phys =
new GeoPhysVol(CryoV2_log);
521 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
522 Cent_phys->add(CryoV2_phys);
526 rmax = rmin + DeltaRout_warm;
528 std::cout <<
"warm vessel from " << rmin <<
" to " << rmax << std::endl;
530 GeoTubs* CryoW2_tube =
new GeoTubs(
533 (Cryo_Distz-Dz_end_tot)/2.,
536 GeoLogVol* CryoW2_log =
new GeoLogVol(baseName+
"WarmTube2",CryoW2_tube,Aluminium);
537 GeoIntrusivePtr<GeoPhysVol> CryoW2_phys =
new GeoPhysVol(CryoW2_log);
538 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
539 Cent_phys->add(CryoW2_phys);
548 std::cout <<
"End plate for warm vessel Rmin,Rmax " << Rmin_mother <<
" "
549 << Rmax_mother << std::endl;
550 std::cout <<
" half size in z " << Dz_end_warm/2. << std::endl;
552 GeoTubs* CryoEndW_tube =
new GeoTubs(
558 GeoLogVol* CryoEndW_log =
new GeoLogVol(baseName+
"EndWarm",CryoEndW_tube,Aluminium);
559 GeoIntrusivePtr<GeoPhysVol> CryoEndW_phys =
new GeoPhysVol(CryoEndW_log);
560 double zwarm = Cryo_Distz/2. - Dz_end_warm/2.;
562 std::cout <<
" position in mother at z " << zwarm << std::endl;
564 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zwarm)));
565 Cent_phys->add(CryoEndW_phys);
569 std::cout <<
"End plate for vacuum Rmin,Rmax " << Rmin_mother <<
" "
570 << Rmax_mother << std::endl;
571 std::cout <<
" half size in z " << Dz_end_vac/2. << std::endl;
573 GeoTubs* CryoEndV_tube =
new GeoTubs(
579 GeoLogVol* CryoEndV_log =
new GeoLogVol(baseName+
"EndVac",CryoEndV_tube,Vacuum);
580 GeoIntrusivePtr<GeoPhysVol> CryoEndV_phys =
new GeoPhysVol(CryoEndV_log);
581 double zvac = Cryo_Distz/2. - Dz_end_warm - Dz_end_vac/2.;
583 std::cout <<
" position in mother at z " << zvac << std::endl;
585 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zvac)));
586 Cent_phys->add(CryoEndV_phys);
590 std::cout <<
"End plate for cold vessel Rmin,Rmax " << Rmin_mother <<
" "
591 << Rmax_mother << std::endl;
592 std::cout <<
" half size in z " << Dz_end_cold/2. << std::endl;
594 GeoTubs* CryoEndC_tube =
new GeoTubs(
600 GeoLogVol* CryoEndC_log =
new GeoLogVol(baseName+
"EndCold",CryoEndC_tube,Aluminium);
601 GeoIntrusivePtr<GeoPhysVol> CryoEndC_phys =
new GeoPhysVol(CryoEndC_log);
602 double zcold = Cryo_Distz/2. - Dz_end_warm - Dz_end_vac -Dz_end_cold/2.;
604 std::cout <<
" position in mother at z " << zcold << std::endl;
606 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zcold)));
607 Cent_phys->add(CryoEndC_phys);
615 #ifdef BUILD_LARMODULE
624 double Zcd = -LAr_z_max/2.+Cryo_z0;
627 std::cout <<
" " << std::endl;
628 std::cout <<
" Position ECAM volume in mother LAr at z " << Zcd << std::endl;
631 if (barrelEnvelope ) {
632 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
633 moth_phys->add(barrelEnvelope);
640 #ifdef BUILD_PRESAMPLER
642 GeoIntrusivePtr<GeoFullPhysVol> barrelPSEnvelope = barrelPSConstruction.
GetPositiveEnvelope();
653 Zcd = presamplerShift+PresamplerMother_length-LAr_z_max/2.+Cryo_z0;
656 std::cout <<
" " << std::endl;
657 std::cout <<
" Position PS volume in mother LAr at z " << Zcd << std::endl;
660 if (barrelPSEnvelope ) {
661 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
662 moth_phys->add(barrelPSEnvelope);
665 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store PRESAMPLER_B_POS");
670 return cryoMotherPhysical;