CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
L1GctInternHtMiss Class Reference

L1 GCT internal Ht Miss component(s) Ht_x and/or Ht_y. More...

#include <L1GctInternHtMiss.h>

Public Types

enum  L1GctInternHtMissType {
  nulltype, miss_htx, miss_hty, miss_htx_and_hty,
  jf_miss_htx_and_hty
}
 Enum for the variants of Internal HtMiss. More...
 
enum  numberOfBits { kJetMissHtNBits = 12, kMissHxAndHyNBits = 14, kMissHxOrHyNBits = 16 }
 

Public Member Functions

int16_t bx () const
 Get BX number. More...
 
uint16_t capBlock () const
 Get capture block. More...
 
uint16_t capIndex () const
 Get index within capture block. More...
 
int16_t htx () const
 Get Ht x-component value. More...
 
int16_t hty () const
 Get Ht y-component. More...
 
bool isThereHtx () const
 Is there a valid Ht x-component stored? More...
 
bool isThereHty () const
 Is there a valid Ht y-component stored? More...
 
 L1GctInternHtMiss ()
 default constructor (for vector initialisation etc.) More...
 
bool operator!= (const L1GctInternHtMiss &rhs) const
 Inequality operator. More...
 
bool operator== (const L1GctInternHtMiss &rhs) const
 Equality operator. More...
 
bool overflow () const
 Get overflow. More...
 
uint32_t raw () const
 Get the raw data. More...
 
L1GctInternHtMiss::L1GctInternHtMissType type () const
 'type' of object? More...
 
 ~L1GctInternHtMiss ()
 destructor More...
 

Static Public Member Functions

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). More...
 
static L1GctInternHtMiss emulatorMissHtx (const int htx, const bool overFlow, const int16_t bx)
 Named ctor for making missing Ht x component object from emulator. More...
 
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). More...
 
static L1GctInternHtMiss emulatorMissHty (const int hty, const bool overFlow, const int16_t bx)
 Named ctor for making missing Ht y component object from emulator. More...
 
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. More...
 
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). More...
 
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. More...
 

Private Types

enum  ShiftsAndMasks {
  kDoubleComponentHtyShift = 16, kSingleComponentOflowMask = (1 << 30), kDoubleComponentOflowMask = (1 << 15), kSingleComponentHtMask = 0xffff,
  kDoubleComponentHtMask = 0x3fff, kJetFinderComponentHtMask = 0x0fff, kSingleComponentRawMask = kSingleComponentOflowMask | kSingleComponentHtMask, kDoubleComponentRawMask
}
 Useful bit masks and bit shifts. More...
 

Private Member Functions

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) More...
 
 L1GctInternHtMiss (const L1GctInternHtMissType type, const uint16_t capBlock, const uint16_t capIndex, const int16_t bx, const uint32_t data)
 Private constructor that the named ctors use. More...
 

Private Attributes

int16_t bx_
 
uint16_t capBlock_
 
uint16_t capIndex_
 
uint32_t data_
 The captured raw data. More...
 
L1GctInternHtMissType type_
 'Type' of the data More...
 

Detailed Description

L1 GCT internal Ht Miss component(s) Ht_x and/or Ht_y.

Author
Robert Frazier
Date
March 2009

Definition at line 17 of file L1GctInternHtMiss.h.

Member Enumeration Documentation

Enum for the variants of Internal HtMiss.

Enumerator
nulltype 
miss_htx 
miss_hty 
miss_htx_and_hty 
jf_miss_htx_and_hty 

Definition at line 23 of file L1GctInternHtMiss.h.

Enumerator
kJetMissHtNBits 
kMissHxAndHyNBits 
kMissHxOrHyNBits 

Definition at line 29 of file L1GctInternHtMiss.h.

29  {
30  // TODO - tidy up all these enums.
31  // These numbers of bits are needed to specify data sizes in the emulator
32  // Other masks are below in the private section.
33  kJetMissHtNBits = 12,
34  kMissHxAndHyNBits = 14,
35  kMissHxOrHyNBits = 16
36  };

Useful bit masks and bit shifts.

