CMS 3D CMS Logo

L1GctHFRingEtSums.cc
Go to the documentation of this file.
1 
3 
5 //static const unsigned L1GctHFRingEtSums::N_SUMS = 4;
6 
8 L1GctHFRingEtSums::L1GctHFRingEtSums() : 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  s.setCapBlock(capBlock);
20  s.setCapIndex(capIndex);
21  s.setBx(bx);
22  s.setEtSum(0, (data >> 12) & 0x7);
23  s.setEtSum(1, (data >> 16) & 0x7);
24  s.setEtSum(2, (data >> 19) & 0x7);
25  s.setEtSum(3, (data >> 22) & 0x7);
26  return s;
27 }
28 
29 // named ctor for GCT emulator
31  const uint16_t etSumPosEtaRing1,
32  const uint16_t etSumNegEtaRing1,
33  const uint16_t etSumPosEtaRing2,
34  const uint16_t etSumNegEtaRing2) {
36  s.setBx(bx);
37  s.setEtSum(0, etSumPosEtaRing1);
38  s.setEtSum(1, etSumNegEtaRing1);
39  s.setEtSum(2, etSumPosEtaRing2);
40  s.setEtSum(3, etSumNegEtaRing2);
41  return s;
42 }
43 
50 uint16_t L1GctHFRingEtSums::etSum(unsigned const i) const { return (data_ >> (i * 3)) & 0x7; }
51 
53 bool L1GctHFRingEtSums::operator==(const L1GctHFRingEtSums& c) const { return (this->raw() == c.raw()); }
54 
56 void L1GctHFRingEtSums::setEtSum(unsigned i, uint16_t et) {
57  data_ &= ~(0x7 << (i * 3));
58  data_ |= (et & 0x7) << (i * 3);
59 }
60 
61 std::ostream& operator<<(std::ostream& s, const L1GctHFRingEtSums& cand) {
62  s << "L1GctHFRingEtSums :";
63 
64  if (cand.empty()) {
65  s << " empty";
66  } else {
67  s << " ring1 eta+=" << cand.etSum(0);
68  s << " ring1 eta-=" << cand.etSum(1);
69  s << " ring2 eta+=" << cand.etSum(2);
70  s << " ring2 eta-=" << cand.etSum(3);
71  s << std::endl;
72  }
73 
74  s << std::hex << " cap block=" << cand.capBlock() << std::dec << " index=" << cand.capIndex() << " BX=" << cand.bx();
75 
76  return s;
77 }
L1GctHFRingEtSums.h
mps_fire.i
i
Definition: mps_fire.py:428
operator<<
std::ostream & operator<<(std::ostream &s, const L1GctHFRingEtSums &cand)
Definition: L1GctHFRingEtSums.cc:61
L1GctHFRingEtSums
L1 GCT HF ring Et sums.
Definition: L1GctHFRingEtSums.h:16
L1GctHFRingEtSums::fromGctEmulator
static L1GctHFRingEtSums fromGctEmulator(const int16_t bx, const uint16_t etSumPosEtaRing1, const uint16_t etSumNegEtaRing1, const uint16_t etSumPosEtaRing2, const uint16_t etSumNegEtaRing2)
named ctor for GCT emulator
Definition: L1GctHFRingEtSums.cc:30
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1GctHFRingEtSums::~L1GctHFRingEtSums
~L1GctHFRingEtSums()
destructor
Definition: L1GctHFRingEtSums.cc:11
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctHFRingEtSums::operator==
bool operator==(const L1GctHFRingEtSums &c) const
operators
Definition: L1GctHFRingEtSums.cc:53
L1GctHFRingEtSums::capBlock
uint16_t capBlock() const
get GCT unpacker capture block
Definition: L1GctHFRingEtSums.h:52
L1GctHFRingEtSums::etSum
uint16_t etSum(unsigned const i) const
Definition: L1GctHFRingEtSums.cc:50
L1GctHFRingEtSums::fromConcRingSums
static L1GctHFRingEtSums fromConcRingSums(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Definition: L1GctHFRingEtSums.cc:14
L1GctHFRingEtSums::capIndex
uint16_t capIndex() const
get index within GCT unpacker capture block
Definition: L1GctHFRingEtSums.h:55
cand
Definition: decayParser.h:32
L1GctHFRingEtSums::bx
int16_t bx() const
get BX number
Definition: L1GctHFRingEtSums.h:58
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
L1GctHFRingEtSums::setEtSum
void setEtSum(unsigned i, uint16_t et)
set a sum
Definition: L1GctHFRingEtSums.cc:56
L1GctHFRingEtSums::data_
uint16_t data_
Definition: L1GctHFRingEtSums.h:106
L1GctHFRingEtSums::raw
uint16_t raw() const
get the raw data
Definition: L1GctHFRingEtSums.h:64
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
L1GctHFRingEtSums::L1GctHFRingEtSums
L1GctHFRingEtSums()
default constructor (for vector initialisation etc.)
Definition: L1GctHFRingEtSums.cc:8