Relative shift of EBpos is too big, This is expected behaviour for testbeam and commissioning configurations
Relative shift of EBpos is too big, This is expected behaviour for testbeam and commissioning configurations
104 bool EBC =
true , BAR =
true , EBA =
true ;
105 int NcpFrom = 1, NcpPlus = 63;
118 (*m_log) << MSG::INFO <<
" Entering TileAtlasFactory::create()" <<
endmsg;
122 if (StatusCode::SUCCESS !=
m_detectorStore->retrieve(theMaterialManager,
"MATERIALS")) {
123 (*m_log) << MSG::ERROR <<
"Could not find Material Manager MATERIALS" <<
endmsg;
126 const GeoMaterial* matAir = theMaterialManager->
getMaterial(
"std::Air");
127 const GeoMaterial* matIron = theMaterialManager->
getMaterial(
"std::Iron");
134 double DzSaddleSupport = 0, RadiusSaddle = 0;
136 (*m_log) << MSG::INFO <<
" Tile Geometry with Saddle supports, starting from TileCal-CSC-02 xxx"<<
endmsg;
143 (*m_log) <<
MSG::DEBUG <<
" DzSaddleSupport()= "<<DzSaddleSupport<<
" RadiusSaddle= "<<RadiusSaddle
153 if (barrel_flag == 5) crack_flag = 9;
154 if (crack_flag == 4 || crack_flag == 5) barrel_flag = 4;
155 bool eb_flag = (barrel_flag<4 || (barrel_flag==4 && crack_flag==0) );
166 GeoLogVol *lvTileEnvelopeBarrel =0, *lvTileEnvelopePosEndcap =0, *lvTileEnvelopeNegEndcap =0, *lvTileEnvelopePosCrack =0, *lvTileEnvelopeNegCrack =0;
167 GeoPhysVol *pvTileEnvelopeBarrel =0, *pvTileEnvelopePosEndcap =0, *pvTileEnvelopeNegEndcap =0, *pvTileEnvelopePosCrack =0, *pvTileEnvelopeNegCrack =0;
171 (*m_log) <<MSG::WARNING <<
"Top-level volume names for crack scintillators are missing"<<
endmsg;
172 (*m_log) <<MSG::WARNING <<
"Crack scintillators will not be built"<<
endmsg;
176 for (
auto v : vols) {
179 pvTileEnvelopePosCrack = tmpPV;
183 pvTileEnvelopeNegCrack = tmpPV;
187 }
else if (crack_flag==3) {
189 (*m_log) <<MSG::WARNING <<
"Top-level volume pointers for crack scintillators are missing"<<
endmsg;
190 (*m_log) <<MSG::WARNING <<
"Crack scintillators will not be built"<<
endmsg;
196 }
else if (crack_flag==4) {
197 pvTileEnvelopePosCrack = world;
198 }
else if (crack_flag==5) {
199 pvTileEnvelopeNegCrack = world;
202 if (pvTileEnvelopePosCrack || pvTileEnvelopeNegCrack) {
203 (*m_log) <<
MSG::DEBUG <<
"Top-level volume names for crack scintillators are "
204 <<
" positive: " << ( (pvTileEnvelopePosCrack) ? pvTileEnvelopePosCrack->getLogVol()->getName() :
"none" )
205 <<
" negative: " << ( (pvTileEnvelopeNegCrack) ? pvTileEnvelopeNegCrack->getLogVol()->getName() :
"none" )
207 }
else if (crack_flag==2) {
208 (*m_log) <<MSG::WARNING <<
"Top-level volume names for crack scintillators "
211 <<
" were not found" <<
endmsg;
212 (*m_log) <<MSG::WARNING <<
"Crack scintillators will not be built"<<
endmsg;
213 (*m_log) <<MSG::WARNING <<
"Available top-level volumes are:";
215 for (
auto v : vols) (*m_log) <<
" " <<
v.first->getLogVol()->getName();
223 double dzITC1 =0, rMinITC1 =0, rMaxITC1 =0;
224 double dzITC2 =0, rMinITC2 =0, rMaxITC2 =0;
226 double thicknessWedgeMother =0, heightWedgeMother =0, dy1WedgeMother =0, dy2WedgeMother =0;
227 double Glue =0, dzGlue =0;
229 double zEndSection =0;
233 double zITCStandard =0;
235 double ZLength[] = {0.0,0.0,0.0,0.0,0.0,0.0};
236 double EnvDZPos[] = {0.0,0.0,0.0,0.0,0.0,0.0};
237 double PhiMax[] = {-360.0,-360.0,-360.0,-360.0,-360.0,-360.0};
238 double PhiMin[] = {+360.0,+360.0,+360.0,+360.0,+360.0,+360.0};
239 double RInMin[] = {99999.9,99999.9,99999.9,99999.9,99999.9,99999.9};
240 double ROutMax[] = {0.0,0.0,0.0,0.0,0.0,0.0};
241 double FingerRmax = 0;
245 double BFingerLength =0;
246 double BFingerLengthNeg =0;
247 double BFingerLengthPos =0;
253 double EBFingerLength =0;
254 double EBFingerLengthNeg =0;
255 double EBFingerLengthPos =0;
268 for (
int i = 0;
i < n_env ; ++
i) {
294 PosDelta = EnvDZPos[3] - EnvDZPos[1];
296 (*m_log) <<
MSG::DEBUG <<
" BFingerLengthPos "<<BFingerLengthPos<<
" PosDelta "<<PosDelta;
297 if (std::abs(PosDelta) < std::abs(EBFingerLength - BFingerLength) ) {
298 BFingerLengthPos += PosDelta;
300 (*m_log) <<
" => New BFingerLengthPos "<<BFingerLengthPos<<
endmsg;
303 BFingerLengthPos = BFingerLength;
306 (*m_log) <<
" => New PosDelta "<<PosDelta<<
endmsg;
314 NegDelta = (-EnvDZPos[2] + EnvDZPos[1]);
316 (*
m_log) <<
MSG::DEBUG <<
" BFingerLengthNeg "<<BFingerLengthNeg<<
" NegDelta "<<NegDelta;
317 if (std::abs(NegDelta) < std::abs(EBFingerLength - BFingerLength) ) {
318 BFingerLengthNeg += NegDelta;
320 (*
m_log) <<
" => New BFingerLengthNeg "<<BFingerLengthNeg<<
endmsg;
323 BFingerLengthNeg = BFingerLength;
335 spC10 = (rMinC10sp < rMinC10);
337 (*m_log) <<
MSG::DEBUG <<
" Special C10, changing Rmin from "<<rMinC10<<
" to "<< rMinC10sp <<
endmsg;
344 double rMinE2neg = rMinE2pos;
350 double rMinE4neg = rMinE4pos;
352 double rMaxE3neg = rMaxE3pos;
355 spE4 = (rMinE4sp < rMinE4neg);
357 (*m_log) <<
MSG::DEBUG <<
" E4' present, changing Rmin for negative crack from "<<rMinE4neg<<
" to "<< rMinE4sp <<
endmsg;
358 rMinE4neg = rMinE4sp;
363 double BFingerRmin=0, EFingerRmin=0;
378 double endCentralBarrel = ZLength[1]/2 - BFingerLength;
379 double endEnvelopeNeg = endCentralBarrel + BFingerLengthNeg;
380 double endEnvelopePos = endCentralBarrel + BFingerLengthPos;
383 double rminBarrel = RInMin[1];
386 double rmaxTotal = ROutMax[1];
392 tileEnvPconeBarrel->addPlane(-endEnvelopeNeg, BFingerRmin, rmaxTotal);
393 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin, rmaxTotal);
395 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
396 tileEnvPconeBarrel->addPlane(-endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
398 tileEnvPconeBarrel->addPlane(-endCentralBarrel, rminBarrel, rmaxTotal);
399 tileEnvPconeBarrel->addPlane( endCentralBarrel, rminBarrel, rmaxTotal);
401 tileEnvPconeBarrel->addPlane( endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
402 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
404 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin, rmaxTotal);
405 tileEnvPconeBarrel->addPlane( endEnvelopePos, BFingerRmin, rmaxTotal);
407 lvTileEnvelopeBarrel =
new GeoLogVol(
"TileCentralBarrel",tileEnvPconeBarrel,matAir);
408 pvTileEnvelopeBarrel =
new GeoPhysVol(lvTileEnvelopeBarrel);
417 double PosEndBarrelFinger = ZLength[1]/2;
418 double PosEndITC = PosEndBarrelFinger + ZLength[5];
419 double PosEndExBarrelFinger = PosEndITC + ZLength[3];
420 double PosEndExBarrel = PosEndExBarrelFinger - EBFingerLengthPos;
424 <<
" EBPos EnvDZPos[3] " << EnvDZPos[3] <<
" ZLength[5] " <<ZLength[5]<<
"+"<<ZLength[3]
425 <<
" = " << ZLength[3]+ZLength[5] <<
" EBFingerLengthPos = " <<EBFingerLengthPos
428 (*m_log) <<
MSG::DEBUG <<
" PosEndBarrelFinger = " << PosEndBarrelFinger
429 <<
" PosEndITC = " << PosEndITC
430 <<
" PosEndExBarrel = " << PosEndExBarrel
431 <<
" PosEndExtBarrelFinger = " << PosEndExBarrelFinger
437 double corr = PosEndITC - PosEndITC1;
438 if (std::abs(corr)>0.01) {
439 (*m_log) << MSG::WARNING
440 <<
"Discrepancy between TileGlobals and TILB tables in GeoModel DB "
441 << PosEndITC <<
" != " << PosEndITC1 <<
"; take this into account"
456 double GapWidth = PosEndGap - PosBeginGap;
458 PosEndGap = PosBeginGap + GapWidth;
463 <<
" PosBeginGap = " << PosBeginGap
464 <<
" PosEndGap = " << PosEndGap
465 <<
" PosBeginCrack = " << PosBeginCrack
466 <<
" PosEndCrack = " << PosEndCrack
480 double PosRminExt = RInMin[3];
483 double PosRmaxTotal = ROutMax[3];
487 <<
" PosRminITC1 = " << PosRminITC1
488 <<
" PosRminITC2 = " << PosRminITC
489 <<
" PosRminGap = " << PosRminGap
490 <<
" PosRmaxCrack = " << PosRmaxCrack
491 <<
" PosRminCrack = " << PosRminCrack
492 <<
" PosRminExt = " << PosRminExt
493 <<
" PosRmaxTotal = " << PosRmaxTotal
501 tileEnvPconePosEndcap->addPlane(PosEndBarrelFinger, PosRminITC1, PosRmaxTotal);
502 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC1, PosRmaxTotal);
503 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC, PosRmaxTotal);
506 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminITC, PosRmaxTotal);
507 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminGap, PosRmaxTotal);
508 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminGap, PosRmaxTotal);
509 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminExt, PosRmaxTotal);
512 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminITC, PosRmaxTotal);
513 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminCrack, PosRmaxTotal);
514 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminCrack, PosRmaxTotal);
515 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminExt, PosRmaxTotal);
517 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, PosRminExt, PosRmaxTotal);
519 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, EFingerRmin-RadiusSaddle, PosRmaxTotal);
520 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin-RadiusSaddle, PosRmaxTotal);
522 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin, PosRmaxTotal);
523 tileEnvPconePosEndcap->addPlane(PosEndExBarrelFinger, EFingerRmin, PosRmaxTotal);
525 lvTileEnvelopePosEndcap =
new GeoLogVol(
"TileEndcapPos",tileEnvPconePosEndcap,matAir);
526 pvTileEnvelopePosEndcap =
new GeoPhysVol(lvTileEnvelopePosEndcap);
534 tileEnvPconePosCrack->addPlane(PosBeginCrack, PosRminCrack, PosRmaxCrack);
535 tileEnvPconePosCrack->addPlane(PosEndCrack, PosRminCrack, PosRmaxCrack);
537 lvTileEnvelopePosCrack =
new GeoLogVol(
"TileCrackPos",tileEnvPconePosCrack,matAir);
538 pvTileEnvelopePosCrack =
new GeoPhysVol(lvTileEnvelopePosCrack);
546 double NegEndBarrelFinger = ZLength[1]/2;
547 double NegEndITC = NegEndBarrelFinger + ZLength[4];
548 double NegEndExtBarrelFinger = NegEndITC + ZLength[2];
549 double NegEndExBarrel = NegEndExtBarrelFinger - EBFingerLengthNeg;
553 <<
" EBNeg EnvDZPos[2] " << EnvDZPos[2] <<
" ZLength[4] " <<ZLength[4]<<
"+"<<ZLength[2]
554 <<
" = " << ZLength[2]+ZLength[4] <<
" EBFingerLengthNeg = " <<EBFingerLengthNeg
557 (*m_log) <<
MSG::DEBUG <<
" NegEndBarrelFinger = " << NegEndBarrelFinger
558 <<
" NegEndITC = " << NegEndITC
559 <<
" NegEndExBarrel = " << NegEndExBarrel
560 <<
" NegEndExtBarrelFinger = " << NegEndExtBarrelFinger
566 corr = NegEndITC - NegEndITC1;
568 if (std::abs(corr)>0.01) {
569 (*m_log) << MSG::WARNING
570 <<
"Discrepancy between TileGlobals and TILB tables in GeoModel DB "
571 << NegEndITC <<
" != " << NegEndITC1 <<
"; take this into account"
585 double GapWidth = NegEndGap - NegBeginGap;
587 NegEndGap = NegBeginGap + GapWidth;
592 <<
" NegBeginGap = " << NegBeginGap
593 <<
" NegEndGap = " << NegEndGap
594 <<
" NegBeginCrack = " << NegBeginCrack
595 <<
" NegEndCrack = " << NegEndCrack
610 double NegRminExt = RInMin[2];
613 double NegRmaxTotal = ROutMax[2];
617 <<
" NegRminITC1 = " << NegRminITC1
618 <<
" NegRminITC2 = " << NegRminITC
619 <<
" NegRminGap = " << NegRminGap
620 <<
" NegRmaxCrack = " << NegRmaxCrack
621 <<
" NegRminCrack = " << NegRminCrack
622 <<
" NegRminExt = " << NegRminExt
623 <<
" NegRmaxTotal = " << NegRmaxTotal
631 tileEnvPconeNegEndcap->addPlane(-NegEndExtBarrelFinger, EFingerRmin, NegRmaxTotal);
632 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin, NegRmaxTotal);
634 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin-RadiusSaddle, NegRmaxTotal);
635 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, EFingerRmin-RadiusSaddle, NegRmaxTotal);
637 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, NegRminExt, NegRmaxTotal);
640 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminExt, NegRmaxTotal);
641 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminGap, NegRmaxTotal);
642 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminGap, NegRmaxTotal);
643 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminITC, NegRmaxTotal);
646 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminExt, NegRmaxTotal);
647 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminCrack, NegRmaxTotal);
648 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxTotal);
649 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminITC, NegRmaxTotal);
651 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC, NegRmaxTotal);
652 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC1, NegRmaxTotal);
653 tileEnvPconeNegEndcap->addPlane(-NegEndBarrelFinger, NegRminITC1, NegRmaxTotal);
655 lvTileEnvelopeNegEndcap =
new GeoLogVol(
"TileEndcapNeg",tileEnvPconeNegEndcap,matAir);
656 pvTileEnvelopeNegEndcap =
new GeoPhysVol(lvTileEnvelopeNegEndcap);
664 tileEnvPconeNegCrack->addPlane(-NegEndCrack, NegRminCrack, NegRmaxCrack);
665 tileEnvPconeNegCrack->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxCrack);
667 lvTileEnvelopeNegCrack =
new GeoLogVol(
"TileCrackNeg",tileEnvPconeNegCrack,matAir);
668 pvTileEnvelopeNegCrack =
new GeoPhysVol(lvTileEnvelopeNegCrack);
694 GeoPhysVol *pvBarrelMother{
nullptr}, *pvFingerMotherNeg{
nullptr}, *pvFingerMotherPos{
nullptr}, *pvSaddleMotherNeg{
nullptr}, *pvSaddleMotherPos{
nullptr};
695 GeoPhysVol *pvEBarrelMotherNeg{
nullptr}, *pvEBarrelMotherPos{
nullptr};
696 GeoPhysVol *pvEFingerMotherNeg{
nullptr}, *pvEFingerMotherPos{
nullptr}, *pvESaddleMotherNeg{
nullptr}, *pvESaddleMotherPos{
nullptr};
697 GeoPhysVol *pvITCMotherNeg{
nullptr}, *pvITCMotherPos{
nullptr};
698 GeoPhysVol *pvGapMotherNeg{
nullptr}, *pvGapMotherPos{
nullptr};
699 GeoPhysVol *pvCrackMotherNeg{
nullptr}, *pvCrackMotherPos{
nullptr};
701 GeoLogVol *lvEBarrelModuleMotherPos{
nullptr}, *lvEBarrelModuleMotherNeg{
nullptr};
702 GeoPhysVol *pvEBarrelModuleMotherPos{
nullptr}, *pvEBarrelModuleMotherNeg{
nullptr};
715 double dX1 =0, dX2 =0, dY1 =0, dY2 =0, dZ1 =0, dZ2 =0;
716 double dxIron =0, dyIron =0, dxIr =0, dyIr =0;
717 std::string volname =
"";
720 double PosXcut =0, PosYcut =0, PosY =0;
721 double modl_length =0;
723 const GeoShapeUnion *CutA= 0;
726 GeoLogVol *lvIrUp =0, *lvIrDw =0, *lvIron3 =0, *lvIron2 =0, *lvIron1 =0, *lvIrBox =0;
727 GeoPhysVol *pvIrUp =0, *pvIrDw =0, *pvIron3 =0, *pvIron2 =0, *pvIron1 =0, *pvIrBox =0;
734 (*
m_log) <<
MSG::DEBUG <<
" Tile Geometry with Ext.Barrel CutOuts and Iron plates, starting form TileCal-CSC-01"
740 modl_length = 4*dbManager->
CutsDX1();
749 checking(
"CutB1",
false, 1, dX1,dX2,dY1,dY2,dZ1);
750 GeoTrd* CutB1 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
763 checking(
"IrUp",
false, 1,dX1,dX2,dY1,dY2,dZ1);
764 GeoTrd* IrUp =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
765 lvIrUp =
new GeoLogVol(
"IrUp",IrUp,matIron);
766 pvIrUp =
new GeoPhysVol(lvIrUp);
776 checking(
"IrDw",
false, 1, dX1,dX2,dY1,dY2,dZ1);
777 GeoTrd* IrDw =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
778 lvIrDw =
new GeoLogVol(
"IrDw",IrDw,matIron);
779 pvIrDw =
new GeoPhysVol(lvIrDw);
791 checking(
"Cut1up",
false, 1, dX1,dX2,dY1,dY2,dZ1);
792 GeoTrd* Cut1up =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
801 checking(
"Cut2down",
false, 1, dX1,dX2,dY1,dY2,dZ2);
802 GeoTrd* Cut1down =
new GeoTrd(dX1,dX2,dY1,dY2,dZ2);
804 GeoTrf::Translate3D yPosA(0.,0.,-dZ1-dZ2);
806 const GeoShapeUnion& CutA1 = Cut1up->add(*Cut1down<<yPosA);
836 checking(
"Iron3",
false, 1, dX1,dX2,dY1,dY2,dZ1);
837 GeoTrd* Iron3 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
838 lvIron3 =
new GeoLogVol(
"Iron3",Iron3,matIron);
839 pvIron3 =
new GeoPhysVol(lvIron3);
849 checking(
"Iron2",
false, 1, dX1,dX2,dY1,dY2,dZ1);
850 GeoTrd* Iron2 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
851 lvIron2 =
new GeoLogVol(
"Iron2",Iron2,matIron);
852 pvIron2 =
new GeoPhysVol(lvIron2);
862 checking(
"Iron1",
false, 1, dX1,dX2,dY1,dY2,dZ1);
863 GeoTrd* Iron1 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
864 lvIron1 =
new GeoLogVol(
"Iron1",Iron1,matIron);
865 pvIron1 =
new GeoPhysVol(lvIron1);
875 checking(
"IrBox",
false, 1, dX1,dX2,dY1,dY2,dZ1);
876 GeoTrd* IrBox =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
877 lvIrBox =
new GeoLogVol(
"IrBox",IrBox,matIron);
878 pvIrBox =
new GeoPhysVol(lvIrBox);
908 for (
int EnvCounter = 0; EnvCounter < NumberOfEnv ; ++EnvCounter) {
919 (*m_log) <<
MSG::DEBUG <<
" EnvCounter " << EnvCounter <<
" EnvType " << EnvType
920 <<
" EnvNModules " << NumberOfMod <<
endmsg;
922 if (EnvType == 1 && barrel_flag < 1) {
924 zEndSection = ZLength[1]/2 - BFingerLength;
931 GeoTubs* barrelMother = GeneralMother;
932 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
933 pvBarrelMother =
new GeoPhysVol(lvBarrelMother);
936 (*m_log) <<
MSG::DEBUG <<
"Barrel envelope parameters: "
937 <<
" Length=" << zEndSection
943 GeoTubs* fingerMotherPos =
new GeoTubs(BFingerRmin,
948 GeoLogVol* lvFingerMotherPos =
new GeoLogVol(
"FingerPos",fingerMotherPos,matAir);
949 pvFingerMotherPos =
new GeoPhysVol(lvFingerMotherPos);
952 GeoTubs* SaddleMotherPos =
new GeoTubs(BFingerRmin-RadiusSaddle,
957 GeoLogVol* lvSaddleMotherPos =
new GeoLogVol(
"SaddlePos",SaddleMotherPos,matAir);
958 pvSaddleMotherPos =
new GeoPhysVol(lvSaddleMotherPos);
962 GeoTubs* fingerMotherNeg =
new GeoTubs(BFingerRmin,
967 GeoLogVol* lvFingerMotherNeg =
new GeoLogVol(
"FingerNeg",fingerMotherNeg,matAir);
968 pvFingerMotherNeg =
new GeoPhysVol(lvFingerMotherNeg);
971 (*m_log) <<
MSG::DEBUG <<
"Barrel finger envelope parameters: "
972 <<
" length Pos/Neg=" << BFingerLengthPos <<
"/" << BFingerLengthNeg
978 GeoTubs* SaddleMotherNeg =
new GeoTubs(BFingerRmin-RadiusSaddle,
983 GeoLogVol* lvSaddleMotherNeg =
new GeoLogVol(
"SaddleNeg",SaddleMotherNeg,matAir);
984 pvSaddleMotherNeg =
new GeoPhysVol(lvSaddleMotherNeg);
988 if (EnvType == 3 && eb_flag) {
1002 GeoTubs* ebarrelMotherPos = GeneralMother;
1003 GeoLogVol* lvEBarrelMotherPos =
new GeoLogVol(
"EBarrel",ebarrelMotherPos,matAir);
1004 pvEBarrelMotherPos =
new GeoPhysVol(lvEBarrelMotherPos);
1007 (*m_log) <<
MSG::DEBUG <<
"Positive ext.barrel envelope parameters: "
1013 if (barrel_flag < 2) {
1017 AnglMin,AnglMax, EBFingerLength/2);
1019 GeoTubs* fingerMother =
new GeoTubs(EFingerRmin,
1024 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
1025 pvEFingerMotherPos =
new GeoPhysVol(lvEFingerMother);
1028 (*m_log) <<
MSG::DEBUG <<
"Positive ext.barrel finger envelope parameters: "
1029 <<
" length=" << EBFingerLength
1030 <<
" Rmin=" << EFingerRmin
1036 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1038 GeoTubs* ESaddleMother =
new GeoTubs(EFingerRmin-RadiusSaddle,
1043 GeoLogVol* lvESaddleMother =
new GeoLogVol(
"ESaddlePos",ESaddleMother,matAir);
1044 pvESaddleMotherPos =
new GeoPhysVol(lvESaddleMother);
1050 if (EnvType == 2 && eb_flag) {
1059 GeoTubs* ebarrelMotherNeg = GeneralMother;
1060 GeoLogVol* lvEBarrelMotherNeg =
new GeoLogVol(
"EBarrel",ebarrelMotherNeg,matAir);
1061 pvEBarrelMotherNeg =
new GeoPhysVol(lvEBarrelMotherNeg);
1064 (*m_log) <<
MSG::DEBUG <<
"Nevative ext.barrel envelope parameters: "
1070 if (barrel_flag < 2) {
1072 GeoTubs* fingerMother =
new GeoTubs(EFingerRmin,
1074 EBFingerLengthNeg/2,
1077 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
1078 pvEFingerMotherNeg =
new GeoPhysVol(lvEFingerMother);
1081 (*m_log) <<
MSG::DEBUG <<
"Negative ext.barrel finger envelope parameters: "
1082 <<
" length=" << EBFingerLengthNeg
1083 <<
" Rmin=" << EFingerRmin
1089 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1091 GeoTubs* ESaddleMother =
new GeoTubs(EFingerRmin-RadiusSaddle,
1096 GeoLogVol* lvESaddleMother =
new GeoLogVol(
"ESaddlePos",ESaddleMother,matAir);
1097 pvESaddleMotherNeg =
new GeoPhysVol(lvESaddleMother);
1105 if (barrel_flag < 3) {
1119 (*m_log) << MSG::INFO <<
" Positive ITC envelope parameters: PLUG1 "
1121 (*m_log) << MSG::INFO <<
" PLUG2 "
1124 checking(
"ITC itcWheel1 (+)",
false, 0,
1132 checking(
"ITC itcWheel2 (+)",
false, 0,
1141 GeoTrf::Translate3D itcWheel2OffsetPos(0.,0.,
Z);
1145 const GeoShapeUnion& itcMotherPos = itcWheel1->add(*itcWheel2<<itcWheel2OffsetPos);
1147 GeoLogVol* lvITCMotherPos =
new GeoLogVol(
"ITC",&itcMotherPos,matAir);
1148 pvITCMotherPos =
new GeoPhysVol(lvITCMotherPos);
1153 if (barrel_flag < 4) {
1167 GeoLogVol* lvGapMotherPos =
new GeoLogVol(
"Gap",GapMotherPos,matAir);
1168 pvGapMotherPos =
new GeoPhysVol(lvGapMotherPos);
1173 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
1187 GeoLogVol* lvCrackMotherPos =
new GeoLogVol(
"Crack",crackMotherPos,matAir);
1188 pvCrackMotherPos =
new GeoPhysVol(lvCrackMotherPos);
1195 if (barrel_flag < 3) {
1209 (*m_log) << MSG::INFO <<
" Negative ITC envelope parameters: PLUG1 "
1211 (*m_log) << MSG::INFO <<
" PLUG2 "
1214 checking(
"ITC itcWheel1 (-)",
false, 0,
1222 checking(
"ITC itcWheel2 (-)",
false, 0,
1231 GeoTrf::Translate3D itcWheel2OffsetNeg(0.,0.,
Z);
1235 const GeoShapeUnion& itcMotherNeg = itcWheel1->add(*itcWheel2<<itcWheel2OffsetNeg);
1237 GeoLogVol* lvITCMotherNeg =
new GeoLogVol(
"ITC",&itcMotherNeg,matAir);
1238 pvITCMotherNeg =
new GeoPhysVol(lvITCMotherNeg);
1243 if (barrel_flag < 4) {
1257 GeoLogVol* lvGapMotherNeg =
new GeoLogVol(
"Gap",GapMotherNeg,matAir);
1258 pvGapMotherNeg =
new GeoPhysVol(lvGapMotherNeg);
1263 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
1277 GeoLogVol* lvCrackMotherNeg =
new GeoLogVol(
"Crack",crackMotherNeg,matAir);
1278 pvCrackMotherNeg =
new GeoPhysVol(lvCrackMotherNeg);
1283 ((EnvType&6) == 0 && barrel_flag < 1) ||
1284 ((EnvType&6) == 2 && barrel_flag < 2) ||
1285 ((EnvType&6) == 4 && barrel_flag < 5) )) {
1288 int ModuleIndex[64];
1289 for (
int i=0;
i < NumberOfMod;
i++) {
1290 ModuleIndex[
i] =
i+1;
1296 GeoIntrusivePtr<GeoTransform> yrotMod{
new GeoTransform(GeoTrf::RotateY3D(90*
Gaudi::Units::deg))};
1299 for (
int ModCounter = 0; ModCounter < NumberOfMod; ModCounter++) {
1301 ModuleNcp = ModuleIndex[ModCounter];
1307 GeoIntrusivePtr<GeoTransform> zrotMod{
new GeoTransform(GeoTrf::RotateZ3D(
phi*
Gaudi::Units::deg))};
1308 GeoIntrusivePtr<GeoTransform> zrotSaddle{
new GeoTransform(GeoTrf::RotateZ3D(ph1*
Gaudi::Units::deg))};
1315 if (!(ModuleNcp>=NcpFrom && ModuleNcp<=NcpFrom+NcpPlus))
continue;
1324 (*m_log) <<
MSG::DEBUG <<
" ModuleNcp= "<< ModuleNcp <<
" ModType "<< ModType <<
" Phi "<<
phi <<
endmsg;
1330 if ( EnvType == 1 && barrel_flag < 1) {
1343 GeoTrd* barrelModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1344 thicknessWedgeMother/2,
1347 heightWedgeMother/2);
1349 GeoLogVol* lvBarrelModuleMother =
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
1350 GeoPhysVol* pvBarrelModuleMother =
new GeoPhysVol(lvBarrelModuleMother);
1354 sectionBuilder->
fillSection(pvBarrelModuleMother, 1,
1361 GeoTransform* xtraMod =
new GeoTransform(GeoTrf::TranslateX3D(
1364 pvBarrelMother->add(zrotMod);
1365 pvBarrelMother->add(xtraMod);
1366 pvBarrelMother->add(XYrtMod);
1368 pvBarrelMother->add(
new GeoIdentifierTag(ModuleNcp));
1369 pvBarrelMother->add(pvBarrelModuleMother);
1381 if ( ModFingpattern != 10 ) {
1382 GeoTrd* fingerModuleMotherPos =
new GeoTrd(BFingerLengthPos/2,
1386 heightWedgeMother/2);
1388 GeoLogVol* lvFingerModuleMotherPos =
new GeoLogVol(
"FingerModule",fingerModuleMotherPos,matAir);
1389 GeoPhysVol* pvFingerModuleMotherPos =
new GeoPhysVol(lvFingerModuleMotherPos);
1392 sectionBuilder->
fillFinger(pvFingerModuleMotherPos, 1,
1404 pvFingerMotherPos->add(zrotMod);
1405 pvFingerMotherPos->add(xtraModFingerPos);
1406 pvFingerMotherPos->add(XYrtMod);
1408 pvFingerMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1409 pvFingerMotherPos->add(pvFingerModuleMotherPos);
1413 if ( ModFingpattern != 1 ) {
1415 GeoTrd* fingerModuleMotherNeg =
new GeoTrd(BFingerLengthNeg/2,
1419 heightWedgeMother/2);
1421 GeoLogVol* lvFingerModuleMotherNeg =
new GeoLogVol(
"FingerModule",fingerModuleMotherNeg,matAir);
1422 GeoPhysVol* pvFingerModuleMotherNeg =
new GeoPhysVol(lvFingerModuleMotherNeg);
1425 sectionBuilder->
fillFinger(pvFingerModuleMotherNeg, 1,
1437 pvFingerMotherNeg->add(zrotMod);
1438 pvFingerMotherNeg->add(xtraModFingerNeg);
1439 pvFingerMotherNeg->add(yrotMod);
1441 pvFingerMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1442 pvFingerMotherNeg->add(pvFingerModuleMotherNeg);
1447 if ( (ModuleNcp >=40 && ModuleNcp <=41) || (ModuleNcp >=56 && ModuleNcp <=57) ) {
1448 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1453 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1454 GeoPhysVol* pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1456 pvSaddleMotherPos->add(zrotSaddle);
1457 pvSaddleMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1458 pvSaddleMotherPos->add(pvSaddleModule);
1460 pvSaddleMotherNeg->add(zrotSaddle);
1461 pvSaddleMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1462 pvSaddleMotherNeg->add(pvSaddleModule);
1469 if (EnvType == 3 && barrel_flag < 2) {
1485 checking(
"EBarrelModule (+)",
false, 1,
1486 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1488 GeoTrd* ebarrelModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
1489 thicknessWedgeMother/2,
1492 heightWedgeMother/2);
1498 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
1499 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1510 PoZ2 = PoZ1 + modl_length/4;
1512 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1514 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1516 if (ModuleNcp>=60 && ModuleNcp<=62) {
1519 * GeoTrf::Translate3D(PoZ1,PosYcut,-PosXcut);
1522 const GeoShape& TmL_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1523 subtract((*CutB)<<TransCutL);
1525 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",&TmL_EBarrelModuleMotherPos,matAir);
1527 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
1530 * GeoTrf::Translate3D(PoZ1,PosYcut,PosXcut) * GeoTrf::RotateY3D(180*
Gaudi::Units::deg);
1533 const GeoShape& TmR_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1534 subtract((*CutB)<<TransCutR);
1536 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",&TmR_EBarrelModuleMotherPos,matAir);
1539 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1542 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
1543 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1549 sectionBuilder->
fillSection(pvEBarrelModuleMotherPos, 2,
1557 GeoTransform* xtraModPos =
new GeoTransform(GeoTrf::TranslateX3D(Radius));
1559 pvEBarrelMotherPos->add(zrotMod);
1560 pvEBarrelMotherPos->add(xtraModPos);
1561 pvEBarrelMotherPos->add(XYrtMod);
1563 pvEBarrelMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1564 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1631 checking(
"EFingerModule (+)",
false, 1,
1632 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1634 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1635 thicknessWedgeMother/2,
1638 heightWedgeMother/2);
1640 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
1641 GeoPhysVol* pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
1645 sectionBuilder->
fillFinger(pvEFingerModuleMother, 2,
1652 GeoTransform* xtraModFingerPos =
new GeoTransform(GeoTrf::TranslateX3D(
1654 pvEFingerMotherPos->add(zrotMod);
1655 pvEFingerMotherPos->add(xtraModFingerPos);
1656 pvEFingerMotherPos->add(XYrtMod);
1658 pvEFingerMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1659 pvEFingerMotherPos->add(pvEFingerModuleMother);
1663 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1664 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1669 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1670 GeoPhysVol* pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1672 pvESaddleMotherPos->add(zrotSaddle);
1673 pvESaddleMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1674 pvESaddleMotherPos->add(pvSaddleModule);
1682 if (EnvType == 2 && barrel_flag < 2) {
1698 checking(
"EBarrelModule (-)",
false, 1,
1699 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1701 GeoTrd* ebarrelModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
1702 thicknessWedgeMother/2,
1705 heightWedgeMother/2);
1711 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
1712 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1723 PoZ2 = PoZ1 + modl_length/4;
1725 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1728 * GeoTrf::Translate3D(-PoZ2,0,-PosY);
1730 if (ModuleNcp>=60 && ModuleNcp<=62) {
1733 * GeoTrf::Translate3D(PoZ1,-PosYcut,-PosXcut);
1736 const GeoShape& TmL_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1737 subtract((*CutB)<<TransCutL);
1739 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",&TmL_EBarrelModuleMotherNeg,matAir);
1741 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
1744 * GeoTrf::Translate3D(PoZ1,-PosYcut,PosXcut) * GeoTrf::RotateY3D(180*
Gaudi::Units::deg);
1747 const GeoShape& TmR_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1748 subtract((*CutB)<<TransCutR);
1750 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",&TmR_EBarrelModuleMotherNeg,matAir);
1753 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1756 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
1757 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1763 sectionBuilder->
fillSection(pvEBarrelModuleMotherNeg, 2,
1772 GeoTransform* xtraModNeg =
new GeoTransform(GeoTrf::TranslateX3D(Radius));
1774 pvEBarrelMotherNeg->add(zrotMod);
1775 pvEBarrelMotherNeg->add(xtraModNeg);
1776 pvEBarrelMotherNeg->add(yrotMod);
1778 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1779 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1848 checking(
"EFingerModule (-)",
false, 1,
1849 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1851 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1852 thicknessWedgeMother/2,
1855 heightWedgeMother/2);
1857 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
1858 GeoPhysVol* pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
1862 sectionBuilder->
fillFinger(pvEFingerModuleMother, 2,
1869 GeoTransform* xtraModFingerNeg =
new GeoTransform(GeoTrf::TranslateX3D(
1871 pvEFingerMotherNeg->add(zrotMod);
1872 pvEFingerMotherNeg->add(xtraModFingerNeg);
1873 pvEFingerMotherNeg->add(yrotMod);
1875 pvEFingerMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1876 pvEFingerMotherNeg->add(pvEFingerModuleMother);
1880 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1881 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1886 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1887 GeoPhysVol* pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1889 pvESaddleMotherNeg->add(zrotSaddle);
1890 pvESaddleMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1891 pvESaddleMotherNeg->add(pvSaddleModule);
1899 if (((EnvType == 4) || (EnvType == 5)) && barrel_flag < 5) {
1901 int Id4 = ModType%100;
1902 int Ic10 = (ModType/100)%100;
1903 int Igap = (ModType/10000)%100;
1904 int Icrack = (ModType/1000000)%100;
1906 bool Ifd4 = ( Id4 != 0);
1907 bool Ifc10 = ( Ic10 != 0);
1908 bool Ifgap = ( Igap != 0);
1909 bool Ifcrack = ( Icrack != 0);
1911 bool Ifspecialgirder = (Id4 == 7);
1915 <<
" Ncp= "<<ModuleNcp<<
" D4 "<<Id4<<
" specialflag = "<<Ifspecialgirder<<
" C10 "<<Ic10<<
" Gap "<<Igap<<
" Crack "<<Icrack
1933 if (Ifspecialgirder) {
1939 (*m_log) << MSG::INFO <<
" D4 unavailable "<<
endmsg;
1943 bool specialC10 = (Ifd4 && Ifc10 && rMaxITC2 < rMinITC1);
1945 rMaxITC2 = rMinITC1;
1952 if ((Ifd4 || Ifc10) && pvITCMotherNeg) {
1960 checking(
"ITCModule tcModuleSub1Neg (-) ",
false, 1,
1961 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1963 GeoTrd* itcModuleSub1Neg =
new GeoTrd(thicknessWedgeMother/2,
1964 thicknessWedgeMother/2,
1967 heightWedgeMother/2);
1974 checking(
"ITCModule itcModuleSub2Neg (-)",
false, 1,
1975 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1977 GeoTrd* itcModuleSub2Neg =
new GeoTrd(thicknessWedgeMother/2,
1978 thicknessWedgeMother/2,
1981 heightWedgeMother/2 );
1988 GeoTrf::Translate3D itcModule_SubShiftNeg(
X, 0.,
Z);
1989 const GeoShapeUnion& itcModuleMotherNeg = itcModuleSub1Neg->add(*itcModuleSub2Neg<<itcModule_SubShiftNeg);
1991 GeoTrf::Translate3D itcModuleSubShiftNeg(
X, 0.,
Z);
1993 GeoLogVol* lvITCModuleMotherNeg =
new GeoLogVol(
"ITCModule",&itcModuleMotherNeg,matAir);
1994 GeoPhysVol* pvITCModuleMotherNeg =
new GeoPhysVol(lvITCModuleMotherNeg);
2013 (*m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzITC1= "<<dzITC1
2019 dzGlue = (Glue - 2*NbPeriod * (dbManager->
TILBdzmast() + dbManager->
TILBdzspac())) / (4.*NbPeriod);
2025 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzGlue= "<<dzGlue<<
" NbPeriod= "<<NbPeriod
2030 (*m_log) << MSG::WARNING <<
" Plug1Module warning: "<<
" dzGlue= "<<dzGlue
2034 checking(
"Plug1Module plug1SubMotherNeg (-)",
false, 2,
2035 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2037 GeoTrd* plug1SubMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2038 thicknessWedgeMother/2,
2041 heightWedgeMother/2);
2043 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2;
2047 (*m_log) <<
MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2049 GeoLogVol *lvPlug1ModuleMotherNeg=0;
2050 if (thicknessWedgeMother > rless) {
2055 checking(
"Plug1Module plug2SubMotherNeg (-)",
false, 2,
2056 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2058 GeoTrd* plug2SubMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2059 thicknessWedgeMother/2,
2062 heightWedgeMother/2);
2067 const GeoShapeUnion& plug1ModuleMotherNeg =
2068 plug1SubMotherNeg->add(*plug2SubMotherNeg<<plug1SubOffsetNeg);
2070 lvPlug1ModuleMotherNeg =
new GeoLogVol(
"Plug1Module",&plug1ModuleMotherNeg,matAir);
2072 lvPlug1ModuleMotherNeg =
new GeoLogVol(
"Plug1Module",plug1SubMotherNeg,matAir);
2075 GeoPhysVol* pvPlug1ModuleMotherNeg =
new GeoPhysVol(lvPlug1ModuleMotherNeg);
2079 sectionBuilder->
fillSection(pvPlug1ModuleMotherNeg, 3,
2089 GeoTransform* tfPlug1ModuleMotherNeg =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
Z));
2091 pvITCModuleMotherNeg->add(tfPlug1ModuleMotherNeg);
2092 pvITCModuleMotherNeg->add(pvPlug1ModuleMotherNeg);
2113 checking(
"Plug2Module (-)",
false, 2,
2114 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2116 GeoTrd* plug2ModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2117 thicknessWedgeMother/2,
2120 heightWedgeMother/2);
2122 GeoLogVol* lvPlug2ModuleMotherNeg =
new GeoLogVol(
"Plug2Module",plug2ModuleMotherNeg,matAir);
2123 GeoPhysVol* pvPlug2ModuleMotherNeg =
new GeoPhysVol(lvPlug2ModuleMotherNeg);
2127 sectionBuilder->
fillSection(pvPlug2ModuleMotherNeg, Ic10,
2138 GeoTransform* tfPlug2ModuleMotherNeg =
new GeoTransform(itcModuleSubShiftNeg);
2140 pvITCModuleMotherNeg->add(tfPlug2ModuleMotherNeg);
2141 pvITCModuleMotherNeg->add(pvPlug2ModuleMotherNeg);
2152 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(
Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./
Gaudi::Units::cm);
2156 <<
" zStandard= "<<zITCStandard<<
" zShift= " <<zShift
2159 GeoTransform* xtraITCNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2161 GeoTransform* ztraITCNeg =
new GeoTransform(GeoTrf::TranslateZ3D(zShift*
Gaudi::Units::cm));
2163 pvITCMotherNeg->add(zrotMod);
2164 pvITCMotherNeg->add(xtraITCNeg);
2165 pvITCMotherNeg->add(ztraITCNeg);
2166 pvITCMotherNeg->add(yrotMod);
2168 pvITCMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2169 pvITCMotherNeg->add(pvITCModuleMotherNeg);
2174 if (Ifgap && pvGapMotherNeg) {
2187 checking(
"GapModule (-)",
false, 2,
2188 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2190 GeoTrd* gapModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2191 thicknessWedgeMother/2,
2194 heightWedgeMother/2);
2196 GeoLogVol* lvGapModuleMotherNeg =
new GeoLogVol(
"GapModule",gapModuleMotherNeg,matAir);
2197 GeoPhysVol* pvGapModuleMotherNeg =
new GeoPhysVol(lvGapModuleMotherNeg);
2201 sectionBuilder->
fillSection(pvGapModuleMotherNeg, 5,
2209 GeoTransform* xtraGapNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2211 pvGapMotherNeg->add(zrotMod);
2212 pvGapMotherNeg->add(xtraGapNeg);
2213 pvGapMotherNeg->add(yrotMod);
2215 pvGapMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2216 pvGapMotherNeg->add(pvGapModuleMotherNeg);
2220 if (Ifcrack && pvCrackMotherNeg) {
2233 checking(
"CrackModule (-)", spE4, 2,
2234 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2236 GeoTrd* crackModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2237 thicknessWedgeMother/2,
2240 heightWedgeMother/2);
2242 GeoLogVol* lvCrackModuleMotherNeg =
new GeoLogVol(
"CrackModule",crackModuleMotherNeg,matAir);
2243 GeoPhysVol* pvCrackModuleMotherNeg =
new GeoPhysVol(lvCrackModuleMotherNeg);
2247 sectionBuilder->
fillSection(pvCrackModuleMotherNeg, 6,
2254 GeoTransform* xtraCrackNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2256 pvCrackMotherNeg->add(zrotMod);
2257 pvCrackMotherNeg->add(xtraCrackNeg);
2258 pvCrackMotherNeg->add(yrotMod);
2260 pvCrackMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2261 pvCrackMotherNeg->add(pvCrackModuleMotherNeg);
2270 if ((Ifd4 || Ifc10) && pvITCMotherPos) {
2278 checking(
"ITCModule itcModuleSub2Pos (+)",
false, 1,
2279 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2281 GeoTrd* itcModuleSub1Pos =
new GeoTrd(thicknessWedgeMother/2,
2282 thicknessWedgeMother/2,
2285 heightWedgeMother/2 );
2292 checking(
"ITCModule itcModuleSub2Pos (+)",
false, 1,
2293 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2295 GeoTrd* itcModuleSub2Pos =
new GeoTrd(thicknessWedgeMother/2,
2296 thicknessWedgeMother/2,
2299 heightWedgeMother/2 );
2306 GeoTrf::Translate3D itcModule_SubShiftPos(
X, 0.,
Z);
2307 const GeoShapeUnion& itcModuleMotherPos = itcModuleSub1Pos->add(*itcModuleSub2Pos<<itcModule_SubShiftPos);
2309 GeoTrf::Translate3D itcModuleSubShiftPos(
X, 0.,
Z);
2311 GeoLogVol* lvITCModuleMotherPos =
new GeoLogVol(
"ITCModule",&itcModuleMotherPos,matAir);
2312 GeoPhysVol* pvITCModuleMotherPos =
new GeoPhysVol(lvITCModuleMotherPos);
2332 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzITC1= "<<dzITC1
2338 dzGlue = (Glue - 2*NbPeriod * (dbManager->
TILBdzmast() + dbManager->
TILBdzspac())) / (4.*NbPeriod);
2341 + dbManager->
TILBdzspac())) / (4.*(NbPeriod-1));
2345 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzGlue= "<<dzGlue<<
" NbPeriod= "<<NbPeriod
2350 (*m_log) << MSG::WARNING <<
" Plug1Module warning: "<<
" dzGlue= "<<dzGlue
2354 checking(
"Plug1Module plug1SubMotherPos (+)",
false, 2,
2355 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2357 GeoTrd* plug1SubMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2358 thicknessWedgeMother/2,
2361 heightWedgeMother/2 );
2364 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2;
2368 (*m_log) <<
MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2370 GeoLogVol *lvPlug1ModuleMotherPos=0;
2371 if (thicknessWedgeMother > rless) {
2376 checking(
"Plug1Module plug2SubMotherPos (+)",
false, 2,
2377 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2379 GeoTrd* plug2SubMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2380 thicknessWedgeMother/2,
2383 heightWedgeMother/2 );
2388 const GeoShapeUnion& plug1ModuleMotherPos = plug1SubMotherPos->add(*plug2SubMotherPos<<plug1SubOffsetPos);
2390 lvPlug1ModuleMotherPos =
new GeoLogVol(
"Plug1Module",&plug1ModuleMotherPos,matAir);
2392 lvPlug1ModuleMotherPos =
new GeoLogVol(
"Plug1Module",plug1SubMotherPos,matAir);
2395 GeoPhysVol* pvPlug1ModuleMotherPos =
new GeoPhysVol(lvPlug1ModuleMotherPos);
2399 sectionBuilder->
fillSection(pvPlug1ModuleMotherPos, 3,
2409 GeoTransform* tfPlug1ModuleMotherPos =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
Z));
2411 pvITCModuleMotherPos->add(tfPlug1ModuleMotherPos);
2412 pvITCModuleMotherPos->add(pvPlug1ModuleMotherPos);
2433 checking(
"Plug2Module (+)",
false, 2,
2434 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2436 GeoTrd* plug2ModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2437 thicknessWedgeMother/2,
2440 heightWedgeMother/2);
2442 GeoLogVol* lvPlug2ModuleMotherPos =
new GeoLogVol(
"Plug2Module",plug2ModuleMotherPos,matAir);
2443 GeoPhysVol* pvPlug2ModuleMotherPos =
new GeoPhysVol(lvPlug2ModuleMotherPos);
2447 sectionBuilder->
fillSection(pvPlug2ModuleMotherPos, Ic10,
2458 GeoTransform* tfPlug2ModuleMotherPos =
new GeoTransform(itcModuleSubShiftPos);
2460 pvITCModuleMotherPos->add(tfPlug2ModuleMotherPos);
2461 pvITCModuleMotherPos->add(pvPlug2ModuleMotherPos);
2470 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(
Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./
Gaudi::Units::cm);
2474 <<
" zStandard= "<<zITCStandard<<
" zShift= " <<zShift
2477 GeoTransform* xtraITCPos =
new GeoTransform(GeoTrf::TranslateX3D(
2479 GeoTransform* ztraITCPos =
new GeoTransform(GeoTrf::TranslateZ3D(zShift*
Gaudi::Units::cm));
2481 pvITCMotherPos->add(zrotMod);
2482 pvITCMotherPos->add(xtraITCPos);
2483 pvITCMotherPos->add(ztraITCPos);
2484 pvITCMotherPos->add(XYrtMod);
2486 pvITCMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2487 pvITCMotherPos->add(pvITCModuleMotherPos);
2493 if (Ifgap && pvGapMotherPos) {
2506 checking(
"Plug2Module (+)",
false, 2,
2507 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2509 GeoTrd* gapModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2510 thicknessWedgeMother/2,
2513 heightWedgeMother/2);
2515 GeoLogVol* lvGapModuleMotherPos =
new GeoLogVol(
"GapModule",gapModuleMotherPos,matAir);
2516 GeoPhysVol* pvGapModuleMotherPos =
new GeoPhysVol(lvGapModuleMotherPos);
2520 sectionBuilder->
fillSection(pvGapModuleMotherPos, 5,
2528 GeoTransform* xtraGapPos =
new GeoTransform(GeoTrf::TranslateX3D(
2530 pvGapMotherPos->add(zrotMod);
2531 pvGapMotherPos->add(xtraGapPos);
2532 pvGapMotherPos->add(XYrtMod);
2534 pvGapMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2535 pvGapMotherPos->add(pvGapModuleMotherPos);
2539 if (Ifcrack && pvCrackMotherPos) {
2552 checking(
"CrackModule (+)", spE4, 2,
2553 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2555 GeoTrd* crackModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2556 thicknessWedgeMother/2,
2559 heightWedgeMother/2);
2561 GeoLogVol* lvCrackModuleMotherPos =
new GeoLogVol(
"CrackModule",crackModuleMotherPos,matAir);
2562 GeoPhysVol* pvCrackModuleMotherPos =
new GeoPhysVol(lvCrackModuleMotherPos);
2566 sectionBuilder->
fillSection(pvCrackModuleMotherPos, 6,
2574 GeoTransform* xtraCrackPos =
new GeoTransform(GeoTrf::TranslateX3D(
2576 pvCrackMotherPos->add(zrotMod);
2577 pvCrackMotherPos->add(xtraCrackPos);
2578 pvCrackMotherPos->add(XYrtMod);
2580 pvCrackMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2581 pvCrackMotherPos->add(pvCrackModuleMotherPos);
2604 if (EnvType == 1 && barrel_flag < 1) {
2606 GeoTransform* tfBarrelMother;
2615 GeoNameTag* ntBarrelModuleMother =
new GeoNameTag(
"Barrel");
2617 pvTileEnvelopeBarrel->add(tfBarrelMother);
2618 pvTileEnvelopeBarrel->add(ntBarrelModuleMother);
2619 pvTileEnvelopeBarrel->add(pvBarrelMother);
2621 GeoTransform* tfFingerMotherPos;
2627 (*m_log) << MSG::INFO <<
" Positioning positive barrel finger with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2629 GeoNameTag* ntFingerMotherPos =
new GeoNameTag(
"TileFingerPos");
2631 pvTileEnvelopeBarrel->add(tfFingerMotherPos);
2632 pvTileEnvelopeBarrel->add(ntFingerMotherPos);
2633 pvTileEnvelopeBarrel->add(pvFingerMotherPos);
2636 GeoTransform* tfSaddleMotherPos;
2642 GeoNameTag* ntSaddleMotherPos =
new GeoNameTag(
"TileSaddlePos");
2644 pvTileEnvelopeBarrel->add(tfSaddleMotherPos);
2645 pvTileEnvelopeBarrel->add(ntSaddleMotherPos);
2646 pvTileEnvelopeBarrel->add(pvSaddleMotherPos);
2651 GeoTransform* tfFingerMotherNeg;
2657 (*m_log) << MSG::INFO <<
" Positioning negative barrel finger with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2659 GeoNameTag* ntFingerMotherNeg =
new GeoNameTag(
"TileFingerNeg");
2660 pvTileEnvelopeBarrel->add(tfFingerMotherNeg);
2661 pvTileEnvelopeBarrel->add(ntFingerMotherNeg);
2662 pvTileEnvelopeBarrel->add(pvFingerMotherNeg);
2665 GeoTransform* tfSaddleMotherNeg;
2671 GeoNameTag* ntSaddleMotherNeg =
new GeoNameTag(
"TileSaddleNeg");
2673 pvTileEnvelopeBarrel->add(tfSaddleMotherNeg);
2674 pvTileEnvelopeBarrel->add(ntSaddleMotherNeg);
2675 pvTileEnvelopeBarrel->add(pvSaddleMotherNeg);
2682 if (EnvType == 3 && eb_flag) {
2688 double PoZ2 = modl_length/4 + PoZ1;
2693 if (dbManager->
BoolCuts() && barrel_flag < 2) {
2702 GeoTransform* tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2704 pvEBarrelMotherPos->add(tfIron1);
2705 pvEBarrelMotherPos->add(
new GeoIdentifierTag(1));
2706 pvEBarrelMotherPos->add(pvIron1);
2708 tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2710 pvEBarrelMotherPos->add(tfIron1);
2711 pvEBarrelMotherPos->add(pvIron1);
2720 GeoTransform* tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2722 pvEBarrelMotherPos->add(tfIron2);
2723 pvEBarrelMotherPos->add(
new GeoIdentifierTag(2));
2724 pvEBarrelMotherPos->add(pvIron2);
2726 tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2728 pvEBarrelMotherPos->add(tfIron2);
2729 pvEBarrelMotherPos->add(pvIron2);
2738 GeoTransform* tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2740 pvEBarrelMotherPos->add(tfIron3);
2741 pvEBarrelMotherPos->add(
new GeoIdentifierTag(3));
2742 pvEBarrelMotherPos->add(pvIron3);
2744 tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2746 pvEBarrelMotherPos->add(tfIron3);
2747 pvEBarrelMotherPos->add(pvIron3);
2754 GeoTransform* tfIrBoxL =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2756 pvEBarrelMotherPos->add(tfIrBoxL);
2757 pvEBarrelMotherPos->add(
new GeoIdentifierTag(4));
2758 pvEBarrelMotherPos->add(pvIrBox);
2760 GeoTransform* tfIrBoxR =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2762 pvEBarrelMotherPos->add(tfIrBoxR);
2763 pvEBarrelMotherPos->add(pvIrBox);
2772 GeoTransform* tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2773 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2775 pvEBarrelMotherPos->add(tfIrUp);
2776 pvEBarrelMotherPos->add(
new GeoIdentifierTag(5));
2777 pvEBarrelMotherPos->add(pvIrUp);
2780 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,-PoZ1)
2782 pvEBarrelMotherPos->add(tfIrUp);
2783 pvEBarrelMotherPos->add(pvIrUp);
2792 GeoTransform* tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2793 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2795 pvEBarrelMotherPos->add(tfIrDw);
2796 pvEBarrelMotherPos->add(
new GeoIdentifierTag(6));
2797 pvEBarrelMotherPos->add(pvIrDw);
2800 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2803 pvEBarrelMotherPos->add(tfIrDw);
2804 pvEBarrelMotherPos->add(pvIrDw);
2811 GeoTransform* tfEBarrelMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2814 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel with translation "<< ztrans*
Gaudi::Units::cm <<
endmsg;
2817 GeoNameTag* ntEBarrelMotherPos =
new GeoNameTag(
"EBarrelPos");
2818 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
2819 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
2820 pvTileEnvelopePosEndcap->add(
new GeoIdentifierTag(3));
2821 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
2824 if (barrel_flag < 2) {
2830 GeoTransform* tfEFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2833 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel finger with translation ztrans= "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2835 GeoNameTag* ntEFingerMotherPos =
new GeoNameTag(
"TileEFingerPos");
2837 pvTileEnvelopePosEndcap->add(tfEFingerMotherPos);
2838 pvTileEnvelopePosEndcap->add(ntEFingerMotherPos);
2839 pvTileEnvelopePosEndcap->add(pvEFingerMotherPos);
2846 GeoTransform* tfESaddleMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2849 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel saddle with translation ztrans= "<<ztrans*
Gaudi::Units::cm
2852 GeoNameTag* ntESaddleMotherPos =
new GeoNameTag(
"TileESaddlePos");
2854 pvTileEnvelopePosEndcap->add(tfESaddleMotherPos);
2855 pvTileEnvelopePosEndcap->add(ntESaddleMotherPos);
2856 pvTileEnvelopePosEndcap->add(pvESaddleMotherPos);
2864 if (EnvType == 2 && eb_flag) {
2870 double PoZ2 = modl_length/4 + PoZ1;
2875 if (dbManager->
BoolCuts() && barrel_flag < 2) {
2881 GeoTransform* tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2883 pvEBarrelMotherNeg->add(tfIron1);
2884 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(1));
2885 pvEBarrelMotherNeg->add(pvIron1);
2887 tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2889 pvEBarrelMotherNeg->add(tfIron1);
2890 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(2));
2891 pvEBarrelMotherNeg->add(pvIron1);
2898 GeoTransform* tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2900 pvEBarrelMotherNeg->add(tfIron2);
2901 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(2));
2902 pvEBarrelMotherNeg->add(pvIron2);
2904 tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2906 pvEBarrelMotherNeg->add(tfIron2);
2907 pvEBarrelMotherNeg->add(pvIron2);
2914 GeoTransform* tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2916 pvEBarrelMotherNeg->add(tfIron3);
2917 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(3));
2918 pvEBarrelMotherNeg->add(pvIron3);
2920 tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2922 pvEBarrelMotherNeg->add(tfIron3);
2923 pvEBarrelMotherNeg->add(pvIron3);
2929 GeoTransform* tfIrBoxL =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2931 pvEBarrelMotherNeg->add(tfIrBoxL);
2932 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(4));
2933 pvEBarrelMotherNeg->add(pvIrBox);
2935 GeoTransform* tfIrBoxR =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2937 pvEBarrelMotherNeg->add(tfIrBoxR);
2938 pvEBarrelMotherNeg->add(pvIrBox);
2945 GeoTransform* tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2946 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2948 pvEBarrelMotherNeg->add(tfIrUp);
2949 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(5));
2950 pvEBarrelMotherNeg->add(pvIrUp);
2953 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,PoZ1)
2955 pvEBarrelMotherNeg->add(tfIrUp);
2956 pvEBarrelMotherNeg->add(pvIrUp);
2963 GeoTransform* tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2964 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2966 pvEBarrelMotherNeg->add(tfIrDw);
2967 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(6));
2968 pvEBarrelMotherNeg->add(pvIrDw);
2971 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2974 pvEBarrelMotherNeg->add(tfIrDw);
2975 pvEBarrelMotherNeg->add(pvIrDw);
2983 GeoTransform* tfEBarrelMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2986 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel with translation ztrans "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2988 GeoNameTag* ntEBarrelMotherNeg =
new GeoNameTag(
"EBarrelNeg");
2990 pvTileEnvelopeNegEndcap->add(tfEBarrelMotherNeg);
2991 pvTileEnvelopeNegEndcap->add(ntEBarrelMotherNeg);
2992 pvTileEnvelopeNegEndcap->add(
new GeoIdentifierTag(2));
2993 pvTileEnvelopeNegEndcap->add(pvEBarrelMotherNeg);
2995 if (barrel_flag < 2) {
3001 GeoTransform* tfEFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3004 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel finger with translation ztrans= "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3006 GeoNameTag* ntEFingerMotherNeg =
new GeoNameTag(
"TileEFingerNeg");
3008 pvTileEnvelopeNegEndcap->add(tfEFingerMotherNeg);
3009 pvTileEnvelopeNegEndcap->add(ntEFingerMotherNeg);
3010 pvTileEnvelopeNegEndcap->add(pvEFingerMotherNeg);
3017 GeoTransform* tfESaddleMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3020 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel saddle with translation ztrans= "<<ztrans*
Gaudi::Units::cm
3023 GeoNameTag* ntESaddleMotherNeg =
new GeoNameTag(
"TileESaddleNeg");
3025 pvTileEnvelopeNegEndcap->add(tfESaddleMotherNeg);
3026 pvTileEnvelopeNegEndcap->add(ntESaddleMotherNeg);
3027 pvTileEnvelopeNegEndcap->add(pvESaddleMotherNeg);
3039 if (barrel_flag < 3) {
3050 GeoTransform* tfITCMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3053 GeoNameTag* ntITCMotherPos =
new GeoNameTag(
"ITCPos");
3055 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
3056 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
3057 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
3061 if (barrel_flag < 4) {
3068 GeoTransform* tfGapMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3071 GeoNameTag* ntGapMotherPos =
new GeoNameTag(
"GapPos");
3073 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
3074 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
3075 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
3080 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
3085 if (crack_flag<=0) {
3086 (*m_log) << MSG::INFO <<
" Positioning positive Crack with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3087 }
else if (crack_flag==1) {
3088 (*m_log) << MSG::INFO <<
" Positioning positive Crack in separate mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3091 (*m_log) << MSG::INFO <<
" Positioning positive Crack in " << pvTileEnvelopePosCrack->getLogVol()->getName() <<
" mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3094 GeoTransform* tfCrackMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3097 GeoNameTag* ntCrackMotherPos =
new GeoNameTag(
"CrackPos");
3099 if (crack_flag<=0) {
3100 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
3101 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
3102 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
3104 pvTileEnvelopePosCrack->add(tfCrackMotherPos);
3105 pvTileEnvelopePosCrack->add(ntCrackMotherPos);
3106 pvTileEnvelopePosCrack->add(pvCrackMotherPos);
3109 (*m_log) << MSG::INFO <<
" Do not create positive Crack"<<
endmsg;
3121 if (barrel_flag < 3) {
3128 GeoTransform* tfITCMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3131 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"ITCNeg");
3133 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
3134 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
3135 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
3139 if (barrel_flag < 4) {
3146 GeoTransform* tfGapMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3149 GeoNameTag* ntGapMotherNeg =
new GeoNameTag(
"GapNeg");
3151 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
3152 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
3153 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
3158 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
3163 if (crack_flag<=0) {
3164 (*m_log) << MSG::INFO <<
" Positioning negative Crack with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3165 }
else if (crack_flag==1) {
3166 (*m_log) << MSG::INFO <<
" Positioning negative Crack in separate mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3169 (*m_log) << MSG::INFO <<
" Positioning positive Crack in " << pvTileEnvelopeNegCrack->getLogVol()->getName() <<
" mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3172 GeoTransform* tfCrackMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3175 GeoNameTag* ntCrackMotherNeg =
new GeoNameTag(
"CrackNeg");
3177 if (crack_flag<=0) {
3178 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
3179 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
3180 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
3182 pvTileEnvelopeNegCrack->add(tfCrackMotherNeg);
3183 pvTileEnvelopeNegCrack->add(ntCrackMotherNeg);
3184 pvTileEnvelopeNegCrack->add(pvCrackMotherNeg);
3187 (*m_log) << MSG::INFO <<
" Do not create negative Crack"<<
endmsg;
3197 if (barrel_flag<4 || (barrel_flag==4 && crack_flag<2) ) {
3201 int nModulesInSection[6] = {0,0,0,0,0,0};
3202 double zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
3205 for (
int EnvCounter = 0; EnvCounter < dbManager->
GetNumberOfEnv(); ++EnvCounter) {
3214 <<
" EnvCounter is " << EnvCounter
3215 <<
" EnvType is " << EnvType
3220 if (EnvType == 1 || EnvType == 0) {
3221 nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
3222 zShiftInSection[0] = zShiftInSection[1] = Zshift;
3223 }
else if (EnvType < 6) {
3224 nModulesInSection[EnvType] = NumberOfMod;
3225 zShiftInSection[EnvType] = Zshift;
3233 int side[6] = {0,1,0,1,0,1};
3236 (*m_log) <<
MSG::DEBUG <<
"Loop over Tile detector regions, and call computeCellDim() when needed..." <<
endmsg;
3237 for (
int ii=0; ii<6; ++ii) {
3239 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
endmsg;
3242 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
" --> calling computeCellDim()..." <<
endmsg;
3245 zShiftInSection[ii+1],
3246 zShiftInSection[ii]);
3254 nModulesInSection[ii],
3255 zShiftInSection[ii]);
3257 (*m_log) <<
MSG::DEBUG <<
"Get an Identifier for the region and add it to the detectorManager..." <<
endmsg;
3259 descriptor->
set(idRegion);
3266 GeoNameTag *
nTag =
new GeoNameTag(
"Tile");
3268 if (BAR && barrel_flag<1) {
3279 (*m_log) << MSG::INFO <<
" Global positioning of barrel with rotation ("
3282 <<
") Gaudi::Units::cm" <<
endmsg;
3284 world->add(barrelTT);
3285 world->add(pvTileEnvelopeBarrel);
3289 if (EBA && eb_flag) {
3300 (*m_log) << MSG::INFO <<
" Global positioning of positive ext.barrel with rotation ("
3303 <<
") Gaudi::Units::cm" <<
endmsg;
3305 world->add(posEcTT);
3306 world->add(pvTileEnvelopePosEndcap);
3310 if (EBC && eb_flag) {
3321 (*m_log) << MSG::INFO <<
" Global positioning of negative ext.barrel with rotation ("
3324 <<
") Gaudi::Units::cm" <<
endmsg;
3326 world->add(negEcTT);
3327 world->add(pvTileEnvelopeNegEndcap);
3332 if (crack_flag==1) {
3335 if (EBA && pvTileEnvelopePosCrack) {
3347 (*m_log) << MSG::INFO <<
" Global positioning of positive Crack with rotation ("
3350 <<
") Gaudi::Units::cm" <<
endmsg;
3352 world->add(posCrackTT);
3353 world->add(pvTileEnvelopePosCrack);
3359 if (EBC && pvTileEnvelopeNegCrack) {
3371 (*m_log) << MSG::INFO <<
" Global positioning of negative Crack with rotation ("
3374 <<
") Gaudi::Units::cm" <<
endmsg;
3376 world->add(negCrackTT);
3377 world->add(pvTileEnvelopeNegCrack);
3383 delete sectionBuilder;