File indexing completed on 2021-02-14 12:53:35
0001 #ifndef DataFormats_HcalDetId_HcalZDCDetId_h_included
0002 #define DataFormats_HcalDetId_HcalZDCDetId_h_included 1
0003
0004 #include <ostream>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 class HcalZDCDetId : public DetId {
0017 public:
0018 static const int kZDCChannelMask = 0xF;
0019 static const int kZDCSectionMask = 0x3;
0020 static const int kZDCSectionOffset = 4;
0021 static const int kZDCZsideMask = 0x40;
0022 static const int kZDCRPDMask = 0x80;
0023 enum Section { Unknown = 0, EM = 1, HAD = 2, LUM = 3, RPD = 4 };
0024
0025 static const int SubdetectorId = 2;
0026
0027
0028 HcalZDCDetId();
0029
0030 HcalZDCDetId(uint32_t rawid);
0031
0032 HcalZDCDetId(Section section, bool true_for_positive_eta, int channel);
0033
0034 HcalZDCDetId(const DetId& id);
0035
0036 HcalZDCDetId& operator=(const DetId& id);
0037
0038
0039 int zside() const { return ((id_ & kZDCZsideMask) ? (1) : (-1)); }
0040
0041 Section section() const;
0042
0043 int depth() const;
0044
0045 int channel() const;
0046
0047 uint32_t denseIndex() const;
0048
0049 static bool validDenseIndex(uint32_t di) { return (di < kSizeForDenseIndexing); }
0050
0051 static HcalZDCDetId detIdFromDenseIndex(uint32_t di);
0052
0053 static bool validDetId(Section se, int dp);
0054
0055 private:
0056 enum {
0057 kDepEM = 5,
0058 kDepHAD = 4,
0059 kDepLUM = 2,
0060 kDepRPD = 16,
0061 kDepRun1 = kDepEM + kDepHAD + kDepLUM,
0062 kDepTot = kDepRun1 + kDepRPD
0063 };
0064
0065 public:
0066 enum { kSizeForDenseIndexing = 2 * kDepRun1 };
0067 };
0068
0069 std::ostream& operator<<(std::ostream&, const HcalZDCDetId& id);
0070
0071 #endif