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
HcalFrontEndId::rm
int rm() const
Definition: HcalFrontEndId.h:26
HcalFrontEndId::operator!=
int operator!=(const HcalFrontEndId &id) const
Definition: HcalFrontEndId.h:34
operator<<
std::ostream & operator<<(std::ostream &, const HcalFrontEndId &id)
Definition: HcalFrontEndId.cc:81
HcalFrontEndId::rbxIndex
int rbxIndex() const
Definition: HcalFrontEndId.h:17
HcalFrontEndId::rawId
uint32_t rawId() const
Definition: HcalFrontEndId.h:14
HcalFrontEndId::~HcalFrontEndId
~HcalFrontEndId()
Definition: HcalFrontEndId.cc:61
HcalFrontEndId::HcalFrontEndId
HcalFrontEndId(uint32_t id)
Definition: HcalFrontEndId.h:11
HcalFrontEndId::rmIndex
int rmIndex() const
Definition: HcalFrontEndId.h:20
HcalFrontEndId::fiberChannel
int fiberChannel() const
Definition: HcalFrontEndId.h:29
HcalFrontEndId::pixel
int pixel() const
Definition: HcalFrontEndId.h:27
HcalFrontEndId::maxRmIndex
static const int maxRmIndex
Definition: HcalFrontEndId.h:21
HcalFrontEndId
Definition: HcalFrontEndId.h:8
HcalFrontEndId::hcalFrontEndId_
uint32_t hcalFrontEndId_
Definition: HcalFrontEndId.h:38
HcalFrontEndId::rmFiber
int rmFiber() const
Definition: HcalFrontEndId.h:28
HcalFrontEndId::maxRbxIndex
static const int maxRbxIndex
Definition: HcalFrontEndId.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalFrontEndId::HcalFrontEndId
HcalFrontEndId()
Definition: HcalFrontEndId.h:10
HcalFrontEndId::operator==
int operator==(const HcalFrontEndId &id) const
Definition: HcalFrontEndId.h:33
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
HcalFrontEndId::rbx
std::string rbx() const
Definition: HcalFrontEndId.cc:63
HcalFrontEndId::qieCard
int qieCard() const
Definition: HcalFrontEndId.h:30
HcalFrontEndId::operator<
int operator<(const HcalFrontEndId &id) const
Definition: HcalFrontEndId.h:35
HcalFrontEndId::adc
int adc() const
Definition: HcalFrontEndId.h:31