CMS 3D CMS Logo

L1GctInternHFData.cc
Go to the documentation of this file.
1 
3 
4 L1GctInternHFData::L1GctInternHFData() : type_(null), capBlock_(0), capIndex_(0), bx_(0), data_(0) {}
5 
8 
10  const uint16_t capIndex,
11  const int16_t bx,
12  const uint32_t data) {
14  d.setType(conc_hf_ring_et_sums);
15  d.setCapIndex(capIndex);
16  d.setCapBlock(capBlock);
17  d.setBx(bx);
18  d.setData(data);
19  return d;
20 }
21 
23  const uint16_t capIndex,
24  const int16_t bx,
25  const uint32_t data) {
27  d.setType(conc_hf_bit_counts);
28  d.setCapIndex(capIndex);
29  d.setCapBlock(capBlock);
30  d.setBx(bx);
31  for (unsigned i = 0; i < 4; ++i) {
32  d.setCount(i, (data >> (6 * i)) & 0x3f);
33  }
34  return d;
35 }
36 
38  const uint16_t capIndex,
39  const int16_t bx,
40  const uint32_t data) {
42  d.setType(wheel_hf_ring_et_sums);
43  d.setCapIndex(capIndex);
44  d.setCapBlock(capBlock);
45  d.setBx(bx);
46  d.setData(data & 0xff);
47  return d;
48 }
49 
51  const uint16_t capIndex,
52  const int16_t bx,
53  const uint32_t data) {
55  d.setType(wheel_hf_bit_counts);
56  d.setCapIndex(capIndex);
57  d.setCapBlock(capBlock);
58  d.setBx(bx);
59  d.setCount(0, data & 0x3f);
60  return d;
61 }
62 
63 // get value
64 uint16_t L1GctInternHFData::value(unsigned i) const { return (data_ >> (i * 8)) & 0xff; }
65 
67 uint16_t L1GctInternHFData::et(unsigned i) const { return value(i); }
68 
70 uint16_t L1GctInternHFData::count(unsigned i) const { return value(i); }
71 
73 bool L1GctInternHFData::operator==(const L1GctInternHFData& c) const { return (this->raw() == c.raw()); }
74 
75 // set value
76 void L1GctInternHFData::setValue(unsigned i, uint16_t val) {
77  data_ &= ~(0xff << (i * 8));
78  data_ |= (val & 0xff) << (i * 8);
79 }
80 
82 void L1GctInternHFData::setEt(unsigned i, uint16_t et) { setValue(i, et); }
83 
85 void L1GctInternHFData::setCount(unsigned i, uint16_t count) { setValue(i, count); }
86 
87 std::ostream& operator<<(std::ostream& s, const L1GctInternHFData& cand) {
88  s << "L1GctInternHFData :";
89 
90  if (cand.empty()) {
91  s << " empty";
92  } else {
94  s << " type=conc_hf_ring_et_sums";
95  s << " ring1 eta+=" << cand.et(0);
96  s << " ring1 eta-=" << cand.et(1);
97  s << " ring2 eta+=" << cand.et(2);
98  s << " ring2 eta-=" << cand.et(3);
99  } else if (cand.type() == L1GctInternHFData::conc_hf_bit_counts) {
100  s << " type=conc_hf_bit_counts";
101  s << " ring1 eta+=" << cand.count(0);
102  s << " ring1 eta-=" << cand.count(1);
103  s << " ring2 eta+=" << cand.count(2);
104  s << " ring2 eta-=" << cand.count(3);
105  } else if (cand.type() == L1GctInternHFData::wheel_hf_ring_et_sums) {
106  s << " type=conc_hf_ring_et_sums";
107  s << " Et sum=" << cand.et(0);
108  } else if (cand.type() == L1GctInternHFData::wheel_hf_bit_counts) {
109  s << " type=wheel_hf_bit_counts";
110  s << " Bit count=" << cand.et(0);
111  }
112  }
113  s << std::endl;
114 
115  s << std::hex << " cap block=" << cand.capBlock() << std::dec << " index=" << cand.capIndex() << " BX=" << cand.bx();
116 
117  return s;
118 }
mps_fire.i
i
Definition: mps_fire.py:428
L1GctInternHFData::conc_hf_bit_counts
Definition: L1GctInternHFData.h:22
operator<<
std::ostream & operator<<(std::ostream &s, const L1GctInternHFData &cand)
Definition: L1GctInternHFData.cc:87
L1GctInternHFData::setValue
void setValue(unsigned const i, uint16_t const val)
set value
Definition: L1GctInternHFData.cc:76
L1GctInternHFData::conc_hf_ring_et_sums
Definition: L1GctInternHFData.h:21
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1GctInternHFData::fromConcBitCounts
static L1GctInternHFData fromConcBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:22
L1GctInternHFData::capIndex
uint16_t capIndex() const
get index within capture block
Definition: L1GctInternHFData.h:62
L1GctInternHFData::wheel_hf_ring_et_sums
Definition: L1GctInternHFData.h:23
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctInternHFData::count
uint16_t count(unsigned i) const
get the counts
Definition: L1GctInternHFData.cc:70
L1GctInternHFData::setCount
void setCount(unsigned const i, uint16_t const count)
set the count
Definition: L1GctInternHFData.cc:85
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
L1GctInternHFData::et
uint16_t et(unsigned i) const
get the et sums
Definition: L1GctInternHFData.cc:67
L1GctInternHFData::fromConcRingSums
static L1GctInternHFData fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:9
L1GctInternHFData::operator==
bool operator==(const L1GctInternHFData &c) const
operators
Definition: L1GctInternHFData.cc:73
L1GctInternHFData::value
uint16_t value(unsigned i) const
get value
Definition: L1GctInternHFData.cc:64
cand
Definition: decayParser.h:32
L1GctInternHFData::fromWheelRingSums
static L1GctInternHFData fromWheelRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:37
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1GctInternHFData::data_
uint32_t data_
Definition: L1GctInternHFData.h:130
L1GctInternHFData::capBlock
uint16_t capBlock() const
get capture block
Definition: L1GctInternHFData.h:59
heppy_batch.val
val
Definition: heppy_batch.py:351
L1GctInternHFData::wheel_hf_bit_counts
Definition: L1GctInternHFData.h:24
L1GctInternHFData
L1 GCT internal ring sums and/or bit counts.
Definition: L1GctInternHFData.h:16
L1GctInternHFData::~L1GctInternHFData
~L1GctInternHFData()
destructor
Definition: L1GctInternHFData.cc:7
L1GctInternHFData::setEt
void setEt(unsigned const i, uint16_t const et)
set the sum
Definition: L1GctInternHFData.cc:82
L1GctInternHFData::fromWheelBitCounts
static L1GctInternHFData fromWheelBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctInternHFData.cc:50
L1GctInternHFData::bx
int16_t bx() const
get BX number
Definition: L1GctInternHFData.h:65
L1GctInternHFData.h
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ztail.d
d
Definition: ztail.py:151
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
L1GctInternHFData::L1GctInternHFData
L1GctInternHFData()
default constructor (for vector initialisation etc.)
Definition: L1GctInternHFData.cc:4
L1GctInternHFData::raw
uint32_t raw() const
get the raw data
Definition: L1GctInternHFData.h:76