104 bool EBC =
true , BAR =
true , EBA =
true ;
105 int NcpFrom = 1, NcpPlus = 63;
110 double AnglMin = (NcpFrom-1)*
deltaPhi*Gaudi::Units::deg, AnglMax = (NcpPlus+1)*
deltaPhi*Gaudi::Units::deg;
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;
141 RadiusSaddle = dbManager->
RadiusSaddle()*Gaudi::Units::cm;
142 if (
m_log->level()<=MSG::DEBUG)
143 (*m_log) << MSG::DEBUG <<
" DzSaddleSupport()= "<<DzSaddleSupport<<
" RadiusSaddle= "<<RadiusSaddle
147 if (
m_log->level()<=MSG::DEBUG) {
148 (*m_log) <<MSG::DEBUG <<
"TileAtlasFactory. addPlates = " <<
m_switches.addPlatesToCell<<
endmsg;
149 (*m_log) <<MSG::DEBUG <<
"TileAtlasFactory. crackOption = " <<
m_switches.crackOption<<
endmsg;
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) );
156 if (
m_log->level()<=MSG::DEBUG) {
157 (*m_log) << MSG::DEBUG <<
"barrel_flag " << barrel_flag <<
endmsg;
158 (*m_log) << MSG::DEBUG <<
"crack_flag " << crack_flag <<
endmsg;
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;
249 BFingerLength = BFingerLengthNeg = BFingerLengthPos = dbManager->
TIFGdz()*Gaudi::Units::cm;
251 double EBFingerLength =0;
252 double EBFingerLengthNeg =0;
253 double EBFingerLengthPos =0;
257 EBFingerLength = EBFingerLengthNeg = EBFingerLengthPos = dbManager->
TIFGdz()*Gaudi::Units::cm;
263 if (
m_log->level()<=MSG::DEBUG)
264 (*m_log) << MSG::DEBUG <<
"n_env " << n_env <<
endmsg;
266 for (
int i = 0; i < n_env ; ++i) {
277 EnvDZPos [
Type] = dbManager->
GetEnvDZ()*Gaudi::Units::cm;
282 FingerRmax = std::max(FingerRmax,dbManager->
GetEnvRout()*Gaudi::Units::cm);
292 PosDelta = EnvDZPos[3] - EnvDZPos[1];
293 if (
m_log->level()<=MSG::DEBUG)
294 (*m_log) << MSG::DEBUG <<
" BFingerLengthPos "<<BFingerLengthPos<<
" PosDelta "<<PosDelta;
295 if (std::abs(PosDelta) < std::abs(EBFingerLength - BFingerLength) ) {
296 BFingerLengthPos += PosDelta;
297 if (
m_log->level()<=MSG::DEBUG)
298 (*m_log) <<
" => New BFingerLengthPos "<<BFingerLengthPos<<
endmsg;
301 BFingerLengthPos = BFingerLength;
303 if (
m_log->level()<=MSG::DEBUG)
304 (*m_log) <<
" => New PosDelta "<<PosDelta<<
endmsg;
312 NegDelta = (-EnvDZPos[2] + EnvDZPos[1]);
313 if (
m_log->level()<=MSG::DEBUG)
314 (*m_log) << MSG::DEBUG <<
" BFingerLengthNeg "<<BFingerLengthNeg<<
" NegDelta "<<NegDelta;
315 if (std::abs(NegDelta) < std::abs(EBFingerLength - BFingerLength) ) {
316 BFingerLengthNeg += NegDelta;
317 if (
m_log->level()<=MSG::DEBUG)
318 (*m_log) <<
" => New BFingerLengthNeg "<<BFingerLengthNeg<<
endmsg;
321 BFingerLengthNeg = BFingerLength;
323 if (
m_log->level()<=MSG::DEBUG)
324 (*m_log) <<
" => New NegDelta "<<NegDelta<<
endmsg;
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;
363 BFingerRmin = dbManager->
TILBrmax()*Gaudi::Units::cm;
365 EFingerRmin = dbManager->
TILBrmax()*Gaudi::Units::cm;
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];
388 GeoPcon* tileEnvPconeBarrel =
new GeoPcon(PhiMin[1]*Gaudi::Units::deg, PhiMax[1]*Gaudi::Units::deg);
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;
420 if (
m_log->level()<=MSG::DEBUG) {
421 (*m_log) << MSG::DEBUG
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;
455 PosBeginGap = PosBeginCrack + 0.9 * Gaudi::Units::cm;
456 PosEndGap = PosBeginGap + GapWidth;
459 if (
m_log->level()<=MSG::DEBUG)
460 (*m_log) << MSG::DEBUG <<
" PosBeginITC2 = " << PosBeginITC2
461 <<
" PosBeginGap = " << PosBeginGap
462 <<
" PosEndGap = " << PosEndGap
463 <<
" PosBeginCrack = " << PosBeginCrack
464 <<
" PosEndCrack = " << PosEndCrack
469 double PosRminITC1 = dbManager->
TILBrminimal()*Gaudi::Units::cm;
471 double PosRminITC = rMinC10 *Gaudi::Units::cm;
473 double PosRminGap = rMinE2pos*Gaudi::Units::cm;
475 double PosRminCrack = rMinE4pos*Gaudi::Units::cm;
476 double PosRmaxCrack = rMaxE3pos*Gaudi::Units::cm;
478 double PosRminExt = RInMin[3];
481 double PosRmaxTotal = ROutMax[3];
483 if (
m_log->level()<=MSG::DEBUG)
484 (*m_log) << MSG::DEBUG
485 <<
" PosRminITC1 = " << PosRminITC1
486 <<
" PosRminITC2 = " << PosRminITC
487 <<
" PosRminGap = " << PosRminGap
488 <<
" PosRmaxCrack = " << PosRmaxCrack
489 <<
" PosRminCrack = " << PosRminCrack
490 <<
" PosRminExt = " << PosRminExt
491 <<
" PosRmaxTotal = " << PosRmaxTotal
496 GeoPcon* tileEnvPconePosEndcap =
new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
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);
530 GeoPcon* tileEnvPconePosCrack =
new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
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;
549 if (
m_log->level()<=MSG::DEBUG) {
550 (*m_log) << MSG::DEBUG
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;
584 NegBeginGap = NegBeginCrack + 0.9 * Gaudi::Units::cm;
585 NegEndGap = NegBeginGap + GapWidth;
588 if (
m_log->level()<=MSG::DEBUG)
589 (*m_log) << MSG::DEBUG <<
" NegBeginITC2 = " << NegBeginITC2
590 <<
" NegBeginGap = " << NegBeginGap
591 <<
" NegEndGap = " << NegEndGap
592 <<
" NegBeginCrack = " << NegBeginCrack
593 <<
" NegEndCrack = " << NegEndCrack
598 double NegRminITC1 = dbManager->
TILBrminimal()*Gaudi::Units::cm;
600 double NegRminITC = rMinC10 *Gaudi::Units::cm;
602 double NegRminGap = rMinE2neg*Gaudi::Units::cm;
604 double NegRminCrack = rMinE4neg*Gaudi::Units::cm;
605 double NegRmaxCrack = rMaxE3neg*Gaudi::Units::cm;
608 double NegRminExt = RInMin[2];
611 double NegRmaxTotal = ROutMax[2];
613 if (
m_log->level()<=MSG::DEBUG)
614 (*m_log) << MSG::DEBUG
615 <<
" NegRminITC1 = " << NegRminITC1
616 <<
" NegRminITC2 = " << NegRminITC
617 <<
" NegRminGap = " << NegRminGap
618 <<
" NegRmaxCrack = " << NegRmaxCrack
619 <<
" NegRminCrack = " << NegRminCrack
620 <<
" NegRminExt = " << NegRminExt
621 <<
" NegRmaxTotal = " << NegRmaxTotal
626 GeoPcon* tileEnvPconeNegEndcap =
new GeoPcon(PhiMin[2]*Gaudi::Units::deg, PhiMax[2]*Gaudi::Units::deg);
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);
660 GeoPcon* tileEnvPconeNegCrack =
new GeoPcon(PhiMin[3]*Gaudi::Units::deg, PhiMax[3]*Gaudi::Units::deg);
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;
731 if (
m_log->level()<=MSG::DEBUG)
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) {
916 if (
m_log->level()<=MSG::DEBUG)
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;
924 GeoTubs* GeneralMother =
new GeoTubs(dbManager->
GetEnvRin()*Gaudi::Units::cm,
929 GeoTubs* barrelMother = GeneralMother;
930 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
931 pvBarrelMother =
new GeoPhysVol(lvBarrelMother);
933 if (
m_log->level()<=MSG::DEBUG)
934 (*m_log) << MSG::DEBUG <<
"Barrel envelope parameters: "
935 <<
" Length=" << zEndSection
936 <<
" Rmin=" << dbManager->
GetEnvRin()*Gaudi::Units::cm
937 <<
" Rmax=" << dbManager->
GetEnvRout()*Gaudi::Units::cm
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);
968 if (
m_log->level()<=MSG::DEBUG)
969 (*m_log) << MSG::DEBUG <<
"Barrel finger envelope parameters: "
970 <<
" length Pos/Neg=" << BFingerLengthPos <<
"/" << BFingerLengthNeg
971 <<
" Rmin=" << BFingerRmin <<
" Rmax=" << dbManager->
GetEnvRout()*Gaudi::Units::cm
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) {
988 if (
m_log->level()<=MSG::DEBUG)
989 (*m_log) << MSG::DEBUG <<
" EBarrelPos DZ "<<(dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2<<
endmsg;
993 AnglMin,AnglMax,(dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2);
995 GeoTubs* GeneralMother =
new GeoTubs(dbManager->
GetEnvRin()*Gaudi::Units::cm,
997 (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2,
1000 GeoTubs* ebarrelMotherPos = GeneralMother;
1001 GeoLogVol* lvEBarrelMotherPos =
new GeoLogVol(
"EBarrel",ebarrelMotherPos,matAir);
1002 pvEBarrelMotherPos =
new GeoPhysVol(lvEBarrelMotherPos);
1004 if (
m_log->level()<=MSG::DEBUG)
1005 (*m_log) << MSG::DEBUG <<
"Positive ext.barrel envelope parameters: "
1006 <<
" length=" << (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLength)
1007 <<
" Rmin=" << dbManager->
GetEnvRin()*Gaudi::Units::cm
1008 <<
" Rmax=" << dbManager->
GetEnvRout()*Gaudi::Units::cm
1011 if (barrel_flag < 2) {
1014 EFingerRmin,dbManager->
GetEnvRout()*Gaudi::Units::cm,
1015 AnglMin,AnglMax, EBFingerLength/2);
1017 GeoTubs* fingerMother =
new GeoTubs(EFingerRmin,
1022 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",fingerMother,matAir);
1023 pvEFingerMotherPos =
new GeoPhysVol(lvEFingerMother);
1025 if (
m_log->level()<=MSG::DEBUG)
1026 (*m_log) << MSG::DEBUG <<
"Positive ext.barrel finger envelope parameters: "
1027 <<
" length=" << EBFingerLength
1028 <<
" Rmin=" << EFingerRmin
1029 <<
" Rmax=" << (dbManager->
GetEnvRout())*Gaudi::Units::cm
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) {
1049 if (
m_log->level()<=MSG::DEBUG)
1050 (*m_log) << MSG::DEBUG <<
" EBarrelNeg DZ "<<(dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2<<
endmsg;
1052 GeoTubs* GeneralMother =
new GeoTubs(dbManager->
GetEnvRin()*Gaudi::Units::cm,
1054 (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2,
1057 GeoTubs* ebarrelMotherNeg = GeneralMother;
1058 GeoLogVol* lvEBarrelMotherNeg =
new GeoLogVol(
"EBarrel",ebarrelMotherNeg,matAir);
1059 pvEBarrelMotherNeg =
new GeoPhysVol(lvEBarrelMotherNeg);
1061 if (
m_log->level()<=MSG::DEBUG)
1062 (*m_log) << MSG::DEBUG <<
"Nevative ext.barrel envelope parameters: "
1063 <<
" length=" << (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLength)
1064 <<
" Rmin=" << dbManager->
GetEnvRin()*Gaudi::Units::cm
1065 <<
" Rmax=" << dbManager->
GetEnvRout()*Gaudi::Units::cm
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);
1078 if (
m_log->level()<=MSG::DEBUG)
1079 (*m_log) << MSG::DEBUG <<
"Negative ext.barrel finger envelope parameters: "
1080 <<
" length=" << EBFingerLengthNeg
1081 <<
" Rmin=" << EFingerRmin
1082 <<
" Rmax=" << dbManager->
GetEnvRout()*Gaudi::Units::cm
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 "
1118 <<
" Rmin= "<<rMinITC1*Gaudi::Units::cm<<
" Rmax= "<<rMaxITC1*Gaudi::Units::cm<<
" dzITC1= "<<dzITC1/2*Gaudi::Units::cm<<
endmsg;
1119 (*m_log) << MSG::INFO <<
" PLUG2 "
1120 <<
" Rmin= "<<rMinITC2*Gaudi::Units::cm<<
" Rmax= "<<rMaxITC2*Gaudi::Units::cm<<
" dzITC2= "<<dzITC2/2*Gaudi::Units::cm<<
endmsg;
1122 checking(
"ITC itcWheel1 (+)",
false, 0,
1123 rMinITC1*Gaudi::Units::cm,rMaxITC1*Gaudi::Units::cm, AnglMin,AnglMax, dzITC1/2*Gaudi::Units::cm);
1125 GeoTubs* itcWheel1 =
new GeoTubs(rMinITC1*Gaudi::Units::cm,
1126 rMaxITC1*Gaudi::Units::cm,
1127 dzITC1/2*Gaudi::Units::cm,
1130 checking(
"ITC itcWheel2 (+)",
false, 0,
1131 rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm, AnglMin,AnglMax, dzITC2/2*Gaudi::Units::cm);
1133 GeoTubs* itcWheel2 =
new GeoTubs(rMinITC2*Gaudi::Units::cm,
1134 rMaxITC2*Gaudi::Units::cm,
1135 dzITC2/2*Gaudi::Units::cm,
1138 Z = ( dzITC1 - dzITC2)/2*Gaudi::Units::cm;
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) {
1158 AnglMin,AnglMax, dbManager->
TILBdzmodul()/2*Gaudi::Units::cm);
1160 GeoTubs* GapMotherPos =
new GeoTubs(dbManager->
TILBrminimal()*Gaudi::Units::cm,
1165 GeoLogVol* lvGapMotherPos =
new GeoLogVol(
"Gap",GapMotherPos,matAir);
1166 pvGapMotherPos =
new GeoPhysVol(lvGapMotherPos);
1171 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
1176 rMinE4pos*Gaudi::Units::cm,
1178 AnglMin,AnglMax, dbManager->
TILBdzmodul()/2*Gaudi::Units::cm);
1180 GeoTubs* crackMotherPos =
new GeoTubs(rMinE4pos*Gaudi::Units::cm,
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 "
1208 <<
" Rmin= "<<rMinITC1*Gaudi::Units::cm<<
" Rmax= "<<rMaxITC1*Gaudi::Units::cm<<
" dzITC1= "<<dzITC1/2*Gaudi::Units::cm<<
endmsg;
1209 (*m_log) << MSG::INFO <<
" PLUG2 "
1210 <<
" Rmin= "<<rMinITC2*Gaudi::Units::cm<<
" Rmax= "<<rMaxITC2*Gaudi::Units::cm<<
" dzITC2= "<<dzITC2/2*Gaudi::Units::cm<<
endmsg;
1212 checking(
"ITC itcWheel1 (-)",
false, 0,
1213 rMinITC1*Gaudi::Units::cm,rMaxITC1*Gaudi::Units::cm, AnglMin,AnglMax, dzITC1/2*Gaudi::Units::cm);
1215 GeoTubs* itcWheel1 =
new GeoTubs(rMinITC1*Gaudi::Units::cm,
1216 rMaxITC1*Gaudi::Units::cm,
1217 dzITC1/2*Gaudi::Units::cm,
1220 checking(
"ITC itcWheel2 (-)",
false, 0,
1221 rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm, AnglMin,AnglMax, dzITC2/2*Gaudi::Units::cm);
1223 GeoTubs* itcWheel2 =
new GeoTubs(rMinITC2*Gaudi::Units::cm,
1224 rMaxITC2*Gaudi::Units::cm,
1225 dzITC2/2*Gaudi::Units::cm,
1228 Z = (-dzITC1 + dzITC2)/2*Gaudi::Units::cm;
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) {
1248 AnglMin,AnglMax, dbManager->
TILBdzmodul()/2*Gaudi::Units::cm);
1250 GeoTubs* GapMotherNeg =
new GeoTubs(dbManager->
TILBrminimal()*Gaudi::Units::cm,
1255 GeoLogVol* lvGapMotherNeg =
new GeoLogVol(
"Gap",GapMotherNeg,matAir);
1256 pvGapMotherNeg =
new GeoPhysVol(lvGapMotherNeg);
1261 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
1266 rMinE4neg*Gaudi::Units::cm,
1268 AnglMin,AnglMax, dbManager->
TILBdzmodul()/2*Gaudi::Units::cm);
1270 GeoTubs* crackMotherNeg =
new GeoTubs(rMinE4neg*Gaudi::Units::cm,
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))};
1295 GeoIntrusivePtr<GeoTransform> XYrtMod{
new GeoTransform(GeoTrf::RotateX3D(180*Gaudi::Units::deg) * GeoTrf::RotateY3D(90*Gaudi::Units::deg))};
1297 for (
int ModCounter = 0; ModCounter < NumberOfMod; ModCounter++) {
1299 ModuleNcp = ModuleIndex[ModCounter];
1302 double phi = (double(ModuleNcp-1) + 0.5)*
deltaPhi;
1303 double ph1 = (double(ModuleNcp-1))*
deltaPhi;
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;
1321 if (
m_log->level()<=MSG::DEBUG)
1322 (*m_log) << MSG::DEBUG <<
" ModuleNcp= "<< ModuleNcp <<
" ModType "<< ModType <<
" Phi "<<
phi <<
endmsg;
1328 if ( EnvType == 1 && barrel_flag < 1) {
1332 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
1334 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1335 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
1374 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax())*Gaudi::Units::cm;
1375 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2*Gaudi::Units::deg)*Gaudi::Units::cm;
1376 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2*Gaudi::Units::deg)*Gaudi::Units::cm;
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,
1396 BFingerLengthPos*(1./Gaudi::Units::cm));
1398 GeoTransform* xtraModFingerPos =
new GeoTransform(GeoTrf::TranslateX3D((dbManager->
TILErmax() + dbManager->
TILBrmax())/2*Gaudi::Units::cm));
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,
1429 BFingerLengthNeg*(1./Gaudi::Units::cm));
1431 GeoTransform* xtraModFingerNeg =
new GeoTransform(GeoTrf::TranslateX3D((dbManager->
TILErmax() + dbManager->
TILBrmax())/2*Gaudi::Units::cm));
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) {
1472 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
1474 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1475 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
1493 if (
m_log->level()<=MSG::DEBUG)
1494 (*m_log) << MSG::DEBUG <<
" BoolCuts NO "<< dbManager->
BoolCuts() <<
endmsg;
1496 lvEBarrelModuleMotherPos =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherPos,matAir);
1497 pvEBarrelModuleMotherPos =
new GeoPhysVol(lvEBarrelModuleMotherPos);
1502 if (
m_log->level()<=MSG::DEBUG)
1503 (*m_log) << MSG::DEBUG <<
" BoolCuts YES "<< dbManager->
BoolCuts() <<
endmsg;
1505 double PoZ2 =0, PoZ1 =0, thicknessEndPlate =dbManager->
TILBdzend1()*Gaudi::Units::cm;
1507 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
1508 PoZ2 = PoZ1 + modl_length/4;
1510 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1511 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius) * GeoTrf::RotateX3D((90-
phi)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1512 * GeoTrf::Translate3D(-PoZ2,0.,-PosY);
1514 if (ModuleNcp>=60 && ModuleNcp<=62) {
1515 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1516 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(
phi*Gaudi::Units::deg)
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) {
1526 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1527 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(
phi*Gaudi::Units::deg)
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);
1624 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
1625 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
1626 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1627 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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) {
1685 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
1687 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1688 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
1706 if (
m_log->level()<=MSG::DEBUG)
1707 (*m_log) << MSG::DEBUG <<
" BoolCuts NO "<< dbManager->
BoolCuts() <<
endmsg;
1709 lvEBarrelModuleMotherNeg =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMotherNeg,matAir);
1710 pvEBarrelModuleMotherNeg =
new GeoPhysVol(lvEBarrelModuleMotherNeg);
1715 if (
m_log->level()<=MSG::DEBUG)
1716 (*m_log) << MSG::DEBUG <<
" BoolCuts YES "<< dbManager->
BoolCuts() <<
endmsg;
1718 double PoZ2 =0, PoZ1 =0, thicknessEndPlate = dbManager->
TILBdzend1()*Gaudi::Units::cm;
1720 PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2;
1721 PoZ2 = PoZ1 + modl_length/4;
1723 if ((ModuleNcp>=35 && ModuleNcp<=37) || (ModuleNcp>=60 && ModuleNcp<=62)) {
1724 GeoTrf::Transform3D TransCut2 = GeoTrf::TranslateZ3D(-Radius)
1725 * GeoTrf::RotateX3D((
phi-90)*Gaudi::Units::deg) * GeoTrf::RotateY3D(180*Gaudi::Units::deg)
1726 * GeoTrf::Translate3D(-PoZ2,0,-PosY);
1728 if (ModuleNcp>=60 && ModuleNcp<=62) {
1729 GeoTrf::Transform3D TransCutL = GeoTrf::TranslateZ3D(-Radius)
1730 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-
phi*Gaudi::Units::deg)
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) {
1740 GeoTrf::Transform3D TransCutR = GeoTrf::TranslateZ3D(-Radius)
1741 * GeoTrf::RotateY3D(180*Gaudi::Units::deg) * GeoTrf::RotateX3D(-
phi*Gaudi::Units::deg)
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);
1841 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
1842 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
1843 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1844 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
1911 if (
m_log->level()<=MSG::DEBUG)
1912 (*m_log) << MSG::DEBUG <<
" ITC : EnvType "<<EnvType<<
" Size = "<<dbManager->
GetModTypeSize()
1913 <<
" Ncp= "<<ModuleNcp<<
" D4 "<<Id4<<
" specialflag = "<<Ifspecialgirder<<
" C10 "<<Ic10<<
" Gap "<<Igap<<
" Crack "<<Icrack
1922 if (
m_log->level()<=MSG::DEBUG)
1923 (*m_log) << MSG::DEBUG <<
" C10 unavailable "<<
endmsg;
1931 if (Ifspecialgirder) {
1932 if (
m_log->level()<=MSG::DEBUG)
1933 (*m_log) << MSG::DEBUG <<
" dzITC1 changed from "<<dzITC1<<
" to "<<dbManager->
TILBdzgir()<<
endmsg;
1937 (*m_log) << MSG::INFO <<
" D4 unavailable "<<
endmsg;
1941 bool specialC10 = (Ifd4 && Ifc10 && rMaxITC2 < rMinITC1);
1943 rMaxITC2 = rMinITC1;
1950 if ((Ifd4 || Ifc10) && pvITCMotherNeg) {
1953 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
1954 heightWedgeMother = (rMaxITC1 - rMinITC1) * Gaudi::Units::cm;
1955 dy1WedgeMother = rMinITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1956 dy2WedgeMother = rMaxITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
1967 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
1968 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
1969 dy1WedgeMother = rMinITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
1970 dy2WedgeMother = rMaxITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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 );
1981 X = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
1982 Z = ((rMinITC2+rMaxITC2)-(rMaxITC1 + rMinITC1))/2*Gaudi::Units::cm;
1983 if (
m_log->level()<=MSG::DEBUG)
1984 (*m_log) << MSG::DEBUG <<
" ITCModule Negative, position X= "<<X<<
" Z= "<<Z<<
endmsg;
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);
2002 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2003 heightWedgeMother = (rMaxITC1 - dbManager->
TILBrmin()) * Gaudi::Units::cm;
2004 dy1WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2005 dy2WedgeMother = rMaxITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2010 if (
m_log->level()<=MSG::DEBUG)
2011 (*m_log) << MSG::DEBUG <<
" Plug1Module : Glue= "<<Glue<<
" dzITC1= "<<dzITC1
2017 dzGlue = (Glue - 2*NbPeriod * (dbManager->
TILBdzmast() + dbManager->
TILBdzspac())) / (4.*NbPeriod);
2022 if (
m_log->level()<=MSG::DEBUG)
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;
2042 thicknessWedgeMother = (dbManager->
TILBdzmodul() - dzITC2Bis) * Gaudi::Units::cm;
2043 if (
m_log->level()<=MSG::DEBUG)
2045 (*m_log) << MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2047 GeoLogVol *lvPlug1ModuleMotherNeg=0;
2048 if (thicknessWedgeMother > rless) {
2050 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2051 dy2WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
2062 GeoTrf::Translate3D plug1SubOffsetNeg(-dzITC2Bis*Gaudi::Units::cm/2, 0.,
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);
2098 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
2100 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2101 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
2148 Z = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2150 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./Gaudi::Units::cm);
2152 if (
m_log->level()<=MSG::DEBUG)
2153 (*m_log) << MSG::DEBUG <<
" ITCModule Negative, position X= "<<X<<
" Z= "<<Z
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) {
2178 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
2180 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2181 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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) {
2224 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
2226 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2227 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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) {
2271 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2272 heightWedgeMother = (rMaxITC1 - rMinITC1) * Gaudi::Units::cm;
2273 dy1WedgeMother = rMinITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2274 dy2WedgeMother = rMaxITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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 );
2285 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
2286 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
2287 dy1WedgeMother = rMinITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2288 dy2WedgeMother = rMaxITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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 );
2299 X = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2300 Z = ((rMinITC2+rMaxITC2)-(rMaxITC1 + rMinITC1))/2*Gaudi::Units::cm;
2301 if (
m_log->level()<=MSG::DEBUG)
2302 (*m_log) << MSG::DEBUG <<
" ITCModule Positive, position X= "<<X<<
" Z= "<<Z<<
endmsg;
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);
2320 thicknessWedgeMother = dzITC1 * Gaudi::Units::cm;
2321 dy1WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2322 dy2WedgeMother = rMaxITC1 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2323 heightWedgeMother = (rMaxITC1 - dbManager->
TILBrmin()) * Gaudi::Units::cm;
2329 if (
m_log->level()<=MSG::DEBUG)
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));
2342 if (
m_log->level()<=MSG::DEBUG)
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;
2363 thicknessWedgeMother = (dbManager->
TILBdzmodul() - dzITC2Bis) * Gaudi::Units::cm;
2364 if (
m_log->level()<=MSG::DEBUG)
2366 (*m_log) << MSG::DEBUG <<
" Separate C10 and D4 in module " << ModuleNcp <<
endmsg;
2368 GeoLogVol *lvPlug1ModuleMotherPos=0;
2369 if (thicknessWedgeMother > rless) {
2371 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2372 dy2WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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 );
2383 GeoTrf::Translate3D plug1SubOffsetPos(-dzITC2Bis/2*Gaudi::Units::cm, 0.,
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);
2418 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
2419 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
2420 dy1WedgeMother = rMinITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2421 dy2WedgeMother = rMaxITC2 * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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);
2466 Z = (dzITC1 - dzITC2)/2*Gaudi::Units::cm;
2468 if (NbPeriod == 6 && !Ifspecialgirder && std::abs(Z) < std::abs(zITCStandard)) zShift = zITCStandard*(1./Gaudi::Units::cm);
2470 if (
m_log->level()<=MSG::DEBUG)
2471 (*m_log) << MSG::DEBUG <<
" ITCModule Positive, position X= "<<X<<
" Z= "<<Z
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) {
2497 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
2499 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2500 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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) {
2543 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
2545 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
2546 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2*Gaudi::Units::deg) * Gaudi::Units::cm;
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;
2609 tfBarrelMother =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
2611 (*m_log) << MSG::INFO <<
" Positioning barrel with translation "<<ztrans*Gaudi::Units::cm<<
endmsg;
2613 GeoNameTag* ntBarrelModuleMother =
new GeoNameTag(
"Barrel");
2615 pvTileEnvelopeBarrel->add(tfBarrelMother);
2616 pvTileEnvelopeBarrel->add(ntBarrelModuleMother);
2617 pvTileEnvelopeBarrel->add(pvBarrelMother);
2619 GeoTransform* tfFingerMotherPos;
2621 ztrans = (dbManager->
GetEnvZLength()*Gaudi::Units::cm/2 - BFingerLengthPos/2 + PosDelta)*(1./Gaudi::Units::cm);
2623 tfFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
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;
2636 ztrans = (dbManager->
GetEnvZLength()*Gaudi::Units::cm/2 - BFingerLengthPos + DzSaddleSupport/2 + PosDelta)*(1./Gaudi::Units::cm);
2638 tfSaddleMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
2640 GeoNameTag* ntSaddleMotherPos =
new GeoNameTag(
"TileSaddlePos");
2642 pvTileEnvelopeBarrel->add(tfSaddleMotherPos);
2643 pvTileEnvelopeBarrel->add(ntSaddleMotherPos);
2644 pvTileEnvelopeBarrel->add(pvSaddleMotherPos);
2649 GeoTransform* tfFingerMotherNeg;
2651 ztrans = (-dbManager->
GetEnvZLength()*Gaudi::Units::cm/2 + BFingerLengthNeg/2 - NegDelta)*(1./Gaudi::Units::cm);
2653 tfFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
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;
2665 ztrans = (-dbManager->
GetEnvZLength()*Gaudi::Units::cm/2 + BFingerLengthNeg - DzSaddleSupport/2 - NegDelta)*(1./Gaudi::Units::cm);
2667 tfSaddleMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*GeoTrf::RotateZ3D((dbManager->
GetEnvDPhi())*Gaudi::Units::deg));
2669 GeoNameTag* ntSaddleMotherNeg =
new GeoNameTag(
"TileSaddleNeg");
2671 pvTileEnvelopeBarrel->add(tfSaddleMotherNeg);
2672 pvTileEnvelopeBarrel->add(ntSaddleMotherNeg);
2673 pvTileEnvelopeBarrel->add(pvSaddleMotherNeg);
2680 if (EnvType == 3 && eb_flag) {
2683 double thicknessEndPlate = dbManager->
TILBdzend1()*Gaudi::Units::cm;
2685 double PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthPos)/2;
2686 double PoZ2 = modl_length/4 + PoZ1;
2691 if (dbManager->
BoolCuts() && barrel_flag < 2) {
2697 if (
m_log->level()<=MSG::DEBUG)
2698 (*m_log) << MSG::DEBUG <<
" Iron1: " << dxIron <<
" " << dyIron <<
endmsg;
2700 GeoTransform* tfIron1 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY-dyIron,PoZ2)
2701 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2707 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2708 pvEBarrelMotherPos->add(tfIron1);
2709 pvEBarrelMotherPos->add(pvIron1);
2715 if (
m_log->level()<=MSG::DEBUG)
2716 (*m_log) << MSG::DEBUG <<
" Iron2: " << dxIron <<
" " << dyIron <<
endmsg;
2718 GeoTransform* tfIron2 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2719 * GeoTrf::RotateZ3D(-84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2725 * GeoTrf::RotateZ3D(84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2726 pvEBarrelMotherPos->add(tfIron2);
2727 pvEBarrelMotherPos->add(pvIron2);
2733 if (
m_log->level()<=MSG::DEBUG)
2734 (*m_log) << MSG::DEBUG <<
" Iron3: " << dxIron <<
" " << dyIron <<
endmsg;
2736 GeoTransform* tfIron3 =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) * GeoTrf::Translate3D(dxIron,PosY+dyIron,PoZ2)
2737 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2743 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2753 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2759 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2760 pvEBarrelMotherPos->add(tfIrBoxR);
2761 pvEBarrelMotherPos->add(pvIrBox);
2767 if (
m_log->level()<=MSG::DEBUG)
2768 (*m_log) << MSG::DEBUG <<
" IrUp: " <<dxIr<<
" " <<dyIr<<
endmsg;
2770 GeoTransform* tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2771 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2772 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2773 pvEBarrelMotherPos->add(tfIrUp);
2774 pvEBarrelMotherPos->add(
new GeoIdentifierTag(5));
2775 pvEBarrelMotherPos->add(pvIrUp);
2777 tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2778 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,-PoZ1)
2779 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2780 pvEBarrelMotherPos->add(tfIrUp);
2781 pvEBarrelMotherPos->add(pvIrUp);
2787 if (
m_log->level()<=MSG::DEBUG)
2788 (*m_log) << MSG::DEBUG <<
" IrDw: " <<dxIr<<
" " <<dyIr<<
endmsg;
2790 GeoTransform* tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2791 * GeoTrf::Translate3D(PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2792 * GeoTrf::RotateZ3D(70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2793 pvEBarrelMotherPos->add(tfIrDw);
2794 pvEBarrelMotherPos->add(
new GeoIdentifierTag(6));
2795 pvEBarrelMotherPos->add(pvIrDw);
2797 tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2798 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,-PoZ1)
2799 * GeoTrf::RotateZ3D(-70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2801 pvEBarrelMotherPos->add(tfIrDw);
2802 pvEBarrelMotherPos->add(pvIrDw);
2807 ztrans = (PosEndCrack + (dbManager->
GetEnvZLength()*Gaudi::Units::cm - EBFingerLengthPos)/2 + 19.5)*(1./Gaudi::Units::cm);
2809 GeoTransform* tfEBarrelMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2810 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
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) {
2826 ztrans = (PosEndExBarrel + EBFingerLengthPos/2)*(1./Gaudi::Units::cm);
2828 GeoTransform* tfEFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2829 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
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);
2842 ztrans = (PosEndExBarrel + DzSaddleSupport/2)*(1./Gaudi::Units::cm);
2844 GeoTransform* tfESaddleMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2845 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
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) {
2865 double thicknessEndPlate = dbManager->
TILBdzend1()*Gaudi::Units::cm;
2867 double PoZ1 = thicknessEndPlate + modl_length/4 - (dbManager->
GetEnvZLength()*Gaudi::Units::cm- EBFingerLengthNeg)/2;
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)
2880 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2886 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2897 * GeoTrf::RotateZ3D(-84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2903 * GeoTrf::RotateZ3D(84.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2913 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2919 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2928 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2934 * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2945 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2946 pvEBarrelMotherNeg->add(tfIrUp);
2947 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(5));
2948 pvEBarrelMotherNeg->add(pvIrUp);
2950 tfIrUp =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2951 * GeoTrf::Translate3D(-PosXcut-dxIr,-PosYcut+dyIr,PoZ1)
2952 * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
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)
2963 * GeoTrf::RotateZ3D(70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2964 pvEBarrelMotherNeg->add(tfIrDw);
2965 pvEBarrelMotherNeg->add(
new GeoIdentifierTag(6));
2966 pvEBarrelMotherNeg->add(pvIrDw);
2968 tfIrDw =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)
2969 * GeoTrf::Translate3D(-PosXcut+dxIr,-PosYcut+dyIr,PoZ1)
2970 * GeoTrf::RotateZ3D(-70.*Gaudi::Units::deg) * GeoTrf::RotateX3D(90.*Gaudi::Units::deg) * GeoTrf::RotateZ3D(90.*Gaudi::Units::deg));
2972 pvEBarrelMotherNeg->add(tfIrDw);
2973 pvEBarrelMotherNeg->add(pvIrDw);
2979 ztrans = (-NegEndCrack - (dbManager->
GetEnvZLength()*Gaudi::Units::cm - EBFingerLengthNeg)/2 - 19.5)*(1./Gaudi::Units::cm);
2981 GeoTransform* tfEBarrelMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
2982 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
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) {
2997 ztrans = (-NegEndExBarrel - EBFingerLengthPos/2)*(1./Gaudi::Units::cm);
2999 GeoTransform* tfEFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3000 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
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);
3013 ztrans = (-NegEndExBarrel - DzSaddleSupport/2)*(1./Gaudi::Units::cm);
3015 GeoTransform* tfESaddleMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3016 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
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) {
3041 ztrans = PosEndBarrelFinger*(1./Gaudi::Units::cm) + dbManager->
TILBdzmodul()/2;
3046 (*m_log) << MSG::INFO <<
" Positioning positive ITC with translation "<<ztrans*Gaudi::Units::cm<<
endmsg;
3048 GeoTransform* tfITCMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm) *
3049 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi() * Gaudi::Units::deg));
3051 GeoNameTag* ntITCMotherPos =
new GeoNameTag(
"ITCPos");
3053 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
3054 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
3055 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
3059 if (barrel_flag < 4) {
3062 ztrans = PosBeginGap*(1./Gaudi::Units::cm) + dbManager->
TILBdzmodul()/2;
3064 (*m_log) << MSG::INFO <<
" Positioning positive Gap with translation "<<ztrans*Gaudi::Units::cm<<
endmsg;
3066 GeoTransform* tfGapMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3067 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
3069 GeoNameTag* ntGapMotherPos =
new GeoNameTag(
"GapPos");
3071 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
3072 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
3073 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
3078 if (crack_flag<=0 || pvTileEnvelopePosCrack) {
3081 ztrans = PosBeginCrack*(1./Gaudi::Units::cm) + dbManager->
TILBdzmodul()/2;
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)*
3093 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
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) {
3122 ztrans = -NegEndBarrelFinger*(1./Gaudi::Units::cm) - dbManager->
TILBdzmodul()/2;
3124 (*m_log) << MSG::INFO <<
" Positioning negative ITC with translation "<<ztrans*Gaudi::Units::cm<<
endmsg;
3126 GeoTransform* tfITCMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3127 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
3129 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"ITCNeg");
3131 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
3132 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
3133 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
3137 if (barrel_flag < 4) {
3140 ztrans = -NegBeginGap*(1./Gaudi::Units::cm) - dbManager->
TILBdzmodul()/2;
3142 (*m_log) << MSG::INFO <<
" Positioning negative Gap with translation "<<ztrans*Gaudi::Units::cm<<
endmsg;
3144 GeoTransform* tfGapMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D(ztrans*Gaudi::Units::cm)*
3145 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
3147 GeoNameTag* ntGapMotherNeg =
new GeoNameTag(
"GapNeg");
3149 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
3150 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
3151 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
3156 if (crack_flag<=0 || pvTileEnvelopeNegCrack) {
3159 ztrans = -NegBeginCrack*(1./Gaudi::Units::cm) - dbManager->
TILBdzmodul()/2;
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)*
3171 GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi()*Gaudi::Units::deg));
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) ) {
3197 (*m_log) << MSG::DEBUG <<
"Creating descriptors for " << dbManager->
GetNumberOfEnv() <<
" envelopes..." <<
endmsg;
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) {
3208 double Zshift = dbManager->
GetEnvZShift()*Gaudi::Units::cm;
3210 if (
m_log->level()<=MSG::DEBUG)
3211 (*m_log) << MSG::DEBUG
3212 <<
" EnvCounter is " << EnvCounter
3213 <<
" EnvType is " << EnvType
3214 <<
" Zshift is " << Zshift*(1./Gaudi::Units::cm) <<
" cm"
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]);
3247 (*m_log) << MSG::DEBUG <<
"calling fillDescriptor()..." <<
endmsg;
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) {
3271 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
3272 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
3273 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
3274 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
3275 GeoTransform* barrelTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
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) {
3292 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
3293 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
3294 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
3295 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
3296 GeoTransform* posEcTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
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) {
3313 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
3314 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
3315 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
3316 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
3317 GeoTransform* negEcTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
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) {
3339 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
3340 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
3341 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
3342 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
3343 GeoTransform* posCrackTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
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) {
3363 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
3364 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
3365 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
3366 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
3367 GeoTransform* negCrackTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
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;