299 ATH_MSG_INFO(
"**************************************************");
300 ATH_MSG_INFO(
" Building HGTD geometry , side = " << bPos <<
" ");
301 ATH_MSG_INFO(
"**************************************************" );
303 GeoFullPhysVol* HGTDparent =
new GeoFullPhysVol( logicalEnvelope );
306 double motherHalfZ = ((GeoTube*) HGTDparent->getLogVol()->getShape())->getZHalfLength();
307 double modulePackageHalfZtot = 3.5/2 + 4./2;
314 std::vector<std::string> hgtdVolumes;
315 hgtdVolumes.push_back(
"HGTD::ModeratorOut");
316 hgtdVolumes.push_back(
"HGTD::BackCover");
317 hgtdVolumes.push_back(
"HGTD::ToleranceBack");
318 hgtdVolumes.push_back(
"HGTD::ModeratorIn");
320 hgtdVolumes.push_back(
"HGTD::ModuleLayer3");
321 hgtdVolumes.push_back(
"HGTD::SupportPlate");
322 hgtdVolumes.push_back(
"HGTD::CoolingPlate");
323 hgtdVolumes.push_back(
"HGTD::SupportPlate");
324 hgtdVolumes.push_back(
"HGTD::ModuleLayer2");
326 hgtdVolumes.push_back(
"HGTD::ToleranceMid");
328 hgtdVolumes.push_back(
"HGTD::ModuleLayer1");
329 hgtdVolumes.push_back(
"HGTD::SupportPlate");
330 hgtdVolumes.push_back(
"HGTD::CoolingPlate");
331 hgtdVolumes.push_back(
"HGTD::SupportPlate");
332 hgtdVolumes.push_back(
"HGTD::ModuleLayer0");
334 hgtdVolumes.push_back(
"HGTD::ToleranceFront");
335 hgtdVolumes.push_back(
"HGTD::FrontCover");
337 hgtdVolumes.push_back(
"HGTD::InnerRCover1");
338 hgtdVolumes.push_back(
"HGTD::InnerRCover2");
339 hgtdVolumes.push_back(
"HGTD::InnerRCover3");
340 hgtdVolumes.push_back(
"HGTD::OuterRCover");
341 hgtdVolumes.push_back(
"HGTD::PeripheralCoolingLines");
355 std::vector<double> flexSheetInnerR;
356 double currentInnerR = 144.;
357 for (
int flexSheet = 0; flexSheet < 8; flexSheet++) {
358 flexSheetInnerR.push_back(currentInnerR);
360 currentInnerR +=
m_boxVolPars[
"HGTDModule0"].xHalf*2 * (2 + 2 * (flexSheet < 4 ? 0.2 : 0.8) );
364 GeoPhysVol* flexPackagePhysical[2] = {};
365 for (
int flexVolume = 0; flexVolume < 2; flexVolume++) {
366 std::vector<double> rInner = flexSheetInnerR;
367 if (flexVolume)
reverse(rInner.begin(), rInner.end());
369 GeoTube* flexPackageSolid =
new GeoTube(packagePars.
rMin, packagePars.
rMax, packagePars.
zHalf);
371 flexPackagePhysical[flexVolume] =
new GeoPhysVol(flexPackageLogical);
373 double flexZoffset = packagePars.
zHalf - flexPars.
zHalf;
374 for (
int flexSheet = 0; flexSheet < 8; flexSheet++) {
375 GeoTube* hgtdFlexSolid =
new GeoTube(rInner[flexSheet], flexPars.
rMax, flexPars.
zHalf);
376 GeoLogVol* hgtdFlexLogical =
new GeoLogVol(
"HGTD::FlexTube"+
std::to_string(flexSheet),
378 GeoPhysVol* hgtdFlexPhysical =
new GeoPhysVol(hgtdFlexLogical);
379 flexPackagePhysical[flexVolume]->add(
new GeoTransform(GeoTrf::TranslateZ3D(flexZoffset)));
380 flexPackagePhysical[flexVolume]->add(hgtdFlexPhysical);
382 ATH_MSG_DEBUG(
"Flex layer (" << (flexSheet ?
"front" :
"back") <<
")" << flexSheet <<
", Rmin = " << std::setw(5)
383 << rInner[flexSheet] <<
" mm, flexZoffset = " << flexZoffset <<
" mm" );
393 std::vector<double> coolingTubeRadii;
394 double coolingTubeRadius = 130.;
395 coolingTubeRadii.push_back(coolingTubeRadius);
399 ATH_MSG_INFO(
"Will now calculate cooling-loop positions for the two-ring layout");
400 for (
int i = 0;
i < 18;
i++) {
401 coolingTubeRadius += (418-130.)/18;
402 coolingTubeRadii.push_back(coolingTubeRadius);
404 for (
int i = 0;
i < 12;
i++) {
405 coolingTubeRadius += (658-418.)/14;
406 coolingTubeRadii.push_back(coolingTubeRadius);
408 coolingTubeRadius = 710.;
409 coolingTubeRadii.push_back(coolingTubeRadius);
410 for (
int i = 0;
i < 7;
i++) {
411 coolingTubeRadius += (890-710.)/6;
412 coolingTubeRadii.push_back(coolingTubeRadius);
416 ATH_MSG_INFO(
"Will now calculate cooling-loop positions for the three-ring layout");
418 int numberOfLoops = 34;
419 float loopDistance = (674.-130.)/numberOfLoops;
420 for (
int i = 0;
i < numberOfLoops;
i++) {
421 coolingTubeRadius += loopDistance;
422 coolingTubeRadii.push_back(coolingTubeRadius);
425 coolingTubeRadius = 720;
426 coolingTubeRadii.push_back(coolingTubeRadius);
428 loopDistance = (900.-720.)/numberOfLoops;
429 for (
int i = 0;
i < numberOfLoops;
i++) {
430 coolingTubeRadius += loopDistance;
431 coolingTubeRadii.push_back(coolingTubeRadius);
434 ATH_MSG_DEBUG(
"Cooling tubes will be created at the following radii (" << coolingTubeRadii.size() <<
" in total):");
435 for (
size_t i = 0;
i < coolingTubeRadii.size();
i++) {
445 GeoTube* periphElec_solid =
new GeoTube(periphElPars.
rMin, periphElPars.
rMax, periphElPars.
zHalf);
447 GeoPhysVol* periphElec_phys =
new GeoPhysVol(periphElec_log);
449 std::array< GeoPhysVol*, 4 > moduleLayerPhysical = {};
456 double zModuleLayerF = 0.;
457 double zModuleLayerB = 0.;
458 for (
size_t vol = 0; vol < hgtdVolumes.size(); vol++) {
460 std::string
v = hgtdVolumes[vol];
469 if (
v.substr(9,8) !=
"erRCover" &&
v !=
"HGTD::PeripheralCoolingLines") {
470 std::string vPrev = hgtdVolumes[vol-1];
476 if (
v.substr(0,15) ==
"HGTD::Tolerance")
continue;
479 if (
v.substr(0,17) ==
"HGTD::ModuleLayer")
485 GeoPhysVol* hgtdSubVolumePhysical =
new GeoPhysVol(hgtdSubVolumeLogical);
488 if (
v ==
"HGTD::CoolingPlate") {
491 static constexpr std::array<int,2> signArr{1,-1};
494 HGTDparent->add(
new GeoTransform(GeoTrf::TranslateZ3D(
m_cylVolPars[
v].zOffsetLocal + signArr[
side]*zOffsetPeriphElec)));
495 HGTDparent->add(periphElec_phys);
499 for (
size_t i = 0;
i < coolingTubeRadii.size();
i++) {
501 GeoTorus* coolingTubeSolid =
new GeoTorus(
m_cylVolPars[
"HGTD::CoolingTubeFluid"].zHalf,
m_cylVolPars[
"HGTD::CoolingTube"].zHalf,
502 coolingTubeRadii[
i], 0, 2*
M_PI);
503 GeoLogVol* coolingTubeLogical =
new GeoLogVol(
"HGTD::CoolingTube", coolingTubeSolid,
505 GeoPhysVol* coolingTubePhysical =
new GeoPhysVol(coolingTubeLogical);
506 hgtdSubVolumePhysical->add(coolingTubePhysical);
508 GeoTorus* coolingFluidSolid =
new GeoTorus(0,
m_cylVolPars[
"HGTD::CoolingTubeFluid"].zHalf,
509 coolingTubeRadii[
i], 0, 2*
M_PI);
510 GeoLogVol* coolingFluidLogical =
new GeoLogVol(
"HGTD::CoolingFluid", coolingFluidSolid,
512 GeoPhysVol* coolingFluidPhysical =
new GeoPhysVol(coolingFluidLogical);
513 hgtdSubVolumePhysical->add(coolingFluidPhysical);
518 if (
v.substr(0,17) ==
"HGTD::ModuleLayer") {
524 bool Lside =
layer % 2;
526 zFlex = -modulePackageHalfZtot +
m_cylVolPars[
"HGTD::FlexPackage"].zHalf;
527 zModuleLayerF = modulePackageHalfZtot - modulePackageHalfZ;
530 zFlex = modulePackageHalfZtot -
m_cylVolPars[
"HGTD::FlexPackage"].zHalf;
531 zModuleLayerB = -modulePackageHalfZtot + modulePackageHalfZ;
535 hgtdSubVolumePhysical->add(
new GeoTransform(GeoTrf::TranslateZ3D(zFlex)));
536 hgtdSubVolumePhysical->add(flexPackagePhysical[(Lside ? 0 : 1)]);
540 HGTDparent->add(
new GeoTransform( GeoTrf::TranslateZ3D(
m_cylVolPars[
v].zOffsetLocal) *
544 HGTDparent->add( hgtdSubVolumePhysical );
545 moduleLayerPhysical[
layer] = hgtdSubVolumePhysical;
549 HGTDparent->add(
new GeoTransform(GeoTrf::TranslateZ3D(
m_cylVolPars[
v].zOffsetLocal)));
550 HGTDparent->add(hgtdSubVolumePhysical);
555 <<
" ), local z = " << std::setw(6) <<
m_cylVolPars[
v].zOffsetLocal
558 <<
" mm, DZ = " << std::setw(5) <<
m_cylVolPars[
v].zHalf <<
" mm" );
567 std::vector<std::string> moduleVolumes;
568 moduleVolumes.push_back(
"HGTD::GlueAsic");
569 moduleVolumes.push_back(
"HGTD::ASIC");
570 moduleVolumes.push_back(
"HGTD::LGADInactive");
571 moduleVolumes.push_back(
"SensorPlaceHolder");
572 moduleVolumes.push_back(
"HGTD::GlueSensor");
573 moduleVolumes.push_back(
"HGTD::Hybrid");
574 moduleVolumes.push_back(
"HGTD::ModuleSpace");
576 int endcap = bPos ? +2 : -2;
577 double thickness = 2.*
m_boxVolPars[
"HGTDSiSensor0"].zHalf;
585 unsigned int maxRows = 21;
596 int Lside =
layer % 2;
598 std::vector<std::string> volumes = moduleVolumes;
599 if ( Lside != 0 )
reverse( volumes.begin(), volumes.end() );
608 double moduleHalfWidth =
m_boxVolPars[moduleName].xHalf;
609 double moduleHalfHeight =
m_boxVolPars[moduleName].yHalf;
615 for (
int q = 0;
q < 4;
q++) {
616 float quadrot =
q*90.;
618 for (
unsigned int row = 0;
row < maxRows;
row ++ ) {
619 std::vector< ModulePosition > ModsPerRow = tmpQuadrant[
row ];
622 if (
m_outputIdfr &&
q == 0 ) std::cout <<
" Row #"<<
row + 1 <<
" :: " << ModsPerRow.size() << std::endl;
624 for (
unsigned int mod = 0;
mod < ModsPerRow.size();
mod ++ ) {
627 double myx = -9999999.9 , myy = -9999999.9 , myrot = -9999999.9;
628 int myphi = -1 , myeta = - 1;
629 std::string module_string =
formModuleName(
layer,
q, maxRows,
row,
mod,
module, myx, myy, myrot, myphi, myeta );
631 if ( module_string ==
"" || myrot == -9999999.9 || myeta == -1 )
632 ATH_MSG_WARNING (
" Please check the module at layer "<<
layer <<
" quadrant " <<
q <<
" row "<<
row <<
" mod " <<
mod <<
" not well retrieved ! " );
635 GeoBox* moduleSolid =
new GeoBox( moduleHalfWidth, moduleHalfHeight, modulePackageHalfZ);
636 GeoLogVol* moduleLogical =
new GeoLogVol( moduleName + module_string, moduleSolid,
m_materialMgr->
getMaterial(
"std::Air"));
637 GeoFullPhysVol* modulePhysical =
new GeoFullPhysVol( moduleLogical );
640 if (
q == 0 &&
row == 0 &&
mod == 0 )
641 ATH_MSG_DEBUG(
"Will now build up an individual HGTD module of layer " <<
layer <<
" and quadrant " <<
q <<
" (" << module_string <<
")" );
645 if (volumes[
comp] ==
"SensorPlaceHolder") volumes[
comp] = sensorName;
647 std::string
c = volumes[
comp];
652 std::string cPrev = volumes[
comp-1];
657 if (volumes[
comp] ==
"HGTD::ModuleSpace")
continue;
663 double xOffsetLocal = moduleHalfWidth - comp_halfx;
666 GeoBox* sensorCompSolidVol =
new GeoBox(comp_halfx, comp_halfy,
m_boxVolPars[
c].zHalf);
670 GeoLogVol* sensorCompLogicalVol =
new GeoLogVol(
m_boxVolPars[
c].
name+attach, sensorCompSolidVol,
672 GeoFullPhysVol* sensorCompPhysicalVol =
new GeoFullPhysVol(sensorCompLogicalVol);
674 if (volumes[
comp] == sensorName) {
681 <<
" upon HGTD_ID => ec: " << endcap <<
", layer: " <<
layer <<
", quadrant: " <<
q
682 <<
", row: " << myphi <<
", module: "<< myeta );
683 ATH_MSG_DEBUG(
" HGTD Module: " <<
m_boxVolPars[
c].
name+module_string <<
", posX: " << myx <<
", posY: " << myy <<
", rot: " << quadrot + myrot );
690 GeoAlignableTransform* xform =
new GeoAlignableTransform(sensorTransform);
692 modulePhysical->add( xform );
693 modulePhysical->add( sensorCompPhysicalVol );
698 modulePhysical->add(
new GeoTransform(GeoTrf::TranslateZ3D(
m_boxVolPars[
c].zOffsetLocal)*GeoTrf::TranslateX3D(xOffsetLocal)));
699 modulePhysical->add(sensorCompPhysicalVol);
703 if (
mod == 0 &&
q == 0 && volumes[
comp] != sensorName )
705 <<
" ), in-sensor-layer local z = " << std::setw(7) <<
m_boxVolPars[
c].zOffsetLocal <<
" mm"
706 <<
", DX = " << std::setw(5) <<
m_boxVolPars[
c].xHalf <<
" mm"
707 <<
", DY = " << std::setw(5) <<
m_boxVolPars[
c].yHalf <<
" mm"
708 <<
", DZ = " << std::setw(5) <<
m_boxVolPars[
c].zHalf <<
" mm" );
711 double zModule = ( Lside == 0 ? zModuleLayerF : zModuleLayerB );
713 GeoTransform* moduleTransform =
new GeoTransform( GeoTrf::TranslateZ3D(zModule) *
714 GeoTrf::TranslateX3D(myx) *
715 GeoTrf::TranslateY3D(myy) *
717 moduleLayerPhysical[
layer]->add( moduleTransform );
718 moduleLayerPhysical[
layer]->add( modulePhysical );
727 ATH_MSG_INFO(
"**************************************************" );
728 ATH_MSG_INFO(
" Done building HGTD with " << totMod <<
" modules " );
729 ATH_MSG_INFO(
"**************************************************" );