Enumerator
kDoubleComponentHtyShift 
kSingleComponentOflowMask 
kDoubleComponentOflowMask 
kSingleComponentHtMask 
kDoubleComponentHtMask 
kJetFinderComponentHtMask 
kSingleComponentRawMask 
kDoubleComponentRawMask 

Definition at line 137 of file L1GctInternHtMiss.h.

137  { kDoubleComponentHtyShift = 16, // Bit shift for Hty in miss_htx_and_hty
138  kSingleComponentOflowMask = (1 << 30), // Overflow bit mask in miss_htx or miss_hty
139  kDoubleComponentOflowMask = (1 << 15), // Overflow bit mask in miss_htx_and_hty
140  kSingleComponentHtMask = 0xffff, // Ht component mask in miss_htx or miss_hty
141  kDoubleComponentHtMask = 0x3fff, // Ht component mask in miss_htx_and_hty
142  kJetFinderComponentHtMask = 0x0fff, // Ht component mask in jf_miss_htx_and_hty
143  kSingleComponentRawMask = kSingleComponentOflowMask | kSingleComponentHtMask, // To mask off all the non-data bits in raw data (e.g. BC0, etc)

Constructor & Destructor Documentation

L1GctInternHtMiss::L1GctInternHtMiss ( )

default constructor (for vector initialisation etc.)

Definition at line 7 of file L1GctInternHtMiss.cc.

Referenced by emulatorJetMissHt(), emulatorMissHtx(), emulatorMissHtxHty(), emulatorMissHty(), unpackerMissHtx(), unpackerMissHtxHty(), and unpackerMissHty().

7  :
9  capBlock_(0),
10  capIndex_(0),
11  bx_(0),
12  data_(0)
13 {
14 }
uint32_t data_
The captured raw data.
L1GctInternHtMissType type_
&#39;Type&#39; of the data
L1GctInternHtMiss::~L1GctInternHtMiss ( )

destructor

Definition at line 17 of file L1GctInternHtMiss.cc.

17 {}
L1GctInternHtMiss::L1GctInternHtMiss ( const L1GctInternHtMissType  type,
const uint16_t  capBlock,
const uint16_t  capIndex,
const int16_t  bx,
const uint32_t  data 
)
private

Private constructor that the named ctors use.

Definition at line 145 of file L1GctInternHtMiss.cc.

149  :
150  type_(type),
153  bx_(bx),
154  data_(data)
155 {
156 }
type
Definition: HCALResponse.h:21
uint16_t capIndex() const
Get index within capture block.
uint32_t data_
The captured raw data.
L1GctInternHtMissType type_
&#39;Type&#39; of the data
uint16_t capBlock() const
Get capture block.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int16_t bx() const
Get BX number.

Member Function Documentation

int16_t L1GctInternHtMiss::bx ( ) const
inline

Get BX number.

Definition at line 101 of file L1GctInternHtMiss.h.

References bx_.

Referenced by operator<<().

101 { return bx_; }
uint16_t L1GctInternHtMiss::capBlock ( ) const
inline

Get capture block.

Definition at line 95 of file L1GctInternHtMiss.h.

References capBlock_.

Referenced by operator<<().

95 { return capBlock_; }
uint16_t L1GctInternHtMiss::capIndex ( ) const
inline

Get index within capture block.

Definition at line 98 of file L1GctInternHtMiss.h.

References capIndex_.

Referenced by operator<<().

98 { return capIndex_; }
int16_t L1GctInternHtMiss::convert14BitTwosCompTo16Bit ( const uint16_t  data) const
private

Converts 14-bit two's complement numbers to 16-bit two's complement (i.e. an int16_t)

The input is the raw bits of the 14-bit two's complement in a 16-bit unsigned number.

Definition at line 158 of file L1GctInternHtMiss.cc.

Referenced by htx(), and hty().

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 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
L1GctInternHtMiss L1GctInternHtMiss::emulatorJetMissHt ( const int  htx,
const int  hty,
const bool  overFlow,
const int16_t  bx 
)
static

Named ctor for making missing Ht x & y components object from emulator (jetFinder output).

Definition at line 47 of file L1GctInternHtMiss.cc.

References jf_miss_htx_and_hty, kDoubleComponentHtyShift, kDoubleComponentOflowMask, kJetFinderComponentHtMask, and L1GctInternHtMiss().

Referenced by L1GctJetFinderBase::getInternalHtMiss().

51 {
52  int32_t xdata = (htx & kJetFinderComponentHtMask);
54  int32_t odata = 0;
55  if (overFlow
59  return L1GctInternHtMiss(jf_miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
60 }
int16_t hty() const
Get Ht y-component.
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
int16_t htx() const
Get Ht x-component value.
L1GctInternHtMiss L1GctInternHtMiss::emulatorMissHtx ( const int  htx,
const bool  overFlow,
const int16_t  bx 
)
static

Named ctor for making missing Ht x component object from emulator.

Definition at line 79 of file L1GctInternHtMiss.cc.

References kSingleComponentHtMask, kSingleComponentOflowMask, L1GctInternHtMiss(), and miss_htx.

Referenced by L1GctWheelJetFpga::getInternalHtMiss().

82 {
83  int32_t xdata = (htx & kSingleComponentHtMask);
84  int32_t odata = 0;
85  if (overFlow
88  return L1GctInternHtMiss(miss_htx, 0, 0, bx, xdata | odata);
89 }
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
int16_t htx() const
Get Ht x-component value.
L1GctInternHtMiss L1GctInternHtMiss::emulatorMissHtxHty ( const int  htx,
const int  hty,
const bool  overFlow,
const int16_t  bx 
)
static

Named ctor for making missing Ht x & y components object from emulator (wheel input).

Definition at line 63 of file L1GctInternHtMiss.cc.

References kDoubleComponentHtMask, kDoubleComponentHtyShift, kDoubleComponentOflowMask, L1GctInternHtMiss(), and miss_htx_and_hty.

Referenced by L1GctJetLeafCard::getInternalHtMiss().

67 {
68  int32_t xdata = (htx & kDoubleComponentHtMask);
70  int32_t odata = 0;
71  if (overFlow
75  return L1GctInternHtMiss(miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata);
76 }
int16_t hty() const
Get Ht y-component.
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
int16_t htx() const
Get Ht x-component value.
L1GctInternHtMiss L1GctInternHtMiss::emulatorMissHty ( const int  hty,
const bool  overFlow,
const int16_t  bx 
)
static

Named ctor for making missing Ht y component object from emulator.

Definition at line 93 of file L1GctInternHtMiss.cc.

References kSingleComponentHtMask, kSingleComponentOflowMask, L1GctInternHtMiss(), and miss_hty.

Referenced by L1GctWheelJetFpga::getInternalHtMiss().

96 {
97  int32_t ydata = (hty & kSingleComponentHtMask);
98  int32_t odata = 0;
99  if (overFlow
102  return L1GctInternHtMiss(miss_hty, 0, 0, bx, ydata | odata);
103 }
int16_t hty() const
Get Ht y-component.
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
int16_t L1GctInternHtMiss::htx ( ) const

Get Ht x-component value.

Definition at line 107 of file L1GctInternHtMiss.cc.

References convert14BitTwosCompTo16Bit(), kDoubleComponentHtMask, kSingleComponentHtMask, miss_htx, miss_htx_and_hty, raw(), and type().

Referenced by operator<<().

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 }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
uint32_t raw() const
Get the 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 L1GctInternHtMiss::hty ( ) const

Get Ht y-component.

Definition at line 121 of file L1GctInternHtMiss.cc.

References convert14BitTwosCompTo16Bit(), kDoubleComponentHtMask, kDoubleComponentHtyShift, kSingleComponentHtMask, miss_htx_and_hty, miss_hty, raw(), and type().

Referenced by operator<<().

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 }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
uint32_t raw() const
Get the 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) ...
bool L1GctInternHtMiss::isThereHtx ( ) const
inline

Is there a valid Ht x-component stored?

Definition at line 104 of file L1GctInternHtMiss.h.

References jf_miss_htx_and_hty, miss_htx, miss_htx_and_hty, and type().

Referenced by operator<<().

104 { return (type() == miss_htx || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty); }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
bool L1GctInternHtMiss::isThereHty ( ) const
inline

Is there a valid Ht y-component stored?

Definition at line 107 of file L1GctInternHtMiss.h.

References jf_miss_htx_and_hty, miss_htx_and_hty, miss_hty, and type().

Referenced by operator<<().

107 { return (type() == miss_hty || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty); }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
bool L1GctInternHtMiss::operator!= ( const L1GctInternHtMiss rhs) const
inline

Inequality operator.

Definition at line 131 of file L1GctInternHtMiss.h.

131 { return !(*this == rhs); }
bool L1GctInternHtMiss::operator== ( const L1GctInternHtMiss rhs) const
inline

Equality operator.

Definition at line 128 of file L1GctInternHtMiss.h.

References raw(), and type().

128 { return (type() == rhs.type() && raw() == rhs.raw()); }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
uint32_t raw() const
Get the raw data.
bool L1GctInternHtMiss::overflow ( ) const

Get overflow.

Definition at line 135 of file L1GctInternHtMiss.cc.

References kDoubleComponentOflowMask, kSingleComponentOflowMask, miss_htx, miss_htx_and_hty, miss_hty, raw(), and type().

Referenced by operator<<().

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 }
L1GctInternHtMiss::L1GctInternHtMissType type() const
&#39;type&#39; of object?
uint32_t raw() const
Get the raw data.
uint32_t L1GctInternHtMiss::raw ( ) const
inline

Get the raw data.

Definition at line 113 of file L1GctInternHtMiss.h.

References data_.

Referenced by htx(), hty(), operator==(), and overflow().

113 { return data_; }
uint32_t data_
The captured raw data.
L1GctInternHtMiss::L1GctInternHtMissType L1GctInternHtMiss::type ( ) const
inline
L1GctInternHtMiss L1GctInternHtMiss::unpackerMissHtx ( const uint16_t  capBlock,
const uint16_t  capIndex,
const int16_t  bx,
const uint32_t  data 
)
static

Named ctor for making missing Ht x-component object from unpacker raw data.

Definition at line 20 of file L1GctInternHtMiss.cc.

References kSingleComponentRawMask, L1GctInternHtMiss(), and miss_htx.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPostWheel().

24 {
26 }
uint16_t capIndex() const
Get index within capture block.
uint16_t capBlock() const
Get capture block.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
L1GctInternHtMiss L1GctInternHtMiss::unpackerMissHtxHty ( const uint16_t  capBlock,
const uint16_t  capIndex,
const int16_t  bx,
const uint32_t  data 
)
static

Named ctor for making missing Ht x & y components object from unpacker raw data (wheel input).

Definition at line 38 of file L1GctInternHtMiss.cc.

References kDoubleComponentRawMask, L1GctInternHtMiss(), and miss_htx_and_hty.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPreWheel().

42 {
44 }
uint16_t capIndex() const
Get index within capture block.
uint16_t capBlock() const
Get capture block.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)
L1GctInternHtMiss L1GctInternHtMiss::unpackerMissHty ( const uint16_t  capBlock,
const uint16_t  capIndex,
const int16_t  bx,
const uint32_t  data 
)
static

Named ctor for making missing Ht y-component object from unpacker raw data.

Definition at line 29 of file L1GctInternHtMiss.cc.

References kSingleComponentRawMask, L1GctInternHtMiss(), and miss_hty.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPostWheel().

33 {
35 }
uint16_t capIndex() const
Get index within capture block.
uint16_t capBlock() const
Get capture block.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int16_t bx() const
Get BX number.
L1GctInternHtMiss()
default constructor (for vector initialisation etc.)

Member Data Documentation

int16_t L1GctInternHtMiss::bx_
private

Definition at line 169 of file L1GctInternHtMiss.h.

Referenced by bx().

uint16_t L1GctInternHtMiss::capBlock_
private

Definition at line 167 of file L1GctInternHtMiss.h.

Referenced by capBlock().

uint16_t L1GctInternHtMiss::capIndex_
private

Definition at line 168 of file L1GctInternHtMiss.h.

Referenced by capIndex().

uint32_t L1GctInternHtMiss::data_
private

The captured raw data.

Definition at line 172 of file L1GctInternHtMiss.h.

Referenced by raw().

L1GctInternHtMissType L1GctInternHtMiss::type_
private