File indexing completed on 2024-04-06 12:04:17
0001
0002 #ifndef DataFormats_HcalDetId_HcalDcsDetId_h
0003 #define DataFormats_HcalDetId_HcalDcsDetId_h
0004
0005 #include <iosfwd>
0006
0007 #include "DataFormats/HcalDetId/interface/HcalOtherDetId.h"
0008 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 class HcalDcsDetId : public HcalOtherDetId {
0028 public:
0029 enum DcsType {
0030 HV = 1,
0031 BV = 2,
0032 CATH = 3,
0033 DYN7 = 4,
0034 DYN8 = 5,
0035 RM_TEMP = 6,
0036 CCM_TEMP = 7,
0037 CALIB_TEMP = 8,
0038 LVTTM_TEMP = 9,
0039 TEMP = 10,
0040 QPLL_LOCK = 11,
0041 STATUS = 12,
0042 DCSUNKNOWN = 15,
0043 DCS_MAX = 16
0044 };
0045
0046 HcalDcsDetId();
0047 HcalDcsDetId(uint32_t rawid);
0048 HcalDcsDetId(const DetId& id);
0049 HcalDcsDetId(HcalOtherSubdetector subd, int side_or_ring, unsigned int slc, DcsType ty, unsigned int subchan);
0050
0051 static DcsType DcsTypeFromString(const std::string& str);
0052 static std::string typeString(DcsType typ);
0053
0054 int zside() const { return (((id_ >> kSideOffset) & 0x1) ? 1 : -1); }
0055 int ring() const { return zside() * ((id_ >> kRingOffset) & 0x3); }
0056 int slice() const { return ((id_ >> kSliceOffset) & 0x1F); }
0057 DcsType type() const { return DcsType((id_ >> kTypeOffset) & 0xF); }
0058 int subchannel() const { return ((id_ >> kSubChannelOffset) & 0xF); }
0059
0060 static const int maxLinearIndex = 0x16800;
0061
0062 protected:
0063 static unsigned int const kSideOffset = 19;
0064 static unsigned int const kRingOffset = 17;
0065 static unsigned int const kSliceOffset = 12;
0066 static unsigned int const kTypeOffset = 8;
0067 static unsigned int const kSubChannelOffset = 4;
0068 };
0069
0070 std::ostream& operator<<(std::ostream&, const HcalDcsDetId& id);
0071
0072 #endif