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;
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);
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);
240 GeoLogVol* lvBarrelMother =
new GeoLogVol(
"Barrel",barrelMother,matAir);
241 GeoFullPhysVol* pvBarrelMother =
new GeoFullPhysVol(lvBarrelMother);
251 GeoTrd* barrelModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
252 thicknessWedgeMother/2.,
255 heightWedgeMother/2.);
257 GeoLogVol* lvBarrelModuleMother =
new GeoLogVol(
"BarrelModule",barrelModuleMother,matAir);
258 GeoPhysVol* pvBarrelModuleMother =
new GeoPhysVol(lvBarrelModuleMother);
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);
360 GeoLogVol* lvEBarrelMother =
new GeoLogVol(
"EBarrel",ebarrelMother,matAir);
361 GeoFullPhysVol* pvEBarrelMotherPos =
new GeoFullPhysVol(lvEBarrelMother);
362 GeoFullPhysVol* pvEBarrelMotherNeg =
new GeoFullPhysVol(lvEBarrelMother);
372 GeoTrd* ebarrelModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
373 thicknessWedgeMother/2.,
376 heightWedgeMother/2.);
378 GeoLogVol* lvEBarrelModuleMother =
new GeoLogVol(
"EBarrelModule",ebarrelModuleMother,matAir);
379 GeoPhysVol* pvEBarrelModuleMother =
new GeoPhysVol(lvEBarrelModuleMother);
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);
410 GeoNameTag* ntEBarrelMotherPos =
new GeoNameTag(
"TileEBarrelPos");
411 pvTileEnvelopePosEndcap->add(tfEBarrelMotherPos);
412 pvTileEnvelopePosEndcap->add(ntEBarrelMotherPos);
413 pvTileEnvelopePosEndcap->add(pvEBarrelMotherPos);
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();
459 descriptor->
set(idRegion);
475 descriptor->
set(idRegion);
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);
516 GeoTrd* itcModuleSub1 =
new GeoTrd(thicknessWedgeMother/2.,
517 thicknessWedgeMother/2.,
520 heightWedgeMother/2.);
528 GeoTrd* itcModuleSub2 =
new GeoTrd(thicknessWedgeMother/2.,
529 thicknessWedgeMother/2.,
532 heightWedgeMother/2.);
538 const GeoShapeUnion& itcModuleMother = itcModuleSub1->add(*itcModuleSub2<<itcModuleSubShift);
540 GeoLogVol* lvITCModuleMother =
new GeoLogVol(
"ITCModule",&itcModuleMother,matAir);
541 GeoPhysVol* pvITCModuleMother =
new GeoPhysVol(lvITCModuleMother);
556 GeoTrd* plug1SubMother =
new GeoTrd(thicknessWedgeMother/2.,
557 thicknessWedgeMother/2.,
560 heightWedgeMother/2.);
568 GeoTrd* plug2SubMother =
new GeoTrd(thicknessWedgeMother/2.,
569 thicknessWedgeMother/2.,
572 heightWedgeMother/2.);
578 const GeoShapeUnion& plug1ModuleMother = plug1SubMother->add(*plug2SubMother<<plug1SubOffset);
579 GeoLogVol* lvPlug1ModuleMother =
new GeoLogVol(
"Plug1Module",&plug1ModuleMother,matAir);
580 GeoPhysVol* 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);
607 GeoTrd* plug2ModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
608 thicknessWedgeMother/2.,
611 heightWedgeMother/2.);
613 GeoLogVol* lvPlug2ModuleMother =
new GeoLogVol(
"Plug2Module",plug2ModuleMother,matAir);
614 GeoPhysVol* pvPlug2ModuleMother =
new GeoPhysVol(lvPlug2ModuleMother);
626 GeoTransform* tfPlug2ModuleMother =
new GeoTransform(itcModuleSubShift);
628 pvITCModuleMother->add(tfPlug2ModuleMother);
629 pvITCModuleMother->add(pvPlug2ModuleMother);
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;
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;
666 GeoNameTag* ntITCMotherNeg =
new GeoNameTag(
"TileITCNeg");
667 pvTileEnvelopeNegEndcap->add(tfITCMotherNeg);
668 pvTileEnvelopeNegEndcap->add(ntITCMotherNeg);
669 pvTileEnvelopeNegEndcap->add(pvITCMotherNeg);
680 GeoLogVol* lvGapMother =
new GeoLogVol(
"Gap",gapMother,matAir);
681 GeoFullPhysVol* pvGapMotherPos =
new GeoFullPhysVol(lvGapMother);
682 GeoFullPhysVol* pvGapMotherNeg =
new GeoFullPhysVol(lvGapMother);
692 GeoTrd* gapModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
693 thicknessWedgeMother/2.,
696 heightWedgeMother/2.);
698 GeoLogVol* lvGapModuleMother =
new GeoLogVol(
"GapModule",gapModuleMother,matAir);
699 GeoPhysVol* pvGapModuleMother =
new GeoPhysVol(lvGapModuleMother);
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;
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;
739 GeoNameTag* ntGapMotherNeg =
new GeoNameTag(
"TileGapNeg");
740 pvTileEnvelopeNegEndcap->add(tfGapMotherNeg);
741 pvTileEnvelopeNegEndcap->add(ntGapMotherNeg);
742 pvTileEnvelopeNegEndcap->add(pvGapMotherNeg);
760 nModulesPos=nModulesNeg=dbManager->
TILEnmodul();
779 descriptor->
set(idRegion);
795 descriptor->
set(idRegion);
808 GeoLogVol* lvCrackMother =
new GeoLogVol(
"Crack",crackMother,matAir);
809 GeoFullPhysVol* pvCrackMotherPos =
new GeoFullPhysVol(lvCrackMother);
810 GeoFullPhysVol* pvCrackMotherNeg =
new GeoFullPhysVol(lvCrackMother);
820 GeoTrd* crackModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
821 thicknessWedgeMother/2.,
824 heightWedgeMother/2.);
826 GeoLogVol* lvCrackModuleMother =
new GeoLogVol(
"CrackModule",crackModuleMother,matAir);
827 GeoPhysVol* pvCrackModuleMother =
new GeoPhysVol(lvCrackModuleMother);
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);
855 GeoNameTag* ntCrackMotherPos =
new GeoNameTag(
"TileCrackPos");
856 pvTileEnvelopePosEndcap->add(tfCrackMotherPos);
857 pvTileEnvelopePosEndcap->add(ntCrackMotherPos);
858 pvTileEnvelopePosEndcap->add(pvCrackMotherPos);
862 GeoNameTag* ntCrackMotherNeg =
new GeoNameTag(
"TileCrackNeg");
863 pvTileEnvelopeNegEndcap->add(tfCrackMotherNeg);
864 pvTileEnvelopeNegEndcap->add(ntCrackMotherNeg);
865 pvTileEnvelopeNegEndcap->add(pvCrackMotherNeg);
882 GeoLogVol* lvFingerMother =
new GeoLogVol(
"Finger",fingerMother,matAir);
883 GeoFullPhysVol* pvFingerMotherPos =
new GeoFullPhysVol(lvFingerMother);
884 GeoFullPhysVol* pvFingerMotherNeg =
new GeoFullPhysVol(lvFingerMother);
897 GeoTrd* fingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
898 thicknessWedgeMother/2.,
901 heightWedgeMother/2.);
903 GeoLogVol* lvFingerModuleMother =
new GeoLogVol(
"FingerModule",fingerModuleMother,matAir);
904 GeoPhysVol* pvFingerModuleMother =
new GeoPhysVol(lvFingerModuleMother);
907 sectionBuilder->
fillFinger(pvFingerModuleMother, 1,
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);
959 GeoLogVol* lvEFingerMother =
new GeoLogVol(
"EFinger",efingerMother,matAir);
960 GeoFullPhysVol* pvEFingerMotherPos =
new GeoFullPhysVol(lvEFingerMother);
961 GeoFullPhysVol* pvEFingerMotherNeg =
new GeoFullPhysVol(lvEFingerMother);
969 GeoTrd* efingerModuleMother =
new GeoTrd(thicknessWedgeMother/2.,
970 thicknessWedgeMother/2.,
973 heightWedgeMother/2.);
975 GeoLogVol* lvEFingerModuleMother =
new GeoLogVol(
"EFingerModule",efingerModuleMother,matAir);
976 GeoPhysVol* pvEFingerModuleMother =
new GeoPhysVol(lvEFingerModuleMother);
979 sectionBuilder->
fillFinger(pvEFingerModuleMother,
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) {
1031 world->add(barrelTT);
1034 world->add(pvTileEnvelopeBarrel);
1038 if (pvTileEnvelopePosEndcap) {
1049 world->add(posEcTT);
1052 world->add(pvTileEnvelopePosEndcap);
1056 if (pvTileEnvelopeNegEndcap) {
1067 world->add(negEcTT);
1070 world->add(pvTileEnvelopeNegEndcap);
1074 delete sectionBuilder;