55 double pmThicknessN=pm.ThicknessN_noSvc();
56 double pmThicknessP=pm.ThicknessP();
57 double pmWidth=pm.Width();
64 double pmThicknessN3D=-1;
65 double pmThicknessP3D=-1.;
67 double pmShilftLateral3D=0.;
68 double radialShift=0.;
69 double radialShiftThickN=0.;
70 if(staveLayout==5||staveLayout==6||staveLayout==7)
75 pmThicknessN3D=pm3D.ThicknessN();
76 pmThicknessP3D=pm3D.ThicknessP();
78 if(pmThicknessP3D>pmThicknessP) radialShift = -(pmThicknessP3D-pmThicknessP);
81 pmThicknessN3D=pm3D.ThicknessN()-radialShift;
82 pmThicknessP3D=pm3D.ThicknessP()+radialShift;
83 pmWidth3D=pm3D.Width();
85 m_gmt_mgr->
msg(MSG::INFO) <<
"Module thicknesses : SiPl P/N "<<pmThicknessP<<
" "<<pmThicknessN<<
" "<<pmWidth<<
86 " SiPl P/N "<<pmThicknessP3D<<
" "<<pmThicknessN3D<<
" "<<pmWidth3D<<
87 " // "<<pm3D.ThicknessP()<<
" "<<pm3D.ThicknessN()<<
endmsg;
91 pmShilftLateral3D= -(MechanicalStaveOffset3D-MechanicalStaveOffset);
93 radialShiftThickN=fabs(radialShift)+(pmThicknessN3D-pmThicknessN)*.5;
97 int ModuleNumber_allPlanar=ModuleNumber;
99 double ModuleLength=pm.Length();
102 int Module3DNumber= 0;
103 double Module3DLength=0;
111 if(staveLayout==5||staveLayout==6||staveLayout==7)
114 bool isModule3D=
true;
117 Module3DLength=pm3D.Length();
119 if(staveLayout==5||staveLayout==7)
121 Module3DNumber=(ModuleNumber/4)*2;
122 ModuleNumber=ModuleNumber*0.75;
124 else if(staveLayout==6)
126 ModuleNumber=ModuleNumber/2;
127 Module3DNumber=ModuleNumber*2;
142 double lgEndBlock=2.0*MechanicalStaveEndBlockLength;
145 double compStaveLength=lgPlanar+lg3D+lgEndBlock;
146 double lgNAStave=(totalStaveLength-compStaveLength)*0.5;
154 m_gmt_mgr->
msg(MSG::INFO) <<
" planar/3D/endblock/NonActive lengths : "<<lgPlanar<<
" "<<lg3D<<
" "<<lgEndBlock<<
" "<<lgNAStave<<
endmsg;
170 if(FacePlateGreaseThick>0.001) FacePlateThick+=FacePlateGreaseThick;
192 bool bFlexConstantThickness =
true;
193 if(!bFlexAndWing) bFlexConstantThickness =
false;
203 double MaxFlexThickness;
204 if (!bFlexConstantThickness){
205 if(ModuleNumber_allPlanar%2==0)
206 MaxFlexThickness=FlexBaseThick+(ModuleNumber_allPlanar/2-1)*FlexLayerThick;
208 MaxFlexThickness=FlexBaseThick+((ModuleNumber_allPlanar-1)/2)*FlexLayerThick;
211 MaxFlexThickness=FlexBaseThick;
213 m_gmt_mgr->
msg(MSG::INFO) <<
"Flex thickness (max) : "<<MaxFlexThickness<<
" computed for "<<ModuleNumber_allPlanar<<
" modules "<<
endmsg;
215 double halfMecStaveWidth=MechanicalStaveWidth*0.5;
229 FlexWidth = sqrt(xDelta*xDelta+yDelta*yDelta);
233 m_gmt_mgr->
msg(MSG::INFO)<<
" MechanicalStaveLength = "<<MechanicalStaveLength <<
endmsg;
234 m_gmt_mgr->
msg(MSG::INFO)<<
" MechanicalStaveOffset = "<<MechanicalStaveOffset <<
endmsg;
236 m_gmt_mgr->
msg(MSG::INFO)<<
" MechanicalStaveEndBlockLength = "<<MechanicalStaveEndBlockLength <<
endmsg;
248 double MiddleSectionLength=MechanicalStaveLength-2.0*MechanicalStaveEndBlockLength;
269 foam1x += xGblOffset;
270 foam2x += xGblOffset;
271 foam3x += xGblOffset;
272 foam4x += xGblOffset;
273 foam5x += xGblOffset;
275 double FoamBaseWidth=sqrt((foam5x-foam1x)*(foam5x-foam1x)+(foam5y-foam1y)*(foam5y-foam1y));
284 double omega1x, omega1y, omega2x, omega2y, omega3x, omega3y;
285 double omega4x, omega4y, omega5x, omega5y;
286 omega1x=omega1y=omega2x=omega2y=omega3x=omega3y=omega4x=omega4y=omega5x=omega5y=0.0;
288 omega1x = 0.0; omega1y = -halfMecStaveWidth;
292 omega5x = 0.0; omega5y = halfMecStaveWidth;
294 omega1x += xGblOffset;
295 omega2x += xGblOffset;
296 omega3x += xGblOffset;
297 omega4x += xGblOffset;
298 omega5x += xGblOffset;
307 double plate1x =0.0, plate1y= foam1y;
308 double plate2x =FacePlateThick, plate2y= foam1y;
309 double plate3x =FacePlateThick, plate3y= foam5y;
310 double plate4x =0.0, plate4y= foam5y;
312 plate1y=omega1y; plate4y=omega5y;
321 double seg1x, seg2x, seg1y, seg2y;
322 seg1x=omega3x; seg1y=omega3y;
323 seg2x=omega4x; seg2y=omega4y;
325 double vDirX=(seg2x-seg1x), vDirY=(seg2y-seg1y);
326 double invNorm=1.0/sqrt(vDirX*vDirX+vDirY*vDirY);
327 vDirX*=invNorm; vDirY*=invNorm;
328 double vPerpDirX=vDirY, vPerpDirY=-vDirX;
333 double flexHalfWidth=FlexWidth*0.5;
334 double wingHalfWidth = WingWidth*.5;
336 double flexWingMaxR=0.;
337 double maxFlex1x = foamMidX-(FlexOffset+flexHalfWidth)*vDirX;
338 double maxFlex1y = foamMidY-(FlexOffset+flexHalfWidth)*vDirY;
339 double maxFlex2x = maxFlex1x+MaxFlexThickness*vPerpDirX;
340 double maxFlex2y = maxFlex1y+MaxFlexThickness*vPerpDirY;
341 double maxFlex4x = foamMidX+(-FlexOffset+flexHalfWidth)*vDirX;
342 double maxFlex4y = foamMidY+(-FlexOffset+flexHalfWidth)*vDirY;
345 double maxFlex4x_wings = foamMidX+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirX;
346 double maxFlex4y_wings = foamMidY+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirY;
347 double maxFlex3x_wings = maxFlex4x_wings+MaxFlexThickness*vPerpDirX;
348 double maxFlex3y_wings = maxFlex4y_wings+MaxFlexThickness*vPerpDirY;
351 wingHalfWidth = WingWidth*.5*.6;
352 maxFlex4x_wings = foamMidX+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirX;
353 maxFlex4y_wings = foamMidY+(-FlexOffset+flexHalfWidth+2.*wingHalfWidth+.5)*vDirY;
354 maxFlex3x_wings = maxFlex4x_wings+MaxFlexThickness*vPerpDirX;
355 maxFlex3y_wings = maxFlex4y_wings+MaxFlexThickness*vPerpDirY;
367 std::vector<double> xShape, yShape;
368 std::vector<int>iShapeExcept;
371 double plate1y_tmp =
std::min(plate1y,-pm.Width()*.5-yStaveOffset);
372 double omega1y_tmp =
std::min(omega1y,-pm.Width()*.5-yStaveOffset);
374 xShape.push_back(plate1x); yShape.push_back(plate1y_tmp); iShapeExcept.push_back(1);
375 xShape.push_back(omega1x); yShape.push_back(omega1y_tmp); iShapeExcept.push_back(0);
376 xShape.push_back(omega2x); yShape.push_back(omega2y); iShapeExcept.push_back(0);
377 xShape.push_back(omega3x); yShape.push_back(omega3y); iShapeExcept.push_back(0);
379 xShape.push_back(maxFlex1x); yShape.push_back(maxFlex1y); iShapeExcept.push_back(0);
380 xShape.push_back(maxFlex2x); yShape.push_back(maxFlex2y); iShapeExcept.push_back(0);
382 xShape.push_back(maxFlex3x_wings); yShape.push_back(maxFlex3y_wings); iShapeExcept.push_back(0);
383 xShape.push_back(maxFlex4x_wings); yShape.push_back(maxFlex4y_wings); iShapeExcept.push_back(0);
386 xShape.push_back(maxFlex4x); yShape.push_back(maxFlex4y); iShapeExcept.push_back(1);
387 flexWingMaxR=sqrt((maxFlex3x_wings+layerRadius)*(maxFlex3x_wings+layerRadius)+maxFlex3y_wings*maxFlex3y_wings);
390 xShape.push_back(omega4x); yShape.push_back(omega4y); iShapeExcept.push_back(0);
391 xShape.push_back(omega5x); yShape.push_back(omega5y); iShapeExcept.push_back(0);
393 xShape.push_back(plate4x); yShape.push_back(plate4y); iShapeExcept.push_back(1);
401 for(
unsigned int iPt=0; iPt<xShape.size(); iPt++)
407 GeoPhysVol * logVolPV =
new GeoPhysVol(logVol);
415 GeoSimplePolygonBrep * foam_shape =
new GeoSimplePolygonBrep(MiddleSectionLength*.5);
416 foam_shape->addVertex(foam1x,foam1y);
417 foam_shape->addVertex(foam2x,foam2y);
418 foam_shape->addVertex(foam3x,foam3y);
419 foam_shape->addVertex(foam4x,foam4y);
420 foam_shape->addVertex(foam5x,foam5y);
423 GeoNameTag* foam_tag =
new GeoNameTag(
"CarbonFoam");
424 GeoTransform* foam_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
426 GeoLogVol * foam_logVol =
new GeoLogVol(
"CarbonFoam",foam_shape,foam_material);
427 GeoPhysVol * foam_logVolPV =
new GeoPhysVol(foam_logVol);
435 GeoSimplePolygonBrep * omega_shape =
new GeoSimplePolygonBrep(MiddleSectionLength*.5);
436 omega_shape->addVertex(omega1x,omega1y);
437 omega_shape->addVertex(omega2x,omega2y);
438 omega_shape->addVertex(omega3x,omega3y);
439 omega_shape->addVertex(omega4x,omega4y);
440 omega_shape->addVertex(omega5x,omega5y);
441 omega_shape->addVertex(foam5x,foam5y);
442 omega_shape->addVertex(foam4x,foam4y);
443 omega_shape->addVertex(foam3x,foam3y);
444 omega_shape->addVertex(foam2x,foam2y);
445 omega_shape->addVertex(foam1x,foam1y);
447 GeoLogVol * omega_logVol =
nullptr;
449 if(OmegaGlueThick<0.0001)
454 omega_logVol =
new GeoLogVol(
"Omega",omega_shape,omega_material);
459 double omegaVolume = omega_shape->volume();
460 double glueVolume = omegaVolume*(OmegaGlueThick/OmegaThick);
461 const std::string compMatName=
"OmegaGlue_IBL";
464 omegaVolume,
"pix::Omega_IBL",
465 glueVolume,
"pix::Stycast2850FT");
467 omega_logVol =
new GeoLogVol(
"Omega",omega_shape,omega_material);
470 GeoNameTag* omega_tag =
new GeoNameTag(
"Omega");
471 GeoTransform* omega_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
478 GeoPhysVol * omega_logVolPV =
new GeoPhysVol(omega_logVol);
479 logVolPV->add(omega_tag);
480 logVolPV->add(omega_xform);
481 logVolPV->add(omega_logVolPV);
490 GeoBox * faceplate_shape =
new GeoBox(FacePlateThick*0.5,MechanicalStaveWidth*0.5,MiddleSectionLength*.5);
491 GeoTrf::Translate3D faceplate_pos((plate1x+plate2x+plate3x+plate4x)*0.25,(plate1y+plate2y+plate3y+plate4y)*0.25,0.0);
492 GeoTransform* faceplate_xform =
new GeoTransform(faceplate_pos);
494 std::string faceplateMatName;
495 const GeoMaterial* faceplate_material;
498 if(FacePlateGlueThick<0.0001)
500 m_gmt_mgr->
msg(MSG::INFO)<<
"** FacePlate : without Stycast "<<FacePlateGlueThick<<
endmsg;
501 faceplateMatName =
"pix::FacePlate_IBL";
506 m_gmt_mgr->
msg(MSG::INFO)<<
" ** FacePlate : with Stycast "<<FacePlateGlueThick<<
" grease : "<<FacePlateGreaseThick<<
endmsg;
508 double glueVolume = FacePlateGlueThick*MechanicalStaveWidth*MiddleSectionLength;
509 double facePlateVolume = (FacePlateThick-FacePlateGreaseThick)*MechanicalStaveWidth*MiddleSectionLength;
511 faceplateMatName=
"FacePlateGlue_IBL";
514 facePlateVolume,
"pix::FacePlate_IBL",
515 glueVolume,
"pix::Stycast2850FT");
520 GeoLogVol * faceplate_logVol =
nullptr;
521 if(FacePlateGreaseThick<0.0001)
525 faceplate_logVol =
new GeoLogVol(
"FacePlate",faceplate_shape,faceplate_material);
531 double greaseVolume = FacePlateGreaseThick*MechanicalStaveWidth*MiddleSectionLength;
532 double facePlateVolume = (FacePlateThick-FacePlateGreaseThick)*MechanicalStaveWidth*MiddleSectionLength;
534 std::string compMatName=
"FacePlateGrease_IBL";
535 if(FacePlateGlueThick>0.0001) compMatName=
"FacePlateGlueGrease_IBL";
537 facePlateVolume+greaseVolume,
538 facePlateVolume,faceplateMatName,
539 greaseVolume,
"pix::ThermGrease_IBL");
540 faceplate_logVol =
new GeoLogVol(
"FacePlate",faceplate_shape,faceplate_material);
546 GeoPhysVol * faceplate_logVolPV =
new GeoPhysVol(faceplate_logVol);
547 GeoNameTag* faceplate_tag =
new GeoNameTag(
"FacePlate");
548 logVolPV->add(faceplate_tag);
549 logVolPV->add(faceplate_xform);
550 logVolPV->add(faceplate_logVolPV);
561 double ModuleLength_flex=pm.Length();
563 double ModuleTotLength=ModuleLength_flex+ModuleGap_flex;
564 double ModulePosZ=ModuleTotLength*0.5;
565 int NbModuleRL=ModuleNumber_flex/2;
566 if(ModuleNumber_flex%2==1)
571 double FlexThicknessRL=FlexBaseThick;
572 double flex_angle=((maxFlex1x-maxFlex4x)*(foam1x-foam5x)+(maxFlex1y-maxFlex4y)*(foam1y-foam5y))/(FlexWidth*FoamBaseWidth);
573 flex_angle=acos(flex_angle);
577 m_gmt_mgr->
msg(MSG::INFO)<<
"Flex angle : "<<flex_angle<<
" Flex pos. in Z : ";
578 double EndblockFlexXpos=0.;
579 double EndblockFlexYpos=0.;
580 double EndblockFlexThickness=0.;
582 double wingZmin=0., wingZmax=0.;
584 GeoLogVol * wingflex_logVol =
nullptr;
585 double wingFlexPosX = 0.;
586 double wingFlexPosY = 0.;
588 for(
int iModule=0; iModule<NbModuleRL; iModule++)
594 if(iModule==NbModuleRL-1)
596 wingZmax=ModulePosZ+ModuleTotLength*0.5;
597 double delta=MiddleSectionLength*0.5-(ModulePosZ+ModuleTotLength*0.5);
598 ModulePosZ+=delta*0.5;
599 ModuleTotLength+=delta;
604 flexGapZ = FlexStaveMiddleGap;
609 GeoBox * cableflex_shape =
new GeoBox(FlexThicknessRL*0.5,FlexWidth*0.5,(ModuleTotLength-
m_SafetyMargin-flexGapZ)*.5);
611 double flex1x = foamMidX-(FlexOffset+flexHalfWidth)*vDirX;
612 double flex1y = foamMidY-(FlexOffset+flexHalfWidth)*vDirY;
613 double flex2x = flex1x+FlexThicknessRL*vPerpDirX;
614 double flex2y = flex1y+FlexThicknessRL*vPerpDirY;
615 double flex4x = foamMidX+(-FlexOffset+flexHalfWidth)*vDirX;
616 double flex4y = foamMidY+(-FlexOffset+flexHalfWidth)*vDirY;
617 double flex3x = flex4x+FlexThicknessRL*vPerpDirX;
618 double flex3y = flex4y+FlexThicknessRL*vPerpDirY;
621 std::ostringstream lname;
622 int iFlexModule=(ModuleNumber_flex%2==0)?(iModule+1):iModule;
623 lname <<
"StaveFlex_"<<iFlexModule;
624 if(!(ModuleNumber_flex%2==1&&iModule==0))lname<<
"A";
627 const GeoMaterial* scaledFlexMaterial=
nullptr;
641 GeoTrf::Translation3D cableflex_pos((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,ModulePosZ+flexGapZ*0.5);
643 GeoTransform* cableflex_xform =
new GeoTransform(
GeoTrf::Transform3D(cableflex_pos*GeoTrf::RotateZ3D(fabs(flex_angle))));
645 GeoLogVol * cableflex_logVol =
nullptr;
646 if(bFlexAndWing||bFlexConstantThickness)
647 cableflex_logVol=
new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
649 cableflex_logVol=
new GeoLogVol(lname.str(),cableflex_shape,cableflex_material);
654 std::ostringstream wingName;
655 wingName <<
"WingFlex";
660 double flex1x_tmp = flex4x;
661 double flex1y_tmp = flex4y;
662 double flex2x_tmp = flex4x+2.*wingHalfWidth*vDirX;
663 double flex2y_tmp = flex4y+2.*wingHalfWidth*vDirY;
664 double flex4x_tmp = flex1x_tmp+WingThick*vPerpDirX;
665 double flex4y_tmp = flex1y_tmp+WingThick*vPerpDirY;
666 double flex3x_tmp = flex2x_tmp+WingThick*vPerpDirX;
667 double flex3y_tmp = flex2y_tmp+WingThick*vPerpDirY;
669 maxFlex3x_wings = flex3x_tmp;
670 maxFlex3y_wings = flex3y_tmp;
671 maxFlex4x_wings = flex4x_tmp;
672 maxFlex4y_wings = flex4y_tmp;
673 wingFlexPosX = (flex1x_tmp+flex2x_tmp+flex3x_tmp+flex4x_tmp)*0.25;
674 wingFlexPosY = (flex1y_tmp+flex2y_tmp+flex3y_tmp+flex4y_tmp)*0.25;
676 double wingHalfLength = 12.15*.5;
677 GeoBox* wingflex_shape =
new GeoBox(WingThick*0.5,wingHalfWidth,wingHalfLength);
681 wingflex_logVol =
new GeoLogVol(wingName.str(),wingflex_shape,wingflex_material);
687 double zPos = (iModule+.5)*ModuleLength_flex+(iModule+.5)*ModuleGap_flex;
689 GeoTransform* wingflex_xformA =
new GeoTransform(
GeoTrf::Transform3D(wingflex_posA*GeoTrf::RotateZ3D(fabs(flex_angle))));
691 GeoPhysVol * wingflex_logVolPV_1 =
new GeoPhysVol(wingflex_logVol);
692 GeoNameTag* wingflex_tag =
new GeoNameTag(wingName.str());
693 logVolPV->add(wingflex_tag);
694 logVolPV->add(wingflex_xformA);
695 logVolPV->add(wingflex_logVolPV_1);
698 GeoTransform* wingflex_xformA_2 =
new GeoTransform(
GeoTrf::Transform3D(wingflex_posA_2*GeoTrf::RotateZ3D(fabs(flex_angle))));
700 GeoPhysVol * wingflex_logVolPV_2 =
new GeoPhysVol(wingflex_logVol);
701 logVolPV->add(wingflex_tag);
702 logVolPV->add(wingflex_xformA_2);
703 logVolPV->add(wingflex_logVolPV_2);
708 GeoTransform* wingflex_xformC =
new GeoTransform(
GeoTrf::Transform3D(wingflex_posC*GeoTrf::RotateZ3D(fabs(flex_angle))));
710 GeoPhysVol * wingflex_logVolPV_C1 =
new GeoPhysVol(wingflex_logVol);
711 logVolPV->add(wingflex_tag);
712 logVolPV->add(wingflex_xformC);
713 logVolPV->add(wingflex_logVolPV_C1);
716 GeoTransform* wingflex_xformC_2 =
new GeoTransform(
GeoTrf::Transform3D(wingflex_posC_2*GeoTrf::RotateZ3D(fabs(flex_angle))));
718 GeoPhysVol * wingflex_logVolPV_C2 =
new GeoPhysVol(wingflex_logVol);
719 logVolPV->add(wingflex_tag);
720 logVolPV->add(wingflex_xformC_2);
721 logVolPV->add(wingflex_logVolPV_C2);
725 GeoPhysVol * cableflex_logVolPV =
new GeoPhysVol(cableflex_logVol);
726 GeoNameTag* cableflex_tag =
new GeoNameTag(lname.str());
727 logVolPV->add(cableflex_tag);
728 logVolPV->add(cableflex_xform);
729 logVolPV->add(cableflex_logVolPV);
732 <<
"(" << cableflex_pos.x() <<
"," << cableflex_pos.y() <<
"," << cableflex_pos.z() <<
")"
733 <<
" " << FlexThicknessRL<<
" / ";
736 if((ModuleNumber_flex%2==1&&iModule>0)||ModuleNumber_flex%2==0)
738 std::ostringstream lname;
739 lname <<
"StaveFlex_"<<iFlexModule<<
"C";
741 GeoTrf::Translation3D cableflex_pos2((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,-ModulePosZ-flexGapZ*0.5);
742 GeoTransform* cableflex_xform2 =
new GeoTransform(
GeoTrf::Transform3D(cableflex_pos2*GeoTrf::RotateZ3D(fabs(flex_angle))));
743 GeoLogVol * cableflex_logVol =
nullptr;
745 const GeoMaterial* scaledFlexMaterial=
nullptr;
758 if(bFlexAndWing||bFlexConstantThickness)
759 cableflex_logVol=
new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
761 cableflex_logVol=
new GeoLogVol(lname.str(),cableflex_shape,cableflex_material);
762 GeoPhysVol * cableflex_logVolPV =
new GeoPhysVol(cableflex_logVol);
763 GeoNameTag* cableflex_tag =
new GeoNameTag(lname.str());
764 logVolPV->add(cableflex_tag);
765 logVolPV->add(cableflex_xform2);
766 logVolPV->add(cableflex_logVolPV);
770 if(iModule==NbModuleRL-1)
772 EndblockFlexXpos=(flex1x+flex2x+flex3x+flex4x)*0.25;
773 EndblockFlexYpos=(flex1y+flex2y+flex3y+flex4y)*0.25;
774 EndblockFlexThickness=FlexThicknessRL;
777 ModulePosZ+=ModuleTotLength;
778 if(!bFlexConstantThickness)
779 FlexThicknessRL+=FlexLayerThick;
790 if(bFlexAndWing&&nbModuleSvc==0)
795 double flex1x = foamMidX+(wingPos+wingHalfWidth)*vDirX;
796 double flex1y = foamMidY+(wingPos+wingHalfWidth)*vDirY;
797 double flex2x = flex1x+WingThick*vPerpDirX;
798 double flex2y = flex1y+WingThick*vPerpDirY;
799 double flex4x = foamMidX+(wingPos)*vDirX;
800 double flex4y = foamMidY+(wingPos)*vDirY;
801 double flex3x = flex4x+WingThick*vPerpDirX;
802 double flex3y = flex4y+WingThick*vPerpDirY;
804 GeoBox* wingflex_shape =
new GeoBox(WingThick*0.5,wingHalfWidth-
m_SafetyMargin,(wingZmax-wingZmin)*.5);
807 std::ostringstream wingName;
808 wingName <<
"WingFlex";
811 GeoTrf::Vector3D wingflex_posA((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,(wingZmax-wingZmin)*.5+FlexStaveMiddleGap);
812 GeoTransform* wingflex_xformA =
new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0,std::abs(flex_angle)),wingflex_posA));
815 GeoLogVol * wingflex_logVol =
new GeoLogVol(wingName.str(),wingflex_shape,wingflex_material);
817 GeoPhysVol * wingflex_logVolPV =
new GeoPhysVol(wingflex_logVol);
818 GeoNameTag* wingflex_tag =
new GeoNameTag(wingName.str());
819 logVolPV->add(wingflex_tag);
820 logVolPV->add(wingflex_xformA);
821 logVolPV->add(wingflex_logVolPV);
823 GeoTrf::Vector3D wingflex_posC((flex1x+flex2x+flex3x+flex4x)*0.25,(flex1y+flex2y+flex3y+flex4y)*0.25,-((wingZmax-wingZmin)*.5+FlexStaveMiddleGap));
824 GeoTransform* wingflex_xformC =
new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0,std::abs(flex_angle)),wingflex_posC));
825 logVolPV->add(wingflex_tag);
826 logVolPV->add(wingflex_xformC);
827 logVolPV->add(wingflex_logVolPV);
835 const GeoTube* coolingPipe =
new GeoTube(0.0,TubeOuterDiam*0.5,MiddleSectionLength*0.5);
836 const GeoTube* coolingPipeInner =
new GeoTube(0.0,TubeInnerDiam*0.5,MiddleSectionLength*0.5);
838 GeoLogVol * cp_logVol =
nullptr;
840 if(TubeGlueThick<0.0001)
844 cp_logVol =
new GeoLogVol(
"CoolingPipe",coolingPipe,cp_material);
848 m_gmt_mgr->
msg(MSG::INFO)<<
"** TUBE : with Stycast "<<TubeGlueThick<<
" diam "<<TubeOuterDiam*0.5<<
" "<<TubeInnerDiam*0.5<<
endmsg;
849 double glueVolume = (TubeOuterDiam*0.5+TubeGlueThick)*(TubeOuterDiam*0.5+TubeGlueThick)*
M_PI*MiddleSectionLength;
850 double tubeOuterVolume = TubeOuterDiam*TubeOuterDiam*0.25*
M_PI*MiddleSectionLength;
851 double tubeInnerVolume = TubeInnerDiam*TubeInnerDiam*0.25*
M_PI*MiddleSectionLength;
853 const std::string compMatName=
"CoolingPipeGlue_IBL";
855 tubeOuterVolume-tubeInnerVolume,
856 tubeOuterVolume-tubeInnerVolume,
"pix::CoolingPipe_IBL",
857 glueVolume-tubeOuterVolume,
"pix::Stycast2850FT");
859 cp_logVol =
new GeoLogVol(
"CoolingPipe",coolingPipe,cp_material);
862 GeoPhysVol * cp_logPV =
new GeoPhysVol(cp_logVol);
868 GeoNameTag* cp_tag =
new GeoNameTag(
"CoolingPipe");
869 GeoTrf::Translate3D cp_pos(xGblOffset+TubeMiddlePos,0.0,0.0);
870 GeoTransform* cp_xform =
new GeoTransform(cp_pos);
871 foam_logVolPV->add(cp_tag);
872 foam_logVolPV->add(cp_xform);
873 foam_logVolPV->add(cp_logPV);
877 GeoLogVol * cp_inner_log =
new GeoLogVol(
"CoolingPipeInner",coolingPipeInner,cp_inner_material);
878 GeoPhysVol * cp_inner_logPV =
new GeoPhysVol(cp_inner_log);
880 GeoNameTag* cp_inner_tag =
new GeoNameTag(
"CoolingPipeInner");
881 GeoTransform* cp_inner_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
882 cp_logPV->add(cp_inner_tag);
883 cp_logPV->add(cp_inner_xform);
884 cp_logPV->add(cp_inner_logPV);
886 logVolPV->add(foam_tag);
887 logVolPV->add(foam_xform);
888 logVolPV->add(foam_logVolPV);
910 double doglegFlexLength=FlexDogLeg_length;
921 GeoSimplePolygonBrep * endblock_shape =
new GeoSimplePolygonBrep(
m_endblockLength*.5+safetyMarginZ);
922 endblock_shape->addVertex(plate1x,plate1y);
923 endblock_shape->addVertex(omega1x,omega1y);
924 endblock_shape->addVertex(omega2x,omega2y);
925 endblock_shape->addVertex(omega3x,omega3y);
926 endblock_shape->addVertex(omega4x,omega4y);
927 endblock_shape->addVertex(omega5x,omega5y);
928 endblock_shape->addVertex(plate4x,plate4y);
931 GeoLogVol * endblock_logVol =
nullptr;
932 GeoLogVol * endblockA_logVol =
nullptr;
933 GeoLogVol * endblockC_logVol =
nullptr;
934 if(endblock_material_weight){
936 double omegaStaveVolume = omega_shape->volume();
937 double omegaVolume = omegaStaveVolume*endblockOmegaOverlap/omegaStaveVolume;
938 double endblockVolume = endblock_shape->volume();
940 const std::string compMatNameA=
"EndblockOgA_IBL";
942 endblockVolume+omegaVolume,
943 omegaVolume,
"pix::Omega_IBL",
944 endblockVolume,
"pix::EndblockA_IBLwght");
946 endblockA_logVol =
new GeoLogVol(
"EndBlock",endblock_shape,endblockA_omega_material);
949 const std::string compMatNameC=
"EndblockOgC_IBL";
951 endblockVolume+omegaVolume,
952 omegaVolume,
"pix::Omega_IBL",
953 endblockVolume,
"pix::EndblockC_IBLwght");
954 endblockC_logVol =
new GeoLogVol(
"EndBlock",endblock_shape,endblockC_omega_material);
960 endblock_logVol =
new GeoLogVol(
"EndBlock",endblock_shape,endblock_material);
973 const GeoTube* endblock_coolingPipe =
new GeoTube(0.0,TubeOuterDiam*0.5,
m_endblockLength*.5);
976 GeoLogVol * cp_endblock_log =
new GeoLogVol(
"EndBlockCoolingPipe",endblock_coolingPipe,cp_endblock_material);
977 GeoPhysVol * cp_endblock_logPV =
new GeoPhysVol(cp_endblock_log);
979 GeoNameTag* cp_endblock_tag =
new GeoNameTag(
"EndBlockCoolingPipe");
980 GeoTrf::Translate3D cp_endblock_pos(xGblOffset+TubeMiddlePos,0.0,0.0);
981 GeoTransform* cp_endblock_xform =
new GeoTransform(cp_endblock_pos);
991 const GeoTube* endblock_coolingPipeInner =
new GeoTube(0.0,TubeInnerDiam*0.5,
m_endblockLength*.5);
993 GeoLogVol * cp_endblock_inner_log =
new GeoLogVol(
"EndBlockCoolingPipeInner",endblock_coolingPipeInner,cp_endblock_inner_material);
994 GeoPhysVol * cp_endblock_inner_logPV =
new GeoPhysVol(cp_endblock_inner_log);
996 GeoNameTag* cp_endblock_inner_tag =
new GeoNameTag(
"EndBlockCoolingPipeInner");
997 GeoTransform* cp_endblock_inner_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
998 cp_endblock_logPV->add(cp_endblock_inner_tag);
999 cp_endblock_logPV->add(cp_endblock_inner_xform);
1000 cp_endblock_logPV->add(cp_endblock_inner_logPV);
1005 m_gmt_mgr->
msg(MSG::INFO)<<
"IBL EOS : mechanical stave length : "<<MechanicalStaveLength*0.5<<
endmsg;
1018 const GeoMaterial* scaledFlexMaterial=
nullptr;
1035 std::ostringstream lname;
1036 lname <<
"SrvEndblockFlex";
1041 m_endblockFlexTrf =
new GeoTransform(GeoTrf::GeoTransformRT(GeoTrf::GeoRotation(0.0,0.0, std::abs(flex_angle)),cableflex_pos));
1042 GeoLogVol * cableflex_logVol =
new GeoLogVol(lname.str(),cableflex_shape,scaledFlexMaterial);
1045 m_gmt_mgr->
msg(MSG::INFO)<<
"Flex half thickness srv : "<<EndblockFlexThickness<<
endmsg;
1056 const GeoTube* service_coolingPipe =
new GeoTube(0.0,TubeOuterDiam*0.5,
m_endblockSrvLength*.5+doglegFlexLength*.5-2*safetyMarginZ);
1059 GeoLogVol * cp_service_log =
new GeoLogVol(
"SrvCoolingPipe",service_coolingPipe,cp_service_material);
1072 const GeoTube* service_coolingPipeInner =
new GeoTube(0.0,TubeInnerDiam*0.5,
m_endblockSrvLength*.5+doglegFlexLength*.5-2*safetyMarginZ);
1074 GeoLogVol * cp_service_inner_log =
new GeoLogVol(
"SrvCoolingPipeInner",service_coolingPipeInner,cp_service_inner_material);
1075 GeoPhysVol * cp_service_inner_logPV =
new GeoPhysVol(cp_service_inner_log);
1077 GeoNameTag* cp_service_inner_tag =
new GeoNameTag(
"SrvCoolingPipeInner");
1078 GeoTransform* cp_service_inner_xform =
new GeoTransform(GeoTrf::Transform3D::Identity());
1096 pmThicknessN3D,pmThicknessP3D,pmShilftLateral3D);