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 GeoIntrusivePtr<GeoLogVol> lvTileEnvelopeBarrel{
nullptr}, lvTileEnvelopePosEndcap{
nullptr}, lvTileEnvelopeNegEndcap{
nullptr}, lvTileEnvelopePosCrack{
nullptr}, lvTileEnvelopeNegCrack{
nullptr};
167 PVLink pvTileEnvelopeBarrel{
nullptr}, pvTileEnvelopePosEndcap{
nullptr}, pvTileEnvelopeNegEndcap {
nullptr}, pvTileEnvelopePosCrack{
nullptr}, pvTileEnvelopeNegCrack{
nullptr};
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) {
178 pvTileEnvelopePosCrack = const_pointer_cast(PVConstLink{
v.first});
181 pvTileEnvelopeNegCrack = const_pointer_cast(PVConstLink{
v.first});
185 }
else if (crack_flag==3) {
187 (*m_log) <<MSG::WARNING <<
"Top-level volume pointers for crack scintillators are missing"<<
endmsg;
188 (*m_log) <<MSG::WARNING <<
"Crack scintillators will not be built"<<
endmsg;
194 }
else if (crack_flag==4) {
195 pvTileEnvelopePosCrack = world;
196 }
else if (crack_flag==5) {
197 pvTileEnvelopeNegCrack = world;
200 if (pvTileEnvelopePosCrack || pvTileEnvelopeNegCrack) {
201 (*m_log) <<
MSG::DEBUG <<
"Top-level volume names for crack scintillators are "
202 <<
" positive: " << ( (pvTileEnvelopePosCrack) ? pvTileEnvelopePosCrack->getLogVol()->getName() :
"none" )
203 <<
" negative: " << ( (pvTileEnvelopeNegCrack) ? pvTileEnvelopeNegCrack->getLogVol()->getName() :
"none" )
205 }
else if (crack_flag==2) {
206 (*m_log) <<MSG::WARNING <<
"Top-level volume names for crack scintillators "
209 <<
" were not found" <<
endmsg;
210 (*m_log) <<MSG::WARNING <<
"Crack scintillators will not be built"<<
endmsg;
211 (*m_log) <<MSG::WARNING <<
"Available top-level volumes are:";
213 for (
auto v : vols) (*m_log) <<
" " <<
v.first->getLogVol()->getName();
221 double dzITC1 =0, rMinITC1 =0, rMaxITC1 =0;
222 double dzITC2 =0, rMinITC2 =0, rMaxITC2 =0;
224 double thicknessWedgeMother =0, heightWedgeMother =0, dy1WedgeMother =0, dy2WedgeMother =0;
225 double Glue =0, dzGlue =0;
227 double zEndSection =0;
231 double zITCStandard =0;
233 double ZLength[] = {0.0,0.0,0.0,0.0,0.0,0.0};
234 double EnvDZPos[] = {0.0,0.0,0.0,0.0,0.0,0.0};
235 double PhiMax[] = {-360.0,-360.0,-360.0,-360.0,-360.0,-360.0};
236 double PhiMin[] = {+360.0,+360.0,+360.0,+360.0,+360.0,+360.0};
237 double RInMin[] = {99999.9,99999.9,99999.9,99999.9,99999.9,99999.9};
238 double ROutMax[] = {0.0,0.0,0.0,0.0,0.0,0.0};
239 double FingerRmax = 0;
243 double BFingerLength =0;
244 double BFingerLengthNeg =0;
245 double BFingerLengthPos =0;
251 double EBFingerLength =0;
252 double EBFingerLengthNeg =0;
253 double EBFingerLengthPos =0;
266 for (
int i = 0;
i < n_env ; ++
i) {
292 PosDelta = EnvDZPos[3] - EnvDZPos[1];
294 (*m_log) <<
MSG::DEBUG <<
" BFingerLengthPos "<<BFingerLengthPos<<
" PosDelta "<<PosDelta;
295 if (std::abs(PosDelta) < std::abs(EBFingerLength - BFingerLength) ) {
296 BFingerLengthPos += PosDelta;
298 (*m_log) <<
" => New BFingerLengthPos "<<BFingerLengthPos<<
endmsg;
301 BFingerLengthPos = BFingerLength;
304 (*m_log) <<
" => New PosDelta "<<PosDelta<<
endmsg;
312 NegDelta = (-EnvDZPos[2] + EnvDZPos[1]);
314 (*
m_log) <<
MSG::DEBUG <<
" BFingerLengthNeg "<<BFingerLengthNeg<<
" NegDelta "<<NegDelta;
315 if (std::abs(NegDelta) < std::abs(EBFingerLength - BFingerLength) ) {
316 BFingerLengthNeg += NegDelta;
318 (*
m_log) <<
" => New BFingerLengthNeg "<<BFingerLengthNeg<<
endmsg;
321 BFingerLengthNeg = BFingerLength;
333 spC10 = (rMinC10sp < rMinC10);
335 (*m_log) <<
MSG::DEBUG <<
" Special C10, changing Rmin from "<<rMinC10<<
" to "<< rMinC10sp <<
endmsg;
342 double rMinE2neg = rMinE2pos;
348 double rMinE4neg = rMinE4pos;
350 double rMaxE3neg = rMaxE3pos;
353 spE4 = (rMinE4sp < rMinE4neg);
355 (*m_log) <<
MSG::DEBUG <<
" E4' present, changing Rmin for negative crack from "<<rMinE4neg<<
" to "<< rMinE4sp <<
endmsg;
356 rMinE4neg = rMinE4sp;
361 double BFingerRmin=0, EFingerRmin=0;
376 double endCentralBarrel = ZLength[1]/2 - BFingerLength;
377 double endEnvelopeNeg = endCentralBarrel + BFingerLengthNeg;
378 double endEnvelopePos = endCentralBarrel + BFingerLengthPos;
381 double rminBarrel = RInMin[1];
384 double rmaxTotal = ROutMax[1];
390 tileEnvPconeBarrel->addPlane(-endEnvelopeNeg, BFingerRmin, rmaxTotal);
391 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin, rmaxTotal);
393 tileEnvPconeBarrel->addPlane(-endCentralBarrel-DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
394 tileEnvPconeBarrel->addPlane(-endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
396 tileEnvPconeBarrel->addPlane(-endCentralBarrel, rminBarrel, rmaxTotal);
397 tileEnvPconeBarrel->addPlane( endCentralBarrel, rminBarrel, rmaxTotal);
399 tileEnvPconeBarrel->addPlane( endCentralBarrel, BFingerRmin-RadiusSaddle,rmaxTotal);
400 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin-RadiusSaddle,rmaxTotal);
402 tileEnvPconeBarrel->addPlane( endCentralBarrel+DzSaddleSupport, BFingerRmin, rmaxTotal);
403 tileEnvPconeBarrel->addPlane( endEnvelopePos, BFingerRmin, rmaxTotal);
405 lvTileEnvelopeBarrel =
new GeoLogVol(
"TileCentralBarrel",tileEnvPconeBarrel,matAir);
406 pvTileEnvelopeBarrel =
new GeoPhysVol(lvTileEnvelopeBarrel);
415 double PosEndBarrelFinger = ZLength[1]/2;
416 double PosEndITC = PosEndBarrelFinger + ZLength[5];
417 double PosEndExBarrelFinger = PosEndITC + ZLength[3];
418 double PosEndExBarrel = PosEndExBarrelFinger - EBFingerLengthPos;
422 <<
" EBPos EnvDZPos[3] " << EnvDZPos[3] <<
" ZLength[5] " <<ZLength[5]<<
"+"<<ZLength[3]
423 <<
" = " << ZLength[3]+ZLength[5] <<
" EBFingerLengthPos = " <<EBFingerLengthPos
426 (*m_log) <<
MSG::DEBUG <<
" PosEndBarrelFinger = " << PosEndBarrelFinger
427 <<
" PosEndITC = " << PosEndITC
428 <<
" PosEndExBarrel = " << PosEndExBarrel
429 <<
" PosEndExtBarrelFinger = " << PosEndExBarrelFinger
435 double corr = PosEndITC - PosEndITC1;
436 if (std::abs(corr)>0.01) {
437 (*m_log) << MSG::WARNING
438 <<
"Discrepancy between TileGlobals and TILB tables in GeoModel DB "
439 << PosEndITC <<
" != " << PosEndITC1 <<
"; take this into account"
454 double GapWidth = PosEndGap - PosBeginGap;
456 PosEndGap = PosBeginGap + GapWidth;
461 <<
" PosBeginGap = " << PosBeginGap
462 <<
" PosEndGap = " << PosEndGap
463 <<
" PosBeginCrack = " << PosBeginCrack
464 <<
" PosEndCrack = " << PosEndCrack
478 double PosRminExt = RInMin[3];
481 double PosRmaxTotal = ROutMax[3];
485 <<
" PosRminITC1 = " << PosRminITC1
486 <<
" PosRminITC2 = " << PosRminITC
487 <<
" PosRminGap = " << PosRminGap
488 <<
" PosRmaxCrack = " << PosRmaxCrack
489 <<
" PosRminCrack = " << PosRminCrack
490 <<
" PosRminExt = " << PosRminExt
491 <<
" PosRmaxTotal = " << PosRmaxTotal
499 tileEnvPconePosEndcap->addPlane(PosEndBarrelFinger, PosRminITC1, PosRmaxTotal);
500 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC1, PosRmaxTotal);
501 tileEnvPconePosEndcap->addPlane(PosBeginITC2, PosRminITC, PosRmaxTotal);
504 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminITC, PosRmaxTotal);
505 tileEnvPconePosEndcap->addPlane(PosBeginGap, PosRminGap, PosRmaxTotal);
506 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminGap, PosRmaxTotal);
507 tileEnvPconePosEndcap->addPlane(PosEndGap, PosRminExt, PosRmaxTotal);
510 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminITC, PosRmaxTotal);
511 tileEnvPconePosEndcap->addPlane(PosBeginCrack, PosRminCrack, PosRmaxTotal);
512 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminCrack, PosRmaxTotal);
513 tileEnvPconePosEndcap->addPlane(PosEndCrack, PosRminExt, PosRmaxTotal);
515 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, PosRminExt, PosRmaxTotal);
517 tileEnvPconePosEndcap->addPlane(PosEndExBarrel, EFingerRmin-RadiusSaddle, PosRmaxTotal);
518 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin-RadiusSaddle, PosRmaxTotal);
520 tileEnvPconePosEndcap->addPlane(PosEndExBarrel+DzSaddleSupport, EFingerRmin, PosRmaxTotal);
521 tileEnvPconePosEndcap->addPlane(PosEndExBarrelFinger, EFingerRmin, PosRmaxTotal);
523 lvTileEnvelopePosEndcap =
new GeoLogVol(
"TileEndcapPos",tileEnvPconePosEndcap,matAir);
524 pvTileEnvelopePosEndcap =
new GeoPhysVol(lvTileEnvelopePosEndcap);
532 tileEnvPconePosCrack->addPlane(PosBeginCrack, PosRminCrack, PosRmaxCrack);
533 tileEnvPconePosCrack->addPlane(PosEndCrack, PosRminCrack, PosRmaxCrack);
535 lvTileEnvelopePosCrack =
new GeoLogVol(
"TileCrackPos",tileEnvPconePosCrack,matAir);
536 pvTileEnvelopePosCrack =
new GeoPhysVol(lvTileEnvelopePosCrack);
544 double NegEndBarrelFinger = ZLength[1]/2;
545 double NegEndITC = NegEndBarrelFinger + ZLength[4];
546 double NegEndExtBarrelFinger = NegEndITC + ZLength[2];
547 double NegEndExBarrel = NegEndExtBarrelFinger - EBFingerLengthNeg;
551 <<
" EBNeg EnvDZPos[2] " << EnvDZPos[2] <<
" ZLength[4] " <<ZLength[4]<<
"+"<<ZLength[2]
552 <<
" = " << ZLength[2]+ZLength[4] <<
" EBFingerLengthNeg = " <<EBFingerLengthNeg
555 (*m_log) <<
MSG::DEBUG <<
" NegEndBarrelFinger = " << NegEndBarrelFinger
556 <<
" NegEndITC = " << NegEndITC
557 <<
" NegEndExBarrel = " << NegEndExBarrel
558 <<
" NegEndExtBarrelFinger = " << NegEndExtBarrelFinger
564 corr = NegEndITC - NegEndITC1;
566 if (std::abs(corr)>0.01) {
567 (*m_log) << MSG::WARNING
568 <<
"Discrepancy between TileGlobals and TILB tables in GeoModel DB "
569 << NegEndITC <<
" != " << NegEndITC1 <<
"; take this into account"
583 double GapWidth = NegEndGap - NegBeginGap;
585 NegEndGap = NegBeginGap + GapWidth;
590 <<
" NegBeginGap = " << NegBeginGap
591 <<
" NegEndGap = " << NegEndGap
592 <<
" NegBeginCrack = " << NegBeginCrack
593 <<
" NegEndCrack = " << NegEndCrack
608 double NegRminExt = RInMin[2];
611 double NegRmaxTotal = ROutMax[2];
615 <<
" NegRminITC1 = " << NegRminITC1
616 <<
" NegRminITC2 = " << NegRminITC
617 <<
" NegRminGap = " << NegRminGap
618 <<
" NegRmaxCrack = " << NegRmaxCrack
619 <<
" NegRminCrack = " << NegRminCrack
620 <<
" NegRminExt = " << NegRminExt
621 <<
" NegRmaxTotal = " << NegRmaxTotal
629 tileEnvPconeNegEndcap->addPlane(-NegEndExtBarrelFinger, EFingerRmin, NegRmaxTotal);
630 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin, NegRmaxTotal);
632 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel-DzSaddleSupport, EFingerRmin-RadiusSaddle, NegRmaxTotal);
633 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, EFingerRmin-RadiusSaddle, NegRmaxTotal);
635 tileEnvPconeNegEndcap->addPlane(-NegEndExBarrel, NegRminExt, NegRmaxTotal);
638 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminExt, NegRmaxTotal);
639 tileEnvPconeNegEndcap->addPlane(-NegEndGap, NegRminGap, NegRmaxTotal);
640 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminGap, NegRmaxTotal);
641 tileEnvPconeNegEndcap->addPlane(-NegBeginGap, NegRminITC, NegRmaxTotal);
644 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminExt, NegRmaxTotal);
645 tileEnvPconeNegEndcap->addPlane(-NegEndCrack, NegRminCrack, NegRmaxTotal);
646 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxTotal);
647 tileEnvPconeNegEndcap->addPlane(-NegBeginCrack, NegRminITC, NegRmaxTotal);
649 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC, NegRmaxTotal);
650 tileEnvPconeNegEndcap->addPlane(-NegBeginITC2, NegRminITC1, NegRmaxTotal);
651 tileEnvPconeNegEndcap->addPlane(-NegEndBarrelFinger, NegRminITC1, NegRmaxTotal);
653 lvTileEnvelopeNegEndcap =
new GeoLogVol(
"TileEndcapNeg",tileEnvPconeNegEndcap,matAir);
654 pvTileEnvelopeNegEndcap =
new GeoPhysVol(lvTileEnvelopeNegEndcap);
662 tileEnvPconeNegCrack->addPlane(-NegEndCrack, NegRminCrack, NegRmaxCrack);
663 tileEnvPconeNegCrack->addPlane(-NegBeginCrack, NegRminCrack, NegRmaxCrack);
665 lvTileEnvelopeNegCrack =
new GeoLogVol(
"TileCrackNeg",tileEnvPconeNegCrack,matAir);
666 pvTileEnvelopeNegCrack =
new GeoPhysVol(lvTileEnvelopeNegCrack);
692 PVLink pvBarrelMother{
nullptr}, pvFingerMotherNeg{
nullptr}, pvFingerMotherPos{
nullptr}, pvSaddleMotherNeg{
nullptr}, pvSaddleMotherPos{
nullptr};
693 PVLink pvEBarrelMotherNeg{
nullptr}, pvEBarrelMotherPos{
nullptr};
694 PVLink pvEFingerMotherNeg{
nullptr}, pvEFingerMotherPos{
nullptr}, pvESaddleMotherNeg{
nullptr}, pvESaddleMotherPos{
nullptr};
695 PVLink pvITCMotherNeg{
nullptr}, pvITCMotherPos{
nullptr};
696 PVLink pvGapMotherNeg{
nullptr}, pvGapMotherPos{
nullptr};
697 PVLink pvCrackMotherNeg{
nullptr}, pvCrackMotherPos{
nullptr};
699 GeoLogVol *lvEBarrelModuleMotherPos{
nullptr}, *lvEBarrelModuleMotherNeg{
nullptr};
700 PVLink pvEBarrelModuleMotherPos{
nullptr}, pvEBarrelModuleMotherNeg{
nullptr};
713 double dX1 =0, dX2 =0, dY1 =0, dY2 =0, dZ1 =0, dZ2 =0;
714 double dxIron =0, dyIron =0, dxIr =0, dyIr =0;
715 std::string volname =
"";
718 double PosXcut =0, PosYcut =0, PosY =0;
719 double modl_length =0;
721 const GeoShapeUnion *CutA= 0;
724 GeoLogVol *lvIrUp =0, *lvIrDw =0, *lvIron3 =0, *lvIron2 =0, *lvIron1 =0, *lvIrBox =0;
725 GeoPhysVol *pvIrUp =0, *pvIrDw =0, *pvIron3 =0, *pvIron2 =0, *pvIron1 =0, *pvIrBox =0;
732 (*
m_log) <<
MSG::DEBUG <<
" Tile Geometry with Ext.Barrel CutOuts and Iron plates, starting form TileCal-CSC-01"
738 modl_length = 4*dbManager->
CutsDX1();
747 checking(
"CutB1",
false, 1, dX1,dX2,dY1,dY2,dZ1);
748 GeoTrd* CutB1 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
761 checking(
"IrUp",
false, 1,dX1,dX2,dY1,dY2,dZ1);
762 GeoTrd* IrUp =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
763 lvIrUp =
new GeoLogVol(
"IrUp",IrUp,matIron);
764 pvIrUp =
new GeoPhysVol(lvIrUp);
774 checking(
"IrDw",
false, 1, dX1,dX2,dY1,dY2,dZ1);
775 GeoTrd* IrDw =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
776 lvIrDw =
new GeoLogVol(
"IrDw",IrDw,matIron);
777 pvIrDw =
new GeoPhysVol(lvIrDw);
789 checking(
"Cut1up",
false, 1, dX1,dX2,dY1,dY2,dZ1);
790 GeoTrd* Cut1up =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
799 checking(
"Cut2down",
false, 1, dX1,dX2,dY1,dY2,dZ2);
800 GeoTrd* Cut1down =
new GeoTrd(dX1,dX2,dY1,dY2,dZ2);
802 GeoTrf::Translate3D yPosA(0.,0.,-dZ1-dZ2);
804 const GeoShapeUnion& CutA1 = Cut1up->add(*Cut1down<<yPosA);
834 checking(
"Iron3",
false, 1, dX1,dX2,dY1,dY2,dZ1);
835 GeoTrd* Iron3 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
836 lvIron3 =
new GeoLogVol(
"Iron3",Iron3,matIron);
837 pvIron3 =
new GeoPhysVol(lvIron3);
847 checking(
"Iron2",
false, 1, dX1,dX2,dY1,dY2,dZ1);
848 GeoTrd* Iron2 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
849 lvIron2 =
new GeoLogVol(
"Iron2",Iron2,matIron);
850 pvIron2 =
new GeoPhysVol(lvIron2);
860 checking(
"Iron1",
false, 1, dX1,dX2,dY1,dY2,dZ1);
861 GeoTrd* Iron1 =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
862 lvIron1 =
new GeoLogVol(
"Iron1",Iron1,matIron);
863 pvIron1 =
new GeoPhysVol(lvIron1);
873 checking(
"IrBox",
false, 1, dX1,dX2,dY1,dY2,dZ1);
874 GeoTrd* IrBox =
new GeoTrd(dX1,dX2,dY1,dY2,dZ1);
875 lvIrBox =
new GeoLogVol(
"IrBox",IrBox,matIron);
876 pvIrBox =
new GeoPhysVol(lvIrBox);
906 for (
int EnvCounter = 0; EnvCounter < NumberOfEnv ; ++EnvCounter) {
917 (*m_log) <<
MSG::DEBUG <<
" EnvCounter " << EnvCounter <<
" EnvType " << EnvType
918 <<
" EnvNModules " << NumberOfMod <<
endmsg;
920 if (EnvType == 1 && barrel_flag < 1) {
922 zEndSection = ZLength[1]/2 - BFingerLength;
929 GeoTubs* barrelMother = GeneralMother;
930 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
931 pvBarrelMother =
new GeoPhysVol(lvBarrelMother);
934 (*m_log) <<
MSG::DEBUG <<
"Barrel envelope parameters: "
935 <<
" Length=" << zEndSection
941 GeoTubs* fingerMotherPos =
new GeoTubs(BFingerRmin,
946 GeoLogVol* lvFingerMotherPos =
new GeoLogVol(
"FingerPos",fingerMotherPos,matAir);
947 pvFingerMotherPos =
new GeoPhysVol(lvFingerMotherPos);
950 GeoTubs* SaddleMotherPos =
new GeoTubs(BFingerRmin-RadiusSaddle,
955 GeoLogVol* lvSaddleMotherPos =
new GeoLogVol(
"SaddlePos",SaddleMotherPos,matAir);
956 pvSaddleMotherPos =
new GeoPhysVol(lvSaddleMotherPos);
960 GeoTubs* fingerMotherNeg =
new GeoTubs(BFingerRmin,
965 GeoLogVol* lvFingerMotherNeg =
new GeoLogVol(
"FingerNeg",fingerMotherNeg,matAir);
966 pvFingerMotherNeg =
new GeoPhysVol(lvFingerMotherNeg);
969 (*m_log) <<
MSG::DEBUG <<
"Barrel finger envelope parameters: "
970 <<
" length Pos/Neg=" << BFingerLengthPos <<
"/" << BFingerLengthNeg
976 GeoTubs* SaddleMotherNeg =
new GeoTubs(BFingerRmin-RadiusSaddle,
981 GeoLogVol* lvSaddleMotherNeg =
new GeoLogVol(
"SaddleNeg",SaddleMotherNeg,matAir);
982 pvSaddleMotherNeg =
new GeoPhysVol(lvSaddleMotherNeg);
986 if (EnvType == 3 && eb_flag) {
1000 GeoTubs* ebarrelMotherPos = GeneralMother;
1001 GeoLogVol* lvEBarrelMotherPos =
new GeoLogVol(
"EBarrel",ebarrelMotherPos,matAir);
1002 pvEBarrelMotherPos =
new GeoPhysVol(lvEBarrelMotherPos);
1005 (*m_log) <<
MSG::DEBUG <<
"Positive ext.barrel envelope parameters: "
1011 if (barrel_flag < 2) {
1015 AnglMin,AnglMax, EBFingerLength/2);
1017 GeoTubs* fingerMother =
new GeoTubs(EFingerRmin,
1022 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
1023 pvEFingerMotherPos =
new GeoPhysVol(lvEFingerMother);
1026 (*m_log) <<
MSG::DEBUG <<
"Positive ext.barrel finger envelope parameters: "
1027 <<
" length=" << EBFingerLength
1028 <<
" Rmin=" << EFingerRmin
1034 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1036 GeoTubs* ESaddleMother =
new GeoTubs(EFingerRmin-RadiusSaddle,
1041 GeoLogVol* lvESaddleMother =
new GeoLogVol(
"ESaddlePos",ESaddleMother,matAir);
1042 pvESaddleMotherPos =
new GeoPhysVol(lvESaddleMother);
1048 if (EnvType == 2 && eb_flag) {
1057 GeoTubs* ebarrelMotherNeg = GeneralMother;
1058 GeoLogVol* lvEBarrelMotherNeg =
new GeoLogVol(
"EBarrel",ebarrelMotherNeg,matAir);
1059 pvEBarrelMotherNeg =
new GeoPhysVol(lvEBarrelMotherNeg);
1062 (*m_log) <<
MSG::DEBUG <<
"Nevative ext.barrel envelope parameters: "
1068 if (barrel_flag < 2) {
1070 GeoTubs* fingerMother =
new GeoTubs(EFingerRmin,
1072 EBFingerLengthNeg/2,
1075 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
1076 pvEFingerMotherNeg =
new GeoPhysVol(lvEFingerMother);
1079 (*m_log) <<
MSG::DEBUG <<
"Negative ext.barrel finger envelope parameters: "
1080 <<
" length=" << EBFingerLengthNeg
1081 <<
" Rmin=" << EFingerRmin
1087 EFingerRmin-RadiusSaddle,EFingerRmin,AnglMin,AnglMax, DzSaddleSupport/2);
1089 GeoTubs* ESaddleMother =
new GeoTubs(EFingerRmin-RadiusSaddle,
1094 GeoLogVol* lvESaddleMother =
new GeoLogVol(
"ESaddlePos",ESaddleMother,matAir);
1095 pvESaddleMotherNeg =
new GeoPhysVol(lvESaddleMother);
1103 if (barrel_flag < 3) {
1117 (*m_log) << MSG::INFO <<
" Positive ITC envelope parameters: PLUG1 "
1119 (*m_log) << MSG::INFO <<
" PLUG2 "
1122 checking(
"ITC itcWheel1 (+)",
false, 0,
1130 checking(
"ITC itcWheel2 (+)",
false, 0,
1139 GeoTrf::Translate3D itcWheel2OffsetPos(0.,0.,
Z);
1143 const GeoShapeUnion& itcMotherPos = itcWheel1->add(*itcWheel2<<itcWheel2OffsetPos);
1145 GeoLogVol* lvITCMotherPos =
new GeoLogVol(
"ITC",&itcMotherPos,matAir);
1146 pvITCMotherPos =
new GeoPhysVol(lvITCMotherPos);
1151 if (barrel_flag < 4) {
1165 GeoLogVol* lvGapMotherPos =
new GeoLogVol(
"Gap",GapMotherPos,matAir);
1166 pvGapMotherPos =
new GeoPhysVol(lvGapMotherPos);
1171 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
1185 GeoLogVol* lvCrackMotherPos =
new GeoLogVol(
"Crack",crackMotherPos,matAir);
1186 pvCrackMotherPos =
new GeoPhysVol(lvCrackMotherPos);
1193 if (barrel_flag < 3) {
1207 (*m_log) << MSG::INFO <<
" Negative ITC envelope parameters: PLUG1 "
1209 (*m_log) << MSG::INFO <<
" PLUG2 "
1212 checking(
"ITC itcWheel1 (-)",
false, 0,
1220 checking(
"ITC itcWheel2 (-)",
false, 0,
1229 GeoTrf::Translate3D itcWheel2OffsetNeg(0.,0.,
Z);
1233 const GeoShapeUnion& itcMotherNeg = itcWheel1->add(*itcWheel2<<itcWheel2OffsetNeg);
1235 GeoLogVol* lvITCMotherNeg =
new GeoLogVol(
"ITC",&itcMotherNeg,matAir);
1236 pvITCMotherNeg =
new GeoPhysVol(lvITCMotherNeg);
1241 if (barrel_flag < 4) {
1255 GeoLogVol* lvGapMotherNeg =
new GeoLogVol(
"Gap",GapMotherNeg,matAir);
1256 pvGapMotherNeg =
new GeoPhysVol(lvGapMotherNeg);
1261 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
1275 GeoLogVol* lvCrackMotherNeg =
new GeoLogVol(
"Crack",crackMotherNeg,matAir);
1276 pvCrackMotherNeg =
new GeoPhysVol(lvCrackMotherNeg);
1281 ((EnvType&6) == 0 && barrel_flag < 1) ||
1282 ((EnvType&6) == 2 && barrel_flag < 2) ||
1283 ((EnvType&6) == 4 && barrel_flag < 5) )) {
1286 int ModuleIndex[64];
1287 for (
int i=0;
i < NumberOfMod;
i++) {
1288 ModuleIndex[
i] =
i+1;
1294 GeoIntrusivePtr<GeoTransform> yrotMod{
new GeoTransform(GeoTrf::RotateY3D(90*
Gaudi::Units::deg))};
1297 for (
int ModCounter = 0; ModCounter < NumberOfMod; ModCounter++) {
1299 ModuleNcp = ModuleIndex[ModCounter];
1305 GeoIntrusivePtr<GeoTransform> zrotMod{
new GeoTransform(GeoTrf::RotateZ3D(
phi*
Gaudi::Units::deg))};
1306 GeoIntrusivePtr<GeoTransform> zrotSaddle{
new GeoTransform(GeoTrf::RotateZ3D(ph1*
Gaudi::Units::deg))};
1313 if (!(ModuleNcp>=NcpFrom && ModuleNcp<=NcpFrom+NcpPlus))
continue;
1322 (*m_log) <<
MSG::DEBUG <<
" ModuleNcp= "<< ModuleNcp <<
" ModType "<< ModType <<
" Phi "<<
phi <<
endmsg;
1328 if ( EnvType == 1 && barrel_flag < 1) {
1341 GeoTrd* barrelModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1342 thicknessWedgeMother/2,
1345 heightWedgeMother/2);
1347 GeoLogVol* lvBarrelModuleMother =
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
1348 PVLink pvBarrelModuleMother =
new GeoPhysVol(lvBarrelModuleMother);
1352 sectionBuilder->
fillSection(pvBarrelModuleMother, 1,
1359 GeoTransform* xtraMod =
new GeoTransform(GeoTrf::TranslateX3D(
1362 pvBarrelMother->add(zrotMod);
1363 pvBarrelMother->add(xtraMod);
1364 pvBarrelMother->add(XYrtMod);
1366 pvBarrelMother->add(
new GeoIdentifierTag(ModuleNcp));
1367 pvBarrelMother->add(pvBarrelModuleMother);
1379 if ( ModFingpattern != 10 ) {
1380 GeoTrd* fingerModuleMotherPos =
new GeoTrd(BFingerLengthPos/2,
1384 heightWedgeMother/2);
1386 GeoLogVol* lvFingerModuleMotherPos =
new GeoLogVol(
"FingerModule",fingerModuleMotherPos,matAir);
1387 PVLink pvFingerModuleMotherPos =
new GeoPhysVol(lvFingerModuleMotherPos);
1390 sectionBuilder->
fillFinger(pvFingerModuleMotherPos, 1,
1402 pvFingerMotherPos->add(zrotMod);
1403 pvFingerMotherPos->add(xtraModFingerPos);
1404 pvFingerMotherPos->add(XYrtMod);
1406 pvFingerMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1407 pvFingerMotherPos->add(pvFingerModuleMotherPos);
1411 if ( ModFingpattern != 1 ) {
1413 GeoTrd* fingerModuleMotherNeg =
new GeoTrd(BFingerLengthNeg/2,
1417 heightWedgeMother/2);
1419 GeoLogVol* lvFingerModuleMotherNeg =
new GeoLogVol(
"FingerModule",fingerModuleMotherNeg,matAir);
1420 PVLink pvFingerModuleMotherNeg =
new GeoPhysVol(lvFingerModuleMotherNeg);
1423 sectionBuilder->
fillFinger(pvFingerModuleMotherNeg, 1,
1435 pvFingerMotherNeg->add(zrotMod);
1436 pvFingerMotherNeg->add(xtraModFingerNeg);
1437 pvFingerMotherNeg->add(yrotMod);
1439 pvFingerMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1440 pvFingerMotherNeg->add(pvFingerModuleMotherNeg);
1445 if ( (ModuleNcp >=40 && ModuleNcp <=41) || (ModuleNcp >=56 && ModuleNcp <=57) ) {
1446 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1451 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1452 PVLink pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1454 pvSaddleMotherPos->add(zrotSaddle);
1455 pvSaddleMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1456 pvSaddleMotherPos->add(pvSaddleModule);
1458 pvSaddleMotherNeg->add(zrotSaddle);
1459 pvSaddleMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1460 pvSaddleMotherNeg->add(pvSaddleModule);
1467 if (EnvType == 3 && barrel_flag < 2) {
1483 checking(
"EBarrelModule (+)",
false, 1,
1484 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1486 GeoTrd* ebarrelModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
1487 thicknessWedgeMother/2,
1490 heightWedgeMother/2);
1496 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
1497 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1508 PoZ2 = PoZ1 + modl_length/4;
1510 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1512 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1514 if (ModuleNcp>=60 && ModuleNcp<=62) {
1517 * GeoTrf::Translate3D(PoZ1,PosYcut,-PosXcut);
1520 const GeoShape& TmL_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1521 subtract((*CutB)<<TransCutL);
1523 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",&TmL_EBarrelModuleMotherPos,matAir);
1525 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
1528 * GeoTrf::Translate3D(PoZ1,PosYcut,PosXcut) * GeoTrf::RotateY3D(180*
Gaudi::Units::deg);
1531 const GeoShape& TmR_EBarrelModuleMotherPos = ebarrelModuleMotherPos->subtract((*CutA)<<TransCut2).
1532 subtract((*CutB)<<TransCutR);
1534 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",&TmR_EBarrelModuleMotherPos,matAir);
1537 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1540 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
1541 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1547 sectionBuilder->
fillSection(pvEBarrelModuleMotherPos, 2,
1555 GeoTransform* xtraModPos =
new GeoTransform(GeoTrf::TranslateX3D(Radius));
1557 pvEBarrelMotherPos->add(zrotMod);
1558 pvEBarrelMotherPos->add(xtraModPos);
1559 pvEBarrelMotherPos->add(XYrtMod);
1561 pvEBarrelMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1562 pvEBarrelMotherPos->add(pvEBarrelModuleMotherPos);
1629 checking(
"EFingerModule (+)",
false, 1,
1630 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1632 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1633 thicknessWedgeMother/2,
1636 heightWedgeMother/2);
1638 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
1639 PVLink pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
1643 sectionBuilder->
fillFinger(pvEFingerModuleMother, 2,
1650 GeoTransform* xtraModFingerPos =
new GeoTransform(GeoTrf::TranslateX3D(
1652 pvEFingerMotherPos->add(zrotMod);
1653 pvEFingerMotherPos->add(xtraModFingerPos);
1654 pvEFingerMotherPos->add(XYrtMod);
1656 pvEFingerMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1657 pvEFingerMotherPos->add(pvEFingerModuleMother);
1661 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1662 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1667 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1668 PVLink pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1670 pvESaddleMotherPos->add(zrotSaddle);
1671 pvESaddleMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
1672 pvESaddleMotherPos->add(pvSaddleModule);
1680 if (EnvType == 2 && barrel_flag < 2) {
1696 checking(
"EBarrelModule (-)",
false, 1,
1697 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1699 GeoTrd* ebarrelModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
1700 thicknessWedgeMother/2,
1703 heightWedgeMother/2);
1709 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
1710 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1721 PoZ2 = PoZ1 + modl_length/4;
1723 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1726 * GeoTrf::Translate3D(-PoZ2,0,-PosY);
1728 if (ModuleNcp>=60 && ModuleNcp<=62) {
1731 * GeoTrf::Translate3D(PoZ1,-PosYcut,-PosXcut);
1734 const GeoShape& TmL_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1735 subtract((*CutB)<<TransCutL);
1737 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",&TmL_EBarrelModuleMotherNeg,matAir);
1739 }
else if (ModuleNcp>=35 && ModuleNcp<=37) {
1742 * GeoTrf::Translate3D(PoZ1,-PosYcut,PosXcut) * GeoTrf::RotateY3D(180*
Gaudi::Units::deg);
1745 const GeoShape& TmR_EBarrelModuleMotherNeg = ebarrelModuleMotherNeg->subtract((*CutA)<<TransCut2).
1746 subtract((*CutB)<<TransCutR);
1748 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",&TmR_EBarrelModuleMotherNeg,matAir);
1751 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1754 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
1755 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1761 sectionBuilder->
fillSection(pvEBarrelModuleMotherNeg, 2,
1770 GeoTransform* xtraModNeg =
new GeoTransform(GeoTrf::TranslateX3D(Radius));
1772 pvEBarrelMotherNeg->add(zrotMod);
1773 pvEBarrelMotherNeg->add(xtraModNeg);
1774 pvEBarrelMotherNeg->add(yrotMod);
1776 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1777 pvEBarrelMotherNeg->add(pvEBarrelModuleMotherNeg);
1846 checking(
"EFingerModule (-)",
false, 1,
1847 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1849 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2,
1850 thicknessWedgeMother/2,
1853 heightWedgeMother/2);
1855 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
1856 PVLink pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
1860 sectionBuilder->
fillFinger(pvEFingerModuleMother, 2,
1867 GeoTransform* xtraModFingerNeg =
new GeoTransform(GeoTrf::TranslateX3D(
1869 pvEFingerMotherNeg->add(zrotMod);
1870 pvEFingerMotherNeg->add(xtraModFingerNeg);
1871 pvEFingerMotherNeg->add(yrotMod);
1873 pvEFingerMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1874 pvEFingerMotherNeg->add(pvEFingerModuleMother);
1878 if ( (ModuleNcp >=39 && ModuleNcp <=42) || (ModuleNcp >=55 && ModuleNcp <=58) ) {
1879 GeoTubs* SaddleModule =
new GeoTubs(BFingerRmin-RadiusSaddle,
1884 GeoLogVol* lvSaddleModule =
new GeoLogVol(
"SaddleModule",SaddleModule,matIron);
1885 PVLink pvSaddleModule =
new GeoPhysVol(lvSaddleModule);
1887 pvESaddleMotherNeg->add(zrotSaddle);
1888 pvESaddleMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
1889 pvESaddleMotherNeg->add(pvSaddleModule);
1897 if (((EnvType == 4) || (EnvType == 5)) && barrel_flag < 5) {
1899 int Id4 = ModType%100;
1900 int Ic10 = (ModType/100)%100;
1901 int Igap = (ModType/10000)%100;
1902 int Icrack = (ModType/1000000)%100;
1904 bool Ifd4 = ( Id4 != 0);
1905 bool Ifc10 = ( Ic10 != 0);
1906 bool Ifgap = ( Igap != 0);
1907 bool Ifcrack = ( Icrack != 0);
1909 bool Ifspecialgirder = (Id4 == 7);
1913 <<
" Ncp= "<<ModuleNcp<<
" D4 "<<Id4<<
" specialflag = "<<Ifspecialgirder<<
" C10 "<<Ic10<<
" Gap "<<Igap<<
" Crack "<<Icrack
1931 if (Ifspecialgirder) {
1937 (*m_log) << MSG::INFO <<
" D4 unavailable "<<
endmsg;
1941 bool specialC10 = (Ifd4 && Ifc10 && rMaxITC2 < rMinITC1);
1943 rMaxITC2 = rMinITC1;
1950 if ((Ifd4 || Ifc10) && pvITCMotherNeg) {
1958 checking(
"ITCModule tcModuleSub1Neg (-) ",
false, 1,
1959 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1961 GeoTrd* itcModuleSub1Neg =
new GeoTrd(thicknessWedgeMother/2,
1962 thicknessWedgeMother/2,
1965 heightWedgeMother/2);
1972 checking(
"ITCModule itcModuleSub2Neg (-)",
false, 1,
1973 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
1975 GeoTrd* itcModuleSub2Neg =
new GeoTrd(thicknessWedgeMother/2,
1976 thicknessWedgeMother/2,
1979 heightWedgeMother/2 );
1986 GeoTrf::Translate3D itcModule_SubShiftNeg(
X, 0.,
Z);
1987 const GeoShapeUnion& itcModuleMotherNeg = itcModuleSub1Neg->add(*itcModuleSub2Neg<<itcModule_SubShiftNeg);
1989 GeoTrf::Translate3D itcModuleSubShiftNeg(
X, 0.,
Z);
1991 GeoLogVol* lvITCModuleMotherNeg =
new GeoLogVol(
"ITCModule",&itcModuleMotherNeg,matAir);
1992 PVLink pvITCModuleMotherNeg =
new GeoPhysVol(lvITCModuleMotherNeg);
2011 (*m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzITC1= "<<dzITC1
2017 dzGlue = (Glue - 2*NbPeriod * (dbManager->
TILBdzmast() + dbManager->
TILBdzspac())) / (4.*NbPeriod);
2023 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzGlue= "<<dzGlue<<
" NbPeriod= "<<NbPeriod
2028 (*m_log) << MSG::WARNING <<
" Plug1Module warning: "<<
" dzGlue= "<<dzGlue
2032 checking(
"Plug1Module plug1SubMotherNeg (-)",
false, 2,
2033 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2035 GeoTrd* plug1SubMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2036 thicknessWedgeMother/2,
2039 heightWedgeMother/2);
2041 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2;
2045 (*m_log) <<
MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2047 GeoLogVol *lvPlug1ModuleMotherNeg=0;
2048 if (thicknessWedgeMother > rless) {
2053 checking(
"Plug1Module plug2SubMotherNeg (-)",
false, 2,
2054 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2056 GeoTrd* plug2SubMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2057 thicknessWedgeMother/2,
2060 heightWedgeMother/2);
2065 const GeoShapeUnion& plug1ModuleMotherNeg =
2066 plug1SubMotherNeg->add(*plug2SubMotherNeg<<plug1SubOffsetNeg);
2068 lvPlug1ModuleMotherNeg =
new GeoLogVol(
"Plug1Module",&plug1ModuleMotherNeg,matAir);
2070 lvPlug1ModuleMotherNeg =
new GeoLogVol(
"Plug1Module",plug1SubMotherNeg,matAir);
2073 PVLink pvPlug1ModuleMotherNeg =
new GeoPhysVol(lvPlug1ModuleMotherNeg);
2077 sectionBuilder->
fillSection(pvPlug1ModuleMotherNeg, 3,
2087 GeoTransform* tfPlug1ModuleMotherNeg =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
Z));
2089 pvITCModuleMotherNeg->add(tfPlug1ModuleMotherNeg);
2090 pvITCModuleMotherNeg->add(pvPlug1ModuleMotherNeg);
2111 checking(
"Plug2Module (-)",
false, 2,
2112 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2114 GeoTrd* plug2ModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2115 thicknessWedgeMother/2,
2118 heightWedgeMother/2);
2120 GeoLogVol* lvPlug2ModuleMotherNeg =
new GeoLogVol(
"Plug2Module",plug2ModuleMotherNeg,matAir);
2121 PVLink pvPlug2ModuleMotherNeg =
new GeoPhysVol(lvPlug2ModuleMotherNeg);
2125 sectionBuilder->
fillSection(pvPlug2ModuleMotherNeg, Ic10,
2136 GeoTransform* tfPlug2ModuleMotherNeg =
new GeoTransform(itcModuleSubShiftNeg);
2138 pvITCModuleMotherNeg->add(tfPlug2ModuleMotherNeg);
2139 pvITCModuleMotherNeg->add(pvPlug2ModuleMotherNeg);
2150 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(
Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./
Gaudi::Units::cm);
2154 <<
" zStandard= "<<zITCStandard<<
" zShift= " <<zShift
2157 GeoTransform* xtraITCNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2159 GeoTransform* ztraITCNeg =
new GeoTransform(GeoTrf::TranslateZ3D(zShift*
Gaudi::Units::cm));
2161 pvITCMotherNeg->add(zrotMod);
2162 pvITCMotherNeg->add(xtraITCNeg);
2163 pvITCMotherNeg->add(ztraITCNeg);
2164 pvITCMotherNeg->add(yrotMod);
2166 pvITCMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2167 pvITCMotherNeg->add(pvITCModuleMotherNeg);
2172 if (Ifgap && pvGapMotherNeg) {
2185 checking(
"GapModule (-)",
false, 2,
2186 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2188 GeoTrd* gapModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2189 thicknessWedgeMother/2,
2192 heightWedgeMother/2);
2194 GeoLogVol* lvGapModuleMotherNeg =
new GeoLogVol(
"GapModule",gapModuleMotherNeg,matAir);
2195 PVLink pvGapModuleMotherNeg =
new GeoPhysVol(lvGapModuleMotherNeg);
2199 sectionBuilder->
fillSection(pvGapModuleMotherNeg, 5,
2207 GeoTransform* xtraGapNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2209 pvGapMotherNeg->add(zrotMod);
2210 pvGapMotherNeg->add(xtraGapNeg);
2211 pvGapMotherNeg->add(yrotMod);
2213 pvGapMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2214 pvGapMotherNeg->add(pvGapModuleMotherNeg);
2218 if (Ifcrack && pvCrackMotherNeg) {
2231 checking(
"CrackModule (-)", spE4, 2,
2232 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2234 GeoTrd* crackModuleMotherNeg =
new GeoTrd(thicknessWedgeMother/2,
2235 thicknessWedgeMother/2,
2238 heightWedgeMother/2);
2240 GeoLogVol* lvCrackModuleMotherNeg =
new GeoLogVol(
"CrackModule",crackModuleMotherNeg,matAir);
2241 PVLink pvCrackModuleMotherNeg =
new GeoPhysVol(lvCrackModuleMotherNeg);
2245 sectionBuilder->
fillSection(pvCrackModuleMotherNeg, 6,
2252 GeoTransform* xtraCrackNeg =
new GeoTransform(GeoTrf::TranslateX3D(
2254 pvCrackMotherNeg->add(zrotMod);
2255 pvCrackMotherNeg->add(xtraCrackNeg);
2256 pvCrackMotherNeg->add(yrotMod);
2258 pvCrackMotherNeg->add(
new GeoIdentifierTag(ModuleNcp));
2259 pvCrackMotherNeg->add(pvCrackModuleMotherNeg);
2268 if ((Ifd4 || Ifc10) && pvITCMotherPos) {
2276 checking(
"ITCModule itcModuleSub2Pos (+)",
false, 1,
2277 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2279 GeoTrd* itcModuleSub1Pos =
new GeoTrd(thicknessWedgeMother/2,
2280 thicknessWedgeMother/2,
2283 heightWedgeMother/2 );
2290 checking(
"ITCModule itcModuleSub2Pos (+)",
false, 1,
2291 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2293 GeoTrd* itcModuleSub2Pos =
new GeoTrd(thicknessWedgeMother/2,
2294 thicknessWedgeMother/2,
2297 heightWedgeMother/2 );
2304 GeoTrf::Translate3D itcModule_SubShiftPos(
X, 0.,
Z);
2305 const GeoShapeUnion& itcModuleMotherPos = itcModuleSub1Pos->add(*itcModuleSub2Pos<<itcModule_SubShiftPos);
2307 GeoTrf::Translate3D itcModuleSubShiftPos(
X, 0.,
Z);
2309 GeoLogVol* lvITCModuleMotherPos =
new GeoLogVol(
"ITCModule",&itcModuleMotherPos,matAir);
2310 PVLink pvITCModuleMotherPos =
new GeoPhysVol(lvITCModuleMotherPos);
2330 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzITC1= "<<dzITC1
2336 dzGlue = (Glue - 2*NbPeriod * (dbManager->
TILBdzmast() + dbManager->
TILBdzspac())) / (4.*NbPeriod);
2339 + dbManager->
TILBdzspac())) / (4.*(NbPeriod-1));
2343 (*
m_log) <<
MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzGlue= "<<dzGlue<<
" NbPeriod= "<<NbPeriod
2348 (*m_log) << MSG::WARNING <<
" Plug1Module warning: "<<
" dzGlue= "<<dzGlue
2352 checking(
"Plug1Module plug1SubMotherPos (+)",
false, 2,
2353 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2355 GeoTrd* plug1SubMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2356 thicknessWedgeMother/2,
2359 heightWedgeMother/2 );
2362 double dzITC2Bis = (specialC10) ? 0.0 : dzITC2;
2366 (*m_log) <<
MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2368 GeoLogVol *lvPlug1ModuleMotherPos=0;
2369 if (thicknessWedgeMother > rless) {
2374 checking(
"Plug1Module plug2SubMotherPos (+)",
false, 2,
2375 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2377 GeoTrd* plug2SubMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2378 thicknessWedgeMother/2,
2381 heightWedgeMother/2 );
2386 const GeoShapeUnion& plug1ModuleMotherPos = plug1SubMotherPos->add(*plug2SubMotherPos<<plug1SubOffsetPos);
2388 lvPlug1ModuleMotherPos =
new GeoLogVol(
"Plug1Module",&plug1ModuleMotherPos,matAir);
2390 lvPlug1ModuleMotherPos =
new GeoLogVol(
"Plug1Module",plug1SubMotherPos,matAir);
2393 PVLink pvPlug1ModuleMotherPos =
new GeoPhysVol(lvPlug1ModuleMotherPos);
2397 sectionBuilder->
fillSection(pvPlug1ModuleMotherPos, 3,
2407 GeoTransform* tfPlug1ModuleMotherPos =
new GeoTransform(GeoTrf::Translate3D(0.,0.,
Z));
2409 pvITCModuleMotherPos->add(tfPlug1ModuleMotherPos);
2410 pvITCModuleMotherPos->add(pvPlug1ModuleMotherPos);
2431 checking(
"Plug2Module (+)",
false, 2,
2432 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2434 GeoTrd* plug2ModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2435 thicknessWedgeMother/2,
2438 heightWedgeMother/2);
2440 GeoLogVol* lvPlug2ModuleMotherPos =
new GeoLogVol(
"Plug2Module",plug2ModuleMotherPos,matAir);
2441 PVLink pvPlug2ModuleMotherPos =
new GeoPhysVol(lvPlug2ModuleMotherPos);
2445 sectionBuilder->
fillSection(pvPlug2ModuleMotherPos, Ic10,
2456 GeoTransform* tfPlug2ModuleMotherPos =
new GeoTransform(itcModuleSubShiftPos);
2458 pvITCModuleMotherPos->add(tfPlug2ModuleMotherPos);
2459 pvITCModuleMotherPos->add(pvPlug2ModuleMotherPos);
2468 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(
Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./
Gaudi::Units::cm);
2472 <<
" zStandard= "<<zITCStandard<<
" zShift= " <<zShift
2475 GeoTransform* xtraITCPos =
new GeoTransform(GeoTrf::TranslateX3D(
2477 GeoTransform* ztraITCPos =
new GeoTransform(GeoTrf::TranslateZ3D(zShift*
Gaudi::Units::cm));
2479 pvITCMotherPos->add(zrotMod);
2480 pvITCMotherPos->add(xtraITCPos);
2481 pvITCMotherPos->add(ztraITCPos);
2482 pvITCMotherPos->add(XYrtMod);
2484 pvITCMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2485 pvITCMotherPos->add(pvITCModuleMotherPos);
2491 if (Ifgap && pvGapMotherPos) {
2504 checking(
"Plug2Module (+)",
false, 2,
2505 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2507 GeoTrd* gapModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2508 thicknessWedgeMother/2,
2511 heightWedgeMother/2);
2513 GeoLogVol* lvGapModuleMotherPos =
new GeoLogVol(
"GapModule",gapModuleMotherPos,matAir);
2514 PVLink pvGapModuleMotherPos =
new GeoPhysVol(lvGapModuleMotherPos);
2518 sectionBuilder->
fillSection(pvGapModuleMotherPos, 5,
2526 GeoTransform* xtraGapPos =
new GeoTransform(GeoTrf::TranslateX3D(
2528 pvGapMotherPos->add(zrotMod);
2529 pvGapMotherPos->add(xtraGapPos);
2530 pvGapMotherPos->add(XYrtMod);
2532 pvGapMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2533 pvGapMotherPos->add(pvGapModuleMotherPos);
2537 if (Ifcrack && pvCrackMotherPos) {
2550 checking(
"CrackModule (+)", spE4, 2,
2551 thicknessWedgeMother/2,thicknessWedgeMother/2,dy1WedgeMother,dy2WedgeMother,heightWedgeMother/2);
2553 GeoTrd* crackModuleMotherPos =
new GeoTrd(thicknessWedgeMother/2,
2554 thicknessWedgeMother/2,
2557 heightWedgeMother/2);
2559 GeoLogVol* lvCrackModuleMotherPos =
new GeoLogVol(
"CrackModule",crackModuleMotherPos,matAir);
2560 PVLink pvCrackModuleMotherPos =
new GeoPhysVol(lvCrackModuleMotherPos);
2564 sectionBuilder->
fillSection(pvCrackModuleMotherPos, 6,
2572 GeoTransform* xtraCrackPos =
new GeoTransform(GeoTrf::TranslateX3D(
2574 pvCrackMotherPos->add(zrotMod);
2575 pvCrackMotherPos->add(xtraCrackPos);
2576 pvCrackMotherPos->add(XYrtMod);
2578 pvCrackMotherPos->add(
new GeoIdentifierTag(ModuleNcp));
2579 pvCrackMotherPos->add(pvCrackModuleMotherPos);
2602 if (EnvType == 1 && barrel_flag < 1) {
2604 GeoTransform* tfBarrelMother;
2613 GeoNameTag* ntBarrelModuleMother =
new GeoNameTag(
"Barrel");
2615 pvTileEnvelopeBarrel->add(tfBarrelMother);
2616 pvTileEnvelopeBarrel->add(ntBarrelModuleMother);
2617 pvTileEnvelopeBarrel->add(pvBarrelMother);
2619 GeoTransform* tfFingerMotherPos;
2625 (*m_log) << MSG::INFO <<
" Positioning positive barrel finger with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2627 GeoNameTag* ntFingerMotherPos =
new GeoNameTag(
"TileFingerPos");
2629 pvTileEnvelopeBarrel->add(tfFingerMotherPos);
2630 pvTileEnvelopeBarrel->add(ntFingerMotherPos);
2631 pvTileEnvelopeBarrel->add(pvFingerMotherPos);
2634 GeoTransform* tfSaddleMotherPos;
2640 GeoNameTag* ntSaddleMotherPos =
new GeoNameTag(
"TileSaddlePos");
2642 pvTileEnvelopeBarrel->add(tfSaddleMotherPos);
2643 pvTileEnvelopeBarrel->add(ntSaddleMotherPos);
2644 pvTileEnvelopeBarrel->add(pvSaddleMotherPos);
2649 GeoTransform* tfFingerMotherNeg;
2655 (*m_log) << MSG::INFO <<
" Positioning negative barrel finger with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2657 GeoNameTag* ntFingerMotherNeg =
new GeoNameTag(
"TileFingerNeg");
2658 pvTileEnvelopeBarrel->add(tfFingerMotherNeg);
2659 pvTileEnvelopeBarrel->add(ntFingerMotherNeg);
2660 pvTileEnvelopeBarrel->add(pvFingerMotherNeg);
2663 GeoTransform* tfSaddleMotherNeg;
2669 GeoNameTag* ntSaddleMotherNeg =
new GeoNameTag(
"TileSaddleNeg");
2671 pvTileEnvelopeBarrel->add(tfSaddleMotherNeg);
2672 pvTileEnvelopeBarrel->add(ntSaddleMotherNeg);
2673 pvTileEnvelopeBarrel->add(pvSaddleMotherNeg);
2680 if (EnvType == 3 && eb_flag) {
2686 double PoZ2 = modl_length/4 + PoZ1;
2691 if (dbManager->
BoolCuts() && barrel_flag < 2) {
2700 GeoTransform* tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2702 pvEBarrelMotherPos->add(tfIron1);
2703 pvEBarrelMotherPos->add(
new GeoIdentifierTag(1));
2704 pvEBarrelMotherPos->add(pvIron1);
2706 tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2708 pvEBarrelMotherPos->add(tfIron1);
2709 pvEBarrelMotherPos->add(pvIron1);
2718 GeoTransform* tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2720 pvEBarrelMotherPos->add(tfIron2);
2721 pvEBarrelMotherPos->add(
new GeoIdentifierTag(2));
2722 pvEBarrelMotherPos->add(pvIron2);
2724 tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2726 pvEBarrelMotherPos->add(tfIron2);
2727 pvEBarrelMotherPos->add(pvIron2);
2736 GeoTransform* tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2738 pvEBarrelMotherPos->add(tfIron3);
2739 pvEBarrelMotherPos->add(
new GeoIdentifierTag(3));
2740 pvEBarrelMotherPos->add(pvIron3);
2742 tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,PoZ2)
2744 pvEBarrelMotherPos->add(tfIron3);
2745 pvEBarrelMotherPos->add(pvIron3);
2752 GeoTransform* tfIrBoxL =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2754 pvEBarrelMotherPos->add(tfIrBoxL);
2755 pvEBarrelMotherPos->add(
new GeoIdentifierTag(4));
2756 pvEBarrelMotherPos->add(pvIrBox);
2758 GeoTransform* tfIrBoxR =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,PoZ2)
2760 pvEBarrelMotherPos->add(tfIrBoxR);
2761 pvEBarrelMotherPos->add(pvIrBox);
2770 GeoTransform* tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2771 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2773 pvEBarrelMotherPos->add(tfIrUp);
2774 pvEBarrelMotherPos->add(
new GeoIdentifierTag(5));
2775 pvEBarrelMotherPos->add(pvIrUp);
2778 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,-PoZ1)
2780 pvEBarrelMotherPos->add(tfIrUp);
2781 pvEBarrelMotherPos->add(pvIrUp);
2790 GeoTransform* tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2791 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2793 pvEBarrelMotherPos->add(tfIrDw);
2794 pvEBarrelMotherPos->add(
new GeoIdentifierTag(6));
2795 pvEBarrelMotherPos->add(pvIrDw);
2798 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2801 pvEBarrelMotherPos->add(tfIrDw);
2802 pvEBarrelMotherPos->add(pvIrDw);
2809 GeoTransform* tfEBarrelMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2812 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel with translation "<< ztrans*
Gaudi::Units::cm <<
endmsg;
2815 GeoNameTag* ntEBarrelMotherPos =
new GeoNameTag(
"EBarrelPos");
2816 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
2817 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
2818 pvTileEnvelopePosEndcap->add(
new GeoIdentifierTag(3));
2819 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
2822 if (barrel_flag < 2) {
2828 GeoTransform* tfEFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2831 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel finger with translation ztrans= "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2833 GeoNameTag* ntEFingerMotherPos =
new GeoNameTag(
"TileEFingerPos");
2835 pvTileEnvelopePosEndcap->add(tfEFingerMotherPos);
2836 pvTileEnvelopePosEndcap->add(ntEFingerMotherPos);
2837 pvTileEnvelopePosEndcap->add(pvEFingerMotherPos);
2844 GeoTransform* tfESaddleMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2847 (*m_log) << MSG::INFO <<
" Positioning positive ext.barrel saddle with translation ztrans= "<<ztrans*
Gaudi::Units::cm
2850 GeoNameTag* ntESaddleMotherPos =
new GeoNameTag(
"TileESaddlePos");
2852 pvTileEnvelopePosEndcap->add(tfESaddleMotherPos);
2853 pvTileEnvelopePosEndcap->add(ntESaddleMotherPos);
2854 pvTileEnvelopePosEndcap->add(pvESaddleMotherPos);
2862 if (EnvType == 2 && eb_flag) {
2868 double PoZ2 = modl_length/4 + PoZ1;
2873 if (dbManager->
BoolCuts() && barrel_flag < 2) {
2879 GeoTransform* tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2881 pvEBarrelMotherNeg->add(tfIron1);
2882 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(1));
2883 pvEBarrelMotherNeg->add(pvIron1);
2885 tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2887 pvEBarrelMotherNeg->add(tfIron1);
2888 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(2));
2889 pvEBarrelMotherNeg->add(pvIron1);
2896 GeoTransform* tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2898 pvEBarrelMotherNeg->add(tfIron2);
2899 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(2));
2900 pvEBarrelMotherNeg->add(pvIron2);
2902 tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2904 pvEBarrelMotherNeg->add(tfIron2);
2905 pvEBarrelMotherNeg->add(pvIron2);
2912 GeoTransform* tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,-PoZ2)
2914 pvEBarrelMotherNeg->add(tfIron3);
2915 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(3));
2916 pvEBarrelMotherNeg->add(pvIron3);
2918 tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(-dxIron,PosY+dyIron,-PoZ2)
2920 pvEBarrelMotherNeg->add(tfIron3);
2921 pvEBarrelMotherNeg->add(pvIron3);
2927 GeoTransform* tfIrBoxL =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,-PoZ2)
2929 pvEBarrelMotherNeg->add(tfIrBoxL);
2930 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(4));
2931 pvEBarrelMotherNeg->add(pvIrBox);
2933 GeoTransform* tfIrBoxR =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *GeoTrf::Translate3D(-dxIron,PosY-dyIron,-PoZ2)
2935 pvEBarrelMotherNeg->add(tfIrBoxR);
2936 pvEBarrelMotherNeg->add(pvIrBox);
2943 GeoTransform* tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2944 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2946 pvEBarrelMotherNeg->add(tfIrUp);
2947 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(5));
2948 pvEBarrelMotherNeg->add(pvIrUp);
2951 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,PoZ1)
2953 pvEBarrelMotherNeg->add(tfIrUp);
2954 pvEBarrelMotherNeg->add(pvIrUp);
2961 GeoTransform* tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)
2962 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2964 pvEBarrelMotherNeg->add(tfIrDw);
2965 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(6));
2966 pvEBarrelMotherNeg->add(pvIrDw);
2969 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2972 pvEBarrelMotherNeg->add(tfIrDw);
2973 pvEBarrelMotherNeg->add(pvIrDw);
2981 GeoTransform* tfEBarrelMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
2984 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel with translation ztrans "<<ztrans*
Gaudi::Units::cm<<
endmsg;
2986 GeoNameTag* ntEBarrelMotherNeg =
new GeoNameTag(
"EBarrelNeg");
2988 pvTileEnvelopeNegEndcap->add(tfEBarrelMotherNeg);
2989 pvTileEnvelopeNegEndcap->add(ntEBarrelMotherNeg);
2990 pvTileEnvelopeNegEndcap->add(
new GeoIdentifierTag(2));
2991 pvTileEnvelopeNegEndcap->add(pvEBarrelMotherNeg);
2993 if (barrel_flag < 2) {
2999 GeoTransform* tfEFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3002 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel finger with translation ztrans= "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3004 GeoNameTag* ntEFingerMotherNeg =
new GeoNameTag(
"TileEFingerNeg");
3006 pvTileEnvelopeNegEndcap->add(tfEFingerMotherNeg);
3007 pvTileEnvelopeNegEndcap->add(ntEFingerMotherNeg);
3008 pvTileEnvelopeNegEndcap->add(pvEFingerMotherNeg);
3015 GeoTransform* tfESaddleMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3018 (*m_log) << MSG::INFO <<
" Positioning negative ext.barrel saddle with translation ztrans= "<<ztrans*
Gaudi::Units::cm
3021 GeoNameTag* ntESaddleMotherNeg =
new GeoNameTag(
"TileESaddleNeg");
3023 pvTileEnvelopeNegEndcap->add(tfESaddleMotherNeg);
3024 pvTileEnvelopeNegEndcap->add(ntESaddleMotherNeg);
3025 pvTileEnvelopeNegEndcap->add(pvESaddleMotherNeg);
3037 if (barrel_flag < 3) {
3048 GeoTransform* tfITCMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm) *
3051 GeoNameTag* ntITCMotherPos =
new GeoNameTag(
"ITCPos");
3053 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
3054 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
3055 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
3059 if (barrel_flag < 4) {
3066 GeoTransform* tfGapMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3069 GeoNameTag* ntGapMotherPos =
new GeoNameTag(
"GapPos");
3071 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
3072 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
3073 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
3078 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
3083 if (crack_flag<=0) {
3084 (*m_log) << MSG::INFO <<
" Positioning positive Crack with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3085 }
else if (crack_flag==1) {
3086 (*m_log) << MSG::INFO <<
" Positioning positive Crack in separate mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3089 (*m_log) << MSG::INFO <<
" Positioning positive Crack in " << pvTileEnvelopePosCrack->getLogVol()->getName() <<
" mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3092 GeoTransform* tfCrackMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3095 GeoNameTag* ntCrackMotherPos =
new GeoNameTag(
"CrackPos");
3097 if (crack_flag<=0) {
3098 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
3099 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
3100 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
3102 pvTileEnvelopePosCrack->add(tfCrackMotherPos);
3103 pvTileEnvelopePosCrack->add(ntCrackMotherPos);
3104 pvTileEnvelopePosCrack->add(pvCrackMotherPos);
3107 (*m_log) << MSG::INFO <<
" Do not create positive Crack"<<
endmsg;
3119 if (barrel_flag < 3) {
3126 GeoTransform* tfITCMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3129 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"ITCNeg");
3131 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
3132 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
3133 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
3137 if (barrel_flag < 4) {
3144 GeoTransform* tfGapMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3147 GeoNameTag* ntGapMotherNeg =
new GeoNameTag(
"GapNeg");
3149 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
3150 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
3151 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
3156 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
3161 if (crack_flag<=0) {
3162 (*m_log) << MSG::INFO <<
" Positioning negative Crack with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3163 }
else if (crack_flag==1) {
3164 (*m_log) << MSG::INFO <<
" Positioning negative Crack in separate mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3167 (*m_log) << MSG::INFO <<
" Positioning positive Crack in " << pvTileEnvelopeNegCrack->getLogVol()->getName() <<
" mother volume with translation "<<ztrans*
Gaudi::Units::cm<<
endmsg;
3170 GeoTransform* tfCrackMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*
Gaudi::Units::cm)*
3173 GeoNameTag* ntCrackMotherNeg =
new GeoNameTag(
"CrackNeg");
3175 if (crack_flag<=0) {
3176 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
3177 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
3178 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
3180 pvTileEnvelopeNegCrack->add(tfCrackMotherNeg);
3181 pvTileEnvelopeNegCrack->add(ntCrackMotherNeg);
3182 pvTileEnvelopeNegCrack->add(pvCrackMotherNeg);
3185 (*m_log) << MSG::INFO <<
" Do not create negative Crack"<<
endmsg;
3195 if (barrel_flag<4 || (barrel_flag==4 && crack_flag<2) ) {
3199 int nModulesInSection[6] = {0,0,0,0,0,0};
3200 double zShiftInSection[6] = {0.0,0.0,0.0,0.0,0.0,0.0,};
3203 for (
int EnvCounter = 0; EnvCounter < dbManager->
GetNumberOfEnv(); ++EnvCounter) {
3212 <<
" EnvCounter is " << EnvCounter
3213 <<
" EnvType is " << EnvType
3218 if (EnvType == 1 || EnvType == 0) {
3219 nModulesInSection[0] = nModulesInSection[1] = NumberOfMod;
3220 zShiftInSection[0] = zShiftInSection[1] = Zshift;
3221 }
else if (EnvType < 6) {
3222 nModulesInSection[EnvType] = NumberOfMod;
3223 zShiftInSection[EnvType] = Zshift;
3231 int side[6] = {0,1,0,1,0,1};
3234 (*m_log) <<
MSG::DEBUG <<
"Loop over Tile detector regions, and call computeCellDim() when needed..." <<
endmsg;
3235 for (
int ii=0; ii<6; ++ii) {
3237 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
endmsg;
3240 (*m_log) <<
MSG::DEBUG <<
"ii: " << ii <<
", region: " << dete[ii] <<
" --> calling computeCellDim()..." <<
endmsg;
3243 zShiftInSection[ii+1],
3244 zShiftInSection[ii]);
3252 nModulesInSection[ii],
3253 zShiftInSection[ii]);
3255 (*m_log) <<
MSG::DEBUG <<
"Get an Identifier for the region and add it to the detectorManager..." <<
endmsg;
3257 descriptor->
set(idRegion);
3264 GeoNameTag *
nTag =
new GeoNameTag(
"Tile");
3266 if (BAR && barrel_flag<1) {
3277 (*m_log) << MSG::INFO <<
" Global positioning of barrel with rotation ("
3280 <<
") Gaudi::Units::cm" <<
endmsg;
3282 world->add(barrelTT);
3283 world->add(pvTileEnvelopeBarrel);
3287 if (EBA && eb_flag) {
3298 (*m_log) << MSG::INFO <<
" Global positioning of positive ext.barrel with rotation ("
3301 <<
") Gaudi::Units::cm" <<
endmsg;
3303 world->add(posEcTT);
3304 world->add(pvTileEnvelopePosEndcap);
3308 if (EBC && eb_flag) {
3319 (*m_log) << MSG::INFO <<
" Global positioning of negative ext.barrel with rotation ("
3322 <<
") Gaudi::Units::cm" <<
endmsg;
3324 world->add(negEcTT);
3325 world->add(pvTileEnvelopeNegEndcap);
3330 if (crack_flag==1) {
3333 if (EBA && pvTileEnvelopePosCrack) {
3345 (*m_log) << MSG::INFO <<
" Global positioning of positive Crack with rotation ("
3348 <<
") Gaudi::Units::cm" <<
endmsg;
3350 world->add(posCrackTT);
3351 world->add(pvTileEnvelopePosCrack);
3357 if (EBC && pvTileEnvelopeNegCrack) {
3369 (*m_log) << MSG::INFO <<
" Global positioning of negative Crack with rotation ("
3372 <<
") Gaudi::Units::cm" <<
endmsg;
3374 world->add(negCrackTT);
3375 world->add(pvTileEnvelopeNegCrack);
3381 delete sectionBuilder;