CMS 3D CMS Logo

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) {
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) {
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) {
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);
42  int32_t odata = 0;
43  if (overFlow || (htx >= kJetFinderComponentHtMask / 2) || (htx < -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);
56  int32_t odata = 0;
57  if (overFlow || (htx >= kDoubleComponentHtMask / 2) || (htx < -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 }
L1GctInternHtMiss::miss_htx
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::L1GctInternHtMiss
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
Definition: L1GctInternHtMiss.cc:6
L1GctInternHtMiss::kDoubleComponentHtMask
Definition: L1GctInternHtMiss.h:121
L1GctInternHtMiss::overflow
bool overflow() const
Get overflow.
Definition: L1GctInternHtMiss.cc:104
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1GctInternHtMiss::convert14BitTwosCompTo16Bit
int16_t convert14BitTwosCompTo16Bit(const uint16_t data) const
Converts 14-bit two's complement numbers to 16-bit two's complement (i.e. an int16_t)
Definition: L1GctInternHtMiss.cc:123
L1GctInternHtMiss::jf_miss_htx_and_hty
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::emulatorMissHty
static L1GctInternHtMiss emulatorMissHty(const int hty, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht y component object from emulator.
Definition: L1GctInternHtMiss.cc:73
L1GctInternHtMiss::~L1GctInternHtMiss
~L1GctInternHtMiss()
destructor
Definition: L1GctInternHtMiss.cc:9
L1GctInternHtMiss
L1 GCT internal Ht Miss component(s) Ht_x and/or Ht_y.
Definition: L1GctInternHtMiss.h:16
L1GctInternHtMiss::emulatorJetMissHt
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).
Definition: L1GctInternHtMiss.cc:36
L1GctInternHtMiss::unpackerMissHtxHty
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).
Definition: L1GctInternHtMiss.cc:28
L1GctInternHtMiss::type
L1GctInternHtMiss::L1GctInternHtMissType type() const
'type' of object?
Definition: L1GctInternHtMiss.h:71
L1GctInternHtMiss::isThereHtx
bool isThereHtx() const
Is there a valid Ht x-component stored?
Definition: L1GctInternHtMiss.h:83
L1GctInternHtMiss::kSingleComponentRawMask
Definition: L1GctInternHtMiss.h:123
L1GctInternHtMiss::unpackerMissHty
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.
Definition: L1GctInternHtMiss.cc:20
L1GctInternHtMiss::hty
int16_t hty() const
Get Ht y-component.
Definition: L1GctInternHtMiss.cc:93
L1GctInternHtMiss::kSingleComponentHtMask
Definition: L1GctInternHtMiss.h:120
L1GctInternHtMiss::capBlock
uint16_t capBlock() const
Get capture block.
Definition: L1GctInternHtMiss.h:74
L1GctInternHtMiss::kSingleComponentOflowMask
Definition: L1GctInternHtMiss.h:118
L1GctInternHtMiss::L1GctInternHtMissType
L1GctInternHtMissType
Enum for the variants of Internal HtMiss.
Definition: L1GctInternHtMiss.h:19
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
L1GctInternHtMiss::kDoubleComponentOflowMask
Definition: L1GctInternHtMiss.h:119
L1GctInternHtMiss::bx
int16_t bx() const
Get BX number.
Definition: L1GctInternHtMiss.h:80
L1GctInternHtMiss::isThereHty
bool isThereHty() const
Is there a valid Ht y-component stored?
Definition: L1GctInternHtMiss.h:88
L1GctInternHtMiss::htx
int16_t htx() const
Get Ht x-component value.
Definition: L1GctInternHtMiss.cc:82
L1GctInternHtMiss::miss_hty
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::kJetFinderComponentHtMask
Definition: L1GctInternHtMiss.h:122
L1GctInternHtMiss::raw
uint32_t raw() const
Get the raw data.
Definition: L1GctInternHtMiss.h:95
L1GctInternHtMiss::emulatorMissHtx
static L1GctInternHtMiss emulatorMissHtx(const int htx, const bool overFlow, const int16_t bx)
Named ctor for making missing Ht x component object from emulator.
Definition: L1GctInternHtMiss.cc:64
L1GctInternHtMiss::emulatorMissHtxHty
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).
Definition: L1GctInternHtMiss.cc:50
L1GctInternHtMiss::capIndex
uint16_t capIndex() const
Get index within capture block.
Definition: L1GctInternHtMiss.h:77
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctInternHtMiss::kDoubleComponentHtyShift
Definition: L1GctInternHtMiss.h:117
operator<<
std::ostream & operator<<(std::ostream &os, const L1GctInternHtMiss &rhs)
Definition: L1GctInternHtMiss.cc:135
L1GctInternHtMiss::miss_htx_and_hty
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::kDoubleComponentRawMask
Definition: L1GctInternHtMiss.h:125
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
L1GctInternHtMiss::unpackerMissHtx
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.
Definition: L1GctInternHtMiss.cc:12
L1GctInternHtMiss.h