Definition of unsigned integer types with overflow. More...
#include <L1GctUnsignedInt.h>
Public Member Functions | |
L1GctUnsignedInt () | |
Construct an unsigned integer with initial value zero. More... | |
L1GctUnsignedInt (unsigned value) | |
Construct an unsigned integer and check for overFlow. More... | |
template<int mBits> | |
L1GctUnsignedInt (const L1GctUnsignedInt< mBits > &rhs) | |
Copy contructor to move data between representations with different numbers of bits. More... | |
L1GctUnsignedInt | operator+ (const L1GctUnsignedInt &rhs) const |
add two numbers More... | |
L1GctUnsignedInt & | operator= (int value) |
overload = operator More... | |
bool | overFlow () const |
access overflow More... | |
void | reset () |
reset value and overflow to zero More... | |
void | setOverFlow (bool oflow) |
set the overflow bit More... | |
void | setValue (unsigned value) |
Set value from unsigned. More... | |
int | size () const |
return number of bits More... | |
unsigned | value () const |
access value as unsigned More... | |
~L1GctUnsignedInt () | |
Destructor. More... | |
Protected Attributes | |
int | m_nBits |
bool | m_overFlow |
unsigned | m_value |
Static Protected Attributes | |
static const int | MAX_NBITS = 24 |
Definition of unsigned integer types with overflow.
This file defines the template class L1GctUnsignedInt. It is used to store energy values that are represented in a given number of bits in hardware. The type has a built-in overFlow that is set if the value to be represented is outside the allowed range for that number of bits. This type represents unsigned integers; signed integers are represented by L1GctTwosComplement. Functions are defined to add two values, and to copy data into a different number of bits.
this header file contains method definitions because these are template classes see http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12
Definition at line 29 of file L1GctUnsignedInt.h.
L1GctUnsignedInt< nBits >::L1GctUnsignedInt | ( | ) |
Construct an unsigned integer with initial value zero.
Definition at line 86 of file L1GctUnsignedInt.h.
References reset().
L1GctUnsignedInt< nBits >::L1GctUnsignedInt | ( | unsigned | value | ) |
Construct an unsigned integer and check for overFlow.
Definition at line 93 of file L1GctUnsignedInt.h.
References reco::JetExtendedAssociation::setValue().
L1GctUnsignedInt< nBits >::~L1GctUnsignedInt | ( | ) |
L1GctUnsignedInt< nBits >::L1GctUnsignedInt | ( | const L1GctUnsignedInt< mBits > & | rhs | ) |
Copy contructor to move data between representations with different numbers of bits.
Definition at line 110 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::overFlow(), reco::JetExtendedAssociation::setValue(), and L1GctUnsignedInt< nBits >::value().
L1GctUnsignedInt< nBits > L1GctUnsignedInt< nBits >::operator+ | ( | const L1GctUnsignedInt< nBits > & | rhs | ) | const |
add two numbers
Definition at line 133 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::overFlow(), L1GctUnsignedInt< nBits >::setOverFlow(), L1GctUnsignedInt< nBits >::setValue(), groupFilesInBlocks::temp, L1GctUnsignedInt< nBits >::value(), and relativeConstraints::value.
L1GctUnsignedInt< nBits > & L1GctUnsignedInt< nBits >::operator= | ( | int | value | ) |
overload = operator
Definition at line 156 of file L1GctUnsignedInt.h.
References reco::JetExtendedAssociation::setValue().
|
inline |
access overflow
Definition at line 56 of file L1GctUnsignedInt.h.
Referenced by L1GctJetFinderBase::doEtSums(), L1GctJetFinderBase::doHtSums(), L1GctJetFinderBase::etComponentForJetFinder(), L1GctJetCount< nBits >::L1GctJetCount(), L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), L1GctMet::metVector(), L1GctJetCount< nBits >::operator+(), L1GctUnsignedInt< nBits >::operator+(), L1GctWheelEnergyFpga::process(), L1GctGlobalEnergyAlgos::process(), and L1GctJetLeafCard::process().
|
inline |
reset value and overflow to zero
Definition at line 44 of file L1GctUnsignedInt.h.
Referenced by L1GctJetFinderBase::hfTowerSumsType::reset(), L1GctWheelEnergyFpga::resetProcessor(), L1GctJetLeafCard::resetProcessor(), and L1GctGlobalEnergyAlgos::resetProcessor().
|
inline |
set the overflow bit
Definition at line 50 of file L1GctUnsignedInt.h.
Referenced by L1GctJetFinderBase::doEtSums(), L1GctJetFinderBase::doHtSums(), L1GctMet::metVector(), L1GctUnsignedInt< nBits >::operator+(), L1GctGlobalEnergyAlgos::process(), L1GctGlobalEnergyAlgos::setInputWheelEt(), and L1GctGlobalEnergyAlgos::setInputWheelHt().
void L1GctUnsignedInt< nBits >::setValue | ( | unsigned | value | ) |
Set value from unsigned.
Definition at line 118 of file L1GctUnsignedInt.h.
Referenced by L1GctJetFinderBase::doEtSums(), L1GctJetFinderBase::doHtSums(), L1GctMet::metVector(), L1GctUnsignedInt< nBits >::operator+(), L1GctWheelEnergyFpga::process(), L1GctGlobalEnergyAlgos::process(), L1GctJetLeafCard::process(), L1GctGlobalEnergyAlgos::setInputWheelEt(), and L1GctGlobalEnergyAlgos::setInputWheelHt().
|
inline |
return number of bits
Definition at line 59 of file L1GctUnsignedInt.h.
Referenced by ntuple._Collection::__iter__(), and ntuple._Collection::__len__().
|
inline |
access value as unsigned
Definition at line 53 of file L1GctUnsignedInt.h.
Referenced by average.Average::average(), L1GctJetFinderBase::etComponentForJetFinder(), L1GctJetCount< nBits >::L1GctJetCount(), L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), L1GctJetCount< nBits >::operator+(), L1GctUnsignedInt< nBits >::operator+(), L1GctGlobalHfSumAlgos::process(), and L1GctGlobalEnergyAlgos::process().
|
protected |
Definition at line 70 of file L1GctUnsignedInt.h.
Referenced by L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::size().
|
protected |
|
protected |
Definition at line 73 of file L1GctUnsignedInt.h.
Referenced by L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::reset(), and L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::value().
|
staticprotected |
Definition at line 78 of file L1GctUnsignedInt.h.