test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <stdint.h>
7 
15 
16 
18 
19  public:
20  static const unsigned N_SUMS=4;
21 
22  public:
23 
26 
29 
33  static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock,
34  const uint16_t capIndex,
35  const int16_t bx,
36  const uint32_t data);
37 
39  static L1GctHFBitCounts fromGctEmulator(const int16_t bx,
40  const uint16_t bitCountPosEtaRing1,
41  const uint16_t bitCountNegEtaRing1,
42  const uint16_t bitCountPosEtaRing2,
43  const uint16_t bitCountNegEtaRing2);
44 
45  // optional named ctor for GT if required
46  // arguments to be defined
47  // static L1GctHFBitCounts fromGtPsb()
48 
49 
50  // getters
51 
52  // get number of ring sums
53  static unsigned nCounts() { return N_SUMS; }
54 
56  uint16_t capBlock() const { return capBlock_; }
57 
59  uint16_t capIndex() const { return capIndex_; }
60 
62  int16_t bx() const { return bx_; }
63 
65  bool empty() const { return (data_ == 0); }
66 
68  uint16_t raw() const { return data_; }
69 
76  uint16_t bitCount(unsigned const i) const;
77 
78 
79  // setters
80 
82  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
83 
85  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
86 
88  void setBx(int16_t bx) { bx_ = bx; }
89 
91  void setBitCount(unsigned i, uint16_t c);
92 
94  void setData(uint32_t data) { data_ = data; }
95 
96 
98 
100  bool operator==(const L1GctHFBitCounts& c) const;
101 
103  bool operator!=(const L1GctHFBitCounts& c) const { return !(*this == c); }
104 
105  private:
106 
107  // source of the data
108  uint16_t capBlock_;
109  uint16_t capIndex_;
110  int16_t bx_;
111 
112  // the captured data
113  uint16_t data_;
114 
115  };
116 
117 std::ostream& operator<<(std::ostream& s, const L1GctHFBitCounts& cand);
118 
119 #endif
int i
Definition: DBlmapReader.cc:9
void setData(uint32_t data)
set the raw data
void setBx(int16_t bx)
set bx
bool empty() const
is the sum non-zero
void setBitCount(unsigned i, uint16_t c)
set a sum
int16_t bx() const
get BX number
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
uint16_t bitCount(unsigned const i) const
bool operator!=(const L1GctHFBitCounts &c) const
inequality operator
~L1GctHFBitCounts()
destructor
uint16_t capBlock() const
get GCT unpacker capture block
L1 GCT HF ring Et sums.
void setCapBlock(uint16_t capBlock)
set cap block
static const unsigned N_SUMS
void setCapIndex(uint16_t capIndex)
set cap index
L1GctHFBitCounts()
default constructor (for vector initialisation etc.)
bool operator==(const L1GctHFBitCounts &c) const
operators
static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
static unsigned nCounts()
uint16_t capIndex() const
get index within GCT unpacker capture block
uint16_t raw() const
the raw data
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