CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GctInternHtMiss.cc
Go to the documentation of this file.
2 
3 // PUBLIC METHODS
4 
5 // Default ctor
6 L1GctInternHtMiss::L1GctInternHtMiss() : type_(nulltype), capBlock_(0), capIndex_(0), bx_(0), data_(0) {}
7 
8 // Destructor
10 
11 // Named ctor for making missing Ht x-component object from unpacker raw data.
13  const uint16_t capIndex,
14  const int16_t bx,
15  const uint32_t data) {
16  return L1GctInternHtMiss(miss_htx, capBlock, capIndex, bx, data & kSingleComponentRawMask);
17 }
18 
19 // Named ctor for making missing Ht y-component object from unpacker raw data.
21  const uint16_t capIndex,
22  const int16_t bx,
23  const uint32_t data) {
24  return L1GctInternHtMiss(miss_hty, capBlock, capIndex, bx, data & kSingleComponentRawMask);
25 }
26 
27 // Named ctor for making missing Ht x & y components object from unpacker raw data.
29  const uint16_t capIndex,
30  const int16_t bx,
31  const uint32_t data) {
32  return L1GctInternHtMiss(miss_htx_and_hty, capBlock, capIndex, bx, data & kDoubleComponentRawMask);
33 }
34 
35 // Named ctor for making missing Ht x & y components object from unpacker raw data.
37  const int hty,
38  const bool overFlow,
39  const int16_t bx) {
40  int32_t xdata = (htx & kJetFinderComponentHtMask);
41  int32_t ydata = (hty & kJetFinderComponentHtMask) << kDoubleComponentHtyShift;
42  int32_t odata = 0;
43  if (overFlow || (htx >= kJetFinderComponentHtMask / 2) || (htx < -kJetFinderComponentHtMask / 2) ||
44  (hty >= kJetFinderComponentHtMask / 2) || (hty < -kJetFinderComponentHtMask / 2))
46  return L1GctInternHtMiss(jf_miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
47 }
48 
51  const int hty,
52  const bool overFlow,
53  const int16_t bx) {
54  int32_t xdata = (htx & kDoubleComponentHtMask);
55  int32_t ydata = (hty & kDoubleComponentHtMask) << kDoubleComponentHtyShift;
56  int32_t odata = 0;
57  if (overFlow || (htx >= kDoubleComponentHtMask / 2) || (htx < -kDoubleComponentHtMask / 2) ||
58  (hty >= kDoubleComponentHtMask / 2) || (hty < -kDoubleComponentHtMask / 2))
60  return L1GctInternHtMiss(miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
61 }
62 
64 L1GctInternHtMiss L1GctInternHtMiss::emulatorMissHtx(const int htx, const bool overFlow, const int16_t bx) {
65  int32_t xdata = (htx & kSingleComponentHtMask);
66  int32_t odata = 0;
67  if (overFlow || (htx >= kSingleComponentHtMask / 2) || (htx < -kSingleComponentHtMask / 2))
69  return L1GctInternHtMiss(miss_htx, 0, 0, bx, xdata | odata);
70 }
71 
73 L1GctInternHtMiss L1GctInternHtMiss::emulatorMissHty(const int hty, const bool overFlow, const int16_t bx) {
74  int32_t ydata = (hty & kSingleComponentHtMask);
75  int32_t odata = 0;
76  if (overFlow || (hty >= kSingleComponentHtMask / 2) || (hty < -kSingleComponentHtMask / 2))
78  return L1GctInternHtMiss(miss_hty, 0, 0, bx, ydata | odata);
79 }
80 
81 // Get Ht x-component
82 int16_t L1GctInternHtMiss::htx() const {
83  if (type() == miss_htx) {
84  return static_cast<int16_t>(raw() & kSingleComponentHtMask);
85  }
86  if (type() == miss_htx_and_hty) {
88  }
89  return 0;
90 }
91 
92 // Get Ht y-component
93 int16_t L1GctInternHtMiss::hty() const {
94  if (type() == miss_hty) {
95  return static_cast<int16_t>(raw() & kSingleComponentHtMask);
96  }
97  if (type() == miss_htx_and_hty) {
99  }
100  return 0;
101 }
102 
103 // Get overflow
105  if (type() == miss_htx || type() == miss_hty) {
106  return (raw() & kSingleComponentOflowMask) != 0;
107  }
108  if (type() == miss_htx_and_hty) {
109  return (raw() & kDoubleComponentOflowMask) != 0;
110  }
111  return false;
112 }
113 
114 // PRIVATE METHODS
115 
117  const uint16_t capBlock,
118  const uint16_t capIndex,
119  const int16_t bx,
120  const uint32_t data)
121  : type_(type), capBlock_(capBlock), capIndex_(capIndex), bx_(bx), data_(data) {}
122 
124  // If bit 13 is high, set bits 13, 14, 15 high.
125  if ((data & 0x2000) != 0) {
126  return static_cast<int16_t>(data | 0xe000);
127  }
128 
129  // Else, bit 13 must be low, so set bits 13, 14, 15 low.
130  return static_cast<int16_t>(data & 0x1fff);
131 }
132 
133 // PRETTY PRINTOUT OPERATOR
134 
135 std::ostream& operator<<(std::ostream& os, const L1GctInternHtMiss& rhs) {
136  os << " L1GctInternHtMiss: htx=";
137  if (rhs.isThereHtx()) {
138  os << rhs.htx();
139  } else {
140  os << "n/a";
141  }
142  os << ", hty=";
143  if (rhs.isThereHty()) {
144  os << rhs.hty();
145  } else {
146  os << "n/a";
147  }
148  if (rhs.overflow()) {
149  os << "; overflow set";
150  }
151  os << "; cap block=0x" << std::hex << rhs.capBlock() << std::dec << ", index=" << rhs.capIndex()
152  << ", BX=" << rhs.bx();
153  return os;
154 }
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.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
uint16_t capIndex() const
Get index within capture block.
~L1GctInternHtMiss()
destructor
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 &amp; 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.
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 &amp; 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 &amp; 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.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
int16_t htx() const
Get Ht x-component value.