CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctInternHtMiss.cc
Go to the documentation of this file.
2 
3 
4 // PUBLIC METHODS
5 
6 // Default ctor
8  type_(nulltype),
9  capBlock_(0),
10  capIndex_(0),
11  bx_(0),
12  data_(0)
13 {
14 }
15 
16 // Destructor
18 
19 // Named ctor for making missing Ht x-component object from unpacker raw data.
21  const uint16_t capIndex,
22  const int16_t bx,
23  const uint32_t data)
24 {
25  return L1GctInternHtMiss(miss_htx, capBlock, capIndex, bx, data & kSingleComponentRawMask);
26 }
27 
28 // Named ctor for making missing Ht y-component object from unpacker raw data.
30  const uint16_t capIndex,
31  const int16_t bx,
32  const uint32_t data)
33 {
34  return L1GctInternHtMiss(miss_hty, capBlock, capIndex, bx, data & kSingleComponentRawMask);
35 }
36 
37 // Named ctor for making missing Ht x & y components object from unpacker raw data.
39  const uint16_t capIndex,
40  const int16_t bx,
41  const uint32_t data)
42 {
43  return L1GctInternHtMiss(miss_htx_and_hty, capBlock, capIndex, bx, data & kDoubleComponentRawMask);
44 }
45 
46 // Named ctor for making missing Ht x & y components object from unpacker raw data.
48  const int hty,
49  const bool overFlow,
50  const int16_t bx)
51 {
52  int32_t xdata = (htx & kJetFinderComponentHtMask);
53  int32_t ydata = (hty & kJetFinderComponentHtMask) << kDoubleComponentHtyShift;
54  int32_t odata = 0;
55  if (overFlow
56  || (htx >= kJetFinderComponentHtMask/2) || (htx < -kJetFinderComponentHtMask/2)
57  || (hty >= kJetFinderComponentHtMask/2) || (hty < -kJetFinderComponentHtMask/2) )
59  return L1GctInternHtMiss(jf_miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
60 }
61 
64  const int hty,
65  const bool overFlow,
66  const int16_t bx)
67 {
68  int32_t xdata = (htx & kDoubleComponentHtMask);
69  int32_t ydata = (hty & kDoubleComponentHtMask) << kDoubleComponentHtyShift;
70  int32_t odata = 0;
71  if (overFlow
72  || (htx >= kDoubleComponentHtMask/2) || (htx < -kDoubleComponentHtMask/2)
73  || (hty >= kDoubleComponentHtMask/2) || (hty < -kDoubleComponentHtMask/2) )
75  return L1GctInternHtMiss(miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
76 }
77 
80  const bool overFlow,
81  const int16_t bx)
82 {
83  int32_t xdata = (htx & kSingleComponentHtMask);
84  int32_t odata = 0;
85  if (overFlow
86  || (htx >= kSingleComponentHtMask/2) || (htx < -kSingleComponentHtMask/2) )
88  return L1GctInternHtMiss(miss_htx, 0, 0, bx, xdata | odata);
89 }
90 
91 
94  const bool overFlow,
95  const int16_t bx)
96 {
97  int32_t ydata = (hty & kSingleComponentHtMask);
98  int32_t odata = 0;
99  if (overFlow
100  || (hty >= kSingleComponentHtMask/2) || (hty < -kSingleComponentHtMask/2) )
102  return L1GctInternHtMiss(miss_hty, 0, 0, bx, ydata | odata);
103 }
104 
105 
106 // Get Ht x-component
107 int16_t L1GctInternHtMiss::htx() const
108 {
109  if(type() == miss_htx)
110  {
111  return static_cast<int16_t>(raw() & kSingleComponentHtMask);
112  }
113  if(type() == miss_htx_and_hty)
114  {
116  }
117  return 0;
118 }
119 
120 // Get Ht y-component
121 int16_t L1GctInternHtMiss::hty() const
122 {
123  if(type() == miss_hty)
124  {
125  return static_cast<int16_t>(raw() & kSingleComponentHtMask);
126  }
127  if(type() == miss_htx_and_hty)
128  {
130  }
131  return 0;
132 }
133 
134 // Get overflow
136 {
137  if(type() == miss_htx || type() == miss_hty) { return (raw() & kSingleComponentOflowMask) != 0; }
138  if(type() == miss_htx_and_hty) { return (raw() & kDoubleComponentOflowMask) != 0; }
139  return false;
140 }
141 
142 
143 // PRIVATE METHODS
144 
146  const uint16_t capBlock,
147  const uint16_t capIndex,
148  const int16_t bx,
149  const uint32_t data):
150  type_(type),
151  capBlock_(capBlock),
152  capIndex_(capIndex),
153  bx_(bx),
154  data_(data)
155 {
156 }
157 
159 {
160  // If bit 13 is high, set bits 13, 14, 15 high.
161  if((data & 0x2000) != 0) { return static_cast<int16_t>(data | 0xe000); }
162 
163  // Else, bit 13 must be low, so set bits 13, 14, 15 low.
164  return static_cast<int16_t>(data & 0x1fff);
165 }
166 
167 
168 // PRETTY PRINTOUT OPERATOR
169 
170 std::ostream& operator<<(std::ostream& os, const L1GctInternHtMiss& rhs)
171 {
172  os << " L1GctInternHtMiss: htx=";
173  if(rhs.isThereHtx()) { os << rhs.htx(); }
174  else { os << "n/a"; }
175  os << ", hty=";
176  if(rhs.isThereHty()) { os << rhs.hty(); }
177  else { os << "n/a"; }
178  if (rhs.overflow()) { os << "; overflow set"; }
179  os << "; cap block=0x" << std::hex << rhs.capBlock() << std::dec
180  << ", index=" << rhs.capIndex()
181  << ", BX=" << rhs.bx();
182  return os;
183 }
type
Definition: HCALResponse.h:21
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:187
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.
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.