test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <stdint.h>
7 
15 
16 
18 
19  public:
20  static const unsigned N_SUMS=4;
21 
22  public:
23 
26 
29 
33  static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock,
34  const uint16_t capIndex,
35  const int16_t bx,
36  const uint32_t data);
37 
39  static L1GctHFRingEtSums fromGctEmulator(const int16_t bx,
40  const uint16_t etSumPosEtaRing1,
41  const uint16_t etSumNegEtaRing1,
42  const uint16_t etSumPosEtaRing2,
43  const uint16_t etSumNegEtaRing2);
44 
45  // optional named ctor for GT if required
46  // arguments to be defined
47  // static L1GctHfRingEtSums fromGtPsb()
48 
49  // get number of ring sums
50  static unsigned nSums() { return N_SUMS; }
51 
52  // getters
53 
55  uint16_t capBlock() const { return capBlock_; }
56 
58  uint16_t capIndex() const { return capIndex_; }
59 
61  int16_t bx() const { return bx_; }
62 
64  bool empty() const { return (data_ == 0); }
65 
67  uint16_t raw() const { return data_; }
68 
75  uint16_t etSum(unsigned const i) const;
76 
77 
78  // setters
79 
81  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
82 
84  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
85 
87  void setBx(uint16_t bx) { bx_ = bx; }
88 
90  void setEtSum(unsigned i, uint16_t et);
91 
93  void setData(uint32_t data) { data_ = data; }
94 
95 
97 
99  bool operator==(const L1GctHFRingEtSums& c) const;
100 
102  bool operator!=(const L1GctHFRingEtSums& c) const { return !(*this == c); }
103 
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 L1GctHFRingEtSums& cand);
118 
119 #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
uint16_t capBlock() const
get GCT unpacker capture block
int i
Definition: DBlmapReader.cc:9
bool operator==(const L1GctHFRingEtSums &c) const
operators
uint16_t capIndex() const
get index within GCT unpacker capture block
void setCapIndex(uint16_t capIndex)
set cap index
~L1GctHFRingEtSums()
destructor
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
bool operator!=(const L1GctHFRingEtSums &c) const
inequality operator
void setData(uint32_t data)
set the raw data
static unsigned nSums()
bool empty() const
is the sum non-zero
void setEtSum(unsigned i, uint16_t et)
set a sum
void setCapBlock(uint16_t capBlock)
set cap block
int16_t bx() const
get BX number
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.
static const unsigned N_SUMS
uint16_t raw() const
get the raw data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
L1GctHFRingEtSums()
default constructor (for vector initialisation etc.)
void setBx(uint16_t bx)
set bx
uint16_t etSum(unsigned const i) const