CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 <stdint.h>
7 
13 
14 
16 
17  public:
18 
21  jet_tot_et, // from jet_tot_et_and_ht in leaf output
22  jet_tot_ht, // from jet_tot_et_and_ht in leaf output
23  jet_miss_et, // leaf output
24  total_et_or_ht, // conc input, wheel input and output
25  miss_etx_or_ety // conc input, wheel input and output
26  };
27 
28  enum numberOfBits {
41  };
42 
45 
47  L1GctInternEtSum(uint16_t capBlock,
48  uint16_t capIndex,
49  int16_t bx,
50  uint32_t et,
51  uint8_t oflow);
52 
55 
56  // named ctors
57  static L1GctInternEtSum fromJetTotEt(uint16_t capBlock,
58  uint16_t capIndex,
59  int16_t bx,
60  uint32_t data);
61 
62  static L1GctInternEtSum fromJetTotHt(uint16_t capBlock,
63  uint16_t capIndex,
64  int16_t bx,
65  uint32_t data);
66 
67  static L1GctInternEtSum fromJetMissEt(uint16_t capBlock,
68  uint16_t capIndex,
69  int16_t bx,
70  uint32_t data);
71 
72 
74  uint16_t capIndex,
75  int16_t bx,
76  uint32_t data);
77 
79  uint16_t capIndex,
80  int16_t bx,
81  uint32_t data);
82 
83  static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx);
84 
85  static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx);
86 
87  static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx);
88 
89  static L1GctInternEtSum fromEmulatorTotalEtOrHt(unsigned totEtOrHt, bool overFlow, int16_t bx);
90 
91  static L1GctInternEtSum fromEmulatorMissEtxOrEty(int missEtxOrEty, bool overFlow, int16_t bx);
92 
94 
97 
99  uint16_t capBlock() const { return capBlock_; }
100 
102  uint16_t capIndex() const { return capIndex_; }
103 
105  int16_t bx() const { return bx_; }
106 
108  bool empty() const { return (data_ == 0); }
109 
110 
112 
114  uint32_t raw() const { return data_; }
115 
117  uint32_t value() const { return data_ & 0x7fffffff; }
118 
120  uint32_t et() const { return value(); }
121 
123  uint32_t count() const { return value(); }
124 
126  uint8_t oflow() const { return (data_>>31) & 0x1; }
127 
128 
129  // setters
130 
132  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
133 
135  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
136 
138  void setBx(uint16_t bx) { bx_ = bx; }
139 
142 
144  void setValue(uint32_t val);
145 
147  void setEt(uint32_t et);
148 
150  void setCount(uint32_t count);
151 
153  void setOflow(uint8_t oflow);
154 
155 
157 
159  bool operator==(const L1GctInternEtSum& c) const;
160 
162  bool operator!=(const L1GctInternEtSum& c) const { return !(*this == c); }
163 
164 
165  private:
166 
167  // type of data
169 
170  // source of the data
171  uint16_t capBlock_;
172  uint16_t capIndex_;
173  int16_t bx_;
174 
175  // the captured data
176  uint32_t data_;
177 
178  };
179 
180 std::ostream& operator<<(std::ostream& s, const L1GctInternEtSum& c);
181 
182 #endif
static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
type
Definition: HCALResponse.h:22
L1GctInternEtSumType
et sum type - not clear this is required
L1 GCT internal energy sum.
bool operator!=(const L1GctInternEtSum &c) const
inequality operator
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:187
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:82
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)