16 #include "GeoModelKernel/GeoBox.h"
17 #include "GeoModelKernel/GeoCons.h"
18 #include "GeoModelKernel/GeoPara.h"
19 #include "GeoModelKernel/GeoPgon.h"
20 #include "GeoModelKernel/GeoShape.h"
21 #include "GeoModelKernel/GeoShapeIntersection.h"
22 #include "GeoModelKernel/GeoShapeShift.h"
23 #include "GeoModelKernel/GeoShapeSubtraction.h"
24 #include "GeoModelKernel/GeoShapeUnion.h"
25 #include "GeoModelKernel/GeoTrap.h"
26 #include "GeoModelKernel/GeoTrd.h"
27 #include "GeoModelKernel/GeoTube.h"
28 #include "GeoModelKernel/GeoTubs.h"
29 #include "GeoModelKernel/GeoVolumeCursor.h"
32 #include "GeoModelHelpers/GeoShapeUtils.h"
96 return StatusCode::SUCCESS;
105 std::vector<std::pair<const GeoVPhysVol*, std::vector<GMInfo>>> stations =
retrieveGMsensitive(muonMgr);
107 for (
const auto& mstation : stations) {
109 std::string
name = mstation.first->getLogVol()->getName();
110 if ( mstation.second[0].mstation )
name = mstation.second[0].mstation->getStationName();
119 if (
name.find(
"sTGC")!= std::string::npos ||
name.substr(0, 2) ==
"MM") {
120 for (
unsigned int i = 0;
i < mstation.second.size();
i++) {
121 std::string sName =
name.substr(
name.find(
'-') + 1);
125 mstation.second[0].trf.inverse());
126 std::unique_ptr<Trk::DetachedTrackingVolume> newStat{msType->
clone(
name, trdef)};
133 translatedStations.push_back(std::move(newStat));
136 for (
auto gminfo : mstation.second) {
138 std::unique_ptr<Trk::DetachedTrackingVolume> newStat{msType->
clone(
name, gminfo.trf)};
149 translatedStations.push_back(std::move(newStat));
154 ATH_MSG_DEBUG(
"returns " << translatedStations.size() <<
" stations");
155 return translatedStations;
164 std::span<Trk::TrackingVolume* const> components = volArray->
arrayObjects();
173 if (cubVolBounds && binUtilityX) {
178 if (low >= 0 &&
up >= 0) {
180 for (
unsigned int i = 0;
i < components.size() - 1; ++
i) {
195 const std::string stationStr =
stationName.substr(0, 3);
196 bool is_valid{
false};
200 stationStr, cscEtaSt,
phi + 1, 1, 1, 0, 1, is_valid);
205 stationStr, cscEtaSt,
phi + 1, 2, 1, 0, 1, is_valid);
210 for (
int gasgap = 0; gasgap < cscRE->
Ngasgaps(); gasgap++) {
224 if (assocVol && assocLay) {
235 }
else if (stationStr[0] ==
'T') {
238 if (stationStr ==
"T1F") {
240 }
else if (stationStr ==
"T1E") {
242 }
else if (stationStr ==
"T2F") {
244 }
else if (stationStr ==
"T2E") {
246 }
else if (stationStr ==
"T3F") {
248 }
else if (stationStr ==
"T3E") {
250 }
else if (stationStr ==
"T4F") {
257 const int stationEta =
259 auto getReadout = [
stationName, stationEta, muonMgr, &idHelper](
int phi) {
260 const int stationPhi =
phi + 1;
261 bool is_valid{
false};
263 return is_valid ? muonMgr->getTgcReadoutElement(
id) :
nullptr;
268 unsigned int phit = 0;
279 int stationEta = idHelper.stationEta(oldId);
296 Identifier wireId = idHelper.channelID(stationStr, etaSt, phiSt, 1, 0, 1, validId);
307 std::span<Trk::Layer* const>
layers =
311 wireId = idHelper.channelID(stationStr, etaSt, phiSt,
il + 1, 1, 1, validId);
321 if ((
layers[
il]->surfaceRepresentation().transform().inverse() * stripSurf->center()).
mag() > 0.001)
323 <<
":"<<
layers[
il]->surfaceRepresentation().
transform().inverse() * stripSurf->center());
329 <<
"," <<
eta <<
"," <<
phi);
336 const int nameIndex = idHelper.stationNameIndex(
stationName.substr(0, 3));
338 std::span<Trk::TrackingVolume* const> cVols =
340 for (
auto* cVol : cVols) {
341 if (cVol->confinedLayers()) {
342 std::span<Trk::Layer* const> cLays = cVol->confinedLayers()->arrayObjects();
344 bool is_valid{
false};
346 for (
auto* cLay : cLays) {
350 idHelper.multilayer(
id),
351 idHelper.tubeLayer(
id),
358 cLay->setLayerType(newid);
361 double ref = cLay->getRef();
365 double loc = (cLay->surfaceRepresentation().transform().inverse() * mdtROE->
tubePos(newId))[1];
366 if (std::abs(
ref) > 10e6) {
367 double sign = (
ref > 0.) ? 1. : -1.;
370 0.5 * (
sign + 1) * 1e5;
371 if (std::abs(
ref - loc) > 0.001) {
372 cLay->setRef(loc + dec * 1e5 + 0.5 * (
sign + 1) * 1e5);
374 }
else if (std::abs(
ref - loc) > 0.001) {
381 if (!cVol->confinedArbitraryLayers().empty()) {
384 for (
auto* cLay : cLays) {
386 bool is_valid{
false};
389 idHelper.doubletR(
id), idHelper.doubletZ(
id),
390 idHelper.doubletPhi(
id), idHelper.gasGap(
id),
391 1, idHelper.strip(
id),
394 cLay->setLayerType(newid);
403 std::span<Trk::TrackingVolume* const> cVols =
405 for (
auto* cVol : cVols) {
406 if (cVol->confinedLayers()) {
407 std::span<Trk::Layer* const> cLays =
408 cVol->confinedLayers()->arrayObjects();
409 for (
unsigned int il = 0;
il < cLays.size();
il++) {
413 <<
"," << cVol->volumeName()
414 <<
", unidentified active layer:" <<
il);
417 " subvolume " + cVol->volumeName(),
418 muonMgr,
id, cLays[
il]);
421 if (!cVol->confinedArbitraryLayers().empty()) {
423 cVol->confinedArbitraryLayers();
424 for (
unsigned int il = 0;
il < cLays.size();
il++) {
428 <<
"," << cVol->volumeName()
429 <<
", unidentified active layer:" <<
il);
432 station->
name() +
" subvolume " +
434 muonMgr,
id, cLays[
il]);
440 std::span<Trk::Layer* const> cLays =
442 for (
unsigned int il = 0;
il < cLays.size();
il++) {
446 <<
"," << station->
name()
447 <<
", unidentified active layer:" <<
il);
450 muonMgr,
id, cLays[
il]);
462 const bool isStgc{station.
name().substr(0, 4) ==
"sTGC"};
463 const bool isMm{station.
name().substr(0, 2) ==
"MM"};
464 if (!isMm && !isStgc)
return;
465 for (
unsigned int il = 0;
il < lays.size();
il++) {
468 const Identifier lid = idHelper.channelID(
id, idHelper.multilayer(
id),
il + 1, 2, 1);
473 const Identifier lid = idHelper.channelID(
id, idHelper.multilayer(
id),
il + 1, 1);
486 const std::string stationNameShort =
stationName.substr(0, 3);
488 bool is_valid{
false};
490 if (
m_idHelperSvc->hasMDT() && (stationFirstChar ==
'B' || stationFirstChar ==
'E')) {
493 const int nameIndex = idHelper.stationNameIndex(stationNameShort);
517 assocLay->
setLayerType(
id.get_identifier32().get_compact());
524 if (confinedVolumes) {
525 std::span<Trk::TrackingVolume* const> vols = confinedVolumes->
arrayObjects();
526 for (
auto* vol : vols) {
527 if (!
m_idHelperSvc->hasRPC() || vol->volumeName() !=
"RPC") {
533 int nameIndex =
m_idHelperSvc->rpcIdHelper().stationNameIndex(stationNameShort);
535 if (stationNameShort ==
"BME" || stationNameShort ==
"BMG") {
546 if (stationNameShort.find(
"BMS") != std::string::npos && (std::abs(
eta) == 2 || std::abs(
eta) == 4)) {
549 else if (stationNameShort.find(
"BOG") != std::string::npos) {
550 if (std::abs(
eta) == 7 || std::abs(
eta) == 8) {
555 }
else if (stationNameShort.find(
"BOF") != std::string::npos && std::abs(
eta) == 4){
566 for (
int doubletZ = 1; doubletZ <= doubletZMax; ++doubletZ) {
585 if (
layer->layerType() == 0 ||
586 !
layer->surfaceRepresentation().isOnSurface(stripLocPos,
false, 0.5*
layer->thickness())){
589 const Amg::Vector3D locPos1 =
layer->surfaceRepresentation().transform().inverse() * stripLocPos;
592 double swap = (std::abs(locPos1[1] - locPos2[0]) > 0.001) ? 20000. : 0.;
613 for (
auto* cVol : cVols) {
614 if (cVol->confinedLayers()) {
615 std::span<Trk::Layer* const> cLays = cVol->confinedLayers()->arrayObjects();
616 for (
unsigned int il = 0;
il < cLays.size();
il++) {
623 if (!cVol->confinedArbitraryLayers().empty()) {
625 for (
unsigned int il = 0;
il < cLays.size();
il++) {
636 for (
unsigned int il = 0;
il < cLays.size();
il++) {
648 std::vector<std::pair<std::pair<const GeoLogVol*, Trk::MaterialProperties*>,
649 std::vector<Amg::Transform3D>>>& vols,
650 std::vector<std::string>& volNames)
const {
655 unsigned int nc =
pv->getNChildVols();
657 <<
pv->getLogVol()->getName() <<
","
658 <<
pv->getLogVol()->getMaterial()->getName()
659 <<
", looping over " <<
nc <<
" children");
661 for (
unsigned int ic = 0;
ic <
nc;
ic++) {
663 const GeoVPhysVol* cv =
pv->getChildVol(
ic);
664 const GeoLogVol* clv = cv->getLogVol();
665 std::string childName = clv->getName();
666 ATH_MSG_DEBUG(
"getNSWStationsForTranslation child " << childName);
668 if (childName.empty()) {
669 childName =
"Spacer";
671 if (childName.size() > 9 && childName.substr(childName.size() - 9, 9) ==
"Sensitive") {
675 std::string cName = childName.compare(0, 3,
"NSW") == 0 || childName.compare(0, 8,
"NewSmall") == 0
679 if (!cv->getNChildVols()) {
681 for (
unsigned int is = 0; is < vols.size(); is++) {
682 if (cName == volNames[is]) {
684 vols[is].
second.front().translation().perp()) <
689 double phiTr = (
transform * transf).translation().phi();
690 if (phiTr > -0.001 && phiTr < 0.4) {
691 vols[is].second.insert(vols[is].
second.begin(),
694 vols[is].second.push_back(
transform * transf);
697 << clv->getName() <<
","
698 << (
transform * transf).translation().perp() <<
","
699 << (
transform * transf).translation().z() <<
","
707 std::vector<Amg::Transform3D> volTr;
712 if (
pv->getLogVol()->getMaterial()->getName() !=
"Ether" &&
713 (childName ==
"MM_Frame" || childName ==
"sTGC_Frame")) {
717 pv->getLogVol()->getMaterial());
726 std::pair<const GeoLogVol*, Trk::MaterialProperties*> cpair(
727 pv->getLogVol(), nMat);
728 vols.emplace_back(cpair, volTr);
730 volNames.push_back(cName);
733 << clv->getMaterial()->getName() <<
", "
734 << volTr.back().translation().z() <<
", "
735 << volTr.back().translation().phi()
747 std::vector<std::pair<const GeoVPhysVol*, std::vector<GMInfo>>>
752 std::vector<std::pair<
const GeoVPhysVol*,
753 std::vector<GMInfo>>> sensitive;
755 std::vector<const MuonGM::MuonStation*> mst = muonMgr->
getMuonStations();
759 GeoVolumeCursor vl(
top);
unsigned int nfv = 0;
760 std::vector<std::pair<const GeoVPhysVol*, std::vector<GMInfo>>>
::iterator it = sensitive.begin();
761 while (!vl.atEnd()) {
762 const GeoVPhysVol* cv = vl.getVolume();
763 const GeoFullPhysVol* cfv =
dynamic_cast<const GeoFullPhysVol*
> (cv);
765 GMInfo info;
info.trf = vl.getTransform();
info.volId = vl.getId() ? *(vl.getId()) : 0;
766 for (
auto im : mst)
if (
im->getPhysVol().get() == cfv )
info.mstation =
im;
767 it = sensitive.begin();
768 while (
it < sensitive.end()) {
772 if (
it == sensitive.end()) {
773 std::vector<GMInfo> cloneList;
774 cloneList.push_back(
info);
775 sensitive.push_back(std::make_pair(cv, cloneList));
776 }
else (*it).second.push_back(
info);
781 if (nfv>0 && nfv >= mst.size() ) {
782 ATH_MSG_INFO( nfv <<
" sensitive volumes found in GM tree" );
783 ATH_MSG_INFO( sensitive.size() <<
" sensitive volume types found in GM tree using match with " << mst.size() <<
" muon stations known to muonMgr" );
790 if (sTGC_top && sTGC_top !=
top) {
791 ATH_MSG_DEBUG(
"sTGC GeoModel branch found:" << sTGC_top->getLogVol()->getName());
792 GeoVolumeCursor vol(sTGC_top);
793 while (!vol.atEnd()) {
794 const GeoVPhysVol* cv = vol.getVolume();
795 const std::string& vname = cv->getLogVol()->getName();
796 if (vname.find(
"sTGC_1") == std::string::npos) {
800 std::vector<std::pair<
const GeoVPhysVol*,
803 while (
it < sensitive.end()) {
804 if (vname == (*it).first->getLogVol()->getName() &&
811 if (
it == sensitive.end()) {
812 std::vector<GMInfo> cloneList;
813 cloneList.emplace_back(
info);
814 sensitive.emplace_back(cv, cloneList);
817 double phiTr =
info.trf.translation().phi();
818 if (phiTr > -0.001 && phiTr < 0.4)
819 (*it).second.insert((*it).second.begin(),
info);
821 (*it).second.emplace_back(
info);
827 if (MM_top && MM_top !=
top) {
828 ATH_MSG_DEBUG(
"MM GeoModel branch found:" << MM_top->getLogVol()->getName());
829 GeoVolumeCursor vol(MM_top);
830 while (!vol.atEnd()) {
831 const GeoVPhysVol* cv = vol.getVolume();
832 const std::string& vname = cv->getLogVol()->getName();
833 if (vname.find(
"MM_1") == std::string::npos) {
837 std::vector<std::pair<
const GeoVPhysVol*,
840 while (
it < sensitive.end()) {
841 if (vname == (*it).first->getLogVol()->getName() &&
848 if (
it == sensitive.end()) {
849 std::vector<GMInfo> cloneList;
850 cloneList.emplace_back(
info);
851 sensitive.emplace_back(cv, cloneList);
854 double phiTr =
info.trf.translation().phi();
855 if (phiTr > -0.001 && phiTr < 0.4)
856 (*it).second.insert((*it).second.begin(),
info);
858 (*it).second.emplace_back(
info);
864 GeoVolumeCursor vol(
top);
865 while (!vol.atEnd()) {
866 const GeoVPhysVol* cv = &(*(vol.getVolume()));
867 const std::string& vname = cv->getLogVol()->getName();
868 if (vname.find(
"Station") == std::string::npos &&
869 vname.find(
"MM_1") == std::string::npos &&
870 vname.find(
"sTGC_1") == std::string::npos) {
876 if (vname.substr(0, 1) ==
"T") {
879 const GeoLogVol* tlv = tv->getLogVol();
881 const std::string& tgc_name = tlv->getName();
883 std::vector<std::pair<
const GeoVPhysVol*,
886 while (
it < sensitive.end()) {
887 if (tgc_name == (*it).first->getLogVol()->getName() &&
895 if (
it == sensitive.end()) {
896 std::vector<GMInfo> cloneList;
897 cloneList.emplace_back(
info);
898 sensitive.emplace_back(tv, cloneList);
901 double phiTr =
info.trf.translation().phi();
902 if (phiTr > -0.001 && phiTr < 0.4)
903 (*it).second.insert((*it).second.begin(),
info);
905 (*it).second.emplace_back(
info);
912 std::vector<std::pair<
const GeoVPhysVol*,
915 while (
it < sensitive.end()) {
916 if (vname == (*it).first->getLogVol()->getName() &&
922 GMInfo info;
info.trf = vol.getTransform();
info.volId = vol.getId() ? *(vol.getId()) : 0;
923 if (
it == sensitive.end()) {
924 std::vector<GMInfo> cloneList;
925 cloneList.emplace_back(
info);
926 sensitive.emplace_back(cv, cloneList);
929 double phiTr =
info.trf.translation().phi();
930 if (phiTr > -0.001 && phiTr < 0.4)
931 (*it).second.insert((*it).second.begin(),
info);
933 (*it).second.emplace_back(
info);
939 ATH_MSG_DEBUG(
"Number of muon station types in GeoModel tree:" << sensitive.size());
944 std::unique_ptr<Trk::DetachedTrackingVolume>
946 const GeoVPhysVol* cv,
947 const GMInfo& gmInfo)
const {
948 const GeoLogVol* clv = cv->getLogVol();
949 std::string vname = clv->getName();
951 ATH_MSG_DEBUG(
name() <<
" building station prototype for " << cv->getLogVol()->getName());
955 std::unique_ptr<Trk::DetachedTrackingVolume> typeStat{};
957 if (vname.find(
"sTGC")!=std::string::npos || vname.starts_with(
"MM")) {
958 std::string sName = vname.substr(vname.find(
'-') + 1);
961 if (vname.find(
"sTGC")!=std::string::npos ) {
964 }
else if (vname.starts_with(
"MM") ) {
974 if (!
m_buildCsc && vname.compare(0, 1,
"C") == 0)
976 if (!
m_buildTgc && vname.compare(0, 1,
"T") == 0)
979 int etaphi = gmInfo.
volId;
980 int sign = (etaphi < 0) ? -1 : 1;
981 etaphi =
sign * etaphi;
982 int is_mirr = etaphi / 1000;
983 etaphi = etaphi - is_mirr * 1000;
984 int eta = etaphi / 100;
985 int phi = etaphi -
eta * 100;
993 int etaphi = gmInfo.
volId;
994 int a_etaphi =
static_cast<int>(etaphi / 100000);
995 int sideC =
static_cast<int>(a_etaphi / 10000);
996 a_etaphi -=
sideC * 10000;
997 is_mirr =
static_cast<int>(a_etaphi / 1000);
998 a_etaphi -= is_mirr * 1000;
999 eta =
static_cast<int>(a_etaphi / 100);
1000 phi = a_etaphi -
eta * 100;
1006 std::string stname = (vname.compare(0, 1,
"T") == 0) ? vname : (clv->getName()).substr(0, vname.size() - 8);
1008 if (stname.compare(0, 1,
"B") == 0 &&
eta < 0) {
1009 stname = (clv->getName()).substr(0, vname.size() - 8) +
"-";
1011 ATH_MSG_VERBOSE(
" new station type " << stname <<
"," << clv->getShape()->type());
1014 if (stname.compare(0, 2,
"CS") == 0 || stname.compare(0, 1,
"T") == 0) {
1016 if (stname.compare(0, 2,
"CS") == 0) {
1021 auto layerVec = std ::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
1022 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, std::move(csc_station),
1023 std::move(layerRepr.first), std::move(layerVec));
1029 auto layerVec = std ::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
1030 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, std::move(tgc_station),
1031 std::move(layerRepr.first), std::move(layerVec));
1035 double halfX1{0.}, halfX2{0.}, halfY1{0.}, halfY2{0.}, halfZ{0.};
1037 const GeoShape* shapeS = clv->getShape();
1038 if (shapeS->type() !=
"Trd") {
1039 getEnvelopeDimensions(clv->getShape(), GeoTrf::Transform3D::Identity(),halfX1, halfX2, halfY1, halfY2, halfZ);
1041 const GeoTrd* trd =
dynamic_cast<const GeoTrd*
>(shapeS);
1043 halfX1 = trd->getXHalfLength1();
1044 halfX2 = trd->getXHalfLength2();
1045 halfY1 = trd->getYHalfLength1();
1046 halfY2 = trd->getYHalfLength2();
1047 halfZ = trd->getZHalfLength();
1049 if (vname.starts_with(
"B") && (std::abs(halfX1-halfX2)>
tolerance || std::abs(halfY1-halfY2)>
tolerance) ) {
1051 halfX1 = fmax(halfX1,halfX2); halfX2 = halfX1;
1052 halfY1 = fmax(halfY1,halfY2); halfY2 = halfY1;
1056 std::unique_ptr<Trk::TrackingVolumeArray> confinedVolumes{};
1057 std::vector<std::unique_ptr<Trk::Layer>> confinedLayers{};
1058 std::shared_ptr<Trk::Volume> envelope;
1059 std::string shape =
"Trd";
1060 if (std::abs(halfX1-halfX2) <
tolerance && std::abs(halfY1-halfY2) <
tolerance ) shape =
"Box";
1062 if (shape ==
"Box") {
1063 auto envBounds = std::make_shared<Trk::CuboidVolumeBounds>(halfX1, halfY1, halfZ);
1066 if (!confinedVolumes) {
1070 envelope = std::make_shared<Trk::Volume>(
nullptr, envBounds);
1071 }
else if (shape ==
"Trd") {
1072 std::shared_ptr<Trk::TrapezoidVolumeBounds> envBounds{};
1074 if (halfY1 == halfY2) {
1075 envBounds = std::make_shared<Trk::TrapezoidVolumeBounds>(halfX1, halfX2, halfY1, halfZ);
1076 ATH_MSG_VERBOSE(
"CAUTION!!!: this trapezoid volume does not require XY -> YZ switch");
1078 if (halfY1 != halfY2 && halfX1 == halfX2) {
1080 envBounds = std::make_shared<Trk::TrapezoidVolumeBounds>(halfY1, halfY2, halfZ, halfX1);
1082 if (halfX1 != halfX2 && halfY1 != halfY2) {
1089 envelope = std::make_shared<Trk::Volume>(
makeTransform(transf), envBounds);
1095 std::unique_ptr<Trk::TrackingVolume> newType{};
1096 if (!confinedLayers.empty()) {
1097 auto confinedLayerPtr = std::make_unique<const std::vector<Trk::Layer*>>(
Muon::release(confinedLayers));
1098 newType = std::make_unique<Trk::TrackingVolume>(*envelope,
m_muonMaterial, std::move(confinedLayerPtr), stname);
1100 newType = std::make_unique<Trk::TrackingVolume>(*envelope,
m_muonMaterial,
nullptr, std::move(confinedVolumes), stname);
1105 if ((stname.compare(0, 1,
"B") == 0 || stname.compare(0, 1,
"E") == 0))
1112 auto layerVec = std::make_unique<std::vector<Trk::Layer*>>(
Muon::release(layerRepr.second));
1113 typeStat = std::make_unique<Trk::DetachedTrackingVolume>(stname, std::move(newType),
1114 std::move(layerRepr.first), std::move(layerVec));
1130 bool is_valid=
false;
1148 int etaphi = gm_info.
volId;
1149 int sign = (etaphi < 0) ? -1 : 1;
1150 etaphi =
sign * etaphi;
1151 int is_mirr = etaphi / 1000;
1152 etaphi = etaphi - is_mirr * 1000;
1154 phi = etaphi -
eta * 100;
1164 int etaphi = gm_info.
volId;
1165 int a_etaphi =
static_cast<int>(etaphi / 100000);
1166 int sideC =
static_cast<int>(a_etaphi / 10000);
1167 a_etaphi -=
sideC * 10000;
1168 is_mirr =
static_cast<int>(a_etaphi / 1000);
1169 a_etaphi -= is_mirr * 1000;
1170 eta =
static_cast<int>(a_etaphi / 100);
1171 phi = a_etaphi -
eta * 100;
1182 if (vname.compare(0, 1,
"T") == 0 || vname.compare(0, 1,
"C") == 0) {
1183 stName = vname.substr(0, 4);
1185 stName = (vname.substr(0, vname.size() - 8));
1186 if (
stName.compare(0, 1,
"B") == 0 &&
eta < 0) {
1187 stName = vname.substr(0, vname.size() - 8) +
"-";
1193 bool is_valid{
false};
1199 if (vname.compare(0, 1,
"C") == 0) {
1201 if (transf.translation().z() < 0)
1203 double phic = transf.translation().phi() + 0.1;
1205 static_cast<int>(phic < 0 ? 4 * phic /
M_PI + 8 : 4 * phic /
M_PI);
1207 if (vname.compare(0, 1,
"T") == 0) {
1209 std::string sub = vname.substr(7, 2);
1210 if (transf.translation().z() < 0)
1214 else if (sub ==
"02")
1216 else if (sub ==
"03")
1218 else if (sub ==
"04")
1220 else if (sub ==
"05")
1222 else if (sub ==
"06")
1224 else if (sub ==
"07")
1226 else if (sub ==
"08")
1228 else if (sub ==
"09")
1230 else if (sub ==
"10")
1232 else if (sub ==
"11")
1234 else if (sub ==
"12")
1236 else if (sub ==
"13")
1238 else if (sub ==
"14")
1240 else if (sub ==
"15")
1242 else if (sub ==
"16")
1244 else if (sub ==
"17")
1246 else if (sub ==
"18")
1248 else if (sub ==
"19")
1250 else if (sub ==
"20")
1252 else if (sub ==
"21")
1254 else if (sub ==
"22")
1258 int etaSt =
eta - 4;
1261 double phic = transf.translation().phi();
1262 if (vname.compare(2, 1,
"E") == 0 && vname.compare(0, 3,
"T4E") != 0)
1263 phi =
static_cast<int>(phic < 0 ? 24 * phic /
M_PI + 48
1264 : 24 * phic /
M_PI);
1266 phi =
static_cast<int>(phic < 0 ? 12 * phic /
M_PI + 24
1267 : 12 * phic /
M_PI);
1269 stId =
m_idHelperSvc->tgcIdHelper().elementID(vname.substr(0, 3), etaSt,
1280 << vname <<
"," <<
eta <<
"," <<
phi);
1319 if (shape->type() ==
"Tube" )
return;
1320 if (shape->type() ==
"Trd" || shape->type() ==
"Box" || shape->type() ==
"SimplePolygonBrep") {
1321 std::vector<GeoTrf::Vector3D> vtx = getPolyShapeEdges(shape, transf);
1322 for (
const auto & vx : vtx) {
1323 halfZ =
std::max( std::abs(vx.z()), halfZ );
1325 halfX1 =
std::max( std::abs(vx.x()), halfX1);
1326 halfY1 =
std::max( std::abs(vx.y()), halfY1);
1327 }
else if ( vx.z()> 0 ) {
1328 halfX2 =
std::max( std::abs(vx.x()), halfX2);
1329 halfY2 =
std::max( std::abs(vx.y()), halfY2);
1332 }
else if (shape->type() ==
"Shift") {
1333 const GeoShapeShift* shift =
static_cast<const GeoShapeShift*
>(shape);
1335 }
else if (shape->type() ==
"Union") {
1336 const GeoShapeUnion* uni =
static_cast<const GeoShapeUnion*
>(shape);
1339 }
else if (shape->type() ==
"Subtraction") {
1340 const GeoShapeSubtraction* sub =
static_cast<const GeoShapeSubtraction*
>(shape);
1343 ATH_MSG_WARNING(
"unexpected station shape in envelope building ? "<< shape->type() );