CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctInternHFData.cc
Go to the documentation of this file.
1 
3 
5  type_(null),
6  capBlock_(0),
7  capIndex_(0),
8  bx_(0),
9  data_(0)
10 { }
11 
14 
16  const uint16_t capIndex,
17  const int16_t bx,
18  const uint32_t data) {
21  d.setCapIndex(capIndex);
22  d.setCapBlock(capBlock);
23  d.setBx(bx);
24  d.setData(data);
25  return d;
26 }
27 
29  const uint16_t capIndex,
30  const int16_t bx,
31  const uint32_t data) {
34  d.setCapIndex(capIndex);
35  d.setCapBlock(capBlock);
36  d.setBx(bx);
37  for (unsigned i=0; i<4; ++i) {
38  d.setCount(i, (data>>(6*i))&0x3f);
39  }
40  return d;
41 }
42 
44  const uint16_t capIndex,
45  const int16_t bx,
46  const uint32_t data) {
49  d.setCapIndex(capIndex);
50  d.setCapBlock(capBlock);
51  d.setBx(bx);
52  d.setData(data & 0xff);
53  return d;
54 }
55 
57  const uint16_t capIndex,
58  const int16_t bx,
59  const uint32_t data) {
62  d.setCapIndex(capIndex);
63  d.setCapBlock(capBlock);
64  d.setBx(bx);
65  d.setCount(0,data & 0x3f);
66  return d;
67 }
68 
69 
70 // get value
71 uint16_t L1GctInternHFData::value(unsigned i) const {
72  return (data_>>(i*8)) & 0xff;
73 }
74 
76 uint16_t L1GctInternHFData::et(unsigned i) const {
77  return value(i);
78 }
79 
81 uint16_t L1GctInternHFData::count(unsigned i) const {
82  return value(i);
83 }
84 
85 
88  return ( this->raw() == c.raw() );
89 }
90 
91 
92 // set value
93 void L1GctInternHFData::setValue(unsigned i, uint16_t val) {
94  data_ &= ~(0xff<<(i*8));
95  data_ |= (val&0xff)<<(i*8);
96 }
97 
99 void L1GctInternHFData::setEt(unsigned i, uint16_t et) {
100  setValue(i, et);
101 }
102 
104 void L1GctInternHFData::setCount(unsigned i, uint16_t count) {
105  setValue(i, count);
106 }
107 
108 
109 std::ostream& operator<<(std::ostream& s, const L1GctInternHFData& cand)
110 {
111  s << "L1GctInternHFData :";
112 
113  if (cand.empty()) {
114  s << " empty";
115  } else {
117  s << " type=conc_hf_ring_et_sums";
118  s << " ring1 eta+=" << cand.et(0);
119  s << " ring1 eta-=" << cand.et(1);
120  s << " ring2 eta+=" << cand.et(2);
121  s << " ring2 eta-=" << cand.et(3);
122  } else if (cand.type()==L1GctInternHFData::conc_hf_bit_counts){
123  s << " type=conc_hf_bit_counts";
124  s << " ring1 eta+=" << cand.count(0);
125  s << " ring1 eta-=" << cand.count(1);
126  s << " ring2 eta+=" << cand.count(2);
127  s << " ring2 eta-=" << cand.count(3);
129  s << " type=conc_hf_ring_et_sums";
130  s << " Et sum=" << cand.et(0);
131  } else if (cand.type()==L1GctInternHFData::wheel_hf_bit_counts){
132  s << " type=wheel_hf_bit_counts";
133  s << " Bit count=" << cand.et(0);
134  }
135  }
136  s << std::endl;
137 
138  s << std::hex << " cap block=" << cand.capBlock() << std::dec << " index=" << cand.capIndex() << " BX=" << cand.bx();
139 
140  return s;
141 
142 }
143 
int i
Definition: DBlmapReader.cc:9
void setCapBlock(uint16_t const capBlock)
set cap block
L1GctInternHFData()
default constructor (for vector initialisation etc.)
L1GctInternHFData::L1GctInternHFDataType type() const
metadata
void setValue(unsigned const i, uint16_t const val)
set value
uint16_t capIndex() const
get index within capture block
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void setCount(unsigned const i, uint16_t const count)
set the count
static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
tuple d
Definition: ztail.py:151
static L1GctInternHFData fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
uint16_t count(unsigned i) const
get the counts
uint16_t capBlock() const
get capture block
uint16_t et(unsigned i) const
get the et sums
int16_t bx() const
get BX number
static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
void setType(L1GctInternHFDataType type)
set type
uint16_t value(unsigned i) const
get value
void setEt(unsigned const i, uint16_t const et)
set the sum
void setBx(int16_t const bx)
set bx
bool empty() const
is the sum non-zero
~L1GctInternHFData()
destructor
void setData(uint32_t const data)
bool operator==(const L1GctInternHFData &c) const
operators
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
uint32_t raw() const
get the raw data
L1 GCT internal ring sums and/or bit counts.
void setCapIndex(uint16_t const capIndex)
set cap index