CMS 3D CMS Logo

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, 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 16 of file L1GctInternHtMiss.h.

Member Enumeration Documentation

◆ L1GctInternHtMissType

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 19 of file L1GctInternHtMiss.h.

◆ numberOfBits

Enumerator
kJetMissHtNBits 
kMissHxAndHyNBits 
kMissHxOrHyNBits 

Definition at line 21 of file L1GctInternHtMiss.h.

21  {
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.
25  kJetMissHtNBits = 12,
26  kMissHxAndHyNBits = 14,
27  kMissHxOrHyNBits = 16
28  };

◆ ShiftsAndMasks

Useful bit masks and bit shifts.

Enumerator
kDoubleComponentHtyShift 
kSingleComponentOflowMask 
kDoubleComponentOflowMask 
kSingleComponentHtMask 
kDoubleComponentHtMask 
kJetFinderComponentHtMask 
kSingleComponentRawMask 
kDoubleComponentRawMask 

Definition at line 116 of file L1GctInternHtMiss.h.

116  {
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  };

Constructor & Destructor Documentation

◆ L1GctInternHtMiss() [1/2]

L1GctInternHtMiss::L1GctInternHtMiss ( )

default constructor (for vector initialisation etc.)

Definition at line 6 of file L1GctInternHtMiss.cc.

6 : type_(nulltype), capBlock_(0), capIndex_(0), bx_(0), data_(0) {}

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

◆ ~L1GctInternHtMiss()

L1GctInternHtMiss::~L1GctInternHtMiss ( )

destructor

Definition at line 9 of file L1GctInternHtMiss.cc.

9 {}

◆ L1GctInternHtMiss() [2/2]

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 116 of file L1GctInternHtMiss.cc.

Member Function Documentation

◆ bx()

int16_t L1GctInternHtMiss::bx ( ) const
inline

◆ capBlock()

uint16_t L1GctInternHtMiss::capBlock ( ) const
inline

Get capture block.

Definition at line 74 of file L1GctInternHtMiss.h.

74 { return capBlock_; }

References capBlock_.

Referenced by operator<<(), unpackerMissHtx(), unpackerMissHtxHty(), and unpackerMissHty().

◆ capIndex()

uint16_t L1GctInternHtMiss::capIndex ( ) const
inline

Get index within capture block.

Definition at line 77 of file L1GctInternHtMiss.h.

77 { return capIndex_; }

References capIndex_.

Referenced by operator<<(), unpackerMissHtx(), unpackerMissHtxHty(), and unpackerMissHty().

◆ convert14BitTwosCompTo16Bit()

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 123 of file L1GctInternHtMiss.cc.

123  {
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 }

References data.

Referenced by htx(), and hty().

◆ emulatorJetMissHt()

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 36 of file L1GctInternHtMiss.cc.

39  {
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 }

References bx(), htx(), hty(), jf_miss_htx_and_hty, kDoubleComponentHtyShift, kDoubleComponentOflowMask, kJetFinderComponentHtMask, and L1GctInternHtMiss().

Referenced by L1GctJetFinderBase::getInternalHtMiss().

◆ emulatorMissHtx()

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 64 of file L1GctInternHtMiss.cc.

64  {
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 }

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

Referenced by L1GctWheelJetFpga::getInternalHtMiss().

◆ emulatorMissHtxHty()

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 50 of file L1GctInternHtMiss.cc.

53  {
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 }

References bx(), htx(), hty(), kDoubleComponentHtMask, kDoubleComponentHtyShift, kDoubleComponentOflowMask, L1GctInternHtMiss(), and miss_htx_and_hty.

Referenced by L1GctJetLeafCard::getInternalHtMiss().

◆ emulatorMissHty()

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 73 of file L1GctInternHtMiss.cc.

73  {
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 }

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

Referenced by L1GctWheelJetFpga::getInternalHtMiss().

◆ htx()

int16_t L1GctInternHtMiss::htx ( ) const

Get Ht x-component value.

Definition at line 82 of file L1GctInternHtMiss.cc.

82  {
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 }

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

Referenced by emulatorJetMissHt(), emulatorMissHtx(), emulatorMissHtxHty(), and operator<<().

◆ hty()

int16_t L1GctInternHtMiss::hty ( ) const

Get Ht y-component.

Definition at line 93 of file L1GctInternHtMiss.cc.

93  {
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 }

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

Referenced by emulatorJetMissHt(), emulatorMissHtxHty(), emulatorMissHty(), and operator<<().

◆ isThereHtx()

bool L1GctInternHtMiss::isThereHtx ( ) const
inline

Is there a valid Ht x-component stored?

Definition at line 83 of file L1GctInternHtMiss.h.

83  {
84  return (type() == miss_htx || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty);
85  }

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

Referenced by operator<<().

◆ isThereHty()

bool L1GctInternHtMiss::isThereHty ( ) const
inline

