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. | |
uint16_t | capBlock () const |
Get capture block. | |
uint16_t | capIndex () const |
Get index within capture block. | |
int16_t | htx () const |
Get Ht x-component value. | |
int16_t | hty () const |
Get Ht y-component. | |
bool | isThereHtx () const |
Is there a valid Ht x-component stored? | |
bool | isThereHty () const |
Is there a valid Ht y-component stored? | |
L1GctInternHtMiss () | |
default constructor (for vector initialisation etc.) | |
bool | operator!= (const L1GctInternHtMiss &rhs) const |
Inequality operator. | |
bool | operator== (const L1GctInternHtMiss &rhs) const |
Equality operator. | |
bool | overflow () const |
Get overflow. | |
uint32_t | raw () const |
Get the raw data. | |
L1GctInternHtMiss::L1GctInternHtMissType | type () const |
'type' of object? | |
~L1GctInternHtMiss () | |
destructor | |
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). | |
static L1GctInternHtMiss | emulatorMissHtx (const int htx, const bool overFlow, const int16_t bx) |
Named ctor for making missing Ht x component object from emulator. | |
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). | |
static L1GctInternHtMiss | emulatorMissHty (const int hty, const bool overFlow, const int16_t bx) |
Named ctor for making missing Ht y component object from emulator. | |
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. | |
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). | |
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. | |
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) | |
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. | |
Private Attributes | |
int16_t | bx_ |
uint16_t | capBlock_ |
uint16_t | capIndex_ |
uint32_t | data_ |
The captured raw data. | |
L1GctInternHtMissType | type_ |
'Type' of the data |
L1 GCT internal Ht Miss component(s) Ht_x and/or Ht_y.
Definition at line 17 of file L1GctInternHtMiss.h.
Enum for the variants of Internal HtMiss.
Definition at line 23 of file L1GctInternHtMiss.h.
Definition at line 29 of file L1GctInternHtMiss.h.
{ // TODO - tidy up all these enums. // These numbers of bits are needed to specify data sizes in the emulator // Other masks are below in the private section. kJetMissHtNBits = 12, kMissHxAndHyNBits = 14, kMissHxOrHyNBits = 16 };
enum L1GctInternHtMiss::ShiftsAndMasks [private] |
Useful bit masks and bit shifts.
kDoubleComponentHtyShift | |
kSingleComponentOflowMask | |
kDoubleComponentOflowMask | |
kSingleComponentHtMask | |
kDoubleComponentHtMask | |
kJetFinderComponentHtMask | |
kSingleComponentRawMask | |
kDoubleComponentRawMask |
Definition at line 137 of file L1GctInternHtMiss.h.
{ kDoubleComponentHtyShift = 16, // Bit shift for Hty in miss_htx_and_hty kSingleComponentOflowMask = (1 << 30), // Overflow bit mask in miss_htx or miss_hty kDoubleComponentOflowMask = (1 << 15), // Overflow bit mask in miss_htx_and_hty kSingleComponentHtMask = 0xffff, // Ht component mask in miss_htx or miss_hty kDoubleComponentHtMask = 0x3fff, // Ht component mask in miss_htx_and_hty kJetFinderComponentHtMask = 0x0fff, // Ht component mask in jf_miss_htx_and_hty kSingleComponentRawMask = kSingleComponentOflowMask | kSingleComponentHtMask, // To mask off all the non-data bits in raw data (e.g. BC0, etc) kDoubleComponentRawMask = (kDoubleComponentHtMask << kDoubleComponentHtyShift) | kDoubleComponentOflowMask | kDoubleComponentHtMask };
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().
L1GctInternHtMiss::~L1GctInternHtMiss | ( | ) |
L1GctInternHtMiss::L1GctInternHtMiss | ( | const L1GctInternHtMissType | type, |
const uint16_t | capBlock, | ||
const uint16_t | capIndex, | ||
const int16_t | bx, | ||
const uint32_t | data | ||
) | [private] |
int16_t L1GctInternHtMiss::bx | ( | ) | const [inline] |
Get BX number.
Definition at line 101 of file L1GctInternHtMiss.h.
References bx_.
Referenced by operator<<().
{ return bx_; }
uint16_t L1GctInternHtMiss::capBlock | ( | ) | const [inline] |
Get capture block.
Definition at line 95 of file L1GctInternHtMiss.h.
References capBlock_.
Referenced by operator<<().
{ 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<<().
{ 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.
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().
{ int32_t xdata = (htx & kJetFinderComponentHtMask); int32_t ydata = (hty & kJetFinderComponentHtMask) << kDoubleComponentHtyShift; int32_t odata = 0; if (overFlow || (htx >= kJetFinderComponentHtMask/2) || (htx < -kJetFinderComponentHtMask/2) || (hty >= kJetFinderComponentHtMask/2) || (hty < -kJetFinderComponentHtMask/2) ) odata = kDoubleComponentOflowMask; return L1GctInternHtMiss(jf_miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata); }
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().
{ int32_t xdata = (htx & kSingleComponentHtMask); int32_t odata = 0; if (overFlow || (htx >= kSingleComponentHtMask/2) || (htx < -kSingleComponentHtMask/2) ) odata = kSingleComponentOflowMask; return L1GctInternHtMiss(miss_htx, 0, 0, bx, xdata | odata); }
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().
{ int32_t xdata = (htx & kDoubleComponentHtMask); int32_t ydata = (hty & kDoubleComponentHtMask) << kDoubleComponentHtyShift; int32_t odata = 0; if (overFlow || (htx >= kDoubleComponentHtMask/2) || (htx < -kDoubleComponentHtMask/2) || (hty >= kDoubleComponentHtMask/2) || (hty < -kDoubleComponentHtMask/2) ) odata = kDoubleComponentOflowMask; return L1GctInternHtMiss(miss_htx_and_hty, 0, 0, bx, xdata | ydata | odata); }
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().
{ int32_t ydata = (hty & kSingleComponentHtMask); int32_t odata = 0; if (overFlow || (hty >= kSingleComponentHtMask/2) || (hty < -kSingleComponentHtMask/2) ) odata = kSingleComponentOflowMask; return L1GctInternHtMiss(miss_hty, 0, 0, bx, ydata | odata); }
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<<().
{ if(type() == miss_htx) { return static_cast<int16_t>(raw() & kSingleComponentHtMask); } if(type() == miss_htx_and_hty) { return convert14BitTwosCompTo16Bit(raw() & kDoubleComponentHtMask); } return 0; }
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<<().
{ if(type() == miss_hty) { return static_cast<int16_t>(raw() & kSingleComponentHtMask); } if(type() == miss_htx_and_hty) { return convert14BitTwosCompTo16Bit((raw() >> kDoubleComponentHtyShift) & kDoubleComponentHtMask); } return 0; }
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<<().
{ return (type() == miss_htx || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty); }
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<<().
{ return (type() == miss_hty || type() == miss_htx_and_hty || type() == jf_miss_htx_and_hty); }
bool L1GctInternHtMiss::operator!= | ( | const L1GctInternHtMiss & | rhs | ) | const [inline] |
Inequality operator.
Definition at line 131 of file L1GctInternHtMiss.h.
{ return !(*this == rhs); }
bool L1GctInternHtMiss::operator== | ( | const L1GctInternHtMiss & | rhs | ) | const [inline] |
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<<().
{ if(type() == miss_htx || type() == miss_hty) { return (raw() & kSingleComponentOflowMask) != 0; } if(type() == miss_htx_and_hty) { return (raw() & kDoubleComponentOflowMask) != 0; } return false; }
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().
{ return data_; }
L1GctInternHtMiss::L1GctInternHtMissType L1GctInternHtMiss::type | ( | ) | const [inline] |
'type' of object?
Definition at line 92 of file L1GctInternHtMiss.h.
References type_.
Referenced by htx(), hty(), isThereHtx(), isThereHty(), operator==(), and overflow().
{ return type_; }
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().
{ return L1GctInternHtMiss(miss_htx, capBlock, capIndex, bx, data & kSingleComponentRawMask); }
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().
{ return L1GctInternHtMiss(miss_htx_and_hty, capBlock, capIndex, bx, data & kDoubleComponentRawMask); }
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().
{ return L1GctInternHtMiss(miss_hty, capBlock, capIndex, bx, data & kSingleComponentRawMask); }
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] |