CMS 3D CMS Logo

L1GctInternHtMiss.h
Go to the documentation of this file.
1 #ifndef L1GCTINTERNHTMISS_H
2 #define L1GCTINTERNHTMISS_H
3 
12 // C++ headers
13 #include <ostream>
14 #include <cstdint>
15 
17 public:
20 
21  enum numberOfBits {
22  // TODO - tidy up all these enums.
23  // These numbers of bits are needed to specify data sizes in the emulator
24  // Other masks are below in the private section.
28  };
29 
32 
35 
36  /* Named Constructors */
37 
39  static L1GctInternHtMiss unpackerMissHtx(const uint16_t capBlock,
40  const uint16_t capIndex,
41  const int16_t bx,
42  const uint32_t data);
43 
45  static L1GctInternHtMiss unpackerMissHty(const uint16_t capBlock,
46  const uint16_t capIndex,
47  const int16_t bx,
48  const uint32_t data);
49 
51  static L1GctInternHtMiss unpackerMissHtxHty(const uint16_t capBlock,
52  const uint16_t capIndex,
53  const int16_t bx,
54  const uint32_t data);
55 
57  static L1GctInternHtMiss emulatorJetMissHt(const int htx, const int hty, const bool overFlow, const int16_t bx);
58 
60  static L1GctInternHtMiss emulatorMissHtxHty(const int htx, const int hty, const bool overFlow, const int16_t bx);
61 
63  static L1GctInternHtMiss emulatorMissHtx(const int htx, const bool overFlow, const int16_t bx);
64 
66  static L1GctInternHtMiss emulatorMissHty(const int hty, const bool overFlow, const int16_t bx);
67 
68  /* Metadata */
69 
72 
74  uint16_t capBlock() const { return capBlock_; }
75 
77  uint16_t capIndex() const { return capIndex_; }
78 
80  int16_t bx() const { return bx_; }
81 
83  bool isThereHtx() const {
84  return (type() == miss_htx || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty);
85  }
86 
88  bool isThereHty() const {
89  return (type() == miss_hty || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty);
90  }
91 
92  /* Access to the actual data */
93 
95  uint32_t raw() const { return data_; }
96 
98  int16_t htx() const;
99 
101  int16_t hty() const;
102 
104  bool overflow() const;
105 
106  /* Operators */
107 
109  bool operator==(const L1GctInternHtMiss& rhs) const { return (type() == rhs.type() && raw() == rhs.raw()); }
110 
112  bool operator!=(const L1GctInternHtMiss& rhs) const { return !(*this == rhs); }
113 
114 private:
117  kDoubleComponentHtyShift = 16, // Bit shift for Hty in miss_htx_and_hty
118  kSingleComponentOflowMask = (1 << 30), // Overflow bit mask in miss_htx or miss_hty
119  kDoubleComponentOflowMask = (1 << 15), // Overflow bit mask in miss_htx_and_hty
120  kSingleComponentHtMask = 0xffff, // Ht component mask in miss_htx or miss_hty
121  kDoubleComponentHtMask = 0x3fff, // Ht component mask in miss_htx_and_hty
122  kJetFinderComponentHtMask = 0x0fff, // Ht component mask in jf_miss_htx_and_hty
124  kSingleComponentHtMask, // To mask off all the non-data bits in raw data (e.g. BC0, etc)
127  };
128 
129  /* Private ctors and methods */
130 
133  const uint16_t capBlock,
134  const uint16_t capIndex,
135  const int16_t bx,
136  const uint32_t data);
137 
139 
140  int16_t convert14BitTwosCompTo16Bit(const uint16_t data) const;
141 
142  /* Private data */
143 
146 
147  // source of the data
148  uint16_t capBlock_;
149  uint16_t capIndex_;
150  int16_t bx_;
151 
153  uint32_t data_;
154 };
155 
156 // Pretty-print operator for L1GctInternHtMiss
157 std::ostream& operator<<(std::ostream& os, const L1GctInternHtMiss& rhs);
158 
159 #endif
type
Definition: HCALResponse.h:21
bool operator!=(const L1GctInternHtMiss &rhs) const
Inequality operator.
static L1GctInternHtMiss emulatorMissHty(const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht y component object from emulator.
bool overflow() const
Get overflow.
bool operator==(const L1GctInternHtMiss &rhs) const
Equality operator.
uint16_t capIndex() const
Get index within capture block.
~L1GctInternHtMiss()
destructor
uint32_t data_
The captured raw data.
L1GctInternHtMissType
Enum for the variants of Internal HtMiss.
bool isThereHty() const
Is there a valid Ht y-component stored?
static L1GctInternHtMiss unpackerMissHtxHty(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht x & y components object from unpacker raw data (wheel input)...
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
static L1GctInternHtMiss unpackerMissHty(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht y-component object from unpacker raw data.
L1GctInternHtMissType type_
&#39;Type&#39; of the data
int16_t hty() const
Get Ht y-component.
static L1GctInternHtMiss emulatorJetMissHt(const int htx, const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x & y components object from emulator (jetFinder output)...
bool isThereHtx() const
Is there a valid Ht x-component stored?
static L1GctInternHtMiss emulatorMissHtx(const int htx, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x component object from emulator.
uint32_t raw() const
Get the raw data.
static L1GctInternHtMiss emulatorMissHtxHty(const int htx, const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x & y components object from emulator (wheel input).
L1 GCT internal Ht Miss component(s) Ht_x and/or Ht_y.
uint16_t capBlock() const
Get capture block.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static L1GctInternHtMiss unpackerMissHtx(const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
Named ctor for making missing Ht x-component object from unpacker raw data.
int16_t convert14BitTwosCompTo16Bit(const uint16_t data) const
Converts 14-bit two&#39;s complement numbers to 16-bit two&#39;s complement (i.e. an int16_t) ...
int16_t bx() const
Get BX number.
ShiftsAndMasks
Useful bit masks and bit shifts.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
std::ostream & operator<<(std::ostream &os, const L1GctInternHtMiss &rhs)
int16_t htx() const
Get Ht x-component value.