Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:22

0001 #ifndef _COMMONDETUNIT_GEOMDETENUMERATORS_H_
0002 #define _COMMONDETUNIT_GEOMDETENUMERATORS_H_
0003 
0004 #include <iosfwd>
0005 
0006 /** Global enumerators for Det types.
0007  */
0008 namespace GeomDetEnumerators {
0009   enum Location { barrel, endcap, invalidLoc };
0010   enum SubDetector {
0011     PixelBarrel,
0012     PixelEndcap,
0013     TIB,
0014     TOB,
0015     TID,
0016     TEC,
0017     CSC,
0018     DT,
0019     RPCBarrel,
0020     RPCEndcap,
0021     GEM,
0022     ME0,
0023     P2OTB,
0024     P2OTEC,
0025     P1PXB,
0026     P1PXEC,
0027     P2PXB,
0028     P2PXEC,
0029     TimingBarrel,
0030     TimingEndcap,
0031     invalidDet
0032   };
0033   // gives subdetId in DetId conrrepsonding to the above
0034   constexpr unsigned int subDetId[21] = {1, 2, 3, 5, 4, 6, 0, 0, 0, 0, 0,
0035                                          0, 5, 4, 1, 2, 1, 2, 2, 2, 0};  // don't ask, don't ask, simply do not ask!
0036   //inverse (only for tracker)
0037   constexpr SubDetector tkDetEnum[8] = {
0038       invalidDet, PixelBarrel, PixelEndcap, TIB, TID, TOB, TEC, invalidDet};  // don't ask, don't ask, simply do not ask!
0039   //to convert a physical subdetector (it could be larger than 5) into a geometry subdetector (between 0 and 5). ONLY for tracker
0040   constexpr SubDetector subDetGeom[21] = {PixelBarrel, PixelEndcap, TIB,         TOB,         TID,         TEC,
0041                                           invalidDet,  invalidDet,  invalidDet,  invalidDet,  invalidDet,  invalidDet,
0042                                           TOB,         TID,         PixelBarrel, PixelEndcap, PixelBarrel, PixelEndcap,
0043                                           invalidDet,  invalidDet,  invalidDet};
0044 
0045   bool isBarrel(GeomDetEnumerators::SubDetector m);
0046   bool isEndcap(GeomDetEnumerators::SubDetector m);
0047 
0048   bool isTrackerPixel(GeomDetEnumerators::SubDetector m);
0049   bool isTrackerStrip(GeomDetEnumerators::SubDetector m);
0050   bool isTracker(GeomDetEnumerators::SubDetector m);
0051   bool isInnerTracker(GeomDetEnumerators::SubDetector m);
0052   bool isOuterTracker(GeomDetEnumerators::SubDetector m);
0053 
0054   bool isDT(GeomDetEnumerators::SubDetector m);
0055   bool isCSC(GeomDetEnumerators::SubDetector m);
0056   bool isRPC(GeomDetEnumerators::SubDetector m);
0057   bool isGEM(GeomDetEnumerators::SubDetector m);
0058   bool isME0(GeomDetEnumerators::SubDetector m);
0059   bool isMuon(GeomDetEnumerators::SubDetector m);
0060   bool isTiming(GeomDetEnumerators::SubDetector m);
0061 
0062 }  // namespace GeomDetEnumerators
0063 
0064 /* overload << for correct output of the enumerators 
0065  *  (e.g. to get "barrel" instead of "0")
0066  */
0067 std::ostream& operator<<(std::ostream& s, GeomDetEnumerators::Location l);
0068 std::ostream& operator<<(std::ostream& s, GeomDetEnumerators::SubDetector m);
0069 
0070 #endif