CMS 3D CMS Logo

L1GctHFBitCounts.cc
Go to the documentation of this file.
1 
3 
5 //static const unsigned L1GctHFBitCounts::N_COUNTS = 4;
6 
8 L1GctHFBitCounts::L1GctHFBitCounts() : capBlock_(0), capIndex_(0), bx_(0), data_(0) {}
9 
12 
13 // named ctor for unpacker
15  const uint16_t capIndex,
16  const int16_t bx,
17  const uint32_t data) {
19  c.setCapBlock(capBlock);
20  c.setCapIndex(capIndex);
21  c.setBx(bx);
22  c.setData(data & 0xfff);
23  return c;
24 }
25 
26 // named ctor for GCT emulator
28  const uint16_t bitCountPosEtaRing1,
29  const uint16_t bitCountNegEtaRing1,
30  const uint16_t bitCountPosEtaRing2,
31  const uint16_t bitCountNegEtaRing2) {
33  c.setBx(bx);
34  c.setBitCount(0, bitCountPosEtaRing1);
35  c.setBitCount(1, bitCountNegEtaRing1);
36  c.setBitCount(2, bitCountPosEtaRing2);
37  c.setBitCount(3, bitCountNegEtaRing2);
38  return c;
39 }
40 
47 uint16_t L1GctHFBitCounts::bitCount(unsigned const i) const { return (data_ >> (i * 3)) & 0x7; }
48 
50 bool L1GctHFBitCounts::operator==(const L1GctHFBitCounts& c) const { return (this->raw() == c.raw()); }
51 
53 void L1GctHFBitCounts::setBitCount(unsigned i, uint16_t c) {
54  data_ &= ~(0x7 << (i * 3));
55  data_ |= (c & 0x7) << (i * 3);
56 }
57 
58 std::ostream& operator<<(std::ostream& s, const L1GctHFBitCounts& cand) {
59  s << "L1GctHFBitCounts :";
60 
61  if (cand.empty()) {
62  s << " empty";
63  } else {
64  s << " ring1 eta+=" << cand.bitCount(0);
65  s << " ring1 eta-=" << cand.bitCount(1);
66  s << " ring2 eta+=" << cand.bitCount(2);
67  s << " ring2 eta-=" << cand.bitCount(3);
68  s << std::endl;
69  }
70 
71  s << std::hex << " cap block=" << cand.capBlock() << std::dec << " index=" << cand.capIndex() << " BX=" << cand.bx();
72 
73  return s;
74 }
L1GctHFBitCounts::capBlock
uint16_t capBlock() const
get GCT unpacker capture block
Definition: L1GctHFBitCounts.h:52
mps_fire.i
i
Definition: mps_fire.py:428
L1GctHFBitCounts::raw
uint16_t raw() const
the raw data
Definition: L1GctHFBitCounts.h:64
L1GctHFBitCounts::L1GctHFBitCounts
L1GctHFBitCounts()
default constructor (for vector initialisation etc.)
Definition: L1GctHFBitCounts.cc:8
L1GctHFBitCounts::bx
int16_t bx() const
get BX number
Definition: L1GctHFBitCounts.h:58
L1GctHFBitCounts::fromConcHFBitCounts
static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctHFBitCounts.cc:14
L1GctHFBitCounts
L1 GCT HF ring Et sums.
Definition: L1GctHFBitCounts.h:16
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1GctHFBitCounts::fromGctEmulator
static L1GctHFBitCounts fromGctEmulator(const int16_t bx, const uint16_t bitCountPosEtaRing1, const uint16_t bitCountNegEtaRing1, const uint16_t bitCountPosEtaRing2, const uint16_t bitCountNegEtaRing2)
named ctor for GCT emulator
Definition: L1GctHFBitCounts.cc:27
L1GctHFBitCounts.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctHFBitCounts::setBitCount
void setBitCount(unsigned i, uint16_t c)
set a sum
Definition: L1GctHFBitCounts.cc:53
L1GctHFBitCounts::bitCount
uint16_t bitCount(unsigned const i) const
Definition: L1GctHFBitCounts.cc:47
L1GctHFBitCounts::data_
uint16_t data_
Definition: L1GctHFBitCounts.h:106
cand
Definition: decayParser.h:32
L1GctHFBitCounts::~L1GctHFBitCounts
~L1GctHFBitCounts()
destructor
Definition: L1GctHFBitCounts.cc:11
L1GctHFBitCounts::capIndex
uint16_t capIndex() const
get index within GCT unpacker capture block
Definition: L1GctHFBitCounts.h:55
L1GctHFBitCounts::operator==
bool operator==(const L1GctHFBitCounts &c) const
operators
Definition: L1GctHFBitCounts.cc:50
operator<<
std::ostream & operator<<(std::ostream &s, const L1GctHFBitCounts &cand)
Definition: L1GctHFBitCounts.cc:58
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142