19 #include "GeoModelKernel/GeoBox.h"
20 #include "GeoModelKernel/GeoShape.h"
21 #include "GeoModelKernel/GeoShapeShift.h"
22 #include "GeoModelKernel/GeoShapeSubtraction.h"
23 #include "GeoModelKernel/GeoShapeUnion.h"
24 #include "GeoModelKernel/GeoSimplePolygonBrep.h"
25 #include "GeoModelKernel/GeoTrd.h"
26 #include "GeoModelKernel/GeoTube.h"
27 #include "GeoModelKernel/GeoTubs.h"
28 #include "GeoModelKernel/GeoVPhysVol.h"
72 static const InterfaceID IID_IMuonStationTypeBuilder(
"MuonStationTypeBuilder", 1, 0);
73 return IID_IMuonStationTypeBuilder;
83 declareInterface<Muon::MuonStationTypeBuilder>(
this);
91 ATH_CHECK(m_trackingVolumeArrayCreator.retrieve());
92 ATH_MSG_INFO(
"Retrieved tool " << m_trackingVolumeArrayCreator);
95 m_muonMaterial = std::make_unique<Trk::Material>(10e10, 10e10, 0., 0., 0.);
96 if (!m_muonMaterial) {
99 return StatusCode::FAILURE;
104 return StatusCode::SUCCESS;
110 ATH_MSG_DEBUG(
" processing station components for "<< mv->getLogVol()->getName());
113 std::vector<std::unique_ptr<Trk::Layer>> lays{};
119 double layArea=
area(*layBounds);
122 m_volumeConverter.collectMaterial(mv, box_mat, layArea);
125 auto layer = std::make_unique<Trk::PlaneLayer>(Amg::Transform3D::Identity(), layBounds,
128 lays.push_back(std::move(
layer));
133 std::unique_ptr<Trk::TrackingVolumeArray>
136 Cache& cache)
const {
138 << mv->getLogVol()->getName());
145 std::vector<std::pair<double, double>> xVol;
146 double xpos{0}, xh{0};
148 const GeoLogVol* clv = cv->getLogVol();
150 std::string
name = clv->getName();
151 if (
name.find(
"MDT") == std::string::npos &&
name.find(
"RPC") == std::string::npos){
154 xpos = transf.translation().x();
155 if (clv->getShape()->type() ==
"Trd") {
156 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
157 xh =
std::max(trd->getXHalfLength1(), trd->getXHalfLength2());
158 }
else if (clv->getShape()->type() ==
"Box") {
159 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
160 xh = box->getXHalfLength();
164 if (!xVol.size() || xpos > xVol.back().first)
165 xVol.push_back(std::make_pair(xpos, xh));
167 std::vector<std::pair<double, double>>
::iterator it = xVol.begin();
168 while (
it != xVol.end() && xpos > (*it).first) {
171 xVol.insert(
it, std::make_pair(xpos, xh));
175 double xl = xVol[0].second;
176 double xc = xVol[0].first;
177 for (
const auto&
xb : xVol) {
178 if (
xb.first > xc &&
xb.first -
xb.second < xc + xl) {
190 std::vector<std::unique_ptr<Trk::Volume>> compVol;
192 std::vector<const GeoVPhysVol*> compGeo;
193 std::vector<Amg::Transform3D> compTransf;
195 const GeoLogVol* clv = cv->getLogVol();
196 std::unique_ptr<Trk::VolumeBounds> volBounds{};
197 std::unique_ptr<Trk::Volume> vol{};
198 if (clv->getShape()->type() ==
"Trd") {
199 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
200 const double halfX1{trd->getXHalfLength1()}, halfX2{trd->getXHalfLength2()},
201 halfY1{trd->getYHalfLength1()}, halfY2{trd->getYHalfLength2()},
202 halfZ{trd->getZHalfLength()};
203 volBounds = std::make_unique<Trk::CuboidVolumeBounds>(
std::max(halfX1, halfX2),
std::max(halfY1, halfY2), halfZ);
204 }
else if (clv->getShape()->type() ==
"Box") {
205 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
206 volBounds = m_geoShapeConverter.convert(box);
208 double xSize = get_x_size(cv);
209 ATH_MSG_VERBOSE(
"subvolume not box nor trapezoid, estimated x size:" << xSize);
210 volBounds = std::make_unique<Trk::CuboidVolumeBounds>(xSize, envelope.
halflengthY(), envelope.
halflengthZ());
212 vol = std::make_unique<Trk::Volume>(
makeTransform(transf), volBounds.release());
214 std::string cname = clv->getName();
215 const std::string& vname = mv->getLogVol()->getName();
216 int nameSize = vname.size() - 8;
217 if (cname.compare(0, nameSize, vname, 0, nameSize) == 0)
218 cname = cname.substr(nameSize, cname.size() - nameSize);
220 if (compVol.empty() || vol->center().x() >= compVol.back()->center().x()) {
221 compVol.push_back(std::move(vol));
223 compGeo.push_back(cv);
224 compTransf.push_back(transf);
226 std::vector<std::unique_ptr<Trk::Volume>>
::iterator volIter = compVol.begin();
231 while (vol->center().x() >= (*volIter)->center().x()) {
237 compVol.insert(volIter, std::move(vol));
239 compGeo.insert(geoIter, cv);
240 compTransf.insert(transfIter, transf);
245 std::vector<std::unique_ptr<Trk::TrackingVolume>> trkVols{};
249 double currX = -envX;
251 bool openSpacer{
false}, openRpc{
false};
252 std::vector<const GeoVPhysVol*> geoSpacer{}, geoRpc{};
253 std::vector<Amg::Transform3D> transfSpacer{}, transfRpc{};
254 double spacerlowXsize{0.}, spaceruppXsize{0.}, rpclowXsize{0.}, rpcuppXsize{0.};
255 std::vector<float> volSteps;
256 volSteps.push_back(-envX);
257 for (
unsigned i = 0;
i < compVol.size(); ++
i) {
258 bool comp_processed =
false;
263 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" box station component does not return cuboid shape "
264 <<
typeid(volBounds).
name());
268 double lowX = compVol[
i]->center().x() - compBounds->
halflengthX();
269 double uppX = compVol[
i]->center().x() + compBounds->
halflengthX();
274 <<
": low edge of next volume:" << lowX);
282 double Xcurr = compVol[
i]->center().x() - compBounds->
halflengthX();
283 if (Xcurr >= currX + rpclowXsize + rpcuppXsize) {
284 auto rpcBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (Xcurr - currX), envY, envZ);
286 auto rpcVol = std::make_unique<Trk::Volume>(
makeTransform(std::move(rpcTrf)),
287 rpcBounds.release());
288 std::unique_ptr<Trk::TrackingVolume> rpcTrkVol = processRpc(*rpcVol, geoRpc, transfRpc, cache);
289 trkVols.push_back(std::move(rpcTrkVol));
290 volSteps.push_back(Xcurr);
300 double Xcurr = compVol[
i]->center().x() - compBounds->
halflengthX();
301 if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >= -
tolerance) {
302 auto spacerBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (Xcurr - currX), envY, envZ);
305 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{processSpacer(spacerVol, geoSpacer, transfSpacer)};
306 trkVols.emplace_back(std::move(spacerTrkVol));
307 volSteps.push_back(Xcurr);
318 geoRpc.push_back(compGeo[
i]);
320 transfRpc.push_back(compTransf[
i]);
322 rpclowXsize = compVol[
i]->center().x() - currX;
329 geoRpc.push_back(compGeo[
i]);
330 transfRpc.push_back(compTransf[
i]);
335 if (compVol[
i]->center().
x() + compBounds->
halflengthX() > currX + rpclowXsize + rpcuppXsize) {
336 rpcuppXsize += (compVol[
i]->center().x() + compBounds->
halflengthX()) -
337 (currX + rpclowXsize + rpcuppXsize);
340 comp_processed =
true;
346 geoSpacer.push_back(compGeo[
i]);
347 transfSpacer.clear();
348 transfSpacer.push_back(compTransf[
i]);
350 spacerlowXsize = compVol[
i]->center().x() - currX;
353 if (std::abs(spacerlowXsize) <
355 ATH_MSG_WARNING(
"spacer low edge - not enough space:current:center:halfSize:"
356 << currX <<
"," << compVol[
i]->center().
x() <<
"," << compBounds->
halflengthX());
359 geoSpacer.push_back(compGeo[
i]);
360 transfSpacer.push_back(compTransf[
i]);
363 ATH_MSG_WARNING(
"spacer low edge - not enough space:current:center:halfSize:"
364 << currX <<
"," << compVol[
i]->center().
x() <<
"," << compBounds->
halflengthX());
366 if (compVol[
i]->center().
x() + compBounds->
halflengthX() > currX + spacerlowXsize + spaceruppXsize) {
367 spaceruppXsize += (compVol[
i]->center().x() + compBounds->
halflengthX()) -
368 (currX + spacerlowXsize + spaceruppXsize);
371 comp_processed =
true;
374 std::unique_ptr<Trk::Volume> mdtVol;
376 double zShift = compVol[
i]->transform().translation().z();
377 if (std::abs(zShift) > 0) {
380 double boundHalfLengthX{0.};
382 auto mdtBounds = std::make_unique<Trk::CuboidVolumeBounds>(compBounds->
halflengthX(), envY, envZ);
383 boundHalfLengthX = mdtBounds->halflengthX();
385 mdtBounds.release());
387 if (std::abs(lowX - currX) > 0.002) {
388 ATH_MSG_DEBUG(
"Mdt volume size does not match the envelope:lowX,currX:"<< lowX <<
"," << currX);
391 auto mdtBounds = std::make_unique<Trk::CuboidVolumeBounds>(compBounds->
halflengthX() + 0.5 * (lowX - currX),
393 boundHalfLengthX = mdtBounds->halflengthX();
396 mdtBounds.release());
398 double shiftSign = 1.;
399 if (std::abs(zShift) > 0.) {
400 const std::string& stName = mv->getLogVol()->getName();
401 if (stName.compare(0, 4,
"BIR3") == 0 || stName.compare(0, 4,
"BIR5") == 0 ||
402 stName.compare(0, 4,
"BIR7") == 0 || stName.compare(0, 5,
"BIR10") == 0) {
407 std::unique_ptr<Trk::TrackingVolume> mdtTrkVol{processMdtBox(*mdtVol, compGeo[
i],
409 shiftSign * std::abs(zShift), cache)};
410 trkVols.push_back(std::move(mdtTrkVol));
411 currX += 2. * boundHalfLengthX;
412 volSteps.push_back(currX);
413 comp_processed =
true;
416 if (!comp_processed) {
423 if (maxX >= currX + spacerlowXsize + spaceruppXsize) {
424 auto spacerBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (maxX - currX), envY, envZ);
427 spacerBounds.release());
428 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{processSpacer(spacerVol, geoSpacer, transfSpacer)};
429 trkVols.emplace_back(std::move(spacerTrkVol));
431 volSteps.push_back(currX);
437 if (maxX >= currX + rpclowXsize + rpcuppXsize) {
438 auto rpcBounds = std::make_unique<Trk::CuboidVolumeBounds>(0.5 * (maxX - currX), envY, envZ);
440 auto rpcVol = std::make_unique<Trk::Volume>(
makeTransform(std::move(rpcTrf)),
441 rpcBounds.release());
442 std::unique_ptr<Trk::TrackingVolume> rpcTrkVol{processRpc(*rpcVol, geoRpc, transfRpc, cache)};
443 trkVols.push_back(std::move(rpcTrkVol));
445 volSteps.push_back(currX);
452 std::unique_ptr<Trk::TrackingVolumeArray> components{};
455 components.reset(m_trackingVolumeArrayCreator->cuboidVolumesArrayNav(
Muon::release(trkVols), binUtility.release(),
false));
461 std::unique_ptr<Trk::TrackingVolumeArray>
464 Cache& cache)
const {
465 ATH_MSG_DEBUG(
" processing station components for " << mv->getLogVol()->getName());
473 std::vector<std::unique_ptr<Trk::Volume>> compVol;
475 std::vector<const GeoVPhysVol*> compGeo;
476 std::vector<Amg::Transform3D> compTransf;
478 const GeoLogVol* clv = cv->getLogVol();
480 std::unique_ptr<Trk::VolumeBounds> bounds{};
482 if (clv->getShape()->type() ==
"Trd") {
483 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
484 const double halfX1 = trd->getXHalfLength1();
485 const double halfX2 = trd->getXHalfLength2();
486 const double halfY1 = trd->getYHalfLength1();
487 const double halfY2 = trd->getYHalfLength2();
488 const double halfZ = trd->getZHalfLength();
489 if (halfX1 == halfX2 && halfY1 == halfY2)
490 bounds = std::make_unique<Trk::CuboidVolumeBounds>(
std::max(halfX1, halfX2),
492 if (halfX1 == halfX2 && halfY1 != halfY2) {
495 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfY1, halfY2,
498 if (halfX1 != halfX2 && halfY1 == halfY2) {
499 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(halfX1, halfX2,
505 }
else if (clv->getShape()->type() ==
"Box") {
506 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
507 const double halfX1 = box->getXHalfLength();
508 const double halfY1 = box->getYHalfLength();
509 const double halfZ = box->getZHalfLength();
510 bounds = std::make_unique<Trk::CuboidVolumeBounds>(halfX1, halfY1, halfZ);
512 double xSize = get_x_size(cv);
514 if (clv->getName().compare(0, 1,
"C") != 0 && clv->getName().compare(0, 2,
"LB") != 0) {
518 bounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envelope.
minHalflengthX(),
522 auto vol = std::make_unique<Trk::Volume>(
makeTransform(std::move(boxTrf)),
524 std::string cname = clv->getName();
525 std::string vname = mv->getLogVol()->getName();
526 int nameSize = vname.size() - 8;
527 if (cname.compare(0, nameSize, vname, 0, nameSize) == 0) {
528 cname = cname.substr(nameSize, cname.size() - nameSize);
531 if (compVol.empty() || vol->center().x() >= compVol.back()->center().x()) {
532 compVol.emplace_back(std::move(vol));
534 compGeo.push_back(cv);
535 compTransf.push_back(transf);
537 std::vector<std::unique_ptr<Trk::Volume>>
::iterator volIter = compVol.begin();
541 while (vol->center().x() >= (*volIter)->center().x()) {
547 compVol.insert(volIter, std::move(vol));
549 compGeo.insert(geoIter, cv);
550 compTransf.insert(transfIter, transf);
554 std::vector<std::unique_ptr<Trk::TrackingVolume>> trkVols;
558 double currX{-envZ}, maxX{envZ};
560 bool openSpacer =
false;
561 std::vector<const GeoVPhysVol*> geoSpacer{}, geoRpc{};
562 std::vector<Amg::Transform3D> transfSpacer{}, transfRpc{};
563 double spacerlowXsize{0.}, spaceruppXsize{0.}, Xcurr{0.}, lowX{0.}, uppX{0.};
564 std::vector<float> volSteps;
566 for (
unsigned i = 0;
i < compVol.size();
i++) {
567 bool comp_processed =
false;
572 lowX = compVol[
i]->center().x() - compCubBounds->
halflengthX();
573 uppX = compVol[
i]->center().x() + compCubBounds->
halflengthX();
574 }
else if (compTrdBounds) {
575 lowX = compVol[
i]->center().x() - compTrdBounds->
halflengthZ();
576 uppX = compVol[
i]->center().x() + compTrdBounds->
halflengthZ();
586 if (!compCubBounds && !compTrdBounds) {
587 ATH_MSG_WARNING(__FILE__<<
":"<<__LINE__<<
" Unknown volume shape "<<
typeid(volBounds).
name());
592 if (Xcurr - currX - (spacerlowXsize + spaceruppXsize) >=-
tolerance) {
593 auto spacerBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY,
594 0.5 * (Xcurr - currX));
598 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{processSpacer(spacerVol, geoSpacer, transfSpacer)};
599 trkVols.push_back(std::move(spacerTrkVol));
601 volSteps.push_back(Xcurr);
604 ATH_MSG_DEBUG(mv->getLogVol()->getName()<<
" : clash in spacer definition ");
608 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
": RPC components in endcaps? ");
614 geoSpacer.push_back(compGeo[
i]);
615 transfSpacer.clear();
616 transfSpacer.push_back(compTransf[
i]);
618 spacerlowXsize = compVol[
i]->center().x() - currX;
622 if (spacerlowXsize < compCubBounds->halflengthX()){
623 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
629 if (spacerlowXsize < compTrdBounds->halflengthZ()) {
630 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
634 geoSpacer.push_back(compGeo[
i]);
635 transfSpacer.push_back(compTransf[
i]);
638 if (compVol[
i]->center().
x() - currX < compCubBounds->halflengthX()) {
639 ATH_MSG_DEBUG( mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
641 if (compVol[
i]->center().
x() + compCubBounds->
halflengthX() > currX + spacerlowXsize + spaceruppXsize) {
642 spaceruppXsize += (compVol[
i]->center().x() + compCubBounds->
halflengthX()) -
643 (currX + spacerlowXsize + spaceruppXsize);
645 }
else if (compTrdBounds) {
646 if (compVol[
i]->center().x() - currX < compTrdBounds->
halflengthZ()) {
647 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
", spacer low edge - not enough space");
649 if (compVol[
i]->center().
x() + compTrdBounds->
halflengthZ() > currX + spacerlowXsize + spaceruppXsize) {
650 spaceruppXsize += (compVol[
i]->center().x() + compTrdBounds->
halflengthZ()) -
651 (currX + spacerlowXsize + spaceruppXsize);
655 comp_processed =
true;
658 std::unique_ptr<Trk::Volume> mdtVol{};
660 if (std::abs(lowX - currX) > 0.002) {
661 ATH_MSG_DEBUG(
"Mdt volume size does not match the envelope:lowX,currX:"<< lowX <<
"," << currX);
664 auto mdtBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY, dZ + 0.5 * (lowX - currX));
665 const double halfZ = mdtBounds->halflengthZ();
667 mdtBounds.release());
668 std::unique_ptr<Trk::TrackingVolume> mdtTrkVol{processMdtTrd(*mdtVol, compGeo[
i], compTransf[
i], cache)};
669 trkVols.push_back(std::move(mdtTrkVol));
671 volSteps.push_back(currX);
672 comp_processed =
true;
680 if (maxX >= currX + spacerlowXsize + spaceruppXsize) {
681 auto spacerBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(envX1, envX2, envY,
682 0.5 * (maxX - currX));
688 std::unique_ptr<Trk::TrackingVolume> spacerTrkVol{processSpacer(spacerVol, geoSpacer, transfSpacer)};
689 trkVols.push_back(std::move(spacerTrkVol));
691 volSteps.push_back(currX);
694 ATH_MSG_DEBUG(mv->getLogVol()->getName() <<
", clash in spacer definition (last volume)");
700 std::unique_ptr<Trk::BinUtility> binUtility = std::make_unique<Trk::BinUtility>(volSteps,
703 std::unique_ptr<Trk::TrackingVolumeArray> components{m_trackingVolumeArrayCreator->trapezoidVolumesArrayNav(
Muon::release(trkVols),
704 binUtility.release(),
false)};
711 return StatusCode::SUCCESS;
715 const GeoVPhysVol* gv,
717 double zShift,
Cache& cache)
const {
718 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
719 std::vector<double> x_array{}, x_ref{}, x_thickness{};
720 std::vector<Trk::MaterialProperties*> x_mat;
721 std::vector<int> x_active;
722 double currX = -100000;
725 const GeoLogVol* clv = cv->getLogVol();
729 if ((clv->getName()).compare(0, 3,
"MDT") == 0) {
732 const GeoTube*
tube =
dynamic_cast<const GeoTube*
>(clv->getShape());
736 double volume = 8 * (
tube->getRMax()) * (
tube->getZHalfLength()) * xv;
737 cache.
m_mdtTubeMat = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(cv, volume, 2 * xv));
743 if ((clv->getName()) ==
"MultiLayerFoam") {
744 xv = decodeX(clv->getShape());
746 if (std::abs(xv - 0.5 *
i->thickness()) < 0.001) {
754 ATH_MSG_ERROR(__FILE__<<
":"<<__LINE__<<
" box station component does not return cuboid shape");
757 cache.
m_mdtFoamMat.push_back(std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(cv, volume, 2 * xv)));
763 if (transfc.translation().x() != currX) {
764 if (x_array.empty() || transfc.translation().x() > x_array.back()) {
765 x_array.push_back(transfc.translation().x());
766 x_mat.push_back(mdtMat);
767 x_thickness.push_back(2 * xv);
768 x_active.push_back(
active);
769 currX = transfc.translation().x();
770 if (std::abs(transfc.translation().y()) > 0.001) {
772 double ref = transfc.translation().z() + 1e5;
773 ref +=
int(1000 * transfc.translation().y()) * 10e6;
774 x_ref.push_back(
ref);
776 x_ref.push_back(transfc.translation().z());
784 while (transfc.translation().x() > *xIter) {
789 x_array.insert(xIter, transfc.translation().x());
790 x_mat.insert(mIter, mdtMat);
791 x_thickness.insert(tIter, 2 * xv);
792 x_active.insert(aIter,
active);
793 if (std::abs(transfc.translation().y()) > 0.001) {
795 double sign = (transfc.translation().y() > 0.) ? 1. : -1.;
796 double ref = transfc.translation().z() +
sign * 1e5;
797 ref +=
int(1000 * transfc.translation().y()) * 10e6;
798 x_ref.insert(rIter,
ref);
800 x_ref.insert(rIter, transfc.translation().z());
802 currX = transfc.translation().x();
807 double thickness{0.};
808 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
814 const auto bounds = std::make_shared<Trk::RectangleBounds>(yv, zv);
815 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
817 thickness = x_thickness[iloop];
827 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, mdtMaterial, thickness, std::move(od));
828 layer->setRef(x_ref[iloop] - zShift);
830 layer->setLayerType(x_active[iloop]);
834 minX = transf.translation().x() - volBounds->
halflengthX();
837 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
838 std::vector<float> binSteps;
841 binSteps.push_back(minX);
844 for (
unsigned int i = 0;
i <
layers.size(); ++
i) {
847 currX = ltransf.translation().x() + 0.5 *
layers[
i]->thickness();
848 binSteps.push_back(currX);
850 layerOrder.emplace_back(std::move(
layers[
i]));
852 binSteps.push_back(transf.translation().x() + volBounds->
halflengthX());
858 auto mdtLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder,
859 binUtility.release(),
862 return std::make_unique<Trk::TrackingVolume>(vol, *m_muonMaterial, mdtLayerArray.release(),
nullptr,
"MDT");
866 std::unique_ptr<Trk::TrackingVolume>
868 const GeoVPhysVol* gv,
870 Cache& cache)
const {
872 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
873 std::vector<double> x_array{},x_thickness{},x_ref{};
874 std::vector<Trk::MaterialProperties*> x_mat{};
875 std::vector<int> x_active;
876 double currX = -100000;
878 const GeoLogVol* clv = cv->getLogVol();
881 if (clv->getShape()->type() ==
"Trd") {
882 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
883 double x1v = trd->getXHalfLength1();
884 double x2v = trd->getXHalfLength2();
889 if ((clv->getName()).compare(0, 3,
"MDT") == 0) {
892 const GeoTube*
tube =
dynamic_cast<const GeoTube*
>(clv->getShape());
893 double volume = 8 * (
tube->getRMax()) * (
tube->getZHalfLength()) * xv;
894 cache.
m_mdtTubeMat = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(cv, volume, 2 * xv));
899 if ((clv->getName()) ==
"MultiLayerFoam") {
900 xv = decodeX(clv->getShape());
902 if (std::abs(xv - 0.5 *
i->thickness()) < 0.001) {
911 ATH_MSG_ERROR(
"trd station component does not return trapezoid shape");
914 cache.
m_mdtFoamMat.push_back(std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(cv, volume, 2 * xv)));
919 if (transfc.translation().x() != currX) {
920 if (x_array.empty() || transfc.translation().x() > x_array.back()) {
921 x_array.push_back(transfc.translation().x());
922 x_mat.push_back(mdtMat);
923 x_thickness.push_back(2 * xv);
924 x_ref.push_back(transfc.translation().z());
925 currX = transfc.translation().x();
926 x_active.push_back(
active);
933 while (transfc.translation().x() > *xIter) {
938 x_array.insert(xIter, transfc.translation().x());
939 x_mat.insert(mIter, mdtMat);
940 x_thickness.insert(tIter, 2 * xv);
941 x_ref.insert(rIter, transfc.translation().z());
942 x_active.insert(aIter,
active);
943 currX = transfc.translation().x();
948 double thickness{0.};
949 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
959 auto bounds = std::make_shared<const Trk::TrapezoidBounds>(x1v, x2v, yv);
960 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
961 thickness = x_thickness[iloop];
969 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, mdtMaterial, thickness, std::move(od));
971 layer->setLayerType(x_active[iloop]);
972 layer->setRef(x_ref[iloop]);
977 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
978 std::vector<float> binSteps;
980 double minX = transf.translation().x() - volBounds->
halflengthZ();
981 binSteps.push_back(minX);
984 for (
unsigned int i = 0;
i <
layers.size(); ++
i) {
987 currX = ltransf.translation().x() + 0.5 *
layers[
i]->thickness();
988 binSteps.push_back(currX);
990 layerOrder.emplace_back(std::move(
layers[
i]));
992 binSteps.push_back(transf.translation().x() + volBounds->
halflengthZ());
995 auto mdtLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
998 return std::make_unique<Trk::TrackingVolume>(vol, *m_muonMaterial, mdtLayerArray.release(),
nullptr,
"MDT");
1002 const std::vector<const GeoVPhysVol*>& gv,
1003 const std::vector<Amg::Transform3D>& transfc,
Cache& cache)
const {
1006 std::vector<std::unique_ptr<Trk::Layer>>
layers{};
1007 for (
unsigned int ic = 0;
ic < gv.size(); ++
ic) {
1008 const GeoLogVol* glv = gv[
ic]->getLogVol();
1009 const GeoShape* shape = glv->getShape();
1010 if (shape->type() !=
"Box" && shape->type() !=
"Trd") {
1011 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(shape);
1012 const GeoShape* subt =
nullptr;
1014 subt = sub->getOpA();
1015 sub =
dynamic_cast<const GeoShapeSubtraction*
>(subt);
1019 if (shape && shape->type() ==
"Box") {
1020 const GeoBox* box =
dynamic_cast<const GeoBox*
>(shape);
1021 double xs = box->getXHalfLength();
1022 double ys = box->getYHalfLength();
1023 double zs = box->getZHalfLength();
1025 double thickness = 2 * xs;
1026 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
1027 auto bounds = std::make_shared<const Trk::RectangleBounds>(ys, zs);
1030 if (glv->getName().compare(0, 3,
"Ded") == 0) {
1034 if (std::abs(thickness -
i->thickness()) < 0.001) {
1041 double volc = 8 * xs * ys * zs;
1042 cache.
m_rpcDed.push_back(std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gv[
ic], volc, 2 * xs)));
1047 if (std::abs(thickness - 46.0) < 0.001) {
1049 double volc = 8 * xs * ys * zs;
1050 cache.
m_rpc46 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gv[
ic], volc, 2 * xs));
1054 ATH_MSG_WARNING(
"RPC module thickness different from 46: "<< thickness);
1059 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, rpcMaterial, thickness, std::move(od));
1062 if ((glv->getName()).compare(0, 3,
"Ded") != 0) {
1063 layer->setLayerType(1);
1065 layer->setLayerType(0);
1068 }
else if (shape && shape->type() ==
"Trd") {
1069 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shape);
1070 double xs1 = trd->getXHalfLength1();
1071 double xs2 = trd->getXHalfLength2();
1072 double ys1 = trd->getYHalfLength1();
1073 double ys2 = trd->getYHalfLength2();
1074 double zs = trd->getZHalfLength();
1076 if (xs1 == xs2 && ys1 == ys2) {
1077 double thickness = 2 * xs1;
1078 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
1079 auto bounds = std::make_shared<const Trk::RectangleBounds>(ys1, zs);
1082 if ((glv->getName()).compare(0, 3,
"Ded") == 0) {
1086 if (std::abs(thickness -
i->thickness()) < 0.001) {
1093 double volc = 8 * xs1 * ys1 * zs;
1094 cache.
m_rpcDed.push_back(std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gv[
ic], volc, 2 * xs1)));
1099 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, rpcMaterial, thickness, std::move(od));
1100 layer->setLayerType(0);
1104 unsigned int ngc = gv[
ic]->getNChildVols();
1105 for (
unsigned int igc = 0; igc < ngc; igc++) {
1108 trgc = gv[
ic]->getXToChildVol(igc);
1112 const GeoVPhysVol* gcv = gv[
ic]->getChildVol(igc);
1113 const GeoLogVol* gclv = gcv->getLogVol();
1114 const GeoShape* lshape = gclv->getShape();
1115 while (lshape->type() ==
"Subtraction") {
1116 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(lshape);
1117 lshape = sub->getOpA();
1119 const GeoTrd* gtrd =
dynamic_cast<const GeoTrd*
>(lshape);
1120 double gx = gtrd->getXHalfLength1();
1121 double gy = gtrd->getYHalfLength1();
1122 double gz = gtrd->getZHalfLength();
1124 if ((gclv->getName()).
compare(0, 6,
"RPC_AL") == 0) {
1125 if (std::abs(gx - 5.0) < 0.001) {
1127 double volc = 8 * gx * gy * gz;
1129 std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gcv, volc, 2 * gx));
1132 }
else if (std::abs(gx - 4.3) < 0.001) {
1134 double volc = 8 * gx * gy * gz;
1136 std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gcv, volc, 2 * gx));
1146 bounds, rpcMaterial, thickness, std::move(od));
1147 layer->setLayerType(0);
1149 }
else if ((gclv->getName()) ==
"Rpclayer") {
1151 if (std::abs(gx - 6.85) > 0.001 && std::abs(gx - 5.9) > 0.001) {
1152 ATH_MSG_WARNING(
"processRpc() - unusual thickness of RPC ("<< glv->getName()<<
") layer :" << 2 * gx);
1155 double volc = 8 * gx * gy * gz;
1157 std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(gcv, volc, 2 * gx));
1164 bounds, rpcMaterial, thickness, std::move(od));
1165 layer->setLayerType(1);
1182 return std::make_unique<Trk::TrackingVolume>(vol, *m_muonMaterial, rpcLayers.release(),
"RPC");
1187 std::vector<const GeoVPhysVol*> gv,
1188 std::vector<Amg::Transform3D> transf)
const {
1190 std::vector<std::unique_ptr<Trk::Layer>>
layers{};
1194 while (
idx < gv.size()) {
1195 const GeoVPhysVol* vol = gv[
idx];
1197 if (vol->getNChildVols()) {
1198 for (
unsigned int ich = 0; ich < vol->getNChildVols(); ++ich) {
1199 gv.push_back(vol->getChildVol(ich));
1200 transf.emplace_back(tf * vol->getXToChildVol(ich));
1202 gv.erase(gv.begin() +
idx);
1203 transf.erase(transf.begin() +
idx);
1209 for (
unsigned int ic = 0;
ic < gv.size(); ++
ic) {
1210 const GeoLogVol* clv = gv[
ic]->getLogVol();
1211 Trk::Material cmat = m_materialConverter.convert(clv->getMaterial());
1213 << cmat.
X0 <<
" L0 " << cmat.
L0 <<
" A " << cmat.
A
1214 <<
" Z " << cmat.
Z <<
" rho " << cmat.
rho);
1215 if (clv->getShape()->type() ==
"Box") {
1216 const GeoBox* box =
dynamic_cast<const GeoBox*
>(clv->getShape());
1217 double xs = box->getXHalfLength();
1218 double ys = box->getYHalfLength();
1219 double zs = box->getZHalfLength();
1222 double thickness{0.};
1224 if (zs <= xs && zs <= ys) {
1225 bounds = std::make_shared<const Trk::RectangleBounds>(xs, ys);
1228 }
else if (xs <= ys && xs <= zs) {
1229 bounds = std::make_shared<Trk::RectangleBounds>(ys, zs);
1233 bounds = std::make_shared<Trk::RectangleBounds>(xs, zs);
1240 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, spacerMaterial, thickness,
nullptr, 0);
1242 }
else if (clv->getShape()->type() ==
"Subtraction") {
1243 const GeoShapeSubtraction* sub =
1244 dynamic_cast<const GeoShapeSubtraction*
>(clv->getShape());
1245 if (sub && sub->getOpA()->type() ==
"Box" && sub->getOpB()->type() ==
"Box") {
1247 const GeoBox* boxA =
dynamic_cast<const GeoBox*
>(sub->getOpA());
1248 const GeoBox* boxB =
dynamic_cast<const GeoBox*
>(sub->getOpB());
1249 auto bounds = std::make_shared<const Trk::RectangleBounds>(boxA->getYHalfLength(), boxA->getZHalfLength());
1250 double thickness = (boxA->getXHalfLength() - boxB->getXHalfLength());
1251 double shift = 0.5 * (boxA->getXHalfLength() + boxB->getXHalfLength());
1254 if (thickness > 0.) {
1260 bounds, spacerMaterial, thickness,
nullptr, 0);
1261 layers.push_back(std::move(layx));
1264 bounds, spacerMaterial, thickness,
nullptr, 0);
1265 layers.push_back(std::move(layxx));
1267 thickness = (boxA->getYHalfLength() - boxB->getYHalfLength());
1268 if (thickness > 0.) {
1271 shift = 0.5 * (boxA->getYHalfLength() + boxB->getYHalfLength());
1272 bounds = std::make_shared<const Trk::RectangleBounds>(boxB->getXHalfLength(), boxA->getZHalfLength());
1274 bounds, spacerMaterial, thickness,
nullptr, 0);
1275 layers.push_back(std::move(lay));
1278 bounds, spacerMaterial, thickness,
nullptr, 0);
1280 layers.push_back(std::move(layy));
1282 thickness = (boxA->getZHalfLength() - boxB->getZHalfLength());
1283 if (thickness > 0.) {
1286 shift = 0.5 * (boxA->getZHalfLength() + boxB->getZHalfLength());
1287 bounds = std::make_shared<const Trk::RectangleBounds>(boxB->getXHalfLength(), boxB->getYHalfLength());
1289 bounds, spacerMaterial, thickness,
nullptr, 0);
1290 layers.push_back(std::move(layz));
1293 bounds, spacerMaterial, thickness,
nullptr, 0);
1294 layers.push_back(std::move(layzz));
1297 std::vector<std::pair<const GeoShape*, Amg::Transform3D>> subVs;
1298 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(sub->getOpB());
1300 subVs.emplace_back(shift->getOp(), shift->getX());
1301 const GeoShape* shape = sub->getOpA();
1302 while (shape->type() ==
"Subtraction") {
1303 const GeoShapeSubtraction* subtr =
dynamic_cast<const GeoShapeSubtraction*
>(shape);
1304 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(subtr->getOpB());
1306 subVs.emplace_back(shift->getOp(), shift->getX());
1307 shape = subtr->getOpA();
1309 const GeoBox* box =
dynamic_cast<const GeoBox*
>(shape);
1310 if (box && subVs.size() == 4) {
1311 std::unique_ptr<Trk::Volume> v1{},
v2{};
1312 std::unique_ptr<Trk::VolumeExcluder> volExcl =
nullptr;
1313 const GeoBox* sb1 =
dynamic_cast<const GeoBox*
>(subVs[0].first);
1316 m_geoShapeConverter.convert(sb1).release());
1318 const GeoBox* sb2 =
dynamic_cast<const GeoBox*
>(subVs[1].first);
1321 m_geoShapeConverter.convert(sb2).release());
1323 const GeoBox* boxB =
dynamic_cast<const GeoBox*
>(subVs[2].first);
1324 if (boxB && v1 &&
v2) {
1325 auto bounds = std::make_shared<const Trk::RectangleBounds>(box->getYHalfLength(), box->getZHalfLength());
1326 double thickness = (box->getXHalfLength() - boxB->getXHalfLength());
1327 double shift{0.5 * (box->getXHalfLength() + boxB->getXHalfLength())};
1328 auto combinedBounds = std::make_unique<Trk::CombinedVolumeBounds>(v1.release(),
v2.release(),
false);
1330 combinedBounds.release());
1331 volExcl = std::make_unique<Trk::VolumeExcluder>(cVol->clone());
1333 auto subPlane = std::make_unique<Trk::SubtractedPlaneSurface>(std::move(surf), volExcl.release(),
false);
1334 auto subPlaneX = std::make_unique<Trk::SubtractedPlaneSurface>(*subPlane,
Amg::getTranslateX3D(-2 * shift));
1339 auto layx = std::make_unique<Trk::SubtractedPlaneLayer>(subPlane.get(), spacerMaterial, thickness,
nullptr, 0);
1340 layers.push_back(std::move(layx));
1342 auto layxx = std::make_unique<Trk::SubtractedPlaneLayer>(subPlaneX.get(), spacerMaterial, thickness,
nullptr, 0);
1343 layers.push_back(std::move(layxx));
1345 bounds = std::make_shared<const Trk::RectangleBounds>( boxB->getXHalfLength(), box->getZHalfLength());
1346 thickness = subVs[2].second.translation().mag();
1349 auto volEx = std::make_unique<Trk::VolumeExcluder>(std::make_unique<Trk::Volume>(*cVol,
Amg::getTranslateX3D(2 * shift)).
release());
1352 auto subPlaneBis = std::make_unique<Trk::SubtractedPlaneSurface>(std::move(surf), volEx.release(),
false);
1355 auto lay = std::make_unique<Trk::SubtractedPlaneLayer>(subPlaneBis.get(), spacerMaterial, thickness,
nullptr, 0);
1356 layers.push_back(std::move(lay));
1360 ATH_MSG_DEBUG(clv->getName() <<
", unresolved spacer component " << clv->getName());
1363 ATH_MSG_DEBUG(clv->getName() <<
", unresolved spacer component " << clv->getName());
1368 for (; lIt !=
layers.end(); ++lIt)
1369 if ((*lIt)->thickness() < 0.)
1373 auto spacer = std::make_unique<Trk::TrackingVolume>(vol, *m_muonMaterial, spacerLayers.release(),
"Spacer");
1375 if (!m_resolveSpacer) {
1377 auto laySpacer = createLayerRepresentation(*
spacer);
1378 laySpacer.first->setLayerType(0);
1380 layers.push_back(std::move(laySpacer.first));
1382 spacer = std::make_unique<Trk::TrackingVolume>(vol, *m_muonMaterial, spacerLays.release(),
"Spacer");
1389 const std::string&
name,
1390 Cache& cache)
const {
1395 bool isDiamond =
false;
1396 double xMin{0.}, xMed{0.}, xMax{0},
y1{0.},
y2{0},
z{0.};
1398 const GeoVPhysVol* cv = &(*(mv->getChildVol(0)));
1399 const GeoLogVol* clv = cv->getLogVol();
1402 if (clv->getShape()->type() ==
"Shift") {
1403 const GeoShapeShift* shift =
1404 dynamic_cast<const GeoShapeShift*
>(clv->getShape());
1405 if (shift->getOp()->type() ==
"Union") {
1409 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(shift->getOp());
1410 if (uni->getOpA()->type() ==
"Trd") {
1411 const GeoTrd* trdA =
dynamic_cast<const GeoTrd*
>(uni->getOpA());
1412 xMin = trdA->getYHalfLength1();
1413 xMed = trdA->getYHalfLength2();
1414 y1 = trdA->getZHalfLength();
1415 z = trdA->getXHalfLength1();
1417 if (uni->getOpB()->type() ==
"Shift") {
1418 const GeoShapeShift*
sh =
dynamic_cast<const GeoShapeShift*
>(uni->getOpB());
1419 const GeoTrd* trdB =
dynamic_cast<const GeoTrd*
>(
sh->getOp());
1420 if (trdB->getYHalfLength1() != xMed || trdB->getXHalfLength1() !=
z) {
1422 ": something is wrong: dimensions of 2 trapezoids do not match");
1424 xMax = trdB->getYHalfLength2();
1425 y2 = trdB->getZHalfLength();
1428 if (shift->getOp()->type() ==
"Trd") {
1430 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shift->getOp());
1431 xMin = trd->getYHalfLength1();
1432 xMed = trd->getYHalfLength2();
1433 y1 = trd->getZHalfLength();
1434 z = trd->getXHalfLength1();
1437 if (clv->getShape()->type() ==
"Trd") {
1439 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
1440 xMin = trd->getYHalfLength1();
1441 xMed = trd->getYHalfLength2();
1442 y1 = trd->getZHalfLength();
1443 z = trd->getXHalfLength1();
1447 std::vector<Amg::Transform3D> compTransf;
1449 std::vector<const GeoVPhysVol*> compGeoVol;
1450 std::vector<double> xSizes;
1451 double xmn = +10000.;
1452 double xmx = -10000.;
1454 const GeoLogVol* clv = cv->getLogVol();
1455 unsigned int ich = compTransf.size();
1457 compName.push_back(clv->getName());
1458 compGeoVol.push_back(cv);
1459 if (clv->getShape()->type() ==
"Shift") {
1460 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(clv->getShape());
1461 if (shift->getOp()->type() ==
"Union") {
1464 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(shift->getOp());
1465 if (uni->getOpA()->type() ==
"Trd") {
1466 const GeoTrd* trdA =
dynamic_cast<const GeoTrd*
>(uni->getOpA());
1467 double xSize = trdA->getXHalfLength1();
1468 if (!xSizes.empty()){
1469 xSizes.push_back((std::abs(
transform.translation().x() - compTransf[ich - 1].translation().x()) - xSizes.back()));
1471 xSizes.push_back(xSize);
1473 double xpos = (
transform * shift->getX()).translation().x();
1474 xmn =
std::min(xmn, xpos - xSizes.back());
1475 xmx =
std::max(xmx, xpos + xSizes.back());
1479 if (clv->getShape()->type() ==
"Trd") {
1480 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(clv->getShape());
1481 double xSize = trd->getXHalfLength1();
1482 if (!xSizes.empty()) {
1483 xSizes.push_back( std::abs(
transform.translation().x() - compTransf[ich - 1].translation().x()) - xSizes.back());
1485 xSizes.push_back(xSize);
1487 double xpos =
transform.translation().x();
1488 xmn =
std::min(xmn, xpos - xSizes.back());
1489 xmx =
std::max(xmx, xpos + xSizes.back());
1494 for (
double xSize : xSizes)
1496 double xShift{0.5 * (xmx + xmn)}, zShift{0.};
1497 zShift = std::abs(compTransf.front().translation().z()) + std::abs(compTransf.back().translation().z());
1500 std::unique_ptr<Trk::Volume> envelope;
1501 double envXMed = xMed;
1504 std::vector<float> volSteps;
1505 volSteps.push_back(-xTotal + xShift);
1506 std::vector<std::unique_ptr<Trk::TrackingVolume>> components{};
1510 auto cscBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(xMin, xMax,
y1, xTotal);
1514 envelope = std::make_unique<Trk::Volume>(
makeTransform(std::move(cTr)), cscBounds.release());
1516 double xCurr = -xTotal;
1517 for (
unsigned int ic = 0;
ic < xSizes.size();
ic++) {
1519 xCurr += xSizes[
ic];
1521 auto compBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(xMin, xMax,
y1, xSizes[
ic]);
1522 std::unique_ptr<Trk::LayerArray> cscLayerArray = processCSCTrdComponent(compGeoVol[
ic], *compBounds, compTr, cache);
1523 std::unique_ptr<Trk::Volume> compVol = std::make_unique<Trk::Volume>(
makeTransform(compTr), compBounds.release());
1524 auto compTV = std::make_unique<Trk::TrackingVolume>(*compVol, *m_muonMaterial, cscLayerArray.release(),
nullptr,
compName[
ic]);
1525 components.push_back(std::move(compTV));
1526 xCurr += xSizes[
ic];
1527 volSteps.push_back(xCurr + xShift);
1530 if (xMed != xMin && xMed != xMax) {
1531 envXMed += zShift / (
y1 / (xMed - xMin) +
y2 / (xMed - xMax));
1532 envY1 =
y1 * (envXMed - xMin) / (xMed - xMin);
1533 envY2 =
y2 * (envXMed - xMax) / (xMed - xMax);
1535 auto cscBounds = std::make_unique<Trk::DoubleTrapezoidVolumeBounds>(xMin, envXMed, xMax, envY1, envY2, xTotal);
1539 envelope = std::make_unique<Trk::Volume>(
makeTransform(cTr), cscBounds.release());
1541 double xCurr = -xTotal;
1542 for (
unsigned int ic = 0;
ic < xSizes.size();
ic++) {
1544 xCurr += xSizes[
ic];
1547 auto compBounds = std::make_unique<Trk::DoubleTrapezoidVolumeBounds>(xMin, envXMed, xMax, envY1, envY2, xSizes[
ic]);
1548 std::unique_ptr<Trk::LayerArray> cscLayerArray{processCSCDiamondComponent(compGeoVol[
ic], *compBounds, compTr, cache)};
1549 std::unique_ptr<Trk::Volume> compVol = std::make_unique<Trk::Volume>(
makeTransform(compTr), compBounds.release());
1550 auto compTV = std::make_unique<Trk::TrackingVolume>(*compVol, *m_muonMaterial,
1551 cscLayerArray.release(),
nullptr,
compName[
ic]);
1552 components.push_back(std::move(compTV));
1553 xCurr += xSizes[
ic];
1554 volSteps.push_back(xCurr + xShift);
1559 std::unique_ptr<Trk::BinnedArray<Trk::TrackingVolume>> compArray{};
1560 if (!components.empty() && isDiamond) {
1562 compArray.reset(m_trackingVolumeArrayCreator->doubleTrapezoidVolumesArrayNav(
Muon::release(components), binUtil.release(),
false));
1563 }
else if (!components.empty() && !isDiamond) {
1566 compArray.reset(m_trackingVolumeArrayCreator->trapezoidVolumesArrayNav(
Muon::release(components), binUtil.release(),
false));
1570 return std::make_unique<Trk::TrackingVolume>(*envelope, *m_muonMaterial,
nullptr, compArray.release(),
name);
1575 const GeoLogVol* clv = cv->getLogVol();
1576 const std::string& tgc_name = clv->getName();
1577 const GeoShape* baseShape = clv->getShape();
1578 if (baseShape->type() ==
"Subtraction") {
1579 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(baseShape);
1581 baseShape = sub->getOpA();
1585 if (baseShape->type() ==
"Trd") {
1586 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(baseShape);
1587 double x1 = trd->getXHalfLength1();
1588 double y1 = trd->getYHalfLength1();
1589 double y2 = trd->getYHalfLength2();
1590 double z = trd->getZHalfLength();
1592 auto tgcBounds = std::make_unique<Trk::TrapezoidVolumeBounds>(
y1,
y2,
z,
x1);
1595 std::unique_ptr<Trk::LayerArray> tgcLayerArray{processTGCComponent(cv, *tgcBounds, tTr, cache)};
1596 printVolumeBounds(
"TGC envelope bounds:", *tgcBounds);
1597 auto envelope = std::make_unique<Trk::Volume>(
makeTransform(tTr), tgcBounds.release());
1600 auto tgc_station = std::make_unique<Trk::TrackingVolume>(*envelope, *m_muonMaterial, tgcLayerArray.release(),
nullptr, tgc_name);
1603 ATH_MSG_WARNING( tgc_name <<
": TGC component not a trapezoid ? no prototype built ");
1609 const GeoVPhysVol* gv,
1612 std::string
vName = gv->getLogVol()->getName();
1615 std::unique_ptr<Trk::Volume> envelope = m_geoShapeConverter.translateGeoShape(gv->getLogVol()->getShape(), transf);
1620 double thickness = envelopeThickness(envelope->
volumeBounds());
1625 double layArea =
area(*layBounds);
1628 m_volumeConverter.collectMaterial(gv, sTgc_mat, layArea);
1630 const double scale = 1. / gv->getNChildVols();
1632 sTgc_layerMat *=
scale;
1637 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1638 unsigned int ic = 0;
1639 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
1642 auto layer = std::make_unique<Trk::PlaneLayer>(envelope->
transform() * trc, layBounds,
1643 stgcLayMaterial, sTgc_layerMat.
thickness());
1645 const Identifier id = idHelper.channelID(nswId,idHelper.multilayer(nswId),
1648 layer->setLayerType(
id.get_identifier32().get_compact());
1654 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1655 std::vector<float> binSteps;
1656 binSteps.push_back(-thickness);
1658 binSteps.push_back(binSteps.back() + sTgc_layerMat.
thickness());
1659 layerOrder.push_back(std::move(
layers[
il]));
1661 if (binSteps.back() > thickness + 1.e-3) {
1662 ATH_MSG_WARNING(
"rescale stgc binning:" << binSteps.back() <<
">" << thickness);
1664 binSteps.back() = thickness;
1666 auto stgcLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
1669 auto sTgc = std::make_unique<Trk::TrackingVolume>(*envelope, *m_muonMaterial,
1670 stgcLayerArray.release(),
nullptr,
vName);
1672 auto layerRepr = std::make_unique<Trk::PlaneLayer>(transf, layBounds, stgcMaterial, sTgc_mat.
thickness());
1674 return std::make_unique<Trk::DetachedTrackingVolume>(
vName, sTgc.release(), layerRepr.release(),
nullptr);
1678 const GeoVPhysVol* gv,
1681 std::string
vName = gv->getLogVol()->getName();
1683 ATH_MSG_DEBUG(
"processing MM:" <<
vName <<
":"<< gv->getLogVol()->getShape()->type());
1684 std::unique_ptr<const Trk::Volume> envelope{m_geoShapeConverter.translateGeoShape(gv->getLogVol()->getShape(), transf)};
1689 double thickness = envelopeThickness(envelope->volumeBounds());
1690 printVolumeBounds(
"MM envelope bounds", envelope->volumeBounds());
1695 double layArea =
area(*layBounds);
1698 m_volumeConverter.collectMaterial(gv, mm_mat, layArea);
1700 double scale = 1. / gv->getNChildVols();
1702 mm_layerMat *=
scale;
1706 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers;
1707 unsigned int ic = 0;
1708 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
1710 auto layer = std::make_unique<Trk::PlaneLayer>(transf * trc, layBounds, mmLayMaterial, mm_layerMat.
thickness());
1711 Identifier id = idHelper.channelID(nswId, idHelper.multilayer(nswId), 1 +
ic, 1);
1712 layer->setLayerType(
id.get_identifier32().get_compact());
1719 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1720 std::vector<float> binSteps;
1721 binSteps.push_back(-thickness);
1723 binSteps.push_back(binSteps.back() + mm_layerMat.
thickness());
1724 layerOrder.push_back(std::move(
layers[
il]));
1726 if (binSteps.back() > thickness + 1.e-3) {
1727 ATH_MSG_WARNING(
"rescale mm binning:" << binSteps.back() <<
">" << thickness);
1729 binSteps.back() = thickness;
1731 auto mmLayerArray = std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
1734 auto mM = std::make_unique<Trk::TrackingVolume>(*envelope, *m_muonMaterial, mmLayerArray.release(),
nullptr,
vName);
1736 auto layerRepr = std::make_unique<Trk::PlaneLayer>(transf, layBounds, mmMaterial, mm_mat.
thickness());
1738 return std::make_unique<Trk::DetachedTrackingVolume>(
vName, mM.release(), layerRepr.release(),
nullptr);
1742 double xlow{0.}, xup{0.};
1746 return decodeX(
pv->getLogVol()->getShape());
1749 for (
const auto& [cv, transf] : vols) {
1750 const GeoLogVol* clv = cv->getLogVol();
1751 double xh = decodeX(clv->getShape());
1752 xlow =
std::min(xlow, (transf.translation())[0] - xh);
1753 xup =
std::max(xup, (transf.translation())[0] + xh);
1761 double thickness)
const {
1767 m_volumeConverter.collectMaterial(
pv, sumMat, volume / thickness);
1779 << sumMat.
material().
X0 <<
" sumMat.material().L0 "
1780 << sumMat.
material().
L0 <<
" sumMat.material().rho "
1781 << sumMat.
material().
rho <<
" sumMat.material().x0() "
1793 Cache& cache)
const {
1795 std::string
name =
pv->getLogVol()->getName();
1796 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1797 std::vector<double> x_array{}, x_thickness{};
1798 std::vector<Trk::MaterialProperties> x_mat;
1799 std::vector<int> x_active;
1800 double currX = -100000;
1808 if (
name.compare(
name.size() - 5, 5,
"CSC01") == 0) {
1810 double vol = (minX + maxX) * 2 * halfY * thickness;
1811 cache.
m_matCSC01 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
1816 const GeoVPhysVol* cv1 =
pv->getChildVol(0);
1818 const GeoLogVol* clv = cv->getLogVol();
1819 if (clv->getName() ==
"CscArCO2") {
1820 double xl = transfc.translation().x();
1821 if (x_array.empty() || xl >= x_array.back()) {
1822 x_array.push_back(xl);
1824 unsigned int ix = 0;
1825 while (ix < x_array.size() && x_array[ix] < xl) {
1828 x_array.insert(x_array.begin() + ix, xl);
1832 if (x_array.empty()) {
1833 x_array.push_back(0.);
1834 x_mat.push_back(matCSC);
1835 x_thickness.push_back(thickness);
1836 x_active.push_back(1);
1837 }
else if (x_array.size() == 1) {
1838 double xthick = 2 *
std::min(x_array[0] + halfZ, halfZ - x_array[0]);
1839 double scale = xthick / thickness;
1843 x_mat.push_back(xmatCSC);
1844 x_thickness.push_back(xthick);
1845 x_active.push_back(1);
1847 double currX = -halfZ;
1848 for (
unsigned int il=0;
il < x_array.size();
il++) {
1850 if (
il < x_array.size() - 1) {
1851 xthick = 2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il]));
1853 xthick = 2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]);
1855 x_thickness.push_back(xthick);
1856 x_mat.push_back(matCSC);
1857 currX = x_array[
il] + 0.5 * x_thickness.back();
1858 x_active.push_back(1);
1862 if (
name ==
"CSCspacer") {
1864 double vol = (minX + maxX) * 2 * halfY * thickness;
1865 cache.
m_matCSCspacer1 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
1867 x_array.push_back(0.);
1869 x_thickness.push_back(thickness);
1870 x_active.push_back(0);
1873 std::unique_ptr<Trk::OverlapDescriptor> od{};
1875 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
1878 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, cscMaterial, x_thickness[iloop], std::move(od));
1880 layer->setLayerType(x_active[iloop]);
1885 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
1886 std::vector<float> binSteps;
1887 double xShift = transf.translation().x();
1889 binSteps.push_back(lowX);
1892 currX = lowX - xShift;
1893 for (
unsigned int i = 0;
i <
layers.size() - 1;
i++) {
1894 currX = x_array[
i] + 0.5 *
layers[
i]->thickness();
1895 layerOrder.push_back(std::move(
layers[
i]));
1896 binSteps.push_back(currX + xShift);
1898 layerOrder.push_back(std::move(
layers.back()));
1899 binSteps.push_back(compBounds.
halflengthZ() + xShift);
1903 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
1907 std::unique_ptr<Trk::LayerArray>
1911 Cache& cache)
const {
1913 std::string
name =
pv->getLogVol()->getName();
1914 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
1915 std::vector<double> x_array{}, x_thickness{};
1916 std::vector<Trk::MaterialProperties> x_mat;
1917 std::vector<int> x_active;
1918 double currX = -100000;
1928 if (
name.compare(
name.size() - 5, 5,
"CSC02") == 0) {
1930 double vol = ((minX + medX) * 2 * halfY1 + (medX + maxX) * 2 * halfY2) * thickness;
1931 cache.
m_matCSC02 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
1936 const GeoVPhysVol* cv1 =
pv->getChildVol(0);
1938 const GeoLogVol* clv = cv->getLogVol();
1939 if (clv->getName() ==
"CscArCO2") {
1940 double xl = transfc.translation().x();
1941 if (x_array.empty() || xl >= x_array.back()) {
1942 x_array.push_back(xl);
1944 unsigned int ix = 0;
1945 while (ix < x_array.size() && x_array[ix] < xl) {
1948 x_array.insert(x_array.begin() + ix, xl);
1953 if (x_array.empty()) {
1954 x_array.push_back(0.);
1955 x_mat.push_back(matCSC);
1956 x_thickness.push_back(thickness);
1957 x_active.push_back(1);
1958 }
else if (x_array.size() == 1) {
1959 x_mat.push_back(matCSC);
1960 x_thickness.push_back(2 *
std::min(x_array[0] + halfZ, halfZ - x_array[0]));
1961 x_active.push_back(1);
1963 double currX = -halfZ;
1964 for (
unsigned int il=0;
il < x_array.size();
il++) {
1966 if (
il < x_array.size() - 1) {
1967 xthick = 2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il]));
1968 x_thickness.push_back(xthick);
1970 xthick = 2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]);
1971 x_thickness.push_back(xthick);
1973 x_mat.push_back(matCSC);
1974 currX = x_array[
il] + 0.5 * x_thickness.back();
1975 x_active.push_back(1);
1979 if (
name ==
"CSCspacer") {
1981 double vol = ((minX + medX) * 2 * halfY1 + (medX + maxX) * 2 * halfY2) *thickness;
1982 cache.
m_matCSCspacer2 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
1985 x_array.push_back(0.);
1986 x_mat.push_back(matCSC);
1987 x_thickness.push_back(thickness);
1988 x_active.push_back(0);
1991 std::unique_ptr<Trk::OverlapDescriptor> od{};
1993 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
1996 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, dbounds, cscMaterial,
1997 x_thickness[iloop], std::move(od));
1999 layer->setLayerType(x_active[iloop]);
2004 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
2005 std::vector<float> binSteps;
2006 double xShift = transf.translation().x();
2008 binSteps.push_back(lowX);
2012 for (
unsigned int i = 0;
i <
layers.size() - 1;
i++) {
2013 currX = x_array[
i] + 0.5 *
layers[
i]->thickness() + xShift;
2014 binSteps.push_back(currX);
2015 layerOrder.push_back(std::move(
layers[
i]));
2018 layerOrder.push_back(std::move(
layers.back()));
2019 binSteps.push_back(compBounds.
halflengthZ() + xShift);
2023 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
2031 Cache& cache)
const {
2033 constexpr
double tol{0.001};
2034 std::string
name =
pv->getLogVol()->getName();
2035 std::vector<std::unique_ptr<Trk::PlaneLayer>>
layers{};
2036 std::vector<double> x_array{}, x_thickness{};
2037 std::vector<Trk::MaterialProperties> x_mat;
2038 double currX = -100000;
2045 double thickness = 2 * halfZ;
2046 if (std::abs(halfZ - 35.00) < tol) {
2048 double vol = (minX + maxX) * 2 * halfY * thickness;
2049 cache.
m_matTGC01 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
2052 }
else if (std::abs(halfZ - 21.85) < tol) {
2054 double vol = (minX + maxX) * 2 * halfY * thickness;
2055 cache.
m_matTGC06 = std::make_unique<Trk::MaterialProperties>(getAveragedLayerMaterial(
pv, vol, thickness));
2063 const GeoLogVol* clv = cv->getLogVol();
2064 if (clv->getName() ==
"muo::TGCGas") {
2065 double xl = transfc.translation().x();
2066 if (x_array.empty() || xl >= x_array.back()) {
2067 x_array.push_back(xl);
2069 unsigned int ix = 0;
2070 while (ix < x_array.size() && x_array[ix] < xl) {
2073 x_array.insert(x_array.begin() + ix, xl);
2077 double activeThick{0.};
2078 if (x_array.empty()) {
2079 x_array.push_back(0.);
2080 x_thickness.push_back(thickness);
2081 activeThick = thickness;
2082 }
else if (x_array.size() == 1) {
2083 x_thickness.push_back(2 * fmin(x_array[0] + halfZ, halfZ - x_array[0]));
2084 activeThick += x_thickness.back();
2086 double currX = -halfZ;
2087 for (
unsigned int il=0;
il < x_array.size(); ++
il) {
2088 if (
il < x_array.size() - 1) {
2089 x_thickness.push_back(2 *
std::min(x_array[
il] - currX, 0.5 * (x_array[
il + 1] - x_array[
il])));
2091 x_thickness.push_back(2 *
std::min(x_array[
il] - currX, halfZ - x_array[
il]));
2093 currX = x_array[
il] + 0.5 * x_thickness.back();
2094 activeThick += x_thickness.back();
2098 double scale = activeThick / thickness;
2102 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2105 for (
unsigned int iloop = 0; iloop < x_array.size(); iloop++) {
2108 auto layer = std::make_unique<Trk::PlaneLayer>(cTr, bounds, tgcMaterial, x_thickness[iloop], std::move(od));
2110 layer->setLayerType(1);
2114 std::vector<Trk::SharedObject<Trk::Layer>> layerOrder;
2115 std::vector<float> binSteps;
2117 float xShift = transf.translation().x();
2118 float lowX = -halfZ + xShift;
2119 binSteps.push_back(lowX);
2122 for (
unsigned int i = 0;
i <
layers.size() - 1; ++
i) {
2123 currX = x_array[
i] + 0.5 *
layers[
i]->thickness() + xShift;
2124 binSteps.push_back(currX);
2125 layerOrder.push_back(std::move(
layers[
i]));
2127 layerOrder.push_back(std::move(
layers.back()));
2128 binSteps.push_back(halfZ + xShift);
2131 return std::make_unique<Trk::NavBinnedArray1D<Trk::Layer>>(layerOrder, binUtility.release(),
2139 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(
sh);
2140 const GeoBox* box =
dynamic_cast<const GeoBox*
>(
sh);
2141 const GeoTube* tub =
dynamic_cast<const GeoTube*
>(
sh);
2142 const GeoTubs* tubs =
dynamic_cast<const GeoTubs*
>(
sh);
2143 const GeoShapeShift* shift =
dynamic_cast<const GeoShapeShift*
>(
sh);
2144 const GeoShapeUnion* uni =
dynamic_cast<const GeoShapeUnion*
>(
sh);
2145 const GeoShapeSubtraction* sub =
dynamic_cast<const GeoShapeSubtraction*
>(
sh);
2146 const GeoSimplePolygonBrep* spb =
dynamic_cast<const GeoSimplePolygonBrep*
>(
sh);
2148 if (!trd && !box && !tub && !tubs && !shift && !uni && !sub && !spb) {
2150 <<
sh->type() <<
"): shape type " <<
sh->type()
2151 <<
" is unknown, returning xHalf=0");
2156 for (
unsigned int i = 0;
i < spb->getNVertices();
i++) {
2158 << spb->getYVertex(
i));
2159 if (spb->getXVertex(
i) > xHalf)
2160 xHalf = spb->getXVertex(
i);
2166 xHalf =
std::max(trd->getXHalfLength1(), trd->getXHalfLength2());
2169 xHalf = box->getXHalfLength();
2172 xHalf = tub->getRMax();
2177 double xA = decodeX(sub->getOpA());
2181 xHalf =
std::max(decodeX(uni->getOpA()), decodeX(uni->getOpB()));
2184 double xA = decodeX(shift->getOp());
2185 double xB = shift->getX().translation().x();
2186 xHalf = xA + std::abs(xB);
2192 std::pair<std::unique_ptr<Trk::Layer>,std::vector<std::unique_ptr<Trk::Layer>>>
2195 std::unique_ptr<Trk::Layer> layRepr{};
2198 std::vector<std::unique_ptr<Trk::Layer>>
multi{};
2222 auto bounds = std::make_unique<Trk::RectangleBounds>(cubBounds->
halflengthY(), cubBounds->
halflengthZ());
2223 std::unique_ptr<Trk::OverlapDescriptor> od;
2236 bounds->clone(),
mat, thickness, std::move(od), 1);
2240 if (vols.size() > 1) {
2241 for (
auto* vol : vols) {
2246 matMulti.
thickness(), std::move(od), 1));
2250 }
else if (trdBounds) {
2253 std::vector<std::unique_ptr<const Trk::Surface>> surfs =
toVec(trdBounds->
decomposeToSurfaces(Amg::Transform3D::Identity()));
2256 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2267 layRepr = std::make_unique<Trk::PlaneLayer>(subt * trVol.
transform(), bounds,
mat, thickness, std::move(od), 1);
2272 if (vols.size() > 1) {
2273 for (
auto* vol : vols) {
2278 matMulti.
thickness(), std::move(od), 1));
2282 }
else if (dtrdBounds) {
2286 std::vector<std::unique_ptr<const Trk::Surface>> surfs =
toVec(dtrdBounds->
decomposeToSurfaces(Amg::Transform3D::Identity()));
2289 std::unique_ptr<Trk::OverlapDescriptor> od =
nullptr;
2301 layRepr = std::make_unique<Trk::PlaneLayer>(trVol.
transform(), bounds,
mat, thickness, std::move(od), 1);
2305 if (vols.size() > 1) {
2306 for (
auto* vol : vols) {
2308 ATH_MSG_VERBOSE(
" collectStationMaterial dtrd matMulti " << matMulti);
2309 multi.emplace_back(std::make_unique<Trk::PlaneLayer>(vol->transform(), bounds,
2311 matMulti.
thickness(), std::move(od), 1));
2316 return std::make_pair(std::move(layRepr), std::move(
multi));
2323 if ((
vName[0] ==
'Q') || (
vName[0] ==
'M')) {
2325 std::istringstream istr(&
vName[1]);
2327 if (
vName[0] ==
'Q') {
2328 std::istringstream istr2(&
vName[2]);
2332 if (transf.translation().z() < 0.)
2335 unsigned int iPhi = 1;
2338 std::istringstream istm(&
vName[3]);
2342 iMult = (
vName[1] ==
'L') ? 1 : 2;
2344 iMult = (
vName[1] ==
'L') ? 2 : 1;
2347 std::istringstream istl(stl);
2351 if (
vName[0] ==
'Q') {
2352 std::string stName = (
vName[1] ==
'L') ?
"STL" :
"STS";
2353 id = m_idHelperSvc->stgcIdHelper().channelID(
2354 stName,
iEta,
iPhi, iMult, iLay, 2, 1);
2356 std::string stName = (
vName[2] ==
'L') ?
"MML" :
"MMS";
2357 id = m_idHelperSvc->mmIdHelper().channelID(stName,
iEta,
iPhi, iMult,
2372 for (
const auto* lay : lays) {
2373 const Trk::MaterialProperties* mLay =lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2378 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined lay "<< layMat);
2384 for (
const auto* lay : lays) {
2385 const Trk::MaterialProperties* mLay = lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2389 if ((rect || trap) && mLay) {
2393 if (lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2396 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined sub lay "<< layMat);
2404 for (
const auto* subVol : subVols) {
2405 if (subVol->confinedLayers()) {
2407 for (
const auto* lay : lays) {
2409 lay->surfaceRepresentation().center());
2413 ATH_MSG_VERBOSE(
" collectStationMaterial after add confined vol " << layMat);
2417 if (!subVol->confinedArbitraryLayers().empty()) {
2419 for (
const auto* lay : lays) {
2420 const Trk::MaterialProperties* mLay = lay->layerMaterialProperties()->fullMaterial(lay->surfaceRepresentation().center());
2426 if ((rect || trap) && mLay) {
2430 if (lay->thickness() > 0 && mLay->
material().
x0() > 0.) {
2432 ATH_MSG_VERBOSE(
" collectStationMaterial after add sub vols " << layMat);
2478 ATH_MSG_DEBUG(
"SimplePolygonBrep bounds: number of vertices:"
2505 std::unique_ptr<Trk::SurfaceBounds>