File indexing completed on 2024-04-06 12:14:23
0001 #include "Geometry/CommonTopologies/interface/GeomDetEnumerators.h"
0002 #include <ostream>
0003 using namespace GeomDetEnumerators;
0004
0005 std::ostream& operator<<(std::ostream& s, Location l) {
0006 if (l == barrel)
0007 return s << "barrel";
0008 else
0009 return s << "endcap";
0010 }
0011
0012 std::ostream& operator<<(std::ostream& s, SubDetector m) {
0013 if (m == PixelBarrel)
0014 return s << "PixelBarrel";
0015 else if (m == PixelEndcap)
0016 return s << "PixelEndcap";
0017 else if (m == TIB)
0018 return s << "TIB";
0019 else if (m == TOB)
0020 return s << "TOB";
0021 else if (m == TID)
0022 return s << "TID";
0023 else if (m == TEC)
0024 return s << "TEC";
0025 else if (m == DT)
0026 return s << "DT";
0027 else if (m == CSC)
0028 return s << "CSC";
0029 else if (m == RPCBarrel)
0030 return s << "RPCBarrel";
0031 else if (m == RPCEndcap)
0032 return s << "RPCEndcap";
0033 else if (m == GEM)
0034 return s << "GEM";
0035 else if (m == ME0)
0036 return s << "ME0";
0037 else if (m == P2OTB)
0038 return s << "Phase2OTBarrel";
0039 else if (m == P2OTEC)
0040 return s << "Phase2OTEndcap";
0041 else if (m == P1PXB)
0042 return s << "Phase1PixelBarrel";
0043 else if (m == P2PXB)
0044 return s << "Phase2PixelBarrel";
0045 else if (m == P1PXEC)
0046 return s << "Phase1PixelEndcap";
0047 else if (m == P2PXEC)
0048 return s << "Phase2PixelEndcap";
0049 else if (m == TimingBarrel)
0050 return s << "Phase2TimingBarrel";
0051 else if (m == TimingEndcap)
0052 return s << "Phase2TimingEndcap";
0053 else
0054 return s << "?";
0055 }
0056
0057 bool GeomDetEnumerators::isBarrel(const GeomDetEnumerators::SubDetector subdet) {
0058 return (subdet == PixelBarrel || subdet == TIB || subdet == TOB || subdet == P1PXB || subdet == P2PXB ||
0059 subdet == P2OTB || isDT(subdet) || subdet == RPCBarrel || subdet == TimingBarrel);
0060 }
0061
0062 bool GeomDetEnumerators::isEndcap(const GeomDetEnumerators::SubDetector subdet) { return (!isBarrel(subdet)); }
0063
0064 bool GeomDetEnumerators::isTrackerStrip(const GeomDetEnumerators::SubDetector subdet) {
0065 return (subdet == TIB || subdet == TOB || subdet == TID || subdet == TEC);
0066 }
0067
0068 bool GeomDetEnumerators::isTrackerPixel(const GeomDetEnumerators::SubDetector subdet) {
0069 return (subdet == PixelBarrel || subdet == PixelEndcap || subdet == P1PXB || subdet == P1PXEC || subdet == P2PXB ||
0070 subdet == P2PXEC || subdet == P2OTB || subdet == P2OTEC);
0071 }
0072
0073 bool GeomDetEnumerators::isInnerTracker(const GeomDetEnumerators::SubDetector subdet) {
0074 return (subdet == PixelBarrel || subdet == PixelEndcap || subdet == P1PXB || subdet == P1PXEC || subdet == P2PXB ||
0075 subdet == P2PXEC);
0076 }
0077
0078 bool GeomDetEnumerators::isOuterTracker(const GeomDetEnumerators::SubDetector subdet) {
0079 return (subdet == TIB || subdet == TOB || subdet == TID || subdet == TEC || subdet == P2OTB || subdet == P2OTEC);
0080 }
0081
0082 bool GeomDetEnumerators::isTracker(const GeomDetEnumerators::SubDetector subdet) {
0083 return (isTrackerStrip(subdet) || isTrackerPixel(subdet));
0084 }
0085
0086 bool GeomDetEnumerators::isDT(const GeomDetEnumerators::SubDetector subdet) { return (subdet == DT); }
0087
0088 bool GeomDetEnumerators::isCSC(const GeomDetEnumerators::SubDetector subdet) { return (subdet == CSC); }
0089
0090 bool GeomDetEnumerators::isRPC(const GeomDetEnumerators::SubDetector subdet) {
0091 return (subdet == RPCBarrel || subdet == RPCEndcap);
0092 }
0093
0094 bool GeomDetEnumerators::isGEM(const GeomDetEnumerators::SubDetector subdet) { return (subdet == GEM); }
0095
0096 bool GeomDetEnumerators::isME0(const GeomDetEnumerators::SubDetector subdet) { return (subdet == ME0); }
0097
0098 bool GeomDetEnumerators::isMuon(const GeomDetEnumerators::SubDetector subdet) {
0099 return (subdet == DT || subdet == CSC || isRPC(subdet) || subdet == GEM || subdet == ME0);
0100 }
0101
0102 bool GeomDetEnumerators::isTiming(const GeomDetEnumerators::SubDetector subdet) {
0103 return (subdet == TimingBarrel || subdet == TimingEndcap);
0104 }