CMS 3D CMS Logo

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:
18  null,
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
L1GctInternEtSum::fromJetTotHt
static L1GctInternEtSum fromJetTotHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:30
L1GctInternEtSum::setValue
void setValue(uint32_t val)
set value
Definition: L1GctInternEtSum.cc:143
L1GctInternEtSum::fromEmulatorMissEtxOrEty
static L1GctInternEtSum fromEmulatorMissEtxOrEty(int missEtxOrEty, bool overFlow, int16_t bx)
Definition: L1GctInternEtSum.cc:129
L1GctInternEtSum::setBx
void setBx(uint16_t bx)
set bx
Definition: L1GctInternEtSum.h:114
L1GctInternEtSum::kMissExOrEyNBits
Definition: L1GctInternEtSum.h:29
L1GctInternEtSum::capBlock
uint16_t capBlock() const
get capture block
Definition: L1GctInternEtSum.h:77
L1GctInternEtSum::et
uint32_t et() const
get et
Definition: L1GctInternEtSum.h:97
L1GctInternEtSum::L1GctInternEtSumType
L1GctInternEtSumType
et sum type - not clear this is required
Definition: L1GctInternEtSum.h:17
L1GctInternEtSum::operator!=
bool operator!=(const L1GctInternEtSum &c) const
inequality operator
Definition: L1GctInternEtSum.h:137
L1GctInternEtSum::type
L1GctInternEtSum::L1GctInternEtSumType type() const
metadata
Definition: L1GctInternEtSum.h:74
L1GctInternEtSum::miss_etx_or_ety
Definition: L1GctInternEtSum.h:23
L1GctInternEtSum::raw
uint32_t raw() const
get the actual bits
Definition: L1GctInternEtSum.h:91
L1GctInternEtSum::setEt
void setEt(uint32_t et)
set Et sum
Definition: L1GctInternEtSum.cc:149
L1GctInternEtSum::setType
void setType(L1GctInternEtSumType type)
set type
Definition: L1GctInternEtSum.h:117
L1GctInternEtSum::kTotEtOrHtMaxValue
Definition: L1GctInternEtSum.h:33
L1GctInternEtSum::capIndex
uint16_t capIndex() const
get index within capture block
Definition: L1GctInternEtSum.h:80
L1GctInternEtSum::kTotEtOrHtOFlowBit
Definition: L1GctInternEtSum.h:30
L1GctInternEtSum::jet_tot_et
Definition: L1GctInternEtSum.h:19
L1GctInternEtSum::~L1GctInternEtSum
~L1GctInternEtSum()
destructor
Definition: L1GctInternEtSum.cc:14
L1GctInternEtSum::numberOfBits
numberOfBits
Definition: L1GctInternEtSum.h:26
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctInternEtSum::type_
L1GctInternEtSumType type_
Definition: L1GctInternEtSum.h:141
L1GctInternEtSum::setCapBlock
void setCapBlock(uint16_t capBlock)
set cap block
Definition: L1GctInternEtSum.h:108
L1GctInternEtSum::count
uint32_t count() const
get count
Definition: L1GctInternEtSum.h:100
operator<<
std::ostream & operator<<(std::ostream &s, const L1GctInternEtSum &c)
Pretty-print operator for L1GctInternEtSum.
Definition: L1GctInternEtSum.cc:161
L1GctInternEtSum::setCapIndex
void setCapIndex(uint16_t capIndex)
set cap index
Definition: L1GctInternEtSum.h:111
L1GctInternEtSum::kJetMissEtRawCtorMask
Definition: L1GctInternEtSum.h:37
L1GctInternEtSum::fromEmulatorTotalEtOrHt
static L1GctInternEtSum fromEmulatorTotalEtOrHt(unsigned totEtOrHt, bool overFlow, int16_t bx)
Definition: L1GctInternEtSum.cc:119
L1GctInternEtSum::kMissExOrEyMaxValue
Definition: L1GctInternEtSum.h:35
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
L1GctInternEtSum::kMissExOrEyRawCtorMask
Definition: L1GctInternEtSum.h:38
L1GctInternEtSum::jet_tot_ht
Definition: L1GctInternEtSum.h:20
L1GctInternEtSum::operator==
bool operator==(const L1GctInternEtSum &c) const
operators
Definition: L1GctInternEtSum.cc:140
L1GctInternEtSum::jet_miss_et
Definition: L1GctInternEtSum.h:21
L1GctInternEtSum::kJetMissEtMaxValue
Definition: L1GctInternEtSum.h:34
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1GctInternEtSum::fromTotalEtOrHt
static L1GctInternEtSum fromTotalEtOrHt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:59
L1GctInternEtSum::fromEmulatorJetMissEt
static L1GctInternEtSum fromEmulatorJetMissEt(int missEtxOrEty, bool overFlow, int16_t bx)
Definition: L1GctInternEtSum.cc:109
L1GctInternEtSum::value
uint32_t value() const
get value
Definition: L1GctInternEtSum.h:94
L1GctInternEtSum::setCount
void setCount(uint32_t count)
set count
Definition: L1GctInternEtSum.cc:152
heppy_batch.val
val
Definition: heppy_batch.py:351
L1GctInternEtSum::kMissExOrEyOFlowBit
Definition: L1GctInternEtSum.h:32
L1GctInternEtSum::kTotEtOrHtRawCtorMask
Definition: L1GctInternEtSum.h:36
L1GctInternEtSum
L1 GCT internal energy sum.
Definition: L1GctInternEtSum.h:14
L1GctInternEtSum::fromMissEtxOrEty
static L1GctInternEtSum fromMissEtxOrEty(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:73
L1GctInternEtSum::empty
bool empty() const
is the sum non-zero
Definition: L1GctInternEtSum.h:86
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternEtSum::capIndex_
uint16_t capIndex_
Definition: L1GctInternEtSum.h:145
L1GctInternEtSum::bx_
int16_t bx_
Definition: L1GctInternEtSum.h:146
L1GctInternEtSum::kJetMissEtOFlowBit
Definition: L1GctInternEtSum.h:31
L1GctInternEtSum::kJetMissEtNBits
Definition: L1GctInternEtSum.h:28
L1GctInternEtSum::total_et_or_ht
Definition: L1GctInternEtSum.h:22
L1GctInternEtSum::data_
uint32_t data_
Definition: L1GctInternEtSum.h:149
L1GctInternEtSum::fromEmulatorJetTotHt
static L1GctInternEtSum fromEmulatorJetTotHt(unsigned totHt, bool overFlow, int16_t bx)
Definition: L1GctInternEtSum.cc:99
L1GctInternEtSum::oflow
uint8_t oflow() const
get oflow
Definition: L1GctInternEtSum.h:103
L1GctInternEtSum::kTotEtOrHtNBits
Definition: L1GctInternEtSum.h:27
L1GctInternEtSum::fromJetMissEt
static L1GctInternEtSum fromJetMissEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:45
L1GctInternEtSum::L1GctInternEtSum
L1GctInternEtSum()
default constructor (for vector initialisation etc.)
Definition: L1GctInternEtSum.cc:4
L1GctInternEtSum::capBlock_
uint16_t capBlock_
Definition: L1GctInternEtSum.h:144
L1GctInternEtSum::bx
int16_t bx() const
get BX number
Definition: L1GctInternEtSum.h:83
L1GctInternEtSum::fromEmulatorJetTotEt
static L1GctInternEtSum fromEmulatorJetTotEt(unsigned totEt, bool overFlow, int16_t bx)
Emulator constructors.
Definition: L1GctInternEtSum.cc:89
L1GctInternEtSum::fromJetTotEt
static L1GctInternEtSum fromJetTotEt(uint16_t capBlock, uint16_t capIndex, int16_t bx, uint32_t data)
Definition: L1GctInternEtSum.cc:16
L1GctInternEtSum::setOflow
void setOflow(uint8_t oflow)
set overflow bit
Definition: L1GctInternEtSum.cc:155