HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HGCalTBElectronicsId.h
Go to the documentation of this file.
1 #ifndef HGCAL_DATAFORMATS_HGCALTBELECTRONICSID_H
2 #define HGCAL_DATAFORMATS_HGCALTBELECTRONICSID_H 1
3 
4 #include <iosfwd>
5 #include <stdint.h>
6 
7 /** \class HGCalTBElectronicsId
8  *
9  * [6:0] ICHAN
10  * [10:7] ISKIROC
11  *
12  * $Date: $
13  * $Revision: $
14  * \author J. Mans - Minnesota
15  */
17 {
18 public:
19  static const int kIChanOffset = 0;
20  static const int kIChanMask = 0x7F;
21  static const int kISkiRocOffset = 7;
22  static const int kISkiRocMask = 0x3F;
23 
25  HGCalTBElectronicsId() : m_id(0) { }
26  HGCalTBElectronicsId(uint32_t rawId) : m_id(rawId) { }
27 
28  int ichan() const
29  {
30  return (m_id & kIChanMask);
31  }
32  int iskiroc() const
33  {
34  return (m_id >> kISkiRocOffset)&kISkiRocMask;
35  }
36 
37  uint32_t rawId() const
38  {
39  return m_id;
40  }
41 
42  bool null() const
43  {
44  return m_id == 0;
45  }
46 
47  operator uint32_t() const
48  {
49  return m_id;
50  }
51 private:
52  uint32_t m_id;
53 };
54 
55 std::ostream& operator<<(std::ostream&, const HGCalTBElectronicsId& id);
56 
57 
58 #endif
static const int kIChanOffset
static const int kIChanMask
HGCalTBElectronicsId(uint32_t rawId)
static const int kISkiRocOffset
uint32_t rawId() const
std::ostream & operator<<(std::ostream &, const HGCalTBDetId &id)
Definition: HGCalTBDetId.cc:37
static const int kISkiRocMask