CMS 3D CMS Logo

L1GctInternHFData.h
Go to the documentation of this file.
1 #ifndef L1GCTINTERNHFDATA_H
2 #define L1GCTINTERNHFDATA_H
3 
4 #include <ostream>
5 #include <string>
6 #include <cstdint>
7 
15 
17 public:
25  };
26 
29 
32 
33  static L1GctInternHFData fromConcRingSums(const uint16_t capBlock,
34  const uint16_t capIndex,
35  const int16_t bx,
36  const uint32_t data);
37 
38  static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock,
39  const uint16_t capIndex,
40  const int16_t bx,
41  const uint32_t data);
42 
43  static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock,
44  const uint16_t capIndex,
45  const int16_t bx,
46  const uint32_t data);
47 
48  static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock,
49  const uint16_t capIndex,
50  const int16_t bx,
51  const uint32_t data);
52 
54 
57 
59  uint16_t capBlock() const { return capBlock_; }
60 
62  uint16_t capIndex() const { return capIndex_; }
63 
65  int16_t bx() const { return bx_; }
66 
68  bool empty() const { return (data_ == 0); }
69 
71 
73  bool isRingSums() const { return (type_ == conc_hf_ring_et_sums || type_ == wheel_hf_ring_et_sums); }
74 
76  uint32_t raw() const { return data_; }
77 
79  uint16_t value(unsigned i) const;
80 
82  uint16_t et(unsigned i) const;
83 
85  uint16_t count(unsigned i) const;
86 
87  // setters
88 
90  void setCapBlock(uint16_t const capBlock) { capBlock_ = capBlock; }
91 
93  void setCapIndex(uint16_t const capIndex) { capIndex_ = capIndex; }
94 
96  void setBx(int16_t const bx) { bx_ = bx; }
97 
100 
102  void setValue(unsigned const i, uint16_t const val);
103 
105  void setEt(unsigned const i, uint16_t const et);
106 
108  void setCount(unsigned const i, uint16_t const count);
109 
110  void setData(uint32_t const data) { data_ = data; }
111 
113 
115  bool operator==(const L1GctInternHFData& c) const;
116 
118  bool operator!=(const L1GctInternHFData& c) const { return !(*this == c); }
119 
120 private:
121  // type of data
123 
124  // source of the data
125  uint16_t capBlock_;
126  uint16_t capIndex_;
127  int16_t bx_;
128 
129  // the captured data
130  uint32_t data_;
131 };
132 
133 std::ostream& operator<<(std::ostream& s, const L1GctInternHFData& cand);
134 
135 #endif
bool empty() const
is the sum non-zero
void setCapBlock(uint16_t const capBlock)
set cap block
L1GctInternHFData()
default constructor (for vector initialisation etc.)
bool isRingSums() const
get the actual data
L1GctInternHFData::L1GctInternHFDataType type() const
metadata
void setValue(unsigned const i, uint16_t const val)
set value
void setCount(unsigned const i, uint16_t const count)
set the count
static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
L1GctInternHFDataType
et sum type - not clear this is required
uint16_t capIndex() const
get index within capture block
uint16_t et(unsigned i) const
get the et sums
bool operator!=(const L1GctInternHFData &c) const
inequality operator
static L1GctInternHFData fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
bool operator==(const L1GctInternHFData &c) const
operators
uint16_t count(unsigned i) const
get the counts
static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
void setType(L1GctInternHFDataType type)
set type
void setEt(unsigned const i, uint16_t const et)
set the sum
uint16_t value(unsigned i) const
get value
int16_t bx() const
get BX number
uint16_t capBlock() const
get capture block
void setBx(int16_t const bx)
set bx
~L1GctInternHFData()
destructor
void setData(uint32_t const data)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternHFDataType type_
uint32_t raw() const
get the raw data
static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
std::ostream & operator<<(std::ostream &s, const L1GctInternHFData &cand)
L1 GCT internal ring sums and/or bit counts.
void setCapIndex(uint16_t const capIndex)
set cap index