Go to the documentation of this file.00001
00002 #ifndef DataFormats_HcalDetId_HcalDcsDetId_h
00003 #define DataFormats_HcalDetId_HcalDcsDetId_h
00004
00005 #include <iosfwd>
00006
00007 #include "DataFormats/HcalDetId/interface/HcalOtherDetId.h"
00008 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00009
00027 class HcalDcsDetId : public HcalOtherDetId {
00028 public :
00029
00030 enum DcsType{ HV = 1, BV = 2, CATH = 3, DYN7 = 4, DYN8 = 5,
00031 RM_TEMP = 6, CCM_TEMP = 7, CALIB_TEMP = 8, LVTTM_TEMP = 9,
00032 TEMP = 10, QPLL_LOCK = 11, STATUS = 12, DCSUNKNOWN = 15,
00033 DCS_MAX = 16 };
00034
00035 HcalDcsDetId ();
00036 HcalDcsDetId(uint32_t rawid);
00037 HcalDcsDetId(const DetId& id);
00038 HcalDcsDetId(HcalOtherSubdetector subd, int side_or_ring, unsigned int slc,
00039 DcsType ty, unsigned int subchan);
00040
00041 static DcsType DcsTypeFromString(const std::string& str );
00042 static std::string typeString (DcsType typ);
00043
00044
00045 int zside() const { return (((id_>>kSideOffset)&0x1)? 1 : -1); }
00046 int ring() const { return zside()*((id_>>kRingOffset)&0x3); }
00047 int slice() const { return ((id_>>kSliceOffset)&0x1F); }
00048 DcsType type() const { return DcsType((id_>>kTypeOffset)&0xF); }
00049 int subchannel() const { return ((id_>>kSubChannelOffset)&0xF); }
00050
00051 static const int maxLinearIndex = 0x16800;
00052
00053 protected :
00054 static unsigned int const kSideOffset = 19;
00055 static unsigned int const kRingOffset = 17;
00056 static unsigned int const kSliceOffset = 12;
00057 static unsigned int const kTypeOffset = 8;
00058 static unsigned int const kSubChannelOffset = 4;
00059 };
00060
00061 std::ostream& operator<<(std::ostream&,const HcalDcsDetId& id);
00062
00063 #endif