745 {
746
747
748
749 std::vector<std::pair<const GeoVPhysVol*,
750 std::vector<GMInfo>>> sensitive;
751
753
754
755
758 if (sTGC_top && sTGC_top != top) {
759 ATH_MSG_DEBUG(
"sTGC GeoModel branch found:" << sTGC_top->getLogVol()->getName());
760 GeoVolumeCursor vol(sTGC_top);
761 while (!vol.atEnd()) {
762 const GeoVPhysVol* cv = vol.getVolume();
763 const std::string& vname = cv->getLogVol()->getName();
764 if (vname.find("sTGC_1") == std::string::npos) {
765 vol.next();
766 continue;
767 }
768 std::vector<std::pair<const GeoVPhysVol*,
769 std::vector<GMInfo>>>::iterator
it =
770 sensitive.begin();
771 while (it < sensitive.end()) {
772 if (vname == (*it).first->getLogVol()->getName() &&
773 m_gmBrowser.compareGeoVolumes(cv, (*it).first, 1.e-3) == 0)
774 break;
776 }
777
778 if (it == sensitive.end()) {
779 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
780 cloneList.emplace_back(vol.getTransform(), 0);
781 sensitive.emplace_back(cv, cloneList);
782 } else {
784
785 double phiTr = transf.translation().phi();
786 if (phiTr > -0.001 && phiTr < 0.4)
787 (*it).second.insert((*it).second.begin(),
788 std::make_pair(vol.getTransform(), 0));
789 else
790 (*it).second.emplace_back(vol.getTransform(), 0);
791 }
792 vol.next();
793 }
794 }
795
796 if (MM_top && MM_top != top) {
797 ATH_MSG_DEBUG(
"MM GeoModel branch found:" << MM_top->getLogVol()->getName());
798 GeoVolumeCursor vol(MM_top);
799 while (!vol.atEnd()) {
800 const GeoVPhysVol* cv = vol.getVolume();
801 const std::string& vname = cv->getLogVol()->getName();
802 if (vname.find("MM_1") == std::string::npos) {
803 vol.next();
804 continue;
805 }
806 std::vector<std::pair<const GeoVPhysVol*,
807 std::vector<GMInfo>>>::iterator
it =
808 sensitive.begin();
809 while (it < sensitive.end()) {
810 if (vname == (*it).first->getLogVol()->getName() &&
811 m_gmBrowser.compareGeoVolumes(cv, (*it).first, 1.e-3) == 0)
812 break;
814 }
815
816 if (it == sensitive.end()) {
817 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
818 cloneList.emplace_back(vol.getTransform(), 0);
819 sensitive.emplace_back(cv, cloneList);
820 } else {
822
823 double phiTr = transf.translation().phi();
824 if (phiTr > -0.001 && phiTr < 0.4)
825 (*it).second.insert((*it).second.begin(), std::make_pair(vol.getTransform(), 0));
826 else
827 (*it).second.emplace_back(vol.getTransform(), 0);
828 }
829 vol.next();
830 }
831 }
832
833 GeoVolumeCursor vol(top);
834 while (!vol.atEnd()) {
835 const GeoVPhysVol* cv = &(*(vol.getVolume()));
836 const std::string& vname = cv->getLogVol()->getName();
837 if (vname.find("Station") == std::string::npos &&
838 vname.find("MM_1") == std::string::npos &&
839 vname.find("sTGC_1") == std::string::npos) {
840 vol.next();
841 continue;
842 }
843
844
845 if (vname.substr(0, 1) == "T") {
846
848 const GeoLogVol* tlv = tv->getLogVol();
850 const std::string& tgc_name = tlv->getName();
851
852 std::vector<std::pair<const GeoVPhysVol*,
853 std::vector<GMInfo>>>::iterator
it =
854 sensitive.begin();
855 while (it < sensitive.end()) {
856 if (tgc_name == (*it).first->getLogVol()->getName() &&
857 m_gmBrowser.compareGeoVolumes(tv, (*it).first, 1.e-3) ==
858 0)
859 break;
861 }
862
863 if (it == sensitive.end()) {
864 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
865 cloneList.emplace_back(transform, vol.getId().value());
866 sensitive.emplace_back(tv, cloneList);
867 } else {
869
870 double phiTr = transf.translation().phi();
871 if (phiTr > -0.001 && phiTr < 0.4) {
872 (*it).second.insert((*it).second.begin(),
873 std::make_pair(transform, vol.getId().value()));
874 }
875 else {
876 (*it).second.emplace_back(transform, vol.getId().value());
877 }
878 }
879
880 }
881
882 } else {
883
884 std::vector<std::pair<const GeoVPhysVol*,
885 std::vector<GMInfo>>>::iterator
it =
886 sensitive.begin();
887 while (it < sensitive.end()) {
888 if (vname == (*it).first->getLogVol()->getName() &&
889 m_gmBrowser.compareGeoVolumes(cv, (*it).first, 1.e-3) == 0)
890 break;
892 }
893
894 if (it == sensitive.end()) {
895 std::vector<std::pair<Amg::Transform3D, int>> cloneList;
896 cloneList.emplace_back(vol.getTransform(), vol.getId().value());
897 sensitive.emplace_back(cv, cloneList);
898 } else {
900
901 double phiTr = transf.translation().phi();
902 if (phiTr > -0.001 && phiTr < 0.4) {
903 (*it).second.insert((*it).second.begin(),
904 std::make_pair(vol.getTransform(), vol.getId().value()));
905 }
906 else {
907 (*it).second.emplace_back(vol.getTransform(), vol.getId().value());
908 }
909 }
910 }
911 vol.next();
912 }
913
914 ATH_MSG_DEBUG(
"Number of muon station types in GeoModel tree:" << sensitive.size());
915
916 return sensitive;
917}
GeoVolumeVec_t geoGetVolumes(const GeoGraphNode *node, int depthLimit=1, int sizeHint=20)
Return the child volumes and associated transforms.
virtual PVConstLink getTreeTop(unsigned int i) const
Trk::GMTreeBrowser m_gmBrowser
static const GeoVPhysVol * findTopBranch(const GeoVPhysVol *gv, std::string_view name)
search of top branch : returns mother volume for children matching name