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 27 of file L1GctUnsignedInt.h.
L1GctUnsignedInt< nBits >::L1GctUnsignedInt | ( | ) |
Construct an unsigned integer with initial value zero.
Definition at line 84 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::m_nBits, L1GctUnsignedInt< nBits >::MAX_NBITS, and L1GctUnsignedInt< nBits >::reset().
L1GctUnsignedInt< nBits >::L1GctUnsignedInt | ( | unsigned | value | ) |
Construct an unsigned integer and check for overFlow.
Definition at line 90 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::m_nBits, L1GctUnsignedInt< nBits >::m_overFlow, L1GctUnsignedInt< nBits >::MAX_NBITS, and L1GctUnsignedInt< nBits >::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 103 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::m_nBits, L1GctUnsignedInt< nBits >::MAX_NBITS, L1GctUnsignedInt< nBits >::overFlow(), L1GctUnsignedInt< nBits >::setOverFlow(), L1GctUnsignedInt< nBits >::setValue(), and L1GctUnsignedInt< nBits >::value().
L1GctUnsignedInt< nBits > L1GctUnsignedInt< nBits >::operator+ | ( | const L1GctUnsignedInt< nBits > & | rhs | ) | const |
add two numbers
Definition at line 123 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::overFlow(), L1GctUnsignedInt< nBits >::setOverFlow(), L1GctUnsignedInt< nBits >::setValue(), groupFilesInBlocks::temp, and L1GctUnsignedInt< nBits >::value().
Referenced by L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::size().
L1GctUnsignedInt< nBits > & L1GctUnsignedInt< nBits >::operator= | ( | int | value | ) |
overload = operator
Definition at line 144 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::setValue().
Referenced by L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::size().
|
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 41 of file L1GctUnsignedInt.h.
Referenced by L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), 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(), L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), 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 111 of file L1GctUnsignedInt.h.
References L1GctUnsignedInt< nBits >::m_nBits, L1GctUnsignedInt< nBits >::m_overFlow, and L1GctUnsignedInt< nBits >::m_value.
Referenced by L1GctJetFinderBase::doEtSums(), L1GctJetFinderBase::doHtSums(), L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), L1GctMet::metVector(), L1GctUnsignedInt< nBits >::operator+(), L1GctUnsignedInt< nBits >::operator=(), L1GctWheelEnergyFpga::process(), L1GctGlobalEnergyAlgos::process(), L1GctJetLeafCard::process(), L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::reset(), L1GctGlobalEnergyAlgos::setInputWheelEt(), and L1GctGlobalEnergyAlgos::setInputWheelHt().
|
inline |
return number of bits
Definition at line 59 of file L1GctUnsignedInt.h.
Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._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(), L1GctGlobalEnergyAlgos::process(), and L1GctJetCount< nBits >::setValue().
|
protected |
Definition at line 69 of file L1GctUnsignedInt.h.
Referenced by L1GctJetCount< nBits >::L1GctJetCount(), L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), L1GctJetCount< nBits >::setOverFlow(), L1GctJetCount< nBits >::setValue(), L1GctUnsignedInt< nBits >::setValue(), and L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::size().
|
protected |
Definition at line 75 of file L1GctUnsignedInt.h.
Referenced by L1GctUnsignedInt< nBits >::L1GctUnsignedInt(), L1GctJetCount< nBits >::operator++(), L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::overFlow(), L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::reset(), L1GctJetCount< nBits >::setOverFlow(), L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::setOverFlow(), L1GctJetCount< nBits >::setValue(), and L1GctUnsignedInt< nBits >::setValue().
|
protected |
Definition at line 72 of file L1GctUnsignedInt.h.
Referenced by L1GctJetCount< nBits >::operator++(), L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::reset(), L1GctJetCount< nBits >::setOverFlow(), L1GctJetCount< nBits >::setValue(), L1GctUnsignedInt< nBits >::setValue(), and L1GctUnsignedInt< L1GctInternEtSum::kTotEtOrHtNBits >::value().
|
staticprotected |
Definition at line 77 of file L1GctUnsignedInt.h.
Referenced by L1GctJetCount< nBits >::L1GctJetCount(), and L1GctUnsignedInt< nBits >::L1GctUnsignedInt().