CMS 3D CMS Logo

HcalFrontEndId.h
Go to the documentation of this file.
1 #ifndef HcalFrontEndId_h
2 #define HcalFrontEndId_h
3 
4 #include <string>
5 #include <cstdint>
6 #include <iosfwd>
7 
9 public:
11  HcalFrontEndId(uint32_t id) { hcalFrontEndId_ = id; };
12  HcalFrontEndId(const std::string& rbx, int rm, int pixel, int rmfiber, int fiberchannel, int qiecard, int adc);
14  uint32_t rawId() const { return hcalFrontEndId_; }
15 
16  // index which uniquely identifies an RBX within HCAL
17  int rbxIndex() const { return (hcalFrontEndId_ >> 18); }
18  static const int maxRbxIndex = 0xFF;
19  // index which uniquely identifies an RM (e.g. HPD) within HCAL
20  int rmIndex() const { return ((rm() - 1) & 0x3) + (rbxIndex() << 2); }
21  static const int maxRmIndex = 0x3FF;
22 
23  bool null() const { return hcalFrontEndId_ == 0; }
24 
25  std::string rbx() const;
26  int rm() const { return ((hcalFrontEndId_ >> 15) & 0x7) + 1; }
27  int pixel() const { return (hcalFrontEndId_ >> 10) & 0x1F; }
28  int rmFiber() const { return ((hcalFrontEndId_ >> 7) & 0x7) + 1; }
29  int fiberChannel() const { return (hcalFrontEndId_ >> 5) & 0x3; }
30  int qieCard() const { return ((hcalFrontEndId_ >> 3) & 0x3) + 1; }
31  int adc() const { return (hcalFrontEndId_ & 0x7) - 1; }
32 
33  int operator==(const HcalFrontEndId& id) const { return id.hcalFrontEndId_ == hcalFrontEndId_; }
34  int operator!=(const HcalFrontEndId& id) const { return id.hcalFrontEndId_ != hcalFrontEndId_; }
35  int operator<(const HcalFrontEndId& id) const { return hcalFrontEndId_ < id.hcalFrontEndId_; }
36 
37 private:
38  uint32_t hcalFrontEndId_;
39 };
40 
41 std::ostream& operator<<(std::ostream&, const HcalFrontEndId& id);
42 
43 #endif
int fiberChannel() const
int pixel() const
int operator<(const HcalFrontEndId &id) const
HcalFrontEndId(uint32_t id)
int operator!=(const HcalFrontEndId &id) const
bool null() const
uint32_t rawId() const
std::string rbx() const
int rmIndex() const
int rm() const
static const int maxRmIndex
std::ostream & operator<<(std::ostream &, const HcalFrontEndId &id)
int adc() const
int rbxIndex() const
uint32_t hcalFrontEndId_
int operator==(const HcalFrontEndId &id) const
int rmFiber() const
int qieCard() const
static const int maxRbxIndex