CMS 3D CMS Logo

L1GctHFBitCounts.h
Go to the documentation of this file.
1 #ifndef L1GCTHFBITCOUNTS_H
2 #define L1GCTHFBITCOUNTS_H
3 
4 #include <ostream>
5 #include <string>
6 #include <cstdint>
7 
15 
17 public:
18  static const unsigned N_SUMS = 4;
19 
20 public:
23 
26 
30  static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock,
31  const uint16_t capIndex,
32  const int16_t bx,
33  const uint32_t data);
34 
36  static L1GctHFBitCounts fromGctEmulator(const int16_t bx,
37  const uint16_t bitCountPosEtaRing1,
38  const uint16_t bitCountNegEtaRing1,
39  const uint16_t bitCountPosEtaRing2,
40  const uint16_t bitCountNegEtaRing2);
41 
42  // optional named ctor for GT if required
43  // arguments to be defined
44  // static L1GctHFBitCounts fromGtPsb()
45 
46  // getters
47 
48  // get number of ring sums
49  static unsigned nCounts() { return N_SUMS; }
50 
52  uint16_t capBlock() const { return capBlock_; }
53 
55  uint16_t capIndex() const { return capIndex_; }
56 
58  int16_t bx() const { return bx_; }
59 
61  bool empty() const { return (data_ == 0); }
62 
64  uint16_t raw() const { return data_; }
65 
72  uint16_t bitCount(unsigned const i) const;
73 
74  // setters
75 
77  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
78 
80  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
81 
83  void setBx(int16_t bx) { bx_ = bx; }
84 
86  void setBitCount(unsigned i, uint16_t c);
87 
89  void setData(uint32_t data) { data_ = data; }
90 
92 
94  bool operator==(const L1GctHFBitCounts& c) const;
95 
97  bool operator!=(const L1GctHFBitCounts& c) const { return !(*this == c); }
98 
99 private:
100  // source of the data
101  uint16_t capBlock_;
102  uint16_t capIndex_;
103  int16_t bx_;
104 
105  // the captured data
106  uint16_t data_;
107 };
108 
109 std::ostream& operator<<(std::ostream& s, const L1GctHFBitCounts& cand);
110 
111 #endif
void setData(uint32_t data)
set the raw data
void setBx(int16_t bx)
set bx
void setBitCount(unsigned i, uint16_t c)
set a sum
uint16_t capBlock() const
get GCT unpacker capture block
uint16_t raw() const
the raw data
~L1GctHFBitCounts()
destructor
L1 GCT HF ring Et sums.
bool operator==(const L1GctHFBitCounts &c) const
operators
void setCapBlock(uint16_t capBlock)
set cap block
std::ostream & operator<<(std::ostream &s, const L1GctHFBitCounts &cand)
static const unsigned N_SUMS
void setCapIndex(uint16_t capIndex)
set cap index
L1GctHFBitCounts()
default constructor (for vector initialisation etc.)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool operator!=(const L1GctHFBitCounts &c) const
inequality operator
int16_t bx() const
get BX number
bool empty() const
is the sum non-zero
static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
uint16_t bitCount(unsigned const i) const
static unsigned nCounts()
uint16_t capIndex() const
get index within GCT unpacker capture block
static L1GctHFBitCounts fromGctEmulator(const int16_t bx, const uint16_t bitCountPosEtaRing1, const uint16_t bitCountNegEtaRing1, const uint16_t bitCountPosEtaRing2, const uint16_t bitCountNegEtaRing2)
named ctor for GCT emulator