TrackingVolumeBuilder interface method - returns vector of Volumes.
132 std::vector<Trk::TrackingVolume*>* tileTrackingVolumes =
new std::vector<Trk::TrackingVolume*>;
143 double plug1Z = 3405.;
144 double plug2Z = 3512.075;
145 double plug1R = 3440.;
146 double plug2R = 2959.;
147 double plug1hZ = 154.5;
148 double plug2hZ = 47.425;
165 std::unique_ptr<Trk::CylinderVolumeBounds> tileBarrelGirderBounds;
176 std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>> entrySurf =
178 std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>> exitSurf =
182 auto barrelProperties = std::make_unique<Trk::Material>(22.7, 212., 45.8, 21.4, 0.0062);
183 auto extendedBarrelProperties = std::make_unique<Trk::Material>(22.7, 210., 45.8, 21.4, 0.0062);
193 ATH_MSG_DEBUG(
"Retrieved " << numTreeTops <<
" tree tops from the TileDetDescrManager. " );
196 std::vector<Trk::IdentifiedMaterial> matTB;
198 matTB.emplace_back(barrelProperties.get(),0);
199 matTB.emplace_back(barrelProperties.get(),baseID);
200 matTB.emplace_back(barrelProperties.get(),baseID+1);
201 matTB.emplace_back(barrelProperties.get(),baseID+2);
204 std::vector<size_t> ltb{0,1,2,3};
207 std::vector<Trk::IdentifiedMaterial> matETB;
209 matETB.emplace_back(extendedBarrelProperties.get(),0);
210 matETB.emplace_back(extendedBarrelProperties.get(),baseID);
211 matETB.emplace_back(extendedBarrelProperties.get(),baseID+1);
212 matETB.emplace_back(extendedBarrelProperties.get(),baseID+2);
216 Trk::Material barrelFingerGapProperties(353., 2254., 20.7, 10., 0.00057);
219 Trk::Material fingerGapProperties(552., 3925., 16.4, 8.1, 0.00034);
221 for (
unsigned int itreetop = 0; itreetop<numTreeTops; ++itreetop){
231 const GeoLogVol* currentLogVol = currentVPhysVolLink->getLogVol();
233 unsigned int currentChilds = currentVPhysVolLink->getNChildVols();
235 ATH_MSG_DEBUG(
"Processing " << currentLogVol->getName() <<
"... has "
236 << currentChilds <<
" childs." );
237 const GeoShape* currentShape = currentLogVol->getShape();
239 std::vector<double> zboundaries;
243 for (
unsigned int ichild = 0; ichild < currentChilds; ++ichild){
245 PVConstLink currentChildLink = currentVPhysVolLink->getChildVol(ichild);
247 const GeoLogVol* childLogVol = currentChildLink->getLogVol();
248 const GeoShape* childShape = childLogVol->getShape();
249 ATH_MSG_VERBOSE(
" Child: " << childLogVol->getName() <<
" has shape " << childShape->type() );
251 const GeoTubs* currentTubs =
dynamic_cast<const GeoTubs*
>(childShape);
255 double childZposition = childTransform.translation().z();
257 if (childCylVolBounds){
260 ATH_MSG_VERBOSE(
" ---> Position in z: " << childTransform.translation().z() );
271 if ( fabs(childZposition)< 100.*
mm ){
276 tileBarrelGirderBounds = make_unique<Trk::CylinderVolumeBounds>(
depth,childCylVolBounds->
outerRadius(),childCylVolBounds->
halflengthZ());
281 std::vector<float>
steps;
293 barrelMaterialBinned,
295 "Calo::Detectors::Tile::Barrel");
301 std::string volumeName;
302 std::string girderName;
303 std::vector<double> girderLayerRadius;
304 std::vector<double> layerRadius;
305 std::vector<double> layerEnvelope;
307 bool tileExtendedBoundsUsed =
false;
308 std::unique_ptr<Trk::CylinderVolumeBounds> gapVolBounds;
312 volumeName = childZposition > 0. ?
313 "Calo::Detectors::Tile::PositiveExtendedBarrel" :
"Calo::Detectors::Tile::NegativeExtendedBarrel";
318 }
else if (childCylVolBounds->
halflengthZ() > 100.){
322 }
else if ( childLogVol->getName()==
"Gap" && !gapBounds ) {
324 gapVolBounds = make_unique<Trk::CylinderVolumeBounds>(childCylVolBounds->
innerRadius(),childCylVolBounds->
outerRadius(),
327 gapZ = fabs(childZposition);
345 std::vector<float>
steps;
353 extendedMaterialBinned =
new Trk::BinnedMaterial(extendedBarrelProperties.get(),eBU,ltb,matETB);
358 extendedMaterialBinned,
361 tileExtendedBoundsUsed =
true;
364 if ( gapVolBounds ) {
365 gapBounds = gapVolBounds.release();
367 }
else if (tileExtendedBounds) {
370 std::vector<float>
steps;
378 extendedMaterialBinned =
new Trk::BinnedMaterial(extendedBarrelProperties.get(),eBU,ltb,matETB);
383 extendedMaterialBinned,
386 tileExtendedBoundsUsed =
true;
391 if (childZposition > 0.) {
392 tilePositiveExtendedBarrel = tileExtendedTrackingVolume;
393 tilePositiveExtendedBarrelBounds = *tileExtendedBounds;
396 tileNegativeExtendedBarrel = tileExtendedTrackingVolume;
398 }
else if (childCylVolBounds->
halflengthZ() > 100.) {
399 tileZ = fabs(childZposition)+childCylVolBounds->
halflengthZ();
401 if (!tileExtendedBoundsUsed)
402 delete tileExtendedBounds;
406 delete childCylVolBounds;
410 if (!gapBounds) std::abort();
411 if (!tileBarrelGirderBounds) std::abort();
412 if (!tilePositiveExtendedBarrel) std::abort();
413 if (!tileNegativeExtendedBarrel) std::abort();
415 ATH_MSG_DEBUG(
"TileDetDescrManager parsed successfully! " );
419 auto tileGirderBounds = std::make_unique<Trk::CylinderVolumeBounds>
425 tileGirderBounds.release(),
427 dummyLayers, dummyVolumes,
428 "Calo::Girder::TileCombined");
432 double tileExtZ = tilePositiveExtendedBarrel->
center().z()-tilePositiveExtendedBarrelBounds.
halflengthZ();
435 std::vector<Trk::IdentifiedMaterial> matITC;
438 matITC.emplace_back(barrelProperties.get(),baseID+15);
439 matITC.emplace_back(barrelProperties.get(),baseID+16);
440 matITC.emplace_back(barrelProperties.get(),baseID+17);
443 double p1Z = 0.5*(plug1Z-plug1hZ+tileExtZ);
444 double hp1Z = 0.5*(tileExtZ-plug1Z+plug1hZ);
455 std::vector<size_t> dummylay(1,1);
468 "Calo::Detectors::Tile::ITCPlug1Pos");
471 itcPlug1Bounds->
clone(),
474 "Calo::Detectors::Tile::ITCPlug1Neg");
479 double p2Z = 0.5*(plug2Z-plug2hZ+tileExtZ);
480 double hp2Z = 0.5*(tileExtZ-plug2Z+plug2hZ);
490 std::vector<size_t> p2lay(1,0);
491 std::vector<float> p2steps{
float(plug2R),
float(plug1R)};
501 "Calo::Detectors::Tile::ITCPlug2Pos");
504 itcPlug2Bounds->
clone(),
507 "Calo::Detectors::Tile::ITCPlug2Neg");
512 float gapi = 0.5*(gapZ-gapBounds->
halflengthZ()+tileExtZ);
513 double hgZ = 0.5*(tileExtZ-gapZ+gapBounds->
halflengthZ());
524 std::vector<size_t> glay(1,2);
533 "Calo::Detectors::Tile::GapPos");
543 "Calo::Detectors::Tile::GapNeg");
549 float zgBuff = 0.5*(p1i+
gi);
550 float hgBuff = 0.5*(
gi-p1i);
564 dummyLayers, dummyVolumes,
565 "Calo::GapVolumes::Tile::GapBufferPos");
569 gapBuffBounds->
clone(),
571 dummyLayers, dummyVolumes,
572 "Calo::GapVolumes::Tile::GapBufferNeg");
576 std::vector<Trk::TrackingVolume*> volsPosGap;
577 volsPosGap.push_back(gBufferPos);
578 volsPosGap.push_back(gapPos);
582 "Calo::Container::PositiveGap");
586 std::vector<Trk::TrackingVolume*> volsNegGap;
587 volsNegGap.push_back(gapNeg);
588 volsNegGap.push_back(gBufferNeg);
592 "Calo::Container::NegativeGap");
596 float z2Buff = 0.5*(p1i+p2i);
597 float h2Buff = 0.5*(p2i-p1i);
611 dummyLayers, dummyVolumes,
612 "Calo::GapVolumes::Tile::Plug2BufferPos");
616 p2BuffBounds->
clone(),
618 dummyLayers, dummyVolumes,
619 "Calo::GapVolumes::Tile::Plug2BufferNeg");
623 std::vector<Trk::TrackingVolume*> volsPosP2;
624 volsPosP2.push_back(p2BufferPos);
625 volsPosP2.push_back(itcPlug2Pos);
629 "Calo::Container::PositiveP2");
633 std::vector<Trk::TrackingVolume*> volsNegP2;
634 volsNegP2.push_back(itcPlug2Neg);
635 volsNegP2.push_back(p2BufferNeg);
639 "Calo::Container::NegativeP2");
644 if (positiveGapSector && positiveP2Sector) {
645 std::vector<Trk::TrackingVolume*> volsITCPos;
646 volsITCPos.push_back(positiveGapSector);
647 volsITCPos.push_back(positiveP2Sector);
648 volsITCPos.push_back(itcPlug1Pos);
652 "Calo::Container::ITCPos");
655 if (negativeGapSector && negativeP2Sector) {
656 std::vector<Trk::TrackingVolume*> volsITCNeg;
657 volsITCNeg.push_back(negativeGapSector);
658 volsITCNeg.push_back(negativeP2Sector);
659 volsITCNeg.push_back(itcPlug1Neg);
663 "Calo::Container::ITCNeg");
674 double zFG = 0.5*(tileBarrelBounds->
halflengthZ()+p1i);
675 double hZ = 0.5*(p1i-tileBarrelBounds->
halflengthZ());
684 tileBarrelFingerGapBounds,
685 barrelFingerGapProperties,
686 dummyLayers, dummyVolumes,
687 "Calo::GapVolumes::Tile::BarrelPositiveFingerGap");
690 tileBarrelFingerGapBounds->
clone(),
691 barrelFingerGapProperties,
692 dummyLayers, dummyVolumes,
693 "Calo::GapVolumes::Tile::BarrelNegativeFingerGap");
698 double zBE = tilePositiveExtendedBarrel->
center().z()+tilePositiveExtendedBarrelBounds.
halflengthZ();
699 zFG = 0.5*(tileZ + zBE);
700 hZ = 0.5*(tileZ - zBE);
713 tilePositiveFingerGapBounds,
715 dummyLayers, dummyVolumes,
716 "Calo::GapVolumes::Tile::PositiveFingerGap");
719 tilePositiveFingerGapBounds->
clone(),
721 dummyLayers, dummyVolumes,
722 "Calo::GapVolumes::Tile::NegativeFingerGap");
743 std::vector<Trk::TrackingVolume*> tileVols;
744 tileVols.push_back(tileNegativeFingerGap);
745 tileVols.push_back(tileNegativeExtendedBarrel);
746 tileVols.push_back(negativeITCSector);
747 tileVols.push_back(tileBarrelNegativeFingerGap);
748 tileVols.push_back(tileBarrel);
749 tileVols.push_back(tileBarrelPositiveFingerGap);
750 tileVols.push_back(positiveITCSector);
751 tileVols.push_back(tilePositiveExtendedBarrel);
752 tileVols.push_back(tilePositiveFingerGap);
756 "Calo::Container::Tile::InnerSector");
759 std::vector<Trk::TrackingVolume*> tileVolumes;
760 tileVolumes.push_back(tileCombinedSector);
761 tileVolumes.push_back(tileGirder);
765 "Calo::Container::Tile::Combined");
769 tileTrackingVolumes->push_back(
tile);
770 tileTrackingVolumes->push_back(tilePositiveExtendedBarrel);
773 ATH_MSG_DEBUG(
"Checking the existence of all Tracking Volumes:" );
795 return tileTrackingVolumes;