65 (*m_log) << MSG::INFO <<
" Entering TileDetectorFactory::create()" <<
endmsg;
68 double thicknessWedgeMother, heightWedgeMother, dy1WedgeMother, dy2WedgeMother;
79 if (StatusCode::SUCCESS !=
m_detectorStore->retrieve(theMaterialManager,
"MATERIALS")) {
80 (*m_log) << MSG::ERROR <<
"Could not find Material Manager MATERIALS" <<
endmsg;
83 const GeoMaterial* matAir = theMaterialManager->
getMaterial(
"std::Air");
92 GeoLogVol *lvTileEnvelopeBarrel = 0, *lvTileEnvelopePosEndcap = 0, *lvTileEnvelopeNegEndcap = 0;
93 GeoPhysVol *pvTileEnvelopeBarrel = 0, *pvTileEnvelopePosEndcap = 0, *pvTileEnvelopeNegEndcap = 0;
101 double endCentralBarrel = dbManager->
TILBdzmodul()/2.*Gaudi::Units::cm;
111 double endTile = dbManager->
TILEzmam()*Gaudi::Units::cm;
114 double endBarrelFinger = endCentralBarrel + dbManager->
TIFGdz()*Gaudi::Units::cm;
126 double rminBarrel = dbManager->
TILBrminimal()*Gaudi::Units::cm;
128 double rminITC1 = dbManager->
TILBrminimal()*Gaudi::Units::cm;
130 double rminITC = dbManager->
TILBrminimal()*Gaudi::Units::cm;
132 double rminCrack = dbManager->
TILBrminimal()*Gaudi::Units::cm;
134 double rminExtended = dbManager->
TILBrminimal()*Gaudi::Units::cm;
135 double rminFinger = dbManager->
TILBrmax()*Gaudi::Units::cm;
138 double rmaxTotal = dbManager->
TILErmam()*Gaudi::Units::cm;
140 GeoPcon* tileEnvPconeBarrel =
new GeoPcon(0, 360*Gaudi::Units::deg);
141 GeoPcon* tileEnvPconePosEndcap =
new GeoPcon(0, 360*Gaudi::Units::deg);
142 GeoPcon* tileEnvPconeNegEndcap =
new GeoPcon(0, 360*Gaudi::Units::deg);
145 tileEnvPconeNegEndcap->addPlane(-endTile,rminFinger,rmaxTotal);
146 tileEnvPconeNegEndcap->addPlane(-endExtendedBarrel,rminFinger,rmaxTotal);
147 tileEnvPconeNegEndcap->addPlane(-endExtendedBarrel,rminExtended,rmaxTotal);
148 tileEnvPconeNegEndcap->addPlane(-endCrack,rminExtended,rmaxTotal);
149 tileEnvPconeNegEndcap->addPlane(-endCrack,rminCrack,rmaxTotal);
150 tileEnvPconeNegEndcap->addPlane(-beginCrack,rminCrack,rmaxTotal);
151 tileEnvPconeNegEndcap->addPlane(-beginCrack,rminITC,rmaxTotal);
152 tileEnvPconeNegEndcap->addPlane(-beginITC2,rminITC,rmaxTotal);
153 tileEnvPconeNegEndcap->addPlane(-beginITC2,rminITC1,rmaxTotal);
154 tileEnvPconeNegEndcap->addPlane(-endBarrelFinger,rminITC1,rmaxTotal);
157 tileEnvPconeBarrel->addPlane(-endBarrelFinger,rminFinger,rmaxTotal);
158 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminFinger,rmaxTotal);
159 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminBarrel,rmaxTotal);
160 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminBarrel,rmaxTotal);
161 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminFinger,rmaxTotal);
162 tileEnvPconeBarrel->addPlane(endBarrelFinger,rminFinger,rmaxTotal);
165 tileEnvPconePosEndcap->addPlane(endBarrelFinger,rminITC1,rmaxTotal);
166 tileEnvPconePosEndcap->addPlane(beginITC2,rminITC1,rmaxTotal);
167 tileEnvPconePosEndcap->addPlane(beginITC2,rminITC,rmaxTotal);
168 tileEnvPconePosEndcap->addPlane(beginCrack,rminITC,rmaxTotal);
169 tileEnvPconePosEndcap->addPlane(beginCrack,rminCrack,rmaxTotal);
170 tileEnvPconePosEndcap->addPlane(endCrack,rminCrack,rmaxTotal);
171 tileEnvPconePosEndcap->addPlane(endCrack,rminExtended,rmaxTotal);
172 tileEnvPconePosEndcap->addPlane(endExtendedBarrel,rminExtended,rmaxTotal);
173 tileEnvPconePosEndcap->addPlane(endExtendedBarrel,rminFinger,rmaxTotal);
174 tileEnvPconePosEndcap->addPlane(endTile,rminFinger,rmaxTotal);
176 lvTileEnvelopeBarrel =
new GeoLogVol(
"TileCentralBarrel",tileEnvPconeBarrel,matAir);
177 lvTileEnvelopePosEndcap =
new GeoLogVol(
"TileEndcapPos",tileEnvPconePosEndcap,matAir);
178 lvTileEnvelopeNegEndcap =
new GeoLogVol(
"TileEndcapNeg",tileEnvPconeNegEndcap,matAir);
180 pvTileEnvelopeBarrel =
new GeoPhysVol(lvTileEnvelopeBarrel);
181 pvTileEnvelopePosEndcap =
new GeoPhysVol(lvTileEnvelopePosEndcap);
182 pvTileEnvelopeNegEndcap =
new GeoPhysVol(lvTileEnvelopeNegEndcap);
201 double endCentralBarrel = dbManager->
TILBdzmodul()/2.*Gaudi::Units::cm;
202 double endEnvelope = endCentralBarrel + dbManager->
TIFGdz()*Gaudi::Units::cm;
205 double rminBarrel = dbManager->
TILBrminimal()*Gaudi::Units::cm;
206 double rminFinger = dbManager->
TILBrmax()*Gaudi::Units::cm;
209 double rmaxTotal = dbManager->
TILErmam()*Gaudi::Units::cm;
211 GeoPcon* tileEnvPconeBarrel =
new GeoPcon(0, 360*Gaudi::Units::deg);
212 tileEnvPconeBarrel->addPlane(-endEnvelope,rminFinger,rmaxTotal);
213 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminFinger,rmaxTotal);
214 tileEnvPconeBarrel->addPlane(-endCentralBarrel,rminBarrel,rmaxTotal);
215 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminBarrel,rmaxTotal);
216 tileEnvPconeBarrel->addPlane(endCentralBarrel,rminFinger,rmaxTotal);
217 tileEnvPconeBarrel->addPlane(endEnvelope,rminFinger,rmaxTotal);
219 lvTileEnvelopeBarrel =
new GeoLogVol(
"TileCentralBarrel",tileEnvPconeBarrel,matAir);
220 pvTileEnvelopeBarrel =
new GeoPhysVol(lvTileEnvelopeBarrel);
229 GENFUNCTION phiInd =
deltaPhi*(varInd+0.5)*Gaudi::Units::deg;
236 GeoTube* barrelMother =
new GeoTube(dbManager->
TILBrminimal()*Gaudi::Units::cm,
237 dbManager->
TILErmam()*Gaudi::Units::cm,
240 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
241 GeoFullPhysVol* pvBarrelMother =
new GeoFullPhysVol(lvBarrelMother);
244 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
246 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
247 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
251 GeoTrd* barrelModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
252 thicknessWedgeMother/2.,
255 heightWedgeMother/2.);
257 GeoLogVol* lvBarrelModuleMother =
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
258 PVLink pvBarrelModuleMother =
new GeoPhysVol(lvBarrelModuleMother);
284 TRANSFUNCTION xfBarrelModuleMother = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
285 GeoSerialTransformer* stBarrelModuleMother =
new GeoSerialTransformer(pvBarrelModuleMother,
286 &xfBarrelModuleMother,
289 pvBarrelMother->add(
new GeoSerialIdentifier(1));
290 pvBarrelMother->add(stBarrelModuleMother);
292 GeoNameTag* ntBarrelMother =
new GeoNameTag(
"TileBarrel");
293 pvTileEnvelopeBarrel->add(ntBarrelMother);
294 pvTileEnvelopeBarrel->add(pvBarrelMother);
330 descriptor->
set(idRegion);
346 descriptor->
set(idRegion);
356 GeoTube* ebarrelMother =
new GeoTube(dbManager->
TILBrminimal()*Gaudi::Units::cm,
357 dbManager->
TILErmam()*Gaudi::Units::cm,
360 GeoLogVol* lvEBarrelMother =
new GeoLogVol(
"EBarrel",ebarrelMother,matAir);
361 GeoFullPhysVol* pvEBarrelMotherPos =
new GeoFullPhysVol(lvEBarrelMother);
362 GeoFullPhysVol* pvEBarrelMotherNeg =
new GeoFullPhysVol(lvEBarrelMother);
365 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
367 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
368 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
372 GeoTrd* ebarrelModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
373 thicknessWedgeMother/2.,
376 heightWedgeMother/2.);
378 GeoLogVol* lvEBarrelModuleMother =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMother,matAir);
379 PVLink pvEBarrelModuleMother =
new GeoPhysVol(lvEBarrelModuleMother);
390 TRANSFUNCTION xfEBarrelModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
391 TRANSFUNCTION xfEBarrelModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
393 GeoSerialTransformer* stEBarrelModuleMotherPos =
new GeoSerialTransformer(pvEBarrelModuleMother,
394 &xfEBarrelModuleMotherPos,
397 pvEBarrelMotherPos->add(
new GeoSerialIdentifier(1));
398 pvEBarrelMotherPos->add(stEBarrelModuleMotherPos);
401 GeoSerialTransformer* stEBarrelModuleMotherNeg =
new GeoSerialTransformer(pvEBarrelModuleMother,
402 &xfEBarrelModuleMotherNeg,
405 pvEBarrelMotherNeg->add(
new GeoSerialIdentifier(1));
406 pvEBarrelMotherNeg->add(stEBarrelModuleMotherNeg);
409 GeoTransform* tfEBarrelMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((dbManager->
TILBzoffset()+dbManager->
TILEzshift())*Gaudi::Units::cm));
410 GeoNameTag* ntEBarrelMotherPos =
new GeoNameTag(
"TileEBarrelPos");
411 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
412 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
413 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
416 GeoTransform* tfEBarrelMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->
TILBzoffset()-dbManager->
TILEzshift())*Gaudi::Units::cm));
417 GeoNameTag* ntEBarrelMotherNeg =
new GeoNameTag(
"TileEBarrelNeg");
418 pvTileEnvelopeNegEndcap->add(tfEBarrelMotherNeg);
419 pvTileEnvelopeNegEndcap->add(ntEBarrelMotherNeg);
420 pvTileEnvelopeNegEndcap->add(pvEBarrelMotherNeg);
423 int nModulesNeg,nModulesPos;
424 float zShiftNeg,zShiftPos;
440 nModulesPos=nModulesNeg=dbManager->
TILEnmodul();
441 zShiftPos=zShiftNeg=dbManager->
TILEzshift()*Gaudi::Units::cm;
459 descriptor->
set(idRegion);
475 descriptor->
set(idRegion);
491 GeoTube* itcWheel1 =
new GeoTube(dbManager->
TILBrminimal()*Gaudi::Units::cm,
492 dbManager->
TILErmam()*Gaudi::Units::cm,
495 GeoTube* itcWheel2 =
new GeoTube(rMinITC2*Gaudi::Units::cm,rMaxITC2*Gaudi::Units::cm,dzITC2/2.*Gaudi::Units::cm);
496 GeoTrf::Translate3D itcWheel2OffsetPos(0.,0.,(dbManager->
TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm);
497 GeoTrf::Translate3D itcWheel2OffsetNeg(0.,0.,(-dbManager->
TILBdzmodul()+dzITC2)/2*Gaudi::Units::cm);
499 const GeoShapeUnion& itcMotherPos = itcWheel1->add(*itcWheel2<<itcWheel2OffsetPos);
500 const GeoShapeUnion& itcMotherNeg = itcWheel1->add(*itcWheel2<<itcWheel2OffsetNeg);
502 GeoLogVol* lvITCMotherPos =
new GeoLogVol(
"ITC",&itcMotherPos,matAir);
503 GeoLogVol* lvITCMotherNeg =
new GeoLogVol(
"ITC",&itcMotherNeg,matAir);
504 GeoFullPhysVol* pvITCMotherPos =
new GeoFullPhysVol(lvITCMotherPos);
505 GeoFullPhysVol* pvITCMotherNeg =
new GeoFullPhysVol(lvITCMotherNeg);
511 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
513 dy1WedgeMother = dbManager->
TILBrminimal()* tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
514 dy2WedgeMother = dbManager->
TILBrmaximal()* tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
516 GeoTrd* itcModuleSub1 =
new GeoTrd(thicknessWedgeMother/2.,
517 thicknessWedgeMother/2.,
520 heightWedgeMother/2.);
523 thicknessWedgeMother = dzITC2 * Gaudi::Units::cm;
524 heightWedgeMother = (rMaxITC2 - rMinITC2) * Gaudi::Units::cm;
525 dy1WedgeMother = rMinITC2* tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
526 dy2WedgeMother = rMaxITC2* tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
528 GeoTrd* itcModuleSub2 =
new GeoTrd(thicknessWedgeMother/2.,
529 thicknessWedgeMother/2.,
532 heightWedgeMother/2.);
534 GeoTrf::Translate3D itcModuleSubShift ((dbManager->
TILBdzmodul()-dzITC2)/2*Gaudi::Units::cm,
538 const GeoShapeUnion& itcModuleMother = itcModuleSub1->add(*itcModuleSub2<<itcModuleSubShift);
540 GeoLogVol* lvITCModuleMother =
new GeoLogVol(
"ITCModule",&itcModuleMother,matAir);
541 PVLink pvITCModuleMother =
new GeoPhysVol(lvITCModuleMother);
549 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
551 dy1WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
552 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
556 GeoTrd* plug1SubMother =
new GeoTrd(thicknessWedgeMother/2.,
557 thicknessWedgeMother/2.,
560 heightWedgeMother/2.);
563 thicknessWedgeMother = (dbManager->
TILBdzmodul() - dzITC2) * Gaudi::Units::cm;
565 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
566 dy2WedgeMother = dbManager->
TILBrmin() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
568 GeoTrd* plug2SubMother =
new GeoTrd(thicknessWedgeMother/2.,
569 thicknessWedgeMother/2.,
572 heightWedgeMother/2.);
574 GeoTrf::Translate3D plug1SubOffset(-dzITC2*Gaudi::Units::cm/2.,
578 const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
579 GeoLogVol* lvPlug1ModuleMother =
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
580 PVLink pvPlug1ModuleMother =
new GeoPhysVol(lvPlug1ModuleMother);
583 sectionBuilder->
fillSection(pvPlug1ModuleMother, 3,
590 GeoTransform* tfPlug1ModuleMother =
new GeoTransform(GeoTrf::Translate3D(0.,
594 pvITCModuleMother->add(tfPlug1ModuleMother);
595 pvITCModuleMother->add(pvPlug1ModuleMother);
600 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
602 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
603 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
607 GeoTrd* plug2ModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
608 thicknessWedgeMother/2.,
611 heightWedgeMother/2.);
613 GeoLogVol* lvPlug2ModuleMother =
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
614 PVLink pvPlug2ModuleMother =
new GeoPhysVol(lvPlug2ModuleMother);
626 GeoTransform* tfPlug2ModuleMother =
new GeoTransform(itcModuleSubShift);
628 pvITCModuleMother->add(tfPlug2ModuleMother);
629 pvITCModuleMother->add(pvPlug2ModuleMother);
632 TRANSFUNCTION xfITCModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
633 TRANSFUNCTION xfITCModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
635 GeoSerialTransformer* stITCModuleMotherPos =
new GeoSerialTransformer(pvITCModuleMother,
636 &xfITCModuleMotherPos,
638 pvITCMotherPos->add(
new GeoSerialIdentifier(1));
639 pvITCMotherPos->add(stITCModuleMotherPos);
641 GeoSerialTransformer* stITCModuleMotherNeg =
new GeoSerialTransformer(pvITCModuleMother,
642 &xfITCModuleMotherNeg,
644 pvITCMotherNeg->add(
new GeoSerialIdentifier(1));
645 pvITCMotherNeg->add(stITCModuleMotherNeg);
650 if (not pvTileEnvelopePosEndcap){
651 (*m_log)<<MSG::ERROR<<
"pvTileEnvelopePosEndcap is null in "<<__func__<<
endmsg;
653 GeoTransform* tfITCMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((dbManager->
TILBzoffset()+dbManager->
TILEzshift())*Gaudi::Units::cm));
654 GeoNameTag* ntITCMotherPos =
new GeoNameTag(
"TileITCPos");
655 pvTileEnvelopePosEndcap->add(tfITCMotherPos);
656 pvTileEnvelopePosEndcap->add(ntITCMotherPos);
657 pvTileEnvelopePosEndcap->add(pvITCMotherPos);
662 if (not pvTileEnvelopeNegEndcap){
663 (*m_log)<<MSG::ERROR<<
"pvTileEnvelopeNegEndcap is null in "<<__func__<<
endmsg;
665 GeoTransform* tfITCMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->
TILBzoffset()-dbManager->
TILEzshift())*Gaudi::Units::cm));
666 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"TileITCNeg");
667 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
668 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
669 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
676 GeoTube* gapMother =
new GeoTube(dbManager->
TILBrminimal()*Gaudi::Units::cm,
680 GeoLogVol* lvGapMother =
new GeoLogVol(
"Gap",gapMother,matAir);
681 GeoFullPhysVol* pvGapMotherPos =
new GeoFullPhysVol(lvGapMother);
682 GeoFullPhysVol* pvGapMotherNeg =
new GeoFullPhysVol(lvGapMother);
685 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
687 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
688 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
692 GeoTrd* gapModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
693 thicknessWedgeMother/2.,
696 heightWedgeMother/2.);
698 GeoLogVol* lvGapModuleMother =
new GeoLogVol(
"GapModule",gapModuleMother,matAir);
699 PVLink pvGapModuleMother =
new GeoPhysVol(lvGapModuleMother);
710 TRANSFUNCTION xfGapModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
711 TRANSFUNCTION xfGapModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
713 GeoSerialTransformer* stGapModuleMotherPos =
new GeoSerialTransformer(pvGapModuleMother,
714 &xfGapModuleMotherPos,
716 pvGapMotherPos->add(
new GeoSerialIdentifier(1));
717 pvGapMotherPos->add(stGapModuleMotherPos);
719 GeoSerialTransformer* stGapModuleMotherNeg =
new GeoSerialTransformer(pvGapModuleMother,
720 &xfGapModuleMotherNeg,
722 pvGapMotherNeg->add(
new GeoSerialIdentifier(1));
723 pvGapMotherNeg->add(stGapModuleMotherNeg);
725 if (not pvTileEnvelopePosEndcap){
726 (*m_log)<<MSG::ERROR<<
"pvTileEnvelopePosEndcap is null in "<<__func__<<
endmsg;
728 GeoTransform* tfGapMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((dbManager->
TILBzoffset()+dbManager->
TILEzshift())*Gaudi::Units::cm));
729 GeoNameTag* ntGapMotherPos =
new GeoNameTag(
"TileGapPos");
730 pvTileEnvelopePosEndcap->add(tfGapMotherPos);
731 pvTileEnvelopePosEndcap->add(ntGapMotherPos);
732 pvTileEnvelopePosEndcap->add(pvGapMotherPos);
735 if (not pvTileEnvelopeNegEndcap){
736 (*m_log)<<MSG::ERROR<<
"pvTileEnvelopeNegEndcap is null in "<<__func__<<
endmsg;
738 GeoTransform* tfGapMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->
TILBzoffset()-dbManager->
TILEzshift())*Gaudi::Units::cm));
739 GeoNameTag* ntGapMotherNeg =
new GeoNameTag(
"TileGapNeg");
740 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
741 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
742 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
760 nModulesPos=nModulesNeg=dbManager->
TILEnmodul();
761 zShiftPos=zShiftNeg=dbManager->
TILEzshift()*Gaudi::Units::cm;
779 descriptor->
set(idRegion);
795 descriptor->
set(idRegion);
804 GeoTube* crackMother =
new GeoTube(dbManager->
TILBrminimal()*Gaudi::Units::cm,
808 GeoLogVol* lvCrackMother =
new GeoLogVol(
"Crack",crackMother,matAir);
809 GeoFullPhysVol* pvCrackMotherPos =
new GeoFullPhysVol(lvCrackMother);
810 GeoFullPhysVol* pvCrackMotherNeg =
new GeoFullPhysVol(lvCrackMother);
813 thicknessWedgeMother = dbManager->
TILBdzmodul() * Gaudi::Units::cm;
815 dy1WedgeMother = dbManager->
TILBrminimal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
816 dy2WedgeMother = dbManager->
TILBrmaximal() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
820 GeoTrd* crackModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
821 thicknessWedgeMother/2.,
824 heightWedgeMother/2.);
826 GeoLogVol* lvCrackModuleMother =
new GeoLogVol(
"CrackModule",crackModuleMother,matAir);
827 PVLink pvCrackModuleMother =
new GeoPhysVol(lvCrackModuleMother);
838 TRANSFUNCTION xfCrackModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
839 TRANSFUNCTION xfCrackModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILBrmaximal()+dbManager->
TILBrminimal())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
841 GeoSerialTransformer* stCrackModuleMotherPos =
new GeoSerialTransformer(pvCrackModuleMother,
842 &xfCrackModuleMotherPos,
844 pvCrackMotherPos->add(
new GeoSerialIdentifier(1));
845 pvCrackMotherPos->add(stCrackModuleMotherPos);
847 GeoSerialTransformer* stCrackModuleMotherNeg =
new GeoSerialTransformer(pvCrackModuleMother,
848 &xfCrackModuleMotherNeg,
850 pvCrackMotherNeg->add(
new GeoSerialIdentifier(1));
851 pvCrackMotherNeg->add(stCrackModuleMotherNeg);
854 GeoTransform* tfCrackMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((dbManager->
TILBzoffset()+dbManager->
TILEzshift())*Gaudi::Units::cm));
855 GeoNameTag* ntCrackMotherPos =
new GeoNameTag(
"TileCrackPos");
856 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
857 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
858 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
861 GeoTransform* tfCrackMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-dbManager->
TILBzoffset()-dbManager->
TILEzshift())*Gaudi::Units::cm));
862 GeoNameTag* ntCrackMotherNeg =
new GeoNameTag(
"TileCrackNeg");
863 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
864 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
865 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
878 GeoTube* fingerMother =
new GeoTube(dbManager->
TILBrmax()*Gaudi::Units::cm,
879 dbManager->
TILErmam()*Gaudi::Units::cm,
880 dbManager->
TIFGdz()/2.*Gaudi::Units::cm);
882 GeoLogVol* lvFingerMother =
new GeoLogVol(
"Finger",fingerMother,matAir);
883 GeoFullPhysVol* pvFingerMotherPos =
new GeoFullPhysVol(lvFingerMother);
884 GeoFullPhysVol* pvFingerMotherNeg =
new GeoFullPhysVol(lvFingerMother);
890 thicknessWedgeMother = dbManager->
TIFGdz()*Gaudi::Units::cm;
893 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
894 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
895 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
897 GeoTrd* fingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
898 thicknessWedgeMother/2.,
901 heightWedgeMother/2.);
903 GeoLogVol* lvFingerModuleMother =
new GeoLogVol(
"FingerModule",fingerModuleMother,matAir);
904 PVLink pvFingerModuleMother =
new GeoPhysVol(lvFingerModuleMother);
907 sectionBuilder->
fillFinger(pvFingerModuleMother, 1,
913 thicknessWedgeMother*(1./Gaudi::Units::cm));
916 TRANSFUNCTION xfFingerModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
917 TRANSFUNCTION xfFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
919 GeoSerialTransformer* stFingerModuleMotherPos =
new GeoSerialTransformer(pvFingerModuleMother,
920 &xfFingerModuleMotherPos,
923 pvFingerMotherPos->add(
new GeoSerialIdentifier(1));
924 pvFingerMotherPos->add(stFingerModuleMotherPos);
926 GeoSerialTransformer* stFingerModuleMotherNeg =
new GeoSerialTransformer(pvFingerModuleMother,
927 &xfFingerModuleMotherNeg,
929 pvFingerMotherNeg->add(
new GeoSerialIdentifier(1));
930 pvFingerMotherNeg->add(stFingerModuleMotherNeg);
933 GeoTransform* tfFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((zEndSection+dbManager->
TIFGdz()/2.)*Gaudi::Units::cm));
934 GeoNameTag* ntFingerMotherPos =
new GeoNameTag(
"TileFingerPos");
935 pvTileEnvelopeBarrel->add(tfFingerMotherPos);
936 pvTileEnvelopeBarrel->add(ntFingerMotherPos);
937 pvTileEnvelopeBarrel->add(pvFingerMotherPos);
940 GeoTransform* tfFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-zEndSection-dbManager->
TIFGdz()/2.)*Gaudi::Units::cm));
941 GeoNameTag* ntFingerMotherNeg =
new GeoNameTag(
"TileFingerNeg");
942 pvTileEnvelopeBarrel->add(tfFingerMotherNeg);
943 pvTileEnvelopeBarrel->add(ntFingerMotherNeg);
944 pvTileEnvelopeBarrel->add(pvFingerMotherNeg);
955 GeoTube* efingerMother =
new GeoTube(dbManager->
TILBrmax()*Gaudi::Units::cm,
956 dbManager->
TILErmam()*Gaudi::Units::cm,
957 dbManager->
TIFGdz()/2.*Gaudi::Units::cm);
959 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",efingerMother,matAir);
960 GeoFullPhysVol* pvEFingerMotherPos =
new GeoFullPhysVol(lvEFingerMother);
961 GeoFullPhysVol* pvEFingerMotherNeg =
new GeoFullPhysVol(lvEFingerMother);
964 thicknessWedgeMother = dbManager->
TIFGdz() * Gaudi::Units::cm;
965 heightWedgeMother = (dbManager->
TILErmax() - dbManager->
TILBrmax()) * Gaudi::Units::cm;
966 dy1WedgeMother = dbManager->
TILBrmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
967 dy2WedgeMother = dbManager->
TILErmax() * tan(
deltaPhi/2.*Gaudi::Units::deg) * Gaudi::Units::cm;
969 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
970 thicknessWedgeMother/2.,
973 heightWedgeMother/2.);
975 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
976 PVLink pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
979 sectionBuilder->
fillFinger(pvEFingerModuleMother,
987 TRANSFUNCTION xfEFingerModuleMotherPos = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateX3D(180*Gaudi::Units::deg)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
988 TRANSFUNCTION xfEFingerModuleMotherNeg = Pow(GeoTrf::RotateZ3D(1.0),phiInd)*GeoTrf::TranslateX3D((dbManager->
TILErmax()+dbManager->
TILBrmax())/2.*Gaudi::Units::cm)*GeoTrf::RotateY3D(90*Gaudi::Units::deg);
990 GeoSerialTransformer* stEFingerModuleMotherPos =
new GeoSerialTransformer(pvEFingerModuleMother,
991 &xfEFingerModuleMotherPos,
993 pvEFingerMotherPos->add(
new GeoSerialIdentifier(1));
994 pvEFingerMotherPos->add(stEFingerModuleMotherPos);
996 GeoSerialTransformer* stEFingerModuleMotherNeg =
new GeoSerialTransformer(pvEFingerModuleMother,
997 &xfEFingerModuleMotherNeg,
999 pvEFingerMotherNeg->add(
new GeoSerialIdentifier(1));
1000 pvEFingerMotherNeg->add(stEFingerModuleMotherNeg);
1003 GeoTransform* tfEFingerMotherPos =
new GeoTransform(GeoTrf::TranslateZ3D((zEndSection+dbManager->
TIFGdz()/2.)*Gaudi::Units::cm));
1004 GeoNameTag* ntEFingerMotherPos =
new GeoNameTag(
"TileEFingerPos");
1005 pvTileEnvelopePosEndcap->add(tfEFingerMotherPos);
1006 pvTileEnvelopePosEndcap->add(ntEFingerMotherPos);
1007 pvTileEnvelopePosEndcap->add(pvEFingerMotherPos);
1010 GeoTransform* tfEFingerMotherNeg =
new GeoTransform(GeoTrf::TranslateZ3D((-zEndSection-dbManager->
TIFGdz()/2.)*Gaudi::Units::cm));
1011 GeoNameTag* ntEFingerMotherNeg =
new GeoNameTag(
"TileEFingerNeg");
1012 pvTileEnvelopeNegEndcap->add(tfEFingerMotherNeg);
1013 pvTileEnvelopeNegEndcap->add(ntEFingerMotherNeg);
1014 pvTileEnvelopeNegEndcap->add(pvEFingerMotherNeg);
1018 GeoNameTag *nTag =
new GeoNameTag(
"Tile");
1020 if (pvTileEnvelopeBarrel) {
1026 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
1027 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
1028 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
1029 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
1030 GeoTransform* barrelTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1031 world->add(barrelTT);
1034 world->add(pvTileEnvelopeBarrel);
1038 if (pvTileEnvelopePosEndcap) {
1044 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
1045 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
1046 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
1047 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
1048 GeoTransform* posEcTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1049 world->add(posEcTT);
1052 world->add(pvTileEnvelopePosEndcap);
1056 if (pvTileEnvelopeNegEndcap) {
1062 GeoTrf::Transform3D mz = GeoTrf::RotateZ3D(dbManager->
GetEnvDPhi());
1063 GeoTrf::Transform3D my = GeoTrf::RotateY3D(dbManager->
GetEnvDTheta());
1064 GeoTrf::Transform3D mx = GeoTrf::RotateZ3D(dbManager->
GetEnvDPsi());
1065 GeoTrf::Transform3D vpos = GeoTrf::Translate3D(dbManager->
GetEnvDX()*Gaudi::Units::cm,dbManager->
GetEnvDY()*Gaudi::Units::cm,dbManager->
GetEnvDZ()*Gaudi::Units::cm);
1066 GeoTransform* negEcTT =
new GeoTransform(GeoTrf::Transform3D(vpos*(mx*(my*(mz)))));
1067 world->add(negEcTT);
1070 world->add(pvTileEnvelopeNegEndcap);
1074 delete sectionBuilder;