00001 #ifndef HcalCastorDetId_h_included 00002 #define HcalCastorDetId_h_included 1 00003 00004 #include <ostream> 00005 #include "DataFormats/DetId/interface/DetId.h" 00006 00023 class HcalCastorDetId : public DetId 00024 { 00025 public: 00026 enum Section { Unknown=0, EM=1, HAD=2 }; 00027 00028 // 1 => CaloTower, 2 => ZDC, 3 => Castor 00029 static const int SubdetectorId = 3; 00030 00032 HcalCastorDetId(); 00033 00035 HcalCastorDetId(uint32_t rawid); 00036 00038 HcalCastorDetId(Section section, bool true_for_positive_eta, int sector, int module); 00039 // constructor without section 00040 HcalCastorDetId(bool true_for_positive_eta, int sector, int module); 00041 00043 HcalCastorDetId(const DetId& id); 00044 00046 HcalCastorDetId& operator=(const DetId& id); 00047 00049 //int zside() const { return (id_&0x40)?(1):(-1); } 00050 int zside() const 00051 { 00052 return ((id_ >> 8) & 0x1); 00053 } 00054 00055 00057 //Section section() const { return (Section)((id_>>7)&0x3); } 00058 Section section() const 00059 { 00060 int mod = module(); 00061 00062 if ( mod <= 2 ) 00063 return HcalCastorDetId::EM; 00064 if ( mod > 2 && mod <= 14 ) 00065 return HcalCastorDetId::HAD; 00066 else 00067 return HcalCastorDetId::Unknown; 00068 } 00069 00071 //int module() const { return id_&0xF; } 00072 int module() const 00073 { 00074 return (id_ & 0xF); 00075 } 00076 00078 //int sector() const { return (id_>>6)&0x3; } 00079 int sector() const 00080 { 00081 return ((id_ >> 4) & 0xF) + 1; 00082 } 00083 00084 // get the individual cell id 00085 // int channel() const; 00086 }; 00087 00088 std::ostream& operator<<(std::ostream&,const HcalCastorDetId& id); 00089 00090 00091 #endif // HcalCastorDetId_h_included 00092