66 ISvcLocator *svcLocator = Gaudi::svcLocator();
68 if (svcLocator->service(
"MessageSvc",
msgSvc,
true )==StatusCode::FAILURE) {
69 throw std::runtime_error(
"Error in EMBConstruction, cannot access MessageSvc");
72 MsgStream
log(
msgSvc,
"LAr::DetectorFactory");
74 log <<MSG::INFO <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++i++" <<
endmsg;
76 log <<MSG::INFO <<
"+ HELLO from LArGeo::TBBarrelCryostatConstruction +" <<
endmsg;
78 log <<MSG::INFO <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++" <<
endmsg;
82 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
83 throw std::runtime_error(
"Error in LArDetectorFactory, cannot access DetectorStore");
90 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
92 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
94 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Air is not found.");
97 const GeoMaterial *Aluminium = materialManager->
getMaterial(
"std::Aluminium");
99 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Aluminium is not found.");
102 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
104 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::LiquidArgon is not found.");
107 const GeoMaterial* Iron = materialManager->
getMaterial(
"std::Iron");
109 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, std::Iron is not found.");
112 const GeoElement* Hydrogen = materialManager->
getElement(
"Hydrogen");
114 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, hydrogen not found.");
117 const GeoElement* Carbon = materialManager->
getElement(
"Carbon");
119 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, carbon not found.");
122 const GeoElement* Oxygen = materialManager->
getElement(
"Oxygen");
124 throw std::runtime_error(
"Error in TBBarrelCryostatConstruction, oxygen not found.");
128 Vacuum->add(Hydrogen,1.);
135 GeoMaterial* Foam =
new GeoMaterial(
"Foam", density);
136 double fraction=8*1.01/(5*12.01+8*1.01+2.*16.0);
137 Foam->add(Hydrogen,fraction);
138 fraction=5.*12.01/(5*12.01+8*1.01+2.*16.0);
139 Foam->add(Carbon,fraction);
140 fraction=2.*16.0/(5*12.01+8*1.01+2.*16.0);
141 Foam->add(Oxygen,fraction);
144 std::cout <<
" Foam density,rad length from GeoModel " << density <<
" " << Foam->getRadLength() << std::endl;
148 std::string baseName =
"LAr::TBBarrel::Cryostat::";
156 double zp[3] ={-1050.,0.,3810.};
157 double ri[3] ={965.,965.,965.};
158 double ro[3] ={2270.,2270.,2270.};
160 std::cout <<
" " << std::endl;
161 std::cout <<
" Pcone volume for overall envelope " << std::endl;
162 std::cout <<
" phi0=-25deg, Dphi=50deg " << std::endl;
163 for (
int i=0;
i<3;
i++) {
164 std::cout <<
" Plane zp/ri/ro " << zp[
i] <<
" " << ri[
i] <<
" " << ro[
i] << std::endl;
168 for (
int i=0;
i < 3;
i++) Em_pcone->addPlane(zp[
i],ri[
i],ro[
i]);
170 const GeoLogVol* cryoMotherLogical =
171 new GeoLogVol(baseName+
"Envelope",Em_pcone, Air);
193 double Dz_end_tot = Dz_end_warm + Dz_end_vac + Dz_end_cold;
196 double Cryo_Xcent = 3363.;
198 double Cryo_Rmax_C = 2326.;
199 double Cryo_Rmin_C = Cryo_Rmax_C - DeltaR_cold;
201 double Cryo_Rmax_W = 2396.;
202 double Cryo_Rmin_W = Cryo_Rmax_W - DeltaR_warm;
207 double Rmin_mother = Cryo_Xcent-Cryo_Rmax_W;
208 double Rmax_mother = 2270.;
223 std::cout <<
" " << std::endl;
224 std::cout <<
"** Mother Volume for TB cryostat (Tubs) " << std::endl;
225 std::cout <<
" (matter = foam) " << std::endl;
226 std::cout <<
" Rmin/Rmax " << Rmin_mother <<
" " << Rmax_mother << std::endl;
227 std::cout <<
" Dz/2 " << Cryo_Distz/2. << std::endl;
232 GeoTubs* Cent_tube =
new GeoTubs(Rmin_mother,
237 GeoLogVol* Cent_log =
new GeoLogVol(baseName+
"Mother",Cent_tube,Foam);
239 double zpos = Cryo_Distz/2.-Cryo_z0;
242 GeoIntrusivePtr<GeoPhysVol> Cent_phys =
new GeoPhysVol(Cent_log);
255 std::cout <<
" " << std::endl;
256 std::cout <<
" ** Cryostat before LAr (shape=Tubs)" << std::endl;
257 std::cout <<
" center in x = " << Cryo_Xcent << std::endl;
258 std::cout <<
" angle 180-11 deg, span = 14 deg" << std::endl;
259 std::cout <<
" R warm vessel " << Cryo_Rmin_W <<
" "
260 << Cryo_Rmax_W << std::endl;
261 std::cout <<
" R vacuum " << Cryo_Rmax_C <<
" "
262 << Cryo_Rmin_W << std::endl;
263 std::cout <<
" R cold vessel " << Cryo_Rmin_C <<
" "
264 << Cryo_Rmax_C << std::endl;
265 std::cout <<
" Half size in z " << (Cryo_Distz-Dz_end_tot)/2. << std::endl;
266 std::cout <<
" position in z in mother " << -Dz_end_tot/2. << std::endl;
269 GeoTubs* CryoW_tube =
new GeoTubs(
272 (Cryo_Distz-Dz_end_tot)/2.,
276 GeoLogVol* CryoW_log =
new GeoLogVol(baseName+
"WarmTube",
280 GeoIntrusivePtr<GeoPhysVol> CryoW_phys =
new GeoPhysVol(CryoW_log);
281 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
282 Cent_phys->add(CryoW_phys);
286 GeoTubs* CryoV_tube =
new GeoTubs(
289 (Cryo_Distz-Dz_end_tot)/2.,
293 GeoLogVol *CryoV_log =
new GeoLogVol(baseName+
"VacTube",
297 GeoIntrusivePtr<GeoPhysVol> CryoV_phys =
new GeoPhysVol(CryoV_log);
298 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
299 Cent_phys->add(CryoV_phys);
303 GeoTubs* CryoC_tube =
new GeoTubs(
306 (Cryo_Distz-Dz_end_tot)/2.,
310 GeoLogVol *CryoC_log =
new GeoLogVol(baseName+
"ColdTube",
314 GeoIntrusivePtr<GeoPhysVol> CryoC_phys =
new GeoPhysVol(CryoC_log);
315 Cent_phys->add(
new GeoTransform(GeoTrf::Translate3D(Cryo_Xcent, 0., -Dz_end_tot/2.)));
316 Cent_phys->add(CryoC_phys);
328 double LAr_outer_radius=Rmax_mother-DeltaRout_warm-DeltaRout_cold
331 double LAr_z_max = Cryo_Distz-Dz_end_tot;
334 std::cout <<
" " << std::endl;
335 std::cout <<
" *** LAr volume (tubs put in foam)" << std::endl;
336 std::cout <<
"Rmin/Rmax " << LAr_inner_radius <<
" "
337 << LAr_outer_radius << std::endl;
340 std::cout <<
"DeltaZ/2 " << LAr_z_max/2. << std::endl;
341 std::cout <<
"Position in z in mother " << (LAr_z_max-Cryo_Distz)/2. << std::endl;
346 GeoTubs* moth_tube =
new GeoTubs( LAr_inner_radius,
352 GeoLogVol* moth_log =
new GeoLogVol(baseName+
"LAr",moth_tube,
LAr);
354 GeoIntrusivePtr<GeoPhysVol> moth_phys =
new GeoPhysVol(moth_log);
356 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D((LAr_z_max-Cryo_Distz)/2.)));
357 Cent_phys->add(moth_phys);
395 for (
int ilar=0;ilar<5;ilar++) {
396 double r1=LAr_inner_radius-delta_LAr[ilar];
397 double r2=LAr_inner_radius;
400 std::cout <<
" Ar additionnal volume before PS " <<
r1 <<
" "
404 GeoTubs* lar_tube =
new GeoTubs(r1,
410 GeoLogVol* lar_log =
new GeoLogVol(baseName+
"LAr2",lar_tube,
LAr);
412 GeoIntrusivePtr<GeoPhysVol> lar_phys =
new GeoPhysVol(lar_log);
413 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D((LAr_z_max-Cryo_Distz)/2.)));
414 Cent_phys->add(lar_phys);
423 #ifdef BUILD_SUPPORTRING
425 double R_ring = 2003.6;
426 double DeltaR1_ring = 12.0;
427 double DeltaZ1_ring = 80.0;
428 double DeltaR2_ring = 75.7;
429 double DeltaZ2_ring = 10.0;
430 double DeltaR3_ring = 12.0;
431 double DeltaZ3_ring = 80.0;
434 std::cout <<
" " << std::endl;
435 std::cout <<
" *** Support Ring1: R/DR/DZ " << R_ring <<
" "
436 << DeltaR1_ring <<
" " << DeltaZ1_ring << std::endl;
437 std::cout <<
" Ring2: R/DR/DZ " << R_ring+DeltaR1_ring <<
" "
438 << DeltaR2_ring <<
" " << DeltaZ2_ring << std::endl;
439 std::cout <<
" Ring3: R/DR/DZ " << R_ring+DeltaR1_ring+DeltaR2_ring <<
" "
440 << DeltaR3_ring <<
" " << DeltaZ3_ring << std::endl;
444 GeoTubs* ring1_shape =
new GeoTubs(
450 GeoLogVol* ring1_log =
new GeoLogVol(baseName+
"Ring1",ring1_shape,Iron);
451 GeoIntrusivePtr<GeoPhysVol> ring1_phys =
new GeoPhysVol(ring1_log);
453 GeoTubs* ring2_shape =
new GeoTubs(
455 R_ring+DeltaR1_ring+DeltaR2_ring,
459 GeoLogVol* ring2_log =
new GeoLogVol(baseName+
"Ring2",ring2_shape,Iron);
460 GeoIntrusivePtr<GeoPhysVol> ring2_phys =
new GeoPhysVol(ring2_log);
462 GeoTubs* ring3_shape =
new GeoTubs(
463 R_ring+DeltaR1_ring+DeltaR2_ring,
464 R_ring+DeltaR1_ring+DeltaR2_ring+DeltaR3_ring,
468 GeoLogVol* ring3_log =
new GeoLogVol(baseName+
"Ring3",ring3_shape,Iron);
469 GeoIntrusivePtr<GeoPhysVol> ring3_phys =
new GeoPhysVol(ring3_log);
471 static const double zring[6] = {397.,805.,1255.,1750.,2316.,2868.};
472 for (
int iring=0; iring < 6; iring++)
474 double Zcd = zring[iring]-LAr_z_max/2.+Cryo_z0;
476 std::cout <<
" Position ring in LAr mother volume at z = "
477 << Zcd <<
" (z atlas= " << zring[iring] << std::endl;
479 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
480 moth_phys->add(ring1_phys);
481 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
482 moth_phys->add(ring2_phys);
483 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
484 moth_phys->add(ring3_phys);
495 rmin = LAr_outer_radius;
496 rmax = LAr_outer_radius + DeltaRout_cold;
498 std::cout <<
" " << std::endl;
499 std::cout <<
"** Cryostat after calo " << std::endl;
500 std::cout <<
"cold vessel from " << rmin <<
" to " << rmax << std::endl;
501 std::cout <<
" position in mother in z " << -Dz_end_tot/2. << std::endl;
503 GeoTubs * CryoC2_tube =
new GeoTubs(
506 (Cryo_Distz-Dz_end_tot)/2.,
509 GeoLogVol* CryoC2_log =
new GeoLogVol(baseName+
"ColdTube2",CryoC2_tube,Aluminium);
510 GeoIntrusivePtr<GeoPhysVol> CryoC2_phys =
new GeoPhysVol(CryoC2_log);
511 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
512 Cent_phys->add(CryoC2_phys);
516 rmax = rmin + DeltaRout_vac;
518 std::cout <<
"vacuum from " << rmin <<
" to " << rmax << std::endl;
520 GeoTubs* CryoV2_tube =
new GeoTubs(
523 (Cryo_Distz-Dz_end_tot)/2.,
526 GeoLogVol* CryoV2_log =
new GeoLogVol(baseName+
"VacTube2",CryoV2_tube,Vacuum);
527 GeoIntrusivePtr<GeoPhysVol> CryoV2_phys =
new GeoPhysVol(CryoV2_log);
528 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
529 Cent_phys->add(CryoV2_phys);
533 rmax = rmin + DeltaRout_warm;
535 std::cout <<
"warm vessel from " << rmin <<
" to " << rmax << std::endl;
537 GeoTubs* CryoW2_tube =
new GeoTubs(
540 (Cryo_Distz-Dz_end_tot)/2.,
543 GeoLogVol* CryoW2_log =
new GeoLogVol(baseName+
"WarmTube2",CryoW2_tube,Aluminium);
544 GeoIntrusivePtr<GeoPhysVol> CryoW2_phys =
new GeoPhysVol(CryoW2_log);
545 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(-Dz_end_tot/2.)));
546 Cent_phys->add(CryoW2_phys);
555 std::cout <<
"End plate for warm vessel Rmin,Rmax " << Rmin_mother <<
" "
556 << Rmax_mother << std::endl;
557 std::cout <<
" half size in z " << Dz_end_warm/2. << std::endl;
559 GeoTubs* CryoEndW_tube =
new GeoTubs(
565 GeoLogVol* CryoEndW_log =
new GeoLogVol(baseName+
"EndWarm",CryoEndW_tube,Aluminium);
566 GeoIntrusivePtr<GeoPhysVol> CryoEndW_phys =
new GeoPhysVol(CryoEndW_log);
567 double zwarm = Cryo_Distz/2. - Dz_end_warm/2.;
569 std::cout <<
" position in mother at z " << zwarm << std::endl;
571 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zwarm)));
572 Cent_phys->add(CryoEndW_phys);
576 std::cout <<
"End plate for vacuum Rmin,Rmax " << Rmin_mother <<
" "
577 << Rmax_mother << std::endl;
578 std::cout <<
" half size in z " << Dz_end_vac/2. << std::endl;
580 GeoTubs* CryoEndV_tube =
new GeoTubs(
586 GeoLogVol* CryoEndV_log =
new GeoLogVol(baseName+
"EndVac",CryoEndV_tube,Vacuum);
587 GeoIntrusivePtr<GeoPhysVol> CryoEndV_phys =
new GeoPhysVol(CryoEndV_log);
588 double zvac = Cryo_Distz/2. - Dz_end_warm - Dz_end_vac/2.;
590 std::cout <<
" position in mother at z " << zvac << std::endl;
592 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zvac)));
593 Cent_phys->add(CryoEndV_phys);
597 std::cout <<
"End plate for cold vessel Rmin,Rmax " << Rmin_mother <<
" "
598 << Rmax_mother << std::endl;
599 std::cout <<
" half size in z " << Dz_end_cold/2. << std::endl;
601 GeoTubs* CryoEndC_tube =
new GeoTubs(
607 GeoLogVol* CryoEndC_log =
new GeoLogVol(baseName+
"EndCold",CryoEndC_tube,Aluminium);
608 GeoIntrusivePtr<GeoPhysVol> CryoEndC_phys =
new GeoPhysVol(CryoEndC_log);
609 double zcold = Cryo_Distz/2. - Dz_end_warm - Dz_end_vac -Dz_end_cold/2.;
611 std::cout <<
" position in mother at z " << zcold << std::endl;
613 Cent_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(zcold)));
614 Cent_phys->add(CryoEndC_phys);
622 #ifdef BUILD_LARMODULE
623 BarrelConstruction barrelConstruction(
true,
params);
626 GeoIntrusivePtr<GeoFullPhysVol> barrelEnvelope = barrelConstruction.GetPositiveEnvelope();
631 double Zcd = -LAr_z_max/2.+Cryo_z0;
634 std::cout <<
" " << std::endl;
635 std::cout <<
" Position ECAM volume in mother LAr at z " << Zcd << std::endl;
638 if (barrelEnvelope ) {
639 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
640 moth_phys->add(barrelEnvelope);
647 #ifdef BUILD_PRESAMPLER
648 BarrelPresamplerConstruction barrelPSConstruction(1,
params);
649 GeoIntrusivePtr<GeoFullPhysVol> barrelPSEnvelope = barrelPSConstruction.GetPositiveEnvelope();
660 Zcd = presamplerShift+PresamplerMother_length-LAr_z_max/2.+Cryo_z0;
663 std::cout <<
" " << std::endl;
664 std::cout <<
" Position PS volume in mother LAr at z " << Zcd << std::endl;
667 if (barrelPSEnvelope ) {
668 moth_phys->add(
new GeoTransform(GeoTrf::TranslateZ3D(Zcd)));
669 moth_phys->add(barrelPSEnvelope);
672 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store PRESAMPLER_B_POS");