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!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
483 string myns{mynamespace(
args.parentName()).
data(), mynamespace(
args.parentName()).
size()};
488 bar.name =
args.str(
"BarName");
490 bar.vecZPts =
args.vecDble(
"BarZPts");
491 bar.vecRMin =
args.vecDble(
"BarRMin");
492 bar.vecRMax =
args.vecDble(
"BarRMax");
493 bar.vecTran =
args.vecDble(
"BarTran");
494 bar.vecRota =
args.vecDble(
"BarRota");
495 bar.vecRota2 =
args.vecDble(
"BarRota2");
496 bar.vecRota3 =
args.vecDble(
"BarRota3");
497 bar.phiLo =
args.dble(
"BarPhiLo");
498 bar.phiHi =
args.dble(
"BarPhiHi");
499 bar.here =
args.dble(
"BarHere");
503 spm.name =
args.str(
"SpmName");
504 spm.mat =
args.str(
"SpmMat");
505 spm.vecZPts =
args.vecDble(
"SpmZPts");
506 spm.vecRMin =
args.vecDble(
"SpmRMin");
507 spm.vecRMax =
args.vecDble(
"SpmRMax");
508 spm.vecTran =
args.vecDble(
"SpmTran");
509 spm.vecRota =
args.vecDble(
"SpmRota");
510 spm.vecBTran =
args.vecDble(
"SpmBTran");
511 spm.vecBRota =
args.vecDble(
"SpmBRota");
512 spm.nPerHalf =
args.integer(
"SpmNPerHalf");
513 spm.lowPhi =
args.dble(
"SpmLowPhi");
514 spm.delPhi =
args.dble(
"SpmDelPhi");
515 spm.phiOff =
args.dble(
"SpmPhiOff");
516 spm.vecHere =
args.vecDble(
"SpmHere");
517 spm.cutName =
args.str(
"SpmCutName");
518 spm.cutThick =
args.dble(
"SpmCutThick");
519 spm.cutShow =
args.value<
int>(
"SpmCutShow");
520 spm.vecCutTM =
args.vecDble(
"SpmCutTM");
521 spm.vecCutTP =
args.vecDble(
"SpmCutTP");
522 spm.cutRM =
args.dble(
"SpmCutRM");
523 spm.cutRP =
args.dble(
"SpmCutRP");
524 spm.expThick =
args.dble(
"SpmExpThick");
525 spm.expWide =
args.dble(
"SpmExpWide");
526 spm.expYOff =
args.dble(
"SpmExpYOff");
527 spm.sideName =
args.str(
"SpmSideName");
528 spm.sideMat =
args.str(
"SpmSideMat");
529 spm.sideHigh =
args.dble(
"SpmSideHigh");
530 spm.sideThick =
args.dble(
"SpmSideThick");
531 spm.sideYOffM =
args.dble(
"SpmSideYOffM");
532 spm.sideYOffP =
args.dble(
"SpmSideYOffP");
535 cry.nomCryDimAF =
args.dble(
"NomCryDimAF");
536 cry.nomCryDimLZ =
args.dble(
"NomCryDimLZ");
537 cry.vecNomCryDimBF =
args.vecDble(
"NomCryDimBF");
538 cry.vecNomCryDimCF =
args.vecDble(
"NomCryDimCF");
539 cry.vecNomCryDimAR =
args.vecDble(
"NomCryDimAR");
540 cry.vecNomCryDimBR =
args.vecDble(
"NomCryDimBR");
541 cry.vecNomCryDimCR =
args.vecDble(
"NomCryDimCR");
543 cry.underAF =
args.dble(
"UnderAF");
544 cry.underLZ =
args.dble(
"UnderLZ");
545 cry.underBF =
args.dble(
"UnderBF");
546 cry.underCF =
args.dble(
"UnderCF");
547 cry.underAR =
args.dble(
"UnderAR");
548 cry.underBR =
args.dble(
"UnderBR");
549 cry.underCR =
args.dble(
"UnderCR");
552 alv.wallThAlv =
args.dble(
"WallThAlv");
553 alv.wrapThAlv =
args.dble(
"WrapThAlv");
554 alv.clrThAlv =
args.dble(
"ClrThAlv");
555 alv.vecGapAlvEta =
args.vecDble(
"GapAlvEta");
557 alv.wallFrAlv =
args.dble(
"WallFrAlv");
558 alv.wrapFrAlv =
args.dble(
"WrapFrAlv");
559 alv.clrFrAlv =
args.dble(
"ClrFrAlv");
561 alv.wallReAlv =
args.dble(
"WallReAlv");
562 alv.wrapReAlv =
args.dble(
"WrapReAlv");
563 alv.clrReAlv =
args.dble(
"ClrReAlv");
565 alv.nCryTypes =
args.integer(
"NCryTypes");
566 alv.nCryPerAlvEta =
args.integer(
"NCryPerAlvEta");
568 cry.name =
args.str(
"CryName");
569 cry.clrName =
args.str(
"ClrName");
570 cry.wrapName =
args.str(
"WrapName");
571 cry.wallName =
args.str(
"WallName");
573 cry.mat =
args.str(
"CryMat");
574 cry.clrMat =
args.str(
"ClrMat");
575 cry.wrapMat =
args.str(
"WrapMat");
576 cry.wallMat =
args.str(
"WallMat");
579 cap.name =
args.str(
"CapName");
580 cap.here =
args.dble(
"CapHere");
582 cap.xSize =
args.dble(
"CapXSize");
583 cap.ySize =
args.dble(
"CapYSize");
584 cap.thick =
args.dble(
"CapThick");
587 cer.name =
args.str(
"CerName");
588 cer.mat =
args.str(
"CerMat");
589 cer.xSize =
args.dble(
"CerXSize");
590 cer.ySize =
args.dble(
"CerYSize");
591 cer.thick =
args.dble(
"CerThick");
594 bSi.name =
args.str(
"BSiName");
595 bSi.mat =
args.str(
"BSiMat");
596 bSi.xSize =
args.dble(
"BSiXSize");
597 bSi.ySize =
args.dble(
"BSiYSize");
598 bSi.thick =
args.dble(
"BSiThick");
601 apd.name =
args.str(
"APDName");
602 apd.mat =
args.str(
"APDMat");
603 apd.side =
args.dble(
"APDSide");
604 apd.thick =
args.dble(
"APDThick");
605 apd.z =
args.dble(
"APDZ");
606 apd.x1 =
args.dble(
"APDX1");
607 apd.x2 =
args.dble(
"APDX2");
609 apd.atjName =
args.str(
"ATJName");
610 apd.atjMat =
args.str(
"ATJMat");
611 apd.atjThick =
args.dble(
"ATJThick");
613 apd.sglName =
args.str(
"SGLName");
614 apd.sglMat =
args.str(
"SGLMat");
615 apd.sglThick =
args.dble(
"SGLThick");
617 apd.aglName =
args.str(
"AGLName");
618 apd.aglMat =
args.str(
"AGLMat");
619 apd.aglThick =
args.dble(
"AGLThick");
621 apd.andName =
args.str(
"ANDName");
622 apd.andMat =
args.str(
"ANDMat");
623 apd.andThick =
args.dble(
"ANDThick");
626 web.here =
args.dble(
"WebHere");
627 web.plName =
args.str(
"WebPlName");
628 web.clrName =
args.str(
"WebClrName");
629 web.plMat =
args.str(
"WebPlMat");
630 web.clrMat =
args.str(
"WebClrMat");
631 web.vecWebPlTh =
args.vecDble(
"WebPlTh");
632 web.vecWebClrTh =
args.vecDble(
"WebClrTh");
633 web.vecWebLength =
args.vecDble(
"WebLength");
635 InnerLayerVolume ily;
636 ily.here =
args.dble(
"IlyHere");
637 ily.name =
args.str(
"IlyName");
638 ily.phiLow =
args.dble(
"IlyPhiLow");
639 ily.delPhi =
args.dble(
"IlyDelPhi");
640 ily.vecIlyMat =
args.vecStr(
"IlyMat");
641 ily.vecIlyThick =
args.vecDble(
"IlyThick");
643 ily.pipeName =
args.str(
"IlyPipeName");
644 ily.pipeHere =
args.dble(
"IlyPipeHere");
645 ily.pipeMat =
args.str(
"IlyPipeMat");
646 ily.pipeOD =
args.dble(
"IlyPipeOD");
647 ily.pipeID =
args.dble(
"IlyPipeID");
648 ily.vecIlyPipeLength =
args.vecDble(
"IlyPipeLength");
649 ily.vecIlyPipeType =
args.vecDble(
"IlyPipeType");
650 ily.vecIlyPipePhi =
args.vecDble(
"IlyPipePhi");
651 ily.vecIlyPipeZ =
args.vecDble(
"IlyPipeZ");
653 ily.pTMName =
args.str(
"IlyPTMName");
654 ily.pTMHere =
args.dble(
"IlyPTMHere");
655 ily.pTMMat =
args.str(
"IlyPTMMat");
656 ily.pTMWidthHalf = 0.5 *
args.dble(
"IlyPTMWidth");
657 ily.pTMLengthHalf = 0.5 *
args.dble(
"IlyPTMLength");
658 ily.pTMHeightHalf = 0.5 *
args.dble(
"IlyPTMHeight");
659 ily.vecIlyPTMZ =
args.vecDble(
"IlyPTMZ");
660 ily.vecIlyPTMPhi =
args.vecDble(
"IlyPTMPhi");
662 ily.fanOutName =
args.str(
"IlyFanOutName");
663 ily.fanOutHere =
args.dble(
"IlyFanOutHere");
664 ily.fanOutMat =
args.str(
"IlyFanOutMat");
665 ily.fanOutWidth =
args.dble(
"IlyFanOutWidth");
666 ily.fanOutLength =
args.dble(
"IlyFanOutLength");
667 ily.fanOutHeightHalf = 0.5 *
args.dble(
"IlyFanOutHeight");
668 ily.vecIlyFanOutZ =
args.vecDble(
"IlyFanOutZ");
669 ily.vecIlyFanOutPhi =
args.vecDble(
"IlyFanOutPhi");
670 ily.diffName =
args.str(
"IlyDiffName");
671 ily.diffMat =
args.str(
"IlyDiffMat");
672 ily.diffOff =
args.dble(
"IlyDiffOff");
673 ily.diffLength =
args.dble(
"IlyDiffLength");
674 ily.bndlName =
args.str(
"IlyBndlName");
675 ily.bndlMat =
args.str(
"IlyBndlMat");
676 ily.bndlOff =
args.dble(
"IlyBndlOff");
677 ily.bndlLength =
args.dble(
"IlyBndlLength");
678 ily.fEMName =
args.str(
"IlyFEMName");
679 ily.fEMMat =
args.str(
"IlyFEMMat");
680 ily.fEMWidth =
args.dble(
"IlyFEMWidth");
681 ily.fEMLength =
args.dble(
"IlyFEMLength");
682 ily.fEMHeight =
args.dble(
"IlyFEMHeight");
683 ily.vecIlyFEMZ =
args.vecDble(
"IlyFEMZ");
684 ily.vecIlyFEMPhi =
args.vecDble(
"IlyFEMPhi");
686 AlveolarWedge alvWedge;
687 alvWedge.hawRName =
args.str(
"HawRName");
688 alvWedge.fawName =
args.str(
"FawName");
689 alvWedge.fawHere =
args.dble(
"FawHere");
690 alvWedge.hawRHBIG =
args.dble(
"HawRHBIG");
691 alvWedge.hawRhsml =
args.dble(
"HawRhsml");
692 alvWedge.hawRCutY =
args.dble(
"HawRCutY");
693 alvWedge.hawRCutZ =
args.dble(
"HawRCutZ");
694 alvWedge.hawRCutDelY =
args.dble(
"HawRCutDelY");
695 alvWedge.hawYOffCry =
args.dble(
"HawYOffCry");
697 alvWedge.nFawPerSupm =
args.integer(
"NFawPerSupm");
698 alvWedge.fawPhiOff =
args.dble(
"FawPhiOff");
699 alvWedge.fawDelPhi =
args.dble(
"FawDelPhi");
700 alvWedge.fawPhiRot =
args.dble(
"FawPhiRot");
701 alvWedge.fawRadOff =
args.dble(
"FawRadOff");
707 grid.thick =
args.dble(
"GridThick");
710 back.here =
args.dble(
"BackHere");
711 back.xOff =
args.dble(
"BackXOff");
712 back.yOff =
args.dble(
"BackYOff");
713 back.sideName =
args.str(
"BackSideName");
714 back.sideHere =
args.dble(
"BackSideHere");
715 back.sideLength =
args.dble(
"BackSideLength");
716 back.sideHeight =
args.dble(
"BackSideHeight");
717 back.sideWidth =
args.dble(
"BackSideWidth");
718 back.sideYOff1 =
args.dble(
"BackSideYOff1");
719 back.sideYOff2 =
args.dble(
"BackSideYOff2");
720 back.sideAngle =
args.dble(
"BackSideAngle");
721 back.sideMat =
args.str(
"BackSideMat");
722 back.plateName =
args.str(
"BackPlateName");
723 back.plateHere =
args.dble(
"BackPlateHere");
724 back.plateLength =
args.dble(
"BackPlateLength");
725 back.plateThick =
args.dble(
"BackPlateThick");
726 back.plateWidth =
args.dble(
"BackPlateWidth");
727 back.plateMat =
args.str(
"BackPlateMat");
728 back.plate2Name =
args.str(
"BackPlate2Name");
729 back.plate2Thick =
args.dble(
"BackPlate2Thick");
730 back.plate2Mat =
args.str(
"BackPlate2Mat");
733 grille.name =
args.str(
"GrilleName");
734 grille.here =
args.dble(
"GrilleHere");
735 grille.thick =
args.dble(
"GrilleThick");
736 grille.width =
args.dble(
"GrilleWidth");
737 grille.zSpace =
args.dble(
"GrilleZSpace");
738 grille.mat =
args.str(
"GrilleMat");
739 grille.vecHeight =
args.vecDble(
"GrilleHeight");
740 grille.vecZOff =
args.vecDble(
"GrilleZOff");
742 grille.edgeSlotName =
args.str(
"GrEdgeSlotName");
743 grille.edgeSlotMat =
args.str(
"GrEdgeSlotMat");
744 grille.edgeSlotHere =
args.dble(
"GrEdgeSlotHere");
745 grille.edgeSlotHeight =
args.dble(
"GrEdgeSlotHeight");
746 grille.edgeSlotWidth =
args.dble(
"GrEdgeSlotWidth");
747 grille.midSlotName =
args.str(
"GrMidSlotName");
748 grille.midSlotMat =
args.str(
"GrMidSlotMat");
749 grille.midSlotHere =
args.dble(
"GrMidSlotHere");
750 grille.midSlotWidth =
args.dble(
"GrMidSlotWidth");
751 grille.midSlotXOff =
args.dble(
"GrMidSlotXOff");
752 grille.vecMidSlotHeight =
args.vecDble(
"GrMidSlotHeight");
755 backPipe.here =
args.dble(
"BackPipeHere");
756 backPipe.name =
args.str(
"BackPipeName");
757 backPipe.vecDiam =
args.vecDble(
"BackPipeDiam");
758 backPipe.vecThick =
args.vecDble(
"BackPipeThick");
759 backPipe.mat =
args.str(
"BackPipeMat");
760 backPipe.waterMat =
args.str(
"BackPipeWaterMat");
762 BackCooling backCool;
763 backCool.here =
args.dble(
"BackCoolHere");
764 backCool.vecName =
args.vecStr(
"BackCoolName");
765 backCool.barHere =
args.dble(
"BackCoolBarHere");
766 backCool.barWidth =
args.dble(
"BackCoolBarWidth");
767 backCool.barHeight =
args.dble(
"BackCoolBarHeight");
768 backCool.mat =
args.str(
"BackCoolMat");
769 backCool.barName =
args.str(
"BackCoolBarName");
770 backCool.barThick =
args.dble(
"BackCoolBarThick");
771 backCool.barMat =
args.str(
"BackCoolBarMat");
772 backCool.barSSName =
args.str(
"BackCoolBarSSName");
773 backCool.barSSThick =
args.dble(
"BackCoolBarSSThick");
774 backCool.barSSMat =
args.str(
"BackCoolBarSSMat");
775 backCool.barWaName =
args.str(
"BackCoolBarWaName");
776 backCool.barWaThick =
args.dble(
"BackCoolBarWaThick");
777 backCool.barWaMat =
args.str(
"BackCoolBarWaMat");
778 backCool.vFEHere =
args.dble(
"BackCoolVFEHere");
779 backCool.vFEName =
args.str(
"BackCoolVFEName");
780 backCool.vFEMat =
args.str(
"BackCoolVFEMat");
781 backCool.backVFEName =
args.str(
"BackVFEName");
782 backCool.backVFEMat =
args.str(
"BackVFEMat");
783 backCool.vecBackVFELyrThick =
args.vecDble(
"BackVFELyrThick");
784 backCool.vecBackVFELyrName =
args.vecStr(
"BackVFELyrName");
785 backCool.vecBackVFELyrMat =
args.vecStr(
"BackVFELyrMat");
786 backCool.vecBackCoolNSec =
args.vecDble(
"BackCoolNSec");
787 backCool.vecBackCoolSecSep =
args.vecDble(
"BackCoolSecSep");
788 backCool.vecBackCoolNPerSec =
args.vecDble(
"BackCoolNPerSec");
791 backMisc.here =
args.dble(
"BackMiscHere");
792 backMisc.vecThick =
args.vecDble(
"BackMiscThick");
793 backMisc.vecName =
args.vecStr(
"BackMiscName");
794 backMisc.vecMat =
args.vecStr(
"BackMiscMat");
795 backMisc.backCBStdSep =
args.dble(
"BackCBStdSep");
797 PatchPanel patchPanel;
798 patchPanel.here =
args.dble(
"PatchPanelHere");
799 patchPanel.vecThick =
args.vecDble(
"PatchPanelThick");
800 patchPanel.vecNames =
args.vecStr(
"PatchPanelNames");
801 patchPanel.vecMat =
args.vecStr(
"PatchPanelMat");
802 patchPanel.name =
args.str(
"PatchPanelName");
804 BackCoolTank backCoolTank;
805 backCoolTank.here =
args.dble(
"BackCoolTankHere");
806 backCoolTank.name =
args.str(
"BackCoolTankName");
807 backCoolTank.width =
args.dble(
"BackCoolTankWidth");
808 backCoolTank.thick =
args.dble(
"BackCoolTankThick");
809 backCoolTank.mat =
args.str(
"BackCoolTankMat");
810 backCoolTank.waName =
args.str(
"BackCoolTankWaName");
811 backCoolTank.waWidth =
args.dble(
"BackCoolTankWaWidth");
812 backCoolTank.waMat =
args.str(
"BackCoolTankWaMat");
813 backCoolTank.backBracketName =
args.str(
"BackBracketName");
814 backCoolTank.backBracketHeight =
args.dble(
"BackBracketHeight");
815 backCoolTank.backBracketMat =
args.str(
"BackBracketMat");
817 DryAirTube dryAirTube;
818 dryAirTube.here =
args.dble(
"DryAirTubeHere");
819 dryAirTube.name =
args.str(
"DryAirTubeName");
820 dryAirTube.mbCoolTubeNum =
args.integer(
"MBCoolTubeNum");
821 dryAirTube.innDiam =
args.dble(
"DryAirTubeInnDiam");
822 dryAirTube.outDiam =
args.dble(
"DryAirTubeOutDiam");
823 dryAirTube.mat =
args.str(
"DryAirTubeMat");
825 MBCoolTube mbCoolTube;
826 mbCoolTube.here =
args.dble(
"MBCoolTubeHere");
827 mbCoolTube.name =
args.str(
"MBCoolTubeName");
828 mbCoolTube.innDiam =
args.dble(
"MBCoolTubeInnDiam");
829 mbCoolTube.outDiam =
args.dble(
"MBCoolTubeOutDiam");
830 mbCoolTube.mat =
args.str(
"MBCoolTubeMat");
833 mbManif.here =
args.dble(
"MBManifHere");
834 mbManif.name =
args.str(
"MBManifName");
835 mbManif.innDiam =
args.dble(
"MBManifInnDiam");
836 mbManif.outDiam =
args.dble(
"MBManifOutDiam");
837 mbManif.mat =
args.str(
"MBManifMat");
840 mbLyr.here =
args.dble(
"MBLyrHere");
841 mbLyr.vecMBLyrThick =
args.vecDble(
"MBLyrThick");
842 mbLyr.vecMBLyrName =
args.vecStr(
"MBLyrName");
843 mbLyr.vecMBLyrMat =
args.vecStr(
"MBLyrMat");
846 pincer.rodHere =
args.dble(
"PincerRodHere");
847 pincer.rodName =
args.str(
"PincerRodName");
848 pincer.rodMat =
args.str(
"PincerRodMat");
849 pincer.vecRodAzimuth =
args.vecDble(
"PincerRodAzimuth");
850 pincer.envName =
args.str(
"PincerEnvName");
851 pincer.envMat =
args.str(
"PincerEnvMat");
852 pincer.envWidth =
args.dble(
"PincerEnvWidth");
853 pincer.envHeight =
args.dble(
"PincerEnvHeight");
854 pincer.envLength =
args.dble(
"PincerEnvLength");
855 pincer.vecEnvZOff =
args.vecDble(
"PincerEnvZOff");
856 pincer.blkName =
args.str(
"PincerBlkName");
857 pincer.blkMat =
args.str(
"PincerBlkMat");
858 pincer.blkLength =
args.dble(
"PincerBlkLength");
859 pincer.shim1Name =
args.str(
"PincerShim1Name");
860 pincer.shimHeight =
args.dble(
"PincerShimHeight");
861 pincer.shim2Name =
args.str(
"PincerShim2Name");
862 pincer.shimMat =
args.str(
"PincerShimMat");
863 pincer.shim1Width =
args.dble(
"PincerShim1Width");
864 pincer.shim2Width =
args.dble(
"PincerShim2Width");
865 pincer.cutName =
args.str(
"PincerCutName");
866 pincer.cutMat =
args.str(
"PincerCutMat");
867 pincer.cutWidth =
args.dble(
"PincerCutWidth");
868 pincer.cutHeight =
args.dble(
"PincerCutHeight");
870 Volume parentVolume = ns.volume(
args.parentName());
872 const unsigned int copyOne(1);
873 const unsigned int copyTwo(2);
875 Solid barSolid = Polycone(
bar.phiLo, (
bar.phiHi -
bar.phiLo),
bar.vecRMin,
bar.vecRMax,
bar.vecZPts);
883 parentVolume.placeVolume(barVolume, copyOne, Transform3D(
rotation, tran));
888 const string spmcut1ddname((0 != spm.cutShow) ? spm.name : (spm.name +
"CUT1"));
889 Solid ddspm = Polycone(spm.lowPhi, spm.delPhi, spm.vecRMin, spm.vecRMax, spm.vecZPts);
891 const unsigned int indx(0.5 * spm.vecRMax.size());
894 array<double, 3> cutBoxParms{{1.05 * (spm.vecRMax[indx] - spm.vecRMin[indx]) * 0.5,
896 fabs(spm.vecZPts.back() - spm.vecZPts.front()) * 0.5 + 1_mm}};
897 Solid spmCutBox = Box(spm.cutName, cutBoxParms[0], cutBoxParms[1], cutBoxParms[2]);
898 Volume spmCutLog =
Volume(spm.cutName, spmCutBox, ns.material(spm.mat));
901 array<double, 3> sideParms{{0.5 * spm.sideHigh, 0.5 * spm.sideThick, 0.5 * fabs(spm.vecZPts[1] - spm.vecZPts[0])}};
902 Solid sideSolid = Box(sideParms[0], sideParms[1], sideParms[2]);
903 Volume sideLog =
Volume(spm.sideName, sideSolid, ns.material(spm.sideMat));
909 Transform3D alltrot1;
910 Transform3D alltrot2;
911 for (
unsigned int icopy(1); icopy <= 2; ++icopy) {
912 const std::vector<double>& tvec(1 == icopy ? spm.vecCutTM : spm.vecCutTP);
913 double rang(1 == icopy ? spm.cutRM : spm.cutRP);
915 const Position tr(tvec[0], tvec[1], tvec[2]);
917 const double ang(1 == icopy ? spm.lowPhi : spm.lowPhi + spm.delPhi);
920 0.5 * (spm.vecRMax[indx] + spm.vecRMin[indx]), 0, 0.5 * (spm.vecZPts.front() + spm.vecZPts.back()));
921 Transform3D alltrot(Transform3D(Transform3D(ro1 * tr1) * tr) * ro);
924 temp1 = SubtractionSolid(spm.name +
"_T1", ddspm, spmCutBox, alltrot);
927 temp2 = SubtractionSolid(spm.name, temp1, spmCutBox, alltrot);
929 const Tl3D trSide(tvec[0],
930 tvec[1] + (1 == icopy ? 1. : -1.) * (cutBoxParms[1] + sideParms[1]) +
931 (1 == icopy ? spm.sideYOffM : spm.sideYOffP),
933 const RoZ3D roSide(rang);
934 const Tf3D sideRot(
RoZ3D(1 == icopy ? spm.lowPhi : spm.lowPhi + spm.delPhi) *
935 Tl3D(spm.vecRMin.front() + sideParms[0], 0, spm.vecZPts.front() + sideParms[2]) * trSide *
938 Rotation3D sideddrot(myrot(ns, spm.sideName + std::to_string(icopy), sideRot.getRotation()));
939 const Position sideddtra(sideRot.getTranslation());
940 1 == icopy ? sideddtra1 = sideddtra : sideddtra2 = sideddtra;
942 Volume spmLog =
Volume(spm.name, ((0 != spm.cutShow) ? ddspm : temp2), ns.material(spm.mat));
943 if (0 != spm.cutShow) {
944 spmLog.placeVolume(spmCutLog, 1, alltrot1);
945 spmLog.placeVolume(spmCutLog, 1, alltrot2);
947 spmLog.placeVolume(sideLog, 1, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(1))), sideddtra1));
948 spmLog.placeVolume(sideLog, 2, Transform3D(ns.rotation(ns.prepend(spm.sideName + std::to_string(2))), sideddtra2));
950 const double dphi(360._deg / (1. * spm.nPerHalf));
951 for (
unsigned int iphi(0);
iphi < 2 * spm.nPerHalf; ++
iphi) {
952 const double phi(
iphi * dphi + spm.phiOff);
958 Ro3D(spm.vecBRota[3],
Vec3(spm.vecBRota[0], spm.vecBRota[1], spm.vecBRota[2])) *
959 Tl3D(
Vec3(spm.vecBTran[0], spm.vecBTran[1], spm.vecBTran[2])));
964 const unsigned int offr(4 *
iphi);
965 const unsigned int offt(3 *
iphi);
967 const Ro3D r1(spm.vecRota[offr + 3],
Vec3(spm.vecRota[offr + 0], spm.vecRota[offr + 1], spm.vecRota[offr + 2]));
969 const Tf3D rotaExtra(
r1 *
Tl3D(
Vec3(spm.vecTran[offt + 0], spm.vecTran[offt + 1], spm.vecTran[offt + 2])));
971 const Tf3D both(rotaExtra * rotaBase);
975 if (spm.vecHere[
iphi] != 0) {
977 Position myTran(
both.getTranslation().x(),
both.getTranslation().y(),
both.getTranslation().z());
978 barVolume.placeVolume(spmLog,
iphi + 1, Transform3D(rota, myTran));
984 const double ilyLength(spm.vecZPts[1] - spm.vecZPts[0]);
985 double ilyRMin(spm.vecRMin[0]);
987 for (
unsigned int ilyx(0); ilyx != ily.vecIlyThick.size(); ++ilyx) {
988 ilyThick += ily.vecIlyThick[ilyx];
990 Solid ilySolid = Tube(ily.name,
995 ily.phiLow + ily.delPhi);
996 Volume ilyLog =
Volume(ily.name, ilySolid, ns.material(spm.mat));
997 spmLog.placeVolume(ilyLog, copyOne,
Position(0, 0, 0.5 * ilyLength));
999 if (0 != ily.pipeHere) {
1000 for (
unsigned int iPipeType(0); iPipeType != ily.vecIlyPipeLength.size(); ++iPipeType) {
1001 string pName(ily.pipeName +
"_" + std::to_string(iPipeType + 1));
1003 Solid ilyPipeSolid = Tube(pName,
1006 0.5 * ily.vecIlyPipeLength[iPipeType],
1009 ilyPipeLog[iPipeType] =
Volume(pName, ilyPipeSolid, ns.material(ily.pipeMat));
1011 string pWaName(ily.pipeName +
"Wa_" + std::to_string(iPipeType + 1));
1012 Solid ilyPipeWaSolid = Tube(pWaName,
1015 0.5 * ily.vecIlyPipeLength[iPipeType],
1018 Volume ilyPipeWaLog =
Volume(pWaName, ilyPipeWaSolid, ns.material(backPipe.waterMat));
1019 ilyPipeLog[iPipeType].placeVolume(ilyPipeWaLog, copyOne);
1023 Solid ilyPTMSolid = Box(ily.pTMHeightHalf, ily.pTMWidthHalf, ily.pTMLengthHalf);
1024 Volume ilyPTMLog =
Volume(ily.pTMName, ilyPTMSolid, ns.material(ily.pTMMat));
1026 Solid ilyFanOutSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.fanOutLength / 2.);
1027 Volume ilyFanOutLog =
Volume(ily.fanOutName, ilyFanOutSolid, ns.material(ily.fanOutMat));
1029 Solid ilyFEMSolid = Box(ily.fEMHeight / 2., ily.fEMWidth / 2., ily.fEMLength / 2.);
1030 Volume ilyFEMLog =
Volume(ily.fEMName, ilyFEMSolid, ns.material(ily.fEMMat));
1032 Solid ilyDiffSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.diffLength / 2.);
1033 Volume ilyDiffLog =
Volume(ily.diffName, ilyDiffSolid, ns.material(ily.diffMat));
1035 Solid ilyBndlSolid = Box(ily.fanOutHeightHalf, ily.fanOutWidth / 2., ily.bndlLength / 2.);
1036 Volume ilyBndlLog =
Volume(ily.bndlName, ilyBndlSolid, ns.material(ily.bndlMat));
1038 ilyFanOutLog.placeVolume(
1039 ilyDiffLog, copyOne,
Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.diffLength / 2 + ily.diffOff));
1040 ilyFanOutLog.placeVolume(
1041 ilyBndlLog, copyOne,
Position(0_mm, 0_mm, -ily.fanOutLength / 2 + ily.bndlLength / 2 + ily.bndlOff));
1043 for (
unsigned int iily(0); iily != ily.vecIlyThick.size(); ++iily) {
1044 const double ilyRMax(ilyRMin + ily.vecIlyThick[iily]);
1045 string xilyName(ily.name + std::to_string(iily));
1046 Solid xilySolid = Tube(xilyName, ilyRMin, ilyRMax, 0.5 * ilyLength, ily.phiLow, ily.phiLow + ily.delPhi);
1047 xilyLog = ns.addVolume(
Volume(xilyName, xilySolid, ns.material(ily.vecIlyMat[iily])));
1048 if (0 != ily.here) {
1049 ilyLog.placeVolume(xilyLog, copyOne);
1051 unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1053 if (10_mm < ily.vecIlyThick[iily] && ily.vecIlyThick.size() != (iily + 1) && 0 != ily.pipeHere) {
1054 if (0 != ily.pTMHere) {
1055 unsigned int ptmCopy(0);
1056 for (
unsigned int ilyPTM(0); ilyPTM != ily.vecIlyPTMZ.size(); ++ilyPTM) {
1057 const double radius(ilyRMax - 1_mm - ily.pTMHeightHalf);
1058 const double phi(ily.vecIlyPTMPhi[ilyPTM]);
1062 xilyLog.placeVolume(
1065 Transform3D(RotationZ(
phi),
Position(
xx,
yy, ily.vecIlyPTMZ[ilyPTM] - ilyLength / 2)));
1068 if (0 != ily.fanOutHere) {
1069 unsigned int fanOutCopy(0);
1070 for (
unsigned int ilyFO(0); ilyFO != ily.vecIlyFanOutZ.size(); ++ilyFO) {
1071 const double radius(ilyRMax - 1_mm - ily.fanOutHeightHalf);
1072 const double phi(ily.vecIlyFanOutPhi[ilyFO]);
1076 xilyLog.placeVolume(ilyFanOutLog,
1078 Transform3D(RotationZ(
phi) * RotationY(180_deg),
1079 Position(
xx,
yy, ily.vecIlyFanOutZ[ilyFO] - ilyLength / 2)));
1081 unsigned int femCopy(0);
1082 for (
unsigned int ilyFEM(0); ilyFEM != ily.vecIlyFEMZ.size(); ++ilyFEM) {
1083 const double radius(ilyRMax - 1_mm - ily.fEMHeight / 2.);
1084 const double phi(ily.vecIlyFEMPhi[ilyFEM]);
1088 xilyLog.placeVolume(
1091 Transform3D(RotationZ(
phi),
Position(
xx,
yy, ily.vecIlyFEMZ[ilyFEM] - ilyLength / 2)));
1094 for (
unsigned int iPipe(0); iPipe != ily.vecIlyPipePhi.size(); ++iPipe) {
1095 const unsigned int type(static_cast<unsigned int>(round(ily.vecIlyPipeType[iPipe])));
1096 const double zz(-ilyLength / 2 + ily.vecIlyPipeZ[iPipe] + (9 >
type ? ily.vecIlyPipeLength[
type] / 2. : 0));
1098 for (
unsigned int ly(0); ly != 2; ++ly) {
1099 const double radius(0 == ly ? ilyRMin + ily.pipeOD / 2. + 1_mm : ilyRMax - ily.pipeOD / 2. - 1_mm);
1100 const double phi(ily.vecIlyPipePhi[iPipe]);
1107 xilyLog.placeVolume(
1121 string clyrName(
"ECLYR");
1122 std::vector<double> cri;
1123 std::vector<double> cro;
1124 std::vector<double> czz;
1125 czz.emplace_back(spm.vecZPts[1]);
1126 cri.emplace_back(spm.vecRMin[0]);
1127 cro.emplace_back(spm.vecRMin[0] + 25_mm);
1128 czz.emplace_back(spm.vecZPts[2]);
1129 cri.emplace_back(spm.vecRMin[2]);
1130 cro.emplace_back(spm.vecRMin[2] + 10_mm);
1131 Solid clyrSolid = Polycone(clyrName, -9.5_deg, 19_deg, cri, cro, czz);
1132 Volume clyrLog =
Volume(clyrName, clyrSolid, ns.material(ily.vecIlyMat[4]));
1133 spmLog.placeVolume(clyrLog, copyOne);
1141 const double BNom1(cry.vecNomCryDimCR[0]);
1142 const double bNom1(cry.vecNomCryDimCF[0]);
1143 const double sWall1(alv.wallThAlv);
1144 const double fWall1(alv.wallFrAlv);
1145 const double sWrap1(alv.wrapThAlv);
1146 const double fWrap1(alv.wrapFrAlv);
1147 const double sClr1(alv.clrThAlv);
1148 const double fClr1(alv.clrFrAlv);
1149 const double LNom1(cry.nomCryDimLZ);
1150 const double beta1(atan((BNom1 - bNom1) / LNom1));
1151 const double sinbeta1(
sin(beta1));
1153 const double tana_hawR((BNom1 - bNom1) / LNom1);
1155 const double H_hawR(alvWedge.hawRHBIG);
1156 const double h_hawR(alvWedge.hawRhsml);
1157 const double a_hawR(bNom1 + sClr1 + 2 * sWrap1 + 2 * sWall1 - sinbeta1 * (fClr1 + fWrap1 + fWall1));
1158 const double B_hawR(a_hawR + H_hawR * tana_hawR);
1159 const double b_hawR(a_hawR + h_hawR * tana_hawR);
1160 const double L_hawR(spm.vecZPts[2]);
1162 const EcalTrap trapHAWR(a_hawR / 2.,
1173 string hawRName1(alvWedge.hawRName +
"1");
1174 Solid hawRSolid1 = mytrap(hawRName1, trapHAWR);
1176 const double al1_fawR(atan((B_hawR - a_hawR) / H_hawR) +
M_PI_2);
1190 const string fawName1(alvWedge.fawName +
"1");
1191 Solid fawSolid1 = mytrap(fawName1, trapFAW);
1196 const double hawBoxClr(1_mm);
1199 const string hawCutName(alvWedge.hawRName +
"CUTBOX");
1200 array<double, 3> hawBoxParms{{0.5 * b_hawR + hawBoxClr, 0.5 * alvWedge.hawRCutY, 0.5 * alvWedge.hawRCutZ}};
1201 Solid hawCutBox = Box(hawCutName, hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
1203 const Pt3D b1(hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
1204 const Pt3D b2(-hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
1205 const Pt3D b3(-hawBoxParms[0], hawBoxParms[1], -hawBoxParms[2]);
1208 sqrt(4 * hawBoxParms[2] * hawBoxParms[2] - (h_hawR - alvWedge.hawRCutDelY) * (h_hawR - alvWedge.hawRCutDelY)));
1210 const Tf3D hawCutForm(
b1,
1213 vHAW[2] +
Pt3D(hawBoxClr, -alvWedge.hawRCutDelY, 0),
1214 vHAW[1] +
Pt3D(-hawBoxClr, -alvWedge.hawRCutDelY, 0),
1215 Pt3D(vHAW[0].
x() - hawBoxClr, vHAW[0].
y(), vHAW[0].
z() - zDel));
1217 Solid hawRSolid = SubtractionSolid(hawRSolid1,
1219 Transform3D(myrot(ns, hawCutName +
"R", hawCutForm.getRotation()),
1220 Position(hawCutForm.getTranslation().x(),
1221 hawCutForm.getTranslation().y(),
1222 hawCutForm.getTranslation().z())));
1223 Volume hawRLog =
Volume(alvWedge.hawRName, hawRSolid, ns.material(spm.mat));
1226 const string fawCutName(alvWedge.fawName +
"CUTBOX");
1227 const array<double, 3> fawBoxParms{{2 * hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]}};
1228 Solid fawCutBox = Box(fawCutName, fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
1230 const Pt3D bb1(fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
1231 const Pt3D bb2(-fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
1232 const Pt3D bb3(-fawBoxParms[0], fawBoxParms[1], -fawBoxParms[2]);
1234 const Tf3D fawCutForm(bb1,
1237 vFAW[2] +
Pt3D(2 * hawBoxClr, -5_mm, 0),
1238 vFAW[1] +
Pt3D(-2 * hawBoxClr, -5_mm, 0),
1239 Pt3D(vFAW[1].
x() - 2 * hawBoxClr, vFAW[1].
y() - trapFAW.h(), vFAW[1].z() - zDel));
1241 Solid fawSolid = SubtractionSolid(fawSolid1,
1243 Transform3D(myrot(ns, fawCutName +
"R", fawCutForm.getRotation()),
1244 Position(fawCutForm.getTranslation().x(),
1245 fawCutForm.getTranslation().y(),
1246 fawCutForm.getTranslation().z())));
1247 Volume fawLog =
Volume(alvWedge.fawName, fawSolid, ns.material(spm.mat));
1249 const Tf3D hawRform(vHAW[3],
1253 0.5 * (vFAW[0] + vFAW[3]),
1254 0.5 * (vFAW[1] + vFAW[2]));
1260 myrot(ns, alvWedge.hawRName +
"R", hawRform.getRotation()),
1261 Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z())));
1269 Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(-
M_PI),
1270 Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z())));
1272 for (
unsigned int iPhi(1); iPhi <= alvWedge.nFawPerSupm; ++iPhi) {
1273 const double rPhi(alvWedge.fawPhiOff + (iPhi - 0.5) * alvWedge.fawDelPhi);
1275 const Tf3D fawform(
RoZ3D(rPhi) *
Tl3D(alvWedge.fawRadOff + (trapFAW.H() + trapFAW.h()) / 4, 0, trapFAW.L() / 2) *
1276 RoZ3D(-90_deg + alvWedge.fawPhiRot));
1277 if (alvWedge.fawHere)
1282 myrot(ns, alvWedge.fawName +
"_Rot" + std::to_string(iPhi), fawform.getRotation()),
1283 Position(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z())));
1290 const double h_Grid(
grid.thick);
1292 const EcalTrap trapGrid((B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2,
1293 (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2,
1297 (L_hawR - 8_cm) / 2.,
1303 Solid gridSolid = mytrap(
grid.name, trapGrid);
1308 const Tf3D gridForm(vGrid[4],
1311 vHAW[5] -
Pt3D(0, h_Grid, 0),
1316 hawRLog.placeVolume(
1320 myrot(ns,
grid.name +
"R", gridForm.getRotation()),
1321 Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z())));
1326 const double aNom(cry.nomCryDimAF);
1327 const double LNom(cry.nomCryDimLZ);
1329 const double AUnd(cry.underAR);
1330 const double aUnd(cry.underAF);
1331 const double bUnd(cry.underCF);
1332 const double HUnd(cry.underBR);
1333 const double hUnd(cry.underBF);
1334 const double LUnd(cry.underLZ);
1336 const double sWall(alv.wallThAlv);
1337 const double sWrap(alv.wrapThAlv);
1338 const double sClr(alv.clrThAlv);
1340 const double fWall(alv.wallFrAlv);
1341 const double fWrap(alv.wrapFrAlv);
1342 const double fClr(alv.clrFrAlv);
1344 const double rWall(alv.wallReAlv);
1345 const double rWrap(alv.wrapReAlv);
1346 const double rClr(alv.clrReAlv);
1349 double theta(90_deg);
1354 for (
unsigned int cryType(1); cryType <= alv.nCryTypes; ++cryType) {
1355 const string sType(
"_" +
std::string(10 > cryType ?
"0" :
"") + std::to_string(cryType));
1357 LogDebug(
"EcalGeom") <<
"Crytype=" << cryType;
1358 const double ANom(cry.vecNomCryDimAR[cryType - 1]);
1359 const double BNom(cry.vecNomCryDimCR[cryType - 1]);
1360 const double bNom(cry.vecNomCryDimCF[cryType - 1]);
1361 const double HNom(cry.vecNomCryDimBR[cryType - 1]);
1362 const double hNom(cry.vecNomCryDimBF[cryType - 1]);
1364 const double alfCry(90_deg + atan((bNom - bUnd - aNom + aUnd) / (hNom - hUnd)));
1366 const EcalTrap trapCry((ANom - AUnd) / 2.,
1373 aNom - aUnd - ANom + AUnd,
1374 hNom - hUnd - HNom + HUnd
1377 const string cryDDName(cry.name + sType);
1378 Solid crySolid = mytrap(cry.name, trapCry);
1379 Volume cryLog =
Volume(cryDDName, crySolid, ns.material(cry.mat));
1382 const unsigned int copyCap(1);
1383 const string capDDName(
cap.name + sType);
1384 Solid capSolid = Box(
cap.xSize / 2.,
cap.ySize / 2.,
cap.thick / 2.);
1387 const string sglDDName(apd.sglName + sType);
1388 Solid sglSolid = Box(
cap.xSize / 2.,
cap.ySize / 2., apd.sglThick / 2.);
1389 Volume sglLog =
Volume(sglDDName, sglSolid, ns.material(apd.sglMat));
1390 const unsigned int copySGL(1);
1392 const string cerDDName(cer.name + sType);
1393 Solid cerSolid = Box(cer.xSize / 2., cer.ySize / 2., cer.thick / 2.);
1394 Volume cerLog =
Volume(cerDDName, cerSolid, ns.material(cer.mat));
1395 unsigned int copyCER(0);
1397 const string bsiDDName(bSi.name + sType);
1398 Solid bsiSolid = Box(bSi.xSize / 2., bSi.ySize / 2., bSi.thick / 2.);
1399 Volume bsiLog =
Volume(bsiDDName, bsiSolid, ns.material(bSi.mat));
1400 const unsigned int copyBSi(1);
1402 const string atjDDName(apd.atjName + sType);
1403 Solid atjSolid = Box(atjDDName, apd.side / 2., apd.side / 2., apd.atjThick / 2.);
1404 Volume atjLog =
Volume(atjDDName, atjSolid, ns.material(apd.atjMat));
1405 const unsigned int copyATJ(1);
1407 const string aglDDName(apd.aglName + sType);
1408 Solid aglSolid = Box(bSi.xSize / 2., bSi.ySize / 2., apd.aglThick / 2.);
1409 Volume aglLog =
Volume(aglDDName, aglSolid, ns.material(apd.aglMat));
1410 const unsigned int copyAGL(1);
1412 const string andDDName(apd.andName + sType);
1413 Solid andSolid = Box(apd.side / 2., apd.side / 2., apd.andThick / 2.);
1414 Volume andLog =
Volume(andDDName, andSolid, ns.material(apd.andMat));
1415 const unsigned int copyAND(1);
1417 const string apdDDName(apd.name + sType);
1418 Solid apdSolid = Box(apdDDName, apd.side / 2., apd.side / 2., apd.thick / 2.);
1419 Volume apdLog =
Volume(apdDDName, apdSolid, ns.material(apd.mat));
1420 const unsigned int copyAPD(1);
1424 const double delta(atan((HNom - hNom) / LNom));
1427 const double gamma(atan((ANom - aNom) / LNom));
1430 const double beta(atan((BNom - bNom) / LNom));
1431 const double sinbeta(
sin(
beta));
1434 const double alfClr(90_deg + atan((bNom - aNom) / (hNom + sClr)));
1436 const EcalTrap trapClr((ANom + sClr + rClr * singamma) / 2.,
1437 (aNom + sClr - fClr * singamma) / 2.,
1438 (bNom + sClr - fClr * sinbeta) / 2.,
1439 (HNom + sClr + rClr * sindelta) / 2.,
1440 (hNom + sClr - fClr * sindelta) / 2.,
1441 (LNom + fClr + rClr) / 2.,
1447 const string clrDDName(cry.clrName + sType);
1448 Solid clrSolid = mytrap(clrDDName, trapClr);
1449 Volume clrLog =
Volume(clrDDName, clrSolid, ns.material(cry.clrMat));
1452 const double alfWrap(90_deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap)));
1454 const EcalTrap trapWrap((trapClr.A() + 2 * sWrap + rWrap * singamma) / 2,
1455 (trapClr.a() + 2 * sWrap - fWrap * singamma) / 2,
1456 (trapClr.b() + 2 * sWrap - fWrap * sinbeta) / 2,
1457 (trapClr.H() + 2 * sWrap + rWrap * sindelta) / 2,
1458 (trapClr.h() + 2 * sWrap - fWrap * sindelta) / 2,
1459 (trapClr.L() + fWrap + rWrap) / 2.,
1461 aNom - ANom - (cryType > 9 ? 0 : 0.020_mm),
1465 const string wrapDDName(cry.wrapName + sType);
1466 Solid wrapSolid = mytrap(wrapDDName, trapWrap);
1467 Volume wrapLog =
Volume(wrapDDName, wrapSolid, ns.material(cry.wrapMat));
1471 const double alfWall(90_deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap + 2 * sWall)));
1473 const EcalTrap trapWall((trapWrap.A() + 2 * sWall + rWall * singamma) / 2,
1474 (trapWrap.a() + 2 * sWall - fWall * singamma) / 2,
1475 (trapWrap.b() + 2 * sWall - fWall * sinbeta) / 2,
1476 (trapWrap.H() + 2 * sWall + rWall * sindelta) / 2,
1477 (trapWrap.h() + 2 * sWall - fWall * sindelta) / 2,
1478 (trapWrap.L() + fWall + rWall) / 2.,
1480 aNom - ANom - (cryType < 10 ? 0.150_mm : 0.100_mm),
1484 const string wallDDName(cry.wallName + sType);
1485 Solid wallSolid = mytrap(wallDDName, trapWall);
1486 Volume wallLog =
Volume(wallDDName, wallSolid, ns.material(cry.wallMat));
1489 const Vec3 cryToClr(0, 0, (rClr - fClr) / 2);
1490 clrLog.placeVolume(cryLog, copyOne,
Position(0_mm, 0_mm, (rClr - fClr) / 2));
1492 if (0 !=
cap.here) {
1493 bsiLog.placeVolume(aglLog, copyAGL,
Position(0_mm, 0_mm, -apd.aglThick / 2. + bSi.thick / 2.));
1494 bsiLog.placeVolume(andLog, copyAND,
Position(0_mm, 0_mm, -apd.andThick / 2. - apd.aglThick + bSi.thick / 2.));
1496 apdLog, copyAPD,
Position(0_mm, 0_mm, -apd.thick / 2. - apd.andThick - apd.aglThick + bSi.thick / 2.));
1500 Position(0_mm, 0_mm, -apd.atjThick / 2. - apd.thick - apd.andThick - apd.aglThick + bSi.thick / 2.));
1501 cerLog.placeVolume(bsiLog, copyBSi,
Position(0_mm, 0_mm, -bSi.thick / 2. + cer.thick / 2.));
1502 capLog.placeVolume(sglLog, copySGL,
Position(0_mm, 0_mm, -apd.sglThick / 2. +
cap.thick / 2.));
1504 for (
unsigned int ijkl(0); ijkl != 2; ++ijkl) {
1505 capLog.placeVolume(cerLog,
1507 Position(trapCry.bl1() - (0 == ijkl ? apd.x1 : apd.x2),
1508 trapCry.h1() - apd.z,
1509 -apd.sglThick - cer.thick / 2. +
cap.thick / 2.));
1511 clrLog.placeVolume(capLog, copyCap,
Position(0_mm, 0_mm, -trapCry.dz() -
cap.thick / 2. + (rClr - fClr) / 2.));
1514 const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2);
1515 wrapLog.placeVolume(clrLog, copyOne,
Position(0_mm, 0_mm, (rWrap - fWrap) / 2));
1518 const Vec3 wrapToWall1(0_mm, 0_mm, (rWall - fWall) / 2);
1519 const Vec3 wrapToWall(
Vec3((cryType > 9 ? 0_mm : 0.005_mm), 0_mm, 0_mm) + wrapToWall1);
1520 wallLog.placeVolume(
1523 Position(
Vec3((cryType > 9 ? 0_mm : 0.005_mm), 0_mm, 0_mm) + wrapToWall1));
1528 const double sidePrime((trapWall.a() - trapCry.a()) / 2);
1529 const double frontPrime(fWall + fWrap + fClr + LUnd / 2);
1535 zee += alv.vecGapAlvEta[0];
1538 for (
unsigned int etaAlv(1); etaAlv <= alv.nCryPerAlvEta; ++etaAlv) {
1540 <<
", frontPrime=" << frontPrime <<
", zeta=" << zeta <<
", delta=" <<
delta
1543 zee += 0.075_mm + (side *
cos(zeta) + trapWall.h() - sidePrime) /
sin(
theta);
1547 const Pt3D trap2(vCry[2] + cryToClr + clrToWrap + wrapToWall);
1549 const Pt3D trap3(trap2 +
Pt3D(0, -trapCry.h(), 0));
1550 const Pt3D trap1(trap3 +
Pt3D(-trapCry.a(), 0, 0));
1552 const Pt3D wedge3(vHAW[4] +
Pt3D(sidePrime, alvWedge.hawYOffCry, zee));
1554 const Pt3D wedge1(wedge3 +
Pt3D(trapCry.a(), 0, 0));
1556 const Tf3D tForm1(trap1, trap2, trap3, wedge1, wedge2, wedge3);
1558 const double xx(0.050_mm);
1560 const Tf3D tForm(HepGeom::Translate3D(
xx, 0, 0) * tForm1);
1561 hawRLog.placeVolume(
1564 Transform3D(myrot(ns, wallDDName +
"_" + std::to_string(etaAlv), tForm.getRotation()),
1565 Position(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z())));
1570 if (5 == cryType || 9 == cryType || 13 == cryType || 17 == cryType) {
1571 zee += 0.5 * alv.vecGapAlvEta[cryType] /
sin(
theta);
1572 zee += 0.5 * alv.vecGapAlvEta[cryType] /
sin(
theta);
1575 zee += alv.vecGapAlvEta[cryType] /
sin(
theta);
1590 if (0 != back.here) {
1597 const Position outtra(back.xOff + back.sideHeight / 2, back.yOff, back.sideLength / 2);
1599 const double realBPthick(back.plateThick + back.plate2Thick);
1600 array<double, 3> backPlateParms{{back.plateWidth / 2., realBPthick / 2., back.plateLength / 2.}};
1601 Solid backPlateSolid = Box(backPlateParms[0], backPlateParms[1], backPlateParms[2]);
1602 Volume backPlateLog =
Volume(back.plateName, backPlateSolid, ns.material(back.plateMat));
1605 back.sideHeight / 2 + backPlateParms[1], 0_mm, backPlateParms[2] - back.sideLength / 2);
1607 Solid backPlate2Solid = Box(back.plateWidth / 2., back.plate2Thick / 2., back.plateLength / 2.);
1608 Volume backPlate2Log =
Volume(back.plate2Name, backPlate2Solid, ns.material(back.plate2Mat));
1610 const Position backPlate2Tra(0_mm, -backPlateParms[1] + back.plate2Thick / 2., 0_mm);
1611 if (0 != back.plateHere) {
1612 backPlateLog.placeVolume(backPlate2Log, copyOne, Transform3D(backPlate2Tra));
1616 Transform3D(myrot(ns, back.plateName +
"Rot5", CLHEP::HepRotationZ(270_deg)), outtra + backPlateTra));
1630 const EcalTrap trapBS(back.sideWidth / 2.,
1631 back.sideWidth / 2.,
1632 back.sideWidth / 4.,
1633 back.sideHeight / 2.,
1634 back.sideHeight / 2.,
1635 back.sideLength / 2.,
1641 Solid backSideSolid = mytrap(back.sideName, trapBS);
1642 Volume backSideLog =
Volume(back.sideName, backSideSolid, ns.material(back.sideMat));
1644 const Position backSideTra1(0_mm, back.plateWidth / 2 + back.sideYOff1, 1_mm);
1645 if (0 != back.sideHere) {
1649 Transform3D(myrot(ns, back.sideName +
"Rot8", CLHEP::HepRotationX(180_deg) * CLHEP::HepRotationZ(90_deg)),
1650 outtra + backSideTra1));
1651 const Position backSideTra2(0_mm, -back.plateWidth / 2 + back.sideYOff2, 1_mm);
1655 Transform3D(myrot(ns, back.sideName +
"Rot9", CLHEP::HepRotationZ(90_deg)), outtra + backSideTra2));
1664 const double backCoolWidth(backCool.barWidth + 2. * backCoolTank.width);
1672 const double manifCut(2_mm);
1674 Solid mBManifSolid = Tube(0, mbManif.outDiam / 2, backCoolWidth / 2. - manifCut, 0_deg, 360_deg);
1675 Volume mBManifLog =
Volume(mbManif.name, mBManifSolid, ns.material(mbManif.mat));
1677 const string mBManifWaName(mbManif.name +
"Wa");
1678 Solid mBManifWaSolid = Tube(0, mbManif.innDiam / 2, backCoolWidth / 2. - manifCut, 0_deg, 360_deg);
1679 Volume mBManifWaLog(mBManifWaName, mBManifWaSolid, ns.material(backPipe.waterMat));
1680 mBManifLog.placeVolume(mBManifWaLog, copyOne);
1694 const double deltaY(-5_mm);
1696 Solid grEdgeSlotSolid = Box(grille.edgeSlotHeight / 2., grille.edgeSlotWidth / 2., grille.thick / 2.);
1697 Volume grEdgeSlotLog =
Volume(grille.edgeSlotName, grEdgeSlotSolid, ns.material(grille.edgeSlotMat));
1699 unsigned int edgeSlotCopy(0);
1700 unsigned int midSlotCopy(0);
1704 for (
unsigned int iGr(0); iGr != grille.vecHeight.size(); ++iGr) {
1705 string gName(grille.name + std::to_string(iGr));
1706 Solid grilleSolid = Box(gName, grille.vecHeight[iGr] / 2., backCoolWidth / 2., grille.thick / 2.);
1707 Volume grilleLog =
Volume(gName, grilleSolid, ns.material(grille.mat));
1709 const Position grilleTra(-realBPthick / 2 - grille.vecHeight[iGr] / 2,
1711 grille.vecZOff[iGr] + grille.thick / 2 - back.sideLength / 2);
1712 const Position gTra(outtra + backPlateTra + grilleTra);
1714 if (0 != grille.midSlotHere && 0 != iGr) {
1715 if (0 == (iGr - 1) % 2) {
1716 string mName(grille.midSlotName + std::to_string(iGr / 2));
1717 Solid grMidSlotSolid =
1718 Box(mName, grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., grille.midSlotWidth / 2., grille.thick / 2.);
1719 grMidSlotLog[(iGr - 1) / 2] =
Volume(mName, grMidSlotSolid, ns.material(grille.midSlotMat));
1721 grilleLog.placeVolume(
1722 grMidSlotLog[(iGr - 1) / 2],
1725 grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., +grille.midSlotXOff, 0)));
1726 grilleLog.placeVolume(
1727 grMidSlotLog[(iGr - 1) / 2],
1730 grille.vecHeight[iGr] / 2. - grille.vecMidSlotHeight[(iGr - 1) / 2] / 2., -grille.midSlotXOff, 0)));
1733 if (0 != grille.edgeSlotHere && 0 != iGr) {
1734 grilleLog.placeVolume(grEdgeSlotLog,
1736 Transform3D(
Position(grille.vecHeight[iGr] / 2. - grille.edgeSlotHeight / 2.,
1737 backCoolWidth / 2 - grille.edgeSlotWidth / 2.,
1739 grilleLog.placeVolume(grEdgeSlotLog,
1741 Transform3D(
Position(grille.vecHeight[iGr] / 2. - grille.edgeSlotHeight / 2.,
1742 -backCoolWidth / 2 + grille.edgeSlotWidth / 2.,
1745 if (0 != grille.here)
1746 spmLog.placeVolume(grilleLog, iGr, Transform3D(gTra));
1748 if ((0 != iGr % 2) && (0 != mbManif.here)) {
1749 spmLog.placeVolume(mBManifLog,
1751 Transform3D(myrot(ns, mbManif.name +
"R1", CLHEP::HepRotationX(90_deg)),
1752 gTra -
Position(-mbManif.outDiam / 2. + grille.vecHeight[iGr] / 2.,
1754 grille.thick / 2. + 3 * mbManif.outDiam / 2.)));
1755 spmLog.placeVolume(mBManifLog,
1757 Transform3D(myrot(ns, mbManif.name +
"R2", CLHEP::HepRotationX(90_deg)),
1758 gTra -
Position(-3 * mbManif.outDiam / 2. + grille.vecHeight[iGr] / 2.,
1760 grille.thick / 2 + 3 * mbManif.outDiam / 2.)));
1776 Solid backCoolBarSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.barThick / 2.);
1777 Volume backCoolBarLog =
Volume(backCool.barName, backCoolBarSolid, ns.material(backCool.barMat));
1779 Solid backCoolBarSSSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.barSSThick / 2.);
1780 Volume backCoolBarSSLog =
Volume(backCool.barSSName, backCoolBarSSSolid, ns.material(backCool.barSSMat));
1781 const Position backCoolBarSSTra(0, 0, 0);
1782 backCoolBarLog.placeVolume(backCoolBarSSLog, copyOne, Transform3D(backCoolBarSSTra));
1784 Solid backCoolBarWaSolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.barWaThick / 2.);
1785 Volume backCoolBarWaLog =
Volume(backCool.barWaName, backCoolBarWaSolid, ns.material(backCool.barWaMat));
1786 const Position backCoolBarWaTra(0, 0, 0);
1787 backCoolBarSSLog.placeVolume(backCoolBarWaLog, copyOne, Transform3D(backCoolBarWaTra));
1802 for (
unsigned int iLyr(0); iLyr != backCool.vecBackVFELyrThick.size(); ++iLyr) {
1803 thickVFE += backCool.vecBackVFELyrThick[iLyr];
1805 Solid backVFESolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., thickVFE / 2.);
1806 Volume backVFELog = ns.addVolumeNS(
Volume(myns + backCool.vFEName, backVFESolid, ns.material(backCool.vFEMat)));
1807 Position offTra(0, 0, -thickVFE / 2);
1808 for (
unsigned int iLyr(0); iLyr != backCool.vecBackVFELyrThick.size(); ++iLyr) {
1809 Solid backVFELyrSolid =
1810 Box(backCool.barHeight / 2., backCool.barWidth / 2., backCool.vecBackVFELyrThick[iLyr] / 2.);
1812 Volume(backCool.vecBackVFELyrName[iLyr], backVFELyrSolid, ns.material(backCool.vecBackVFELyrMat[iLyr]));
1813 const Position backVFELyrTra(0, 0, backCool.vecBackVFELyrThick[iLyr] / 2);
1814 backVFELog.placeVolume(backVFELyrLog, copyOne, Transform3D(backVFELyrTra + offTra));
1815 offTra += 2 * backVFELyrTra;
1830 const double halfZCoolVFE(thickVFE + backCool.barThick / 2.);
1831 Solid backCoolVFESolid = Box(backCool.barHeight / 2., backCool.barWidth / 2., halfZCoolVFE);
1832 Volume backCoolVFELog =
Volume(backCool.backVFEName, backCoolVFESolid, ns.material(backCool.backVFEMat));
1833 if (0 != backCool.barHere)
1834 backCoolVFELog.placeVolume(backCoolBarLog, copyOne, Transform3D());
1835 if (0 != backCool.vFEHere)
1836 backCoolVFELog.placeVolume(
1837 backVFELog, copyOne, Transform3D(
Position(0, 0, backCool.barThick / 2. + thickVFE / 2.)));
1838 backCoolVFELog.placeVolume(backVFELog,
1840 Transform3D(myrot(ns, backCool.backVFEName +
"Flip", CLHEP::HepRotationX(180_deg)),
1841 Position(0, 0, -backCool.barThick / 2. - thickVFE / 2.)));
1854 unsigned int iCVFECopy(1);
1855 unsigned int iSep(0);
1856 unsigned int iNSec(0);
1857 const unsigned int nMisc(backMisc.vecThick.size() / 4);
1858 for (
unsigned int iMod(0); iMod != 4; ++iMod) {
1859 const double pipeLength(grille.vecZOff[2 * iMod + 1] - grille.vecZOff[2 * iMod] - grille.thick - 3_mm);
1860 const double pipeZPos(grille.vecZOff[2 * iMod + 1] - pipeLength / 2 - 1.5_mm);
1863 double backCoolHeight(backCool.barHeight + mbCoolTube.outDiam);
1864 for (
unsigned int iMisc(0); iMisc != nMisc; ++iMisc) {
1865 backCoolHeight += backMisc.vecThick[iMod * nMisc + iMisc];
1867 double bottomThick(mbCoolTube.outDiam);
1868 for (
unsigned int iMB(0); iMB != mbLyr.vecMBLyrThick.size(); ++iMB) {
1869 backCoolHeight += mbLyr.vecMBLyrThick[iMB];
1870 bottomThick += mbLyr.vecMBLyrThick[iMB];
1873 string backCName(backCool.vecName[iMod]);
1874 const double halfZBCool((pipeLength - 2 * mbManif.outDiam - grille.zSpace) / 2);
1875 Solid backCoolSolid = Box(backCoolHeight / 2., backCoolWidth / 2., halfZBCool);
1876 Volume backCoolLog =
Volume(backCName, backCoolSolid, ns.material(spm.mat));
1879 -realBPthick / 2 + backCoolHeight / 2 - grille.vecHeight[2 * iMod],
1881 grille.vecZOff[2 * iMod] + grille.thick + grille.zSpace + halfZBCool - back.sideLength / 2);
1882 if (0 != backCool.here)
1883 spmLog.placeVolume(backCoolLog, iMod + 1, outtra + backPlateTra + bCoolTra);
1886 const double backCoolTankHeight(backCool.barHeight);
1887 const double halfZTank(halfZBCool - 5_cm);
1889 string bTankName(backCoolTank.name + std::to_string(iMod + 1));
1890 Solid backCoolTankSolid = Box(backCoolTankHeight / 2., backCoolTank.width / 2., halfZTank);
1891 Volume backCoolTankLog =
Volume(bTankName, backCoolTankSolid, ns.material(backCoolTank.mat));
1892 if (0 != backCoolTank.here)
1893 backCoolLog.placeVolume(backCoolTankLog,
1895 Transform3D(Rotation3D(),
1896 Position(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick,
1897 backCool.barWidth / 2. + backCoolTank.width / 2.,
1900 string bTankWaName(backCoolTank.waName + std::to_string(iMod + 1));
1901 Solid backCoolTankWaSolid = Box(backCoolTankHeight / 2. - backCoolTank.thick / 2.,
1902 backCoolTank.waWidth / 2.,
1903 halfZTank - backCoolTank.thick / 2.);
1904 Volume backCoolTankWaLog =
Volume(bTankWaName, backCoolTankWaSolid, ns.material(backCoolTank.waMat));
1905 backCoolTankLog.placeVolume(backCoolTankWaLog, copyOne, Transform3D(Rotation3D(),
Position(0, 0, 0)));
1907 string bBracketName(backCoolTank.backBracketName + std::to_string(iMod + 1));
1908 Solid backBracketSolid = Box(backCoolTank.backBracketHeight / 2., backCoolTank.width / 2., halfZTank);
1909 Volume backBracketLog =
Volume(bBracketName, backBracketSolid, ns.material(backCoolTank.backBracketMat));
1910 if (0 != backCoolTank.here)
1911 backCoolLog.placeVolume(backBracketLog,
1913 Transform3D(Rotation3D(),
1914 Position(backCool.barHeight - backCoolHeight / 2. -
1915 backCoolTank.backBracketHeight / 2. + bottomThick,
1916 -backCool.barWidth / 2. - backCoolTank.width / 2.,
1920 Position bSumTra(backCool.barHeight - backCoolHeight / 2. + bottomThick, 0, 0);
1921 for (
unsigned int j(0);
j != nMisc; ++
j) {
1922 const string bName(backMisc.vecName[iMod * nMisc +
j]);
1924 Box(backMisc.vecThick[iMod * nMisc +
j] / 2, backCool.barWidth / 2. + backCoolTank.width, halfZBCool);
1926 Volume bLog =
Volume(bName, bSolid, ns.material(backMisc.vecMat[iMod * nMisc +
j]));
1928 const Position bTra(backMisc.vecThick[iMod * nMisc +
j] / 2, 0_mm, 0_mm);
1930 if (0 != backMisc.here)
1931 backCoolLog.placeVolume(bLog, copyOne, Transform3D(Rotation3D(), bSumTra + bTra));
1933 bSumTra += 2 * bTra;
1936 const double bHalfWidth(backCool.barWidth / 2. + backCoolTank.width);
1938 if (0 != mbLyr.here) {
1939 Position mTra(-backCoolHeight / 2. + mbCoolTube.outDiam, 0, 0);
1940 for (
unsigned int j(0);
j != mbLyr.vecMBLyrThick.size(); ++
j)
1942 const string mName(mbLyr.vecMBLyrName[
j] +
"_" + std::to_string(iMod + 1));
1943 Solid mSolid = Box(mbLyr.vecMBLyrThick[
j] / 2, bHalfWidth, halfZBCool);
1944 Volume mLog =
Volume(mName, mSolid, ns.material(mbLyr.vecMBLyrMat[
j]));
1946 mTra +=
Position(mbLyr.vecMBLyrThick[
j] / 2.0, 0_mm, 0_mm);
1947 backCoolLog.placeVolume(mLog, copyOne, Transform3D(Rotation3D(), mTra));
1948 mTra +=
Position(mbLyr.vecMBLyrThick[
j] / 2.0, 0_mm, 0_mm);
1952 if (0 != mbCoolTube.here) {
1953 const string mBName(mbCoolTube.name +
"_" + std::to_string(iMod + 1));
1955 Solid mBCoolTubeSolid = Tube(0, mbCoolTube.outDiam / 2, halfZBCool, 0_deg, 360_deg);
1956 Volume mBLog =
Volume(mBName, mBCoolTubeSolid, ns.material(mbCoolTube.mat));
1958 const string mBWaName(mbCoolTube.name +
"Wa_" + std::to_string(iMod + 1));
1959 Solid mBCoolTubeWaSolid = Tube(mBWaName, 0, mbCoolTube.innDiam / 2, halfZBCool, 0_deg, 360_deg);
1960 Volume mBWaLog =
Volume(mBWaName, mBCoolTubeWaSolid, ns.material(backPipe.waterMat));
1961 mBLog.placeVolume(mBWaLog, copyOne);
1963 for (
unsigned int j(0);
j != dryAirTube.mbCoolTubeNum; ++
j)
1965 backCoolLog.placeVolume(mBLog,
1967 Transform3D(Rotation3D(),
1968 Position(-backCoolHeight / 2.0 + mbCoolTube.outDiam / 2.,
1969 -bHalfWidth + (
j + 1) * bHalfWidth / 5,
1979 if (0 != backPipe.here && 0 != iMod) {
1980 string bPipeName(backPipe.name +
"_" + std::to_string(iMod + 1));
1981 string bInnerName(backPipe.name +
"_H2O_" + std::to_string(iMod + 1));
1983 Solid backPipeSolid = Tube(bPipeName, 0_mm, backPipe.vecDiam[iMod] / 2, pipeLength / 2, 0_deg, 360_deg);
1984 Solid backInnerSolid = Tube(
1985 bInnerName, 0_mm, backPipe.vecDiam[iMod] / 2 - backPipe.vecThick[iMod], pipeLength / 2, 0_deg, 360_deg);
1987 Volume backPipeLog =
Volume(bPipeName, backPipeSolid, ns.material(backPipe.mat));
1988 Volume backInnerLog =
Volume(bInnerName, backInnerSolid, ns.material(backPipe.waterMat));
1990 const Position bPipeTra1(back.xOff + back.sideHeight - 0.7 * backPipe.vecDiam[iMod],
1991 back.yOff + back.plateWidth / 2 - back.sideWidth - 0.7 * backPipe.vecDiam[iMod],
1994 spmLog.placeVolume(backPipeLog, copyOne, Transform3D(Rotation3D(), bPipeTra1));
1997 bPipeTra1.x(), back.yOff - back.plateWidth / 2 + back.sideWidth + backPipe.vecDiam[iMod], bPipeTra1.z());
1999 spmLog.placeVolume(backPipeLog, copyTwo, Transform3D(Rotation3D(), bPipeTra2));
2000 backPipeLog.placeVolume(backInnerLog, copyOne, Transform3D(Rotation3D(),
Position()));
2010 if (0 != dryAirTube.here) {
2011 string dryAirTubName(dryAirTube.name + std::to_string(iMod + 1));
2013 Solid dryAirTubeSolid =
2014 Tube(dryAirTubName, dryAirTube.innDiam / 2, dryAirTube.outDiam / 2, pipeLength / 2, 0_deg, 360_deg);
2015 Volume dryAirTubeLog =
Volume(dryAirTubName, dryAirTubeSolid, ns.material(dryAirTube.mat));
2017 const Position dryAirTubeTra1(back.xOff + back.sideHeight - 0.7 * dryAirTube.outDiam - backPipe.vecDiam[iMod],
2018 back.yOff + back.plateWidth / 2 - back.sideWidth - 1.2 * dryAirTube.outDiam,
2021 spmLog.placeVolume(dryAirTubeLog, copyOne, Transform3D(Rotation3D(), dryAirTubeTra1));
2023 const Position dryAirTubeTra2(dryAirTubeTra1.x(),
2024 back.yOff - back.plateWidth / 2 + back.sideWidth + 0.7 * dryAirTube.outDiam,
2025 dryAirTubeTra1.z());
2027 spmLog.placeVolume(dryAirTubeLog, copyTwo, Transform3D(Rotation3D(), dryAirTubeTra2));
2037 Position cTra(backCool.barHeight / 2. - backCoolHeight / 2. + bottomThick, 0, -halfZTank + halfZCoolVFE);
2038 const unsigned int numSec(static_cast<unsigned int>(backCool.vecBackCoolNSec[iMod]));
2039 for (
unsigned int jSec(0); jSec != numSec; ++jSec) {
2040 const unsigned int nMax(static_cast<unsigned int>(backCool.vecBackCoolNPerSec[iNSec++]));
2041 for (
unsigned int iBar(0); iBar !=
nMax; ++iBar) {
2042 backCoolLog.placeVolume(backCoolVFELog, iCVFECopy++, cTra);
2043 cTra +=
Position(0, 0, backMisc.backCBStdSep);
2045 cTra -=
Position(0, 0, backMisc.backCBStdSep);
2046 if (jSec != numSec - 1)
2047 cTra +=
Position(0, 0, backCool.vecBackCoolSecSep[iSep++]);
2068 double patchHeight(0);
2069 for (
unsigned int iPatch(0); iPatch != patchPanel.vecThick.size(); ++iPatch) {
2070 patchHeight += patchPanel.vecThick[iPatch];
2073 array<double, 3> patchParms{
2074 {patchHeight / 2., backCool.barWidth / 2., (spm.vecZPts.back() - grille.vecZOff.back() - grille.thick) / 2}};
2075 Solid patchSolid = Box(patchParms[0], patchParms[1], patchParms[2]);
2076 Volume patchLog =
Volume(patchPanel.name, patchSolid, ns.material(spm.mat));
2078 const Position patchTra(back.xOff + 4_mm, 0_mm, grille.vecZOff.back() + grille.thick + patchParms[2]);
2079 if (0 != patchPanel.here)
2080 spmLog.placeVolume(patchLog, copyOne, patchTra);
2082 Position pTra(-patchParms[0], 0, 0);
2084 for (
unsigned int j(0);
j != patchPanel.vecNames.size(); ++
j) {
2085 const string pName(patchPanel.vecNames[
j]);
2087 Solid pSolid = Box(patchPanel.vecThick[
j] / 2., patchParms[1], patchParms[2]);
2088 Volume pLog =
Volume(pName, pSolid, ns.material(patchPanel.vecMat[
j]));
2090 pTra +=
Position(patchPanel.vecThick[
j] / 2, 0_mm, 0_mm);
2091 patchLog.placeVolume(pLog, copyOne, pTra);
2093 pTra +=
Position(patchPanel.vecThick[
j] / 2, 0_mm, 0_mm);
2107 if (0 != pincer.rodHere) {
2110 Solid rodSolid = Box(pincer.rodName, pincer.envWidth / 2., pincer.envHeight / 2., ilyLength / 2);
2111 Volume rodLog =
Volume(pincer.rodName, rodSolid, ns.material(pincer.rodMat));
2113 array<double, 3> envParms{{pincer.envWidth / 2., pincer.envHeight / 2., pincer.envLength / 2}};
2114 Solid envSolid = Box(pincer.envName, envParms[0], envParms[1], envParms[2]);
2115 Volume envLog =
Volume(pincer.envName, envSolid, ns.material(pincer.envMat));
2117 array<double, 3> blkParms{{pincer.envWidth / 2., pincer.envHeight / 2., pincer.blkLength / 2}};
2118 Solid blkSolid = Box(pincer.blkName, blkParms[0], blkParms[1], blkParms[2]);
2119 Volume blkLog =
Volume(pincer.blkName, blkSolid, ns.material(pincer.blkMat));
2121 envLog.placeVolume(blkLog, copyOne,
Position(0_mm, 0_mm, pincer.envLength / 2 - pincer.blkLength / 2));
2123 array<double, 3> cutParms{{pincer.cutWidth / 2., pincer.cutHeight / 2., pincer.blkLength / 2}};
2124 Solid cutSolid = Box(pincer.cutName, cutParms[0], cutParms[1], cutParms[2]);
2125 Volume cutLog =
Volume(pincer.cutName, cutSolid, ns.material(pincer.cutMat));
2130 +blkParms[0] - cutParms[0] - pincer.shim1Width + pincer.shim2Width, -blkParms[1] + cutParms[1], 0_mm));
2131 array<double, 3> shim2Parms{{pincer.shim2Width / 2., pincer.shimHeight / 2., pincer.blkLength / 2}};
2132 Solid shim2Solid = Box(pincer.shim2Name, shim2Parms[0], shim2Parms[1], shim2Parms[2]);
2133 Volume shim2Log =
Volume(pincer.shim2Name, shim2Solid, ns.material(pincer.shimMat));
2135 shim2Log, copyOne,
Position(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0_mm));
2137 array<double, 3> shim1Parms{
2138 {pincer.shim1Width / 2., pincer.shimHeight / 2., (pincer.envLength - pincer.blkLength) / 2}};
2139 Solid shim1Solid = Box(pincer.shim1Name, shim1Parms[0], shim1Parms[1], shim1Parms[2]);
2140 Volume shim1Log =
Volume(pincer.shim1Name, shim1Solid, ns.material(pincer.shimMat));
2144 Position(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2]));
2146 for (
unsigned int iEnv(0); iEnv != pincer.vecEnvZOff.size(); ++iEnv) {
2147 rodLog.placeVolume(envLog,
2149 Position(0_mm, 0_mm, -ilyLength / 2. + pincer.vecEnvZOff[iEnv] - pincer.envLength / 2.));
2153 const double radius(ilyRMin - pincer.envHeight / 2 - 1_mm);
2154 const string xilyName(ily.name + std::to_string(ily.vecIlyMat.size() - 1));
2156 for (
unsigned int iRod(0); iRod != pincer.vecRodAzimuth.size(); ++iRod) {
2158 radius *
cos(pincer.vecRodAzimuth[iRod]),
radius *
sin(pincer.vecRodAzimuth[iRod]), 0_mm);
2159 xilyLog.placeVolume(rodLog,
2161 Transform3D(myrot(ns,
2162 pincer.rodName + std::to_string(iRod),
2163 CLHEP::HepRotationZ(90_deg + pincer.vecRodAzimuth[iRod])),