CMS 3D CMS Logo

L1GctHFBitCounts.h
Go to the documentation of this file.
1 #ifndef L1GCTHFBITCOUNTS_H
2 #define L1GCTHFBITCOUNTS_H
3 
4 #include <ostream>
5 #include <string>
6 #include <cstdint>
7 
15 
17 public:
18  static const unsigned N_SUMS = 4;
19 
20 public:
23 
26 
30  static L1GctHFBitCounts fromConcHFBitCounts(const uint16_t capBlock,
31  const uint16_t capIndex,
32  const int16_t bx,
33  const uint32_t data);
34 
36  static L1GctHFBitCounts fromGctEmulator(const int16_t bx,
37  const uint16_t bitCountPosEtaRing1,
38  const uint16_t bitCountNegEtaRing1,
39  const uint16_t bitCountPosEtaRing2,
40  const uint16_t bitCountNegEtaRing2);
41 
42  // optional named ctor for GT if required
43  // arguments to be defined
44  // static L1GctHFBitCounts fromGtPsb()
45 
46  // getters
47 
48  // get number of ring sums
49  static unsigned nCounts() { return N_SUMS; }
50 
52  uint16_t capBlock() const { return capBlock_; }
53 
55  uint16_t capIndex() const { return capIndex_; }
56 
58  int16_t bx() const { return bx_; }
59 
61  bool empty() const { return (data_ == 0); }
62 
64  uint16_t raw() const { return data_; }
65 
72  uint16_t bitCount(unsigned const i) const;
73 
74  // setters
75 
77  void setCapBlock(uint16_t capBlock) { capBlock_ = capBlock; }
78 
80  void setCapIndex(uint16_t capIndex) { capIndex_ = capIndex; }
81 
83  void setBx(int16_t bx) { bx_ = bx; }
84 
86  void setBitCount(unsigned i, uint16_t c);
87 
89  void setData(uint32_t data) { data_ = data; }
90 
92 
94  bool operator==(const L1GctHFBitCounts& c) const;
95 
97  bool operator!=(const L1GctHFBitCounts& c) const { return !(*this == c); }
98 
99 private:
100  // source of the data
101  uint16_t capBlock_;
102  uint16_t capIndex_;
103  int16_t bx_;
104 
105  // the captured data
106  uint16_t data_;
107 };
108 
109 std::ostream& operator<<(std::ostream& s, const L1GctHFBitCounts& cand);
110 
111 #endif
L1GctHFBitCounts::capBlock
uint16_t capBlock() const
get GCT unpacker capture block
Definition: L1GctHFBitCounts.h:52
L1GctHFBitCounts::capIndex_
uint16_t capIndex_
Definition: L1GctHFBitCounts.h:102
mps_fire.i
i
Definition: mps_fire.py:355
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::capBlock_
uint16_t capBlock_
Definition: L1GctHFBitCounts.h:101
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
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::empty
bool empty() const
is the sum non-zero
Definition: L1GctHFBitCounts.h:61
L1GctHFBitCounts::nCounts
static unsigned nCounts()
Definition: L1GctHFBitCounts.h:49
L1GctHFBitCounts::N_SUMS
static const unsigned N_SUMS
Definition: L1GctHFBitCounts.h:18
L1GctHFBitCounts::setData
void setData(uint32_t data)
set the raw data
Definition: L1GctHFBitCounts.h:89
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctHFBitCounts::operator!=
bool operator!=(const L1GctHFBitCounts &c) const
inequality operator
Definition: L1GctHFBitCounts.h:97
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
operator<<
std::ostream & operator<<(std::ostream &s, const L1GctHFBitCounts &cand)
Definition: L1GctHFBitCounts.cc:58
cand
Definition: decayParser.h:34
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
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1GctHFBitCounts::operator==
bool operator==(const L1GctHFBitCounts &c) const
operators
Definition: L1GctHFBitCounts.cc:50
L1GctHFBitCounts::setBx
void setBx(int16_t bx)
set bx
Definition: L1GctHFBitCounts.h:83
L1GctHFBitCounts::setCapBlock
void setCapBlock(uint16_t capBlock)
set cap block
Definition: L1GctHFBitCounts.h:77
L1GctHFBitCounts::bx_
int16_t bx_
Definition: L1GctHFBitCounts.h:103
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctHFBitCounts::setCapIndex
void setCapIndex(uint16_t capIndex)
set cap index
Definition: L1GctHFBitCounts.h:80