Is there a valid Ht y-component stored?

Definition at line 88 of file L1GctInternHtMiss.h.

88  {
89  return (type() == miss_hty || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty);
90  }

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

Referenced by operator<<().

◆ operator!=()

bool L1GctInternHtMiss::operator!= ( const L1GctInternHtMiss rhs) const
inline

Inequality operator.

Definition at line 112 of file L1GctInternHtMiss.h.

112 { return !(*this == rhs); }

◆ operator==()

bool L1GctInternHtMiss::operator== ( const L1GctInternHtMiss rhs) const
inline

Equality operator.

Definition at line 109 of file L1GctInternHtMiss.h.

109 { return (type() == rhs.type() && raw() == rhs.raw()); }

References raw(), and type().

◆ overflow()

bool L1GctInternHtMiss::overflow ( ) const

Get overflow.

Definition at line 104 of file L1GctInternHtMiss.cc.

104  {
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 }

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

Referenced by operator<<().

◆ raw()

uint32_t L1GctInternHtMiss::raw ( ) const
inline

Get the raw data.

Definition at line 95 of file L1GctInternHtMiss.h.

95 { return data_; }

References data_.

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

◆ type()

L1GctInternHtMiss::L1GctInternHtMissType L1GctInternHtMiss::type ( ) const
inline

'type' of object?

Definition at line 71 of file L1GctInternHtMiss.h.

71 { return type_; }

References type_.

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

◆ unpackerMissHtx()

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 12 of file L1GctInternHtMiss.cc.

References bx(), capBlock(), capIndex(), data, kSingleComponentRawMask, L1GctInternHtMiss(), and miss_htx.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPostWheel().

◆ unpackerMissHtxHty()

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 28 of file L1GctInternHtMiss.cc.

References bx(), capBlock(), capIndex(), data, kDoubleComponentRawMask, L1GctInternHtMiss(), and miss_htx_and_hty.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPreWheel().

◆ unpackerMissHty()

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 20 of file L1GctInternHtMiss.cc.

References bx(), capBlock(), capIndex(), data, kSingleComponentRawMask, L1GctInternHtMiss(), and miss_hty.

Referenced by GctFormatTranslateV38::blockToGctInternHtMissPostWheel().

Member Data Documentation

◆ bx_

int16_t L1GctInternHtMiss::bx_
private

Definition at line 150 of file L1GctInternHtMiss.h.

Referenced by bx().

◆ capBlock_

uint16_t L1GctInternHtMiss::capBlock_
private

Definition at line 148 of file L1GctInternHtMiss.h.

Referenced by capBlock().

◆ capIndex_

uint16_t L1GctInternHtMiss::capIndex_
private

Definition at line 149 of file L1GctInternHtMiss.h.

Referenced by capIndex().

◆ data_

uint32_t L1GctInternHtMiss::data_
private

The captured raw data.

Definition at line 153 of file L1GctInternHtMiss.h.

Referenced by raw().

◆ type_

L1GctInternHtMissType L1GctInternHtMiss::type_
private
L1GctInternHtMiss::kJetMissHtNBits
Definition: L1GctInternHtMiss.h:25
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::capIndex_
uint16_t capIndex_
Definition: L1GctInternHtMiss.h:149
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::data_
uint32_t data_
The captured raw data.
Definition: L1GctInternHtMiss.h:153
L1GctInternHtMiss::jf_miss_htx_and_hty
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::type_
L1GctInternHtMissType type_
'Type' of the data
Definition: L1GctInternHtMiss.h:145
L1GctInternHtMiss::type
L1GctInternHtMiss::L1GctInternHtMissType type() const
'type' of object?
Definition: L1GctInternHtMiss.h:71
L1GctInternHtMiss::kSingleComponentRawMask
Definition: L1GctInternHtMiss.h:123
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::kDoubleComponentOflowMask
Definition: L1GctInternHtMiss.h:119
L1GctInternHtMiss::bx
int16_t bx() const
Get BX number.
Definition: L1GctInternHtMiss.h:80
L1GctInternHtMiss::bx_
int16_t bx_
Definition: L1GctInternHtMiss.h:150
L1GctInternHtMiss::kMissHxAndHyNBits
Definition: L1GctInternHtMiss.h:26
L1GctInternHtMiss::htx
int16_t htx() const
Get Ht x-component value.
Definition: L1GctInternHtMiss.cc:82
type
type
Definition: HCALResponse.h:21
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::nulltype
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::capBlock_
uint16_t capBlock_
Definition: L1GctInternHtMiss.h:148
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
L1GctInternHtMiss::kMissHxOrHyNBits
Definition: L1GctInternHtMiss.h:27
L1GctInternHtMiss::miss_htx_and_hty
Definition: L1GctInternHtMiss.h:19
L1GctInternHtMiss::kDoubleComponentRawMask
Definition: L1GctInternHtMiss.h:125