CMS 3D CMS Logo

L1GctHFRingEtSums.h
Go to the documentation of this file.
1 #ifndef L1GCTHFRINGETSUMS_H
2 #define L1GCTHFRINGETSUMS_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 L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock,
31  const uint16_t capIndex,
32  const int16_t bx,
33  const uint32_t data);
34 
36  static L1GctHFRingEtSums fromGctEmulator(const int16_t bx,
37  const uint16_t etSumPosEtaRing1,
38  const uint16_t etSumNegEtaRing1,
39  const uint16_t etSumPosEtaRing2,
40  const uint16_t etSumNegEtaRing2);
41 
42  // optional named ctor for GT if required
43  // arguments to be defined
44  // static L1GctHfRingEtSums fromGtPsb()
45 
46  // get number of ring sums
47  static unsigned nSums() { return N_SUMS; }
48 
49  // getters
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 etSum(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(uint16_t bx) { bx_ = bx; }
84 
86  void setEtSum(unsigned i, uint16_t et);
87 
89  void setData(uint32_t data) { data_ = data; }
90 
92 
94  bool operator==(const L1GctHFRingEtSums& c) const;
95 
97  bool operator!=(const L1GctHFRingEtSums& 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 L1GctHFRingEtSums& cand);
110 
111 #endif
static L1GctHFRingEtSums fromGctEmulator(const int16_t bx, const uint16_t etSumPosEtaRing1, const uint16_t etSumNegEtaRing1, const uint16_t etSumPosEtaRing2, const uint16_t etSumNegEtaRing2)
named ctor for GCT emulator
void setCapIndex(uint16_t capIndex)
set cap index
~L1GctHFRingEtSums()
destructor
bool operator==(const L1GctHFRingEtSums &c) const
operators
void setData(uint32_t data)
set the raw data
static unsigned nSums()
uint16_t etSum(unsigned const i) const
bool empty() const
is the sum non-zero
bool operator!=(const L1GctHFRingEtSums &c) const
inequality operator
int16_t bx() const
get BX number
std::ostream & operator<<(std::ostream &s, const L1GctHFRingEtSums &cand)
void setEtSum(unsigned i, uint16_t et)
set a sum
uint16_t capIndex() const
get index within GCT unpacker capture block
void setCapBlock(uint16_t capBlock)
set cap block
static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
L1 GCT HF ring Et sums.
uint16_t capBlock() const
get GCT unpacker capture block
static const unsigned N_SUMS
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
uint16_t raw() const
get the raw data
L1GctHFRingEtSums()
default constructor (for vector initialisation etc.)
void setBx(uint16_t bx)
set bx