CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GctInternEtSum.h
Go to the documentation of this file.
1 #ifndef L1GCTINTERNETSUM_H
2 #define L1GCTINTERNETSUM_H
3 
4 #include <ostream>
5 #include <string>
6 #include <cstdint>
7 
13 
15 public:
19  jet_tot_et, // from jet_tot_et_and_ht in leaf output
20  jet_tot_ht, // from jet_tot_et_and_ht in leaf output
21  jet_miss_et, // leaf output
22  total_et_or_ht, // conc input, wheel input and output
23  miss_etx_or_ety // conc input, wheel input and output
24  };
25 
26  enum numberOfBits {
39  };
40 
43 
45  L1GctInternEtSum(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t et, uint8_t oflow);
46 
49 
50  // named ctors
51  static L1GctInternEtSum fromJetTotEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data);
52 
53  static L1GctInternEtSum fromJetTotHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data);
54 
55  static L1GctInternEtSum fromJetMissEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data);
56 
57  static L1GctInternEtSum fromTotalEtOrHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data);
58 
59  static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data);
60 
61  static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx);
62 
63  static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx);
64 
65  static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx);
66 
67  static L1GctInternEtSum fromEmulatorTotalEtOrHt(unsigned totEtOrHt, bool overFlow, int16_t bx);
68 
69  static L1GctInternEtSum fromEmulatorMissEtxOrEty(int missEtxOrEty, bool overFlow, int16_t bx);
70 
72 
75 
77  uint16_t capBlock() const { return capBlock_; }
78 
80  uint16_t capIndex() const { return capIndex_; }
81 
83  int16_t bx() const { return bx_; }
84 
86  bool empty() const { return (data_ == 0); }
87 
89 
91  uint32_t raw() const { return data_; }
92 
94  uint32_t value() const { return data_ & 0x7fffffff; }
95 
97  uint32_t et() const { return value(); }
98 
100  uint32_t count() const { return value(); }
101 
103  uint8_t oflow() const { return (data_ >> 31) & 0x1; }
104 
105  // setters
106 
108  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
109 
111  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
112 
114  void setBx(uint16_t bx) { bx_ = bx; }
115 
118 
120  void setValue(uint32_t val);
121 
123  void setEt(uint32_t et);
124 
126  void setCount(uint32_t count);
127 
129  void setOflow(uint8_t oflow);
130 
132 
134  bool operator==(const L1GctInternEtSum& c) const;
135 
137  bool operator!=(const L1GctInternEtSum& c) const { return !(*this == c); }
138 
139 private:
140  // type of data
142 
143  // source of the data
144  uint16_t capBlock_;
145  uint16_t capIndex_;
146  int16_t bx_;
147 
148  // the captured data
149  uint32_t data_;
150 };
151 
152 std::ostream& operator<<(std::ostream& s, const L1GctInternEtSum& c);
153 
154 #endif
static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
L1GctInternEtSumType
et sum type - not clear this is required
L1 GCT internal energy sum.
bool operator!=(const L1GctInternEtSum &c) const
inequality operator
const edm::EventSetup & c
uint32_t count() const
get count
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
uint16_t capIndex() const
get index within capture block
uint16_t capBlock() const
get capture block
void setOflow(uint8_t oflow)
set overflow bit
void setCapBlock(uint16_t capBlock)
set cap block
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
bool empty() const
is the sum non-zero
void setBx(uint16_t bx)
set bx
static L1GctInternEtSum fromTotalEtOrHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
~L1GctInternEtSum()
destructor
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
L1GctInternEtSumType type_
uint8_t oflow() const
get oflow
void setType(L1GctInternEtSumType type)
set type
static L1GctInternEtSum fromEmulatorMissEtxOrEty(int missEtxOrEty, bool overFlow, int16_t bx)
static L1GctInternEtSum fromJetMissEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
static L1GctInternEtSum fromEmulatorTotalEtOrHt(unsigned totEtOrHt, bool overFlow, int16_t bx)
L1GctInternEtSum::L1GctInternEtSumType type() const
metadata
uint32_t et() const
get et
uint32_t value() const
get value
void setCount(uint32_t count)
set count
void setEt(uint32_t et)
set Et sum
uint32_t raw() const
get the actual bits
void setValue(uint32_t val)
set value
bool operator==(const L1GctInternEtSum &c) const
operators
int16_t bx() const
get BX number
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
L1GctInternEtSum()
default constructor (for vector initialisation etc.)
void setCapIndex(uint16_t capIndex)
set cap index
static L1GctInternEtSum fromJetTotEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
static L1GctInternEtSum fromJetTotHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)