Emulates the energy summing on a GCT Wheel card. More...
#include <L1GctWheelEnergyFpga.h>
Public Types | |
typedef L1GctTwosComplement < L1GctInternEtSum::kMissExOrEyNBits > | etComponentType |
typedef L1GctUnsignedInt < L1GctInternEtSum::kTotEtOrHtNBits > | etHadType |
typedef L1GctUnsignedInt < L1GctInternEtSum::kTotEtOrHtNBits > | etTotalType |
typedefs for energy values in fixed numbers of bits | |
enum | maxValues { etTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue, htTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue } |
Public Member Functions | |
virtual void | fetchInput () |
get input data from sources; this is the standard way to provide input | |
etTotalType | getInputEt (unsigned leafnum) const |
get input Et value from a Leaf card (0-2) | |
etComponentType | getInputEx (unsigned leafnum) const |
get input Ex value from a Leaf card (0-2) | |
etComponentType | getInputEy (unsigned leafnum) const |
get input Ey value from a Leaf card (0-2) | |
L1GctJetLeafCard * | getinputLeafCard (unsigned leafnum) const |
provide access to input Leaf card pointer (0-2) | |
std::vector< L1GctInternEtSum > | getInternalEtSums () const |
get the Et sums in internal component format | |
etTotalType | getOutputEt () const |
get output Et value | |
etComponentType | getOutputEx () const |
get output Ex value | |
etComponentType | getOutputEy () const |
get output Ey value | |
etHadType | getOutputHt () const |
get the output Ht | |
etHadType | inputHt (unsigned leafnum) const |
get input Ht value from a Leaf card (0-2) | |
L1GctWheelEnergyFpga (int id, std::vector< L1GctJetLeafCard * > leafCards) | |
Constructor, needs the Leaf cards to be set up first. id should be 0 or 1. | |
virtual void | process () |
process the data, fill output buffers | |
void | setInputEnergy (unsigned i, int ex, int ey, unsigned et, unsigned ht) |
set input data; not used in normal operation | |
bool | setupOk () const |
check the setup | |
~L1GctWheelEnergyFpga () | |
Destructor. | |
Static Public Attributes | |
static const unsigned int | MAX_LEAF_CARDS = L1GctWheelJetFpga::MAX_LEAF_CARDS |
Max number of leaf card pointers. | |
Protected Member Functions | |
virtual void | resetPipelines () |
virtual void | resetProcessor () |
Separate reset methods for the processor itself and any data stored in pipelines. | |
virtual void | setupObjects () |
Initialise inputs with null objects for the correct bunch crossing if required. | |
Private Attributes | |
int | m_id |
std::vector< etTotalType > | m_inputEt |
std::vector< etComponentType > | m_inputEx |
std::vector< etComponentType > | m_inputEy |
std::vector< etHadType > | m_inputHt |
std::vector< L1GctJetLeafCard * > | m_inputLeafCards |
etTotalType | m_outputEt |
Pipeline< etTotalType > | m_outputEtPipe |
etComponentType | m_outputEx |
Pipeline< etComponentType > | m_outputExPipe |
record the output data history | |
etComponentType | m_outputEy |
Pipeline< etComponentType > | m_outputEyPipe |
etHadType | m_outputHt |
Pipeline< etHadType > | m_outputHtPipe |
bool | m_setupOk |
check the setup | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const L1GctWheelEnergyFpga &fpga) |
Overload << operator. |
Emulates the energy summing on a GCT Wheel card.
This class carries out the summing of total Et, and missing Et components Ex and Ey, for a single Wheel. The inputs come from the three Leaf cards and the outputs are sent to the L1GctGlobalEnergyAlgos class.
Definition at line 30 of file L1GctWheelEnergyFpga.h.
typedef L1GctTwosComplement< L1GctInternEtSum::kMissExOrEyNBits > L1GctWheelEnergyFpga::etComponentType |
Definition at line 36 of file L1GctWheelEnergyFpga.h.
typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> L1GctWheelEnergyFpga::etHadType |
Definition at line 35 of file L1GctWheelEnergyFpga.h.
typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> L1GctWheelEnergyFpga::etTotalType |
typedefs for energy values in fixed numbers of bits
Definition at line 34 of file L1GctWheelEnergyFpga.h.
Definition at line 38 of file L1GctWheelEnergyFpga.h.
L1GctWheelEnergyFpga::L1GctWheelEnergyFpga | ( | int | id, |
std::vector< L1GctJetLeafCard * > | leafCards | ||
) |
Constructor, needs the Leaf cards to be set up first. id should be 0 or 1.
Definition at line 15 of file L1GctWheelEnergyFpga.cc.
References i, m_id, m_inputLeafCards, m_setupOk, L1GctProcessor::m_verbose, and MAX_LEAF_CARDS.
: L1GctProcessor(), m_id(id), m_inputLeafCards(leafCards), m_inputEx(MAX_LEAF_CARDS), m_inputEy(MAX_LEAF_CARDS), m_inputEt(MAX_LEAF_CARDS), m_inputHt(MAX_LEAF_CARDS), m_outputEx(0), m_outputEy(0), m_outputEt(0), m_outputHt(0), m_setupOk(true), m_outputExPipe(), m_outputEyPipe(), m_outputEtPipe(), m_outputHtPipe() { //Check wheelEnergyFpga setup if(m_id != 0 && m_id != 1) { m_setupOk = false; if (m_verbose) { edm::LogWarning("L1GctSetupError") << "L1GctWheelEnergyFpga::L1GctWheelEnergyFpga() : Wheel Energy Fpga ID " << m_id << " has been incorrectly constructed!\n" << "ID number should be 0 or 1.\n"; } } if(m_inputLeafCards.size() != MAX_LEAF_CARDS) { m_setupOk = false; if (m_verbose) { edm::LogWarning("L1GctSetupError") << "L1GctWheelEnergyFpga::L1GctWheelEnergyFpga() : Wheel Energy Fpga ID " << m_id << " has been incorrectly constructed!\n" << "This class needs " << MAX_LEAF_CARDS << " leaf card pointers, yet only " << m_inputLeafCards.size() << " leaf card pointers are present.\n"; } } for(unsigned int i = 0; i < m_inputLeafCards.size(); ++i) { if(m_inputLeafCards.at(i) == 0) { m_setupOk = false; if (m_verbose) { edm::LogWarning("L1GctSetupError") << "L1GctWheelEnergyFpga::L1GctWheelEnergyFpga() : Wheel Energy Fpga ID " << m_id << " has been incorrectly constructed!\n" << "Input Leaf card pointer " << i << " has not been set!\n"; } } } if (!m_setupOk && m_verbose) { edm::LogError("L1GctSetupError") << "L1GctWheelEnergyFpga has been incorrectly constructed"; } }
L1GctWheelEnergyFpga::~L1GctWheelEnergyFpga | ( | ) |
void L1GctWheelEnergyFpga::fetchInput | ( | ) | [virtual] |
get input data from sources; this is the standard way to provide input
Implements L1GctProcessor.
Definition at line 129 of file L1GctWheelEnergyFpga.cc.
References i, m_inputEt, m_inputEx, m_inputEy, m_inputHt, m_inputLeafCards, m_setupOk, and MAX_LEAF_CARDS.
{ if (m_setupOk) { // Fetch the output values from each of our input leaf cards. for (unsigned int i=0; i<MAX_LEAF_CARDS; i++) { m_inputEx.at(i) = m_inputLeafCards.at(i)->getOutputEx(); m_inputEy.at(i) = m_inputLeafCards.at(i)->getOutputEy(); m_inputEt.at(i) = m_inputLeafCards.at(i)->getOutputEt(); m_inputHt.at(i) = m_inputLeafCards.at(i)->getOutputHt(); } } }
etTotalType L1GctWheelEnergyFpga::getInputEt | ( | unsigned | leafnum | ) | const [inline] |
get input Et value from a Leaf card (0-2)
Definition at line 71 of file L1GctWheelEnergyFpga.h.
References m_inputEt.
{ return m_inputEt.at(leafnum); }
etComponentType L1GctWheelEnergyFpga::getInputEx | ( | unsigned | leafnum | ) | const [inline] |
get input Ex value from a Leaf card (0-2)
Definition at line 67 of file L1GctWheelEnergyFpga.h.
References m_inputEx.
{ return m_inputEx.at(leafnum); }
etComponentType L1GctWheelEnergyFpga::getInputEy | ( | unsigned | leafnum | ) | const [inline] |
get input Ey value from a Leaf card (0-2)
Definition at line 69 of file L1GctWheelEnergyFpga.h.
References m_inputEy.
{ return m_inputEy.at(leafnum); }
L1GctJetLeafCard* L1GctWheelEnergyFpga::getinputLeafCard | ( | unsigned | leafnum | ) | const [inline] |
provide access to input Leaf card pointer (0-2)
Definition at line 64 of file L1GctWheelEnergyFpga.h.
References m_inputLeafCards.
{ return m_inputLeafCards.at(leafnum); }
std::vector< L1GctInternEtSum > L1GctWheelEnergyFpga::getInternalEtSums | ( | ) | const |
get the Et sums in internal component format
Definition at line 175 of file L1GctWheelEnergyFpga.cc.
References L1GctProcessor::bxMin(), L1GctInternEtSum::fromEmulatorMissEtxOrEty(), L1GctInternEtSum::fromEmulatorTotalEtOrHt(), m_outputEtPipe, m_outputExPipe, m_outputEyPipe, m_outputHtPipe, L1GctProcessor::numOfBx(), and query::result.
{ std::vector< L1GctInternEtSum > result; for (int bx=0; bx<numOfBx(); bx++) { result.push_back( L1GctInternEtSum::fromEmulatorMissEtxOrEty( m_outputExPipe.contents.at(bx).value(), m_outputExPipe.contents.at(bx).overFlow(), static_cast<int16_t> (bx-bxMin()) ) ); result.push_back( L1GctInternEtSum::fromEmulatorMissEtxOrEty( m_outputEyPipe.contents.at(bx).value(), m_outputEyPipe.contents.at(bx).overFlow(), static_cast<int16_t> (bx-bxMin()) ) ); result.push_back( L1GctInternEtSum::fromEmulatorTotalEtOrHt( m_outputEtPipe.contents.at(bx).value(), m_outputEtPipe.contents.at(bx).overFlow(), static_cast<int16_t> (bx-bxMin()) ) ); result.push_back( L1GctInternEtSum::fromEmulatorTotalEtOrHt( m_outputHtPipe.contents.at(bx).value(), m_outputHtPipe.contents.at(bx).overFlow(), static_cast<int16_t> (bx-bxMin()) ) ); } return result; }
etTotalType L1GctWheelEnergyFpga::getOutputEt | ( | ) | const [inline] |
get output Et value
Definition at line 80 of file L1GctWheelEnergyFpga.h.
References m_outputEt.
Referenced by L1GctGlobalEnergyAlgos::fetchInput().
{ return m_outputEt; }
etComponentType L1GctWheelEnergyFpga::getOutputEx | ( | ) | const [inline] |
get output Ex value
Definition at line 76 of file L1GctWheelEnergyFpga.h.
References m_outputEx.
Referenced by L1GctGlobalEnergyAlgos::fetchInput().
{ return m_outputEx; }
etComponentType L1GctWheelEnergyFpga::getOutputEy | ( | ) | const [inline] |
get output Ey value
Definition at line 78 of file L1GctWheelEnergyFpga.h.
References m_outputEy.
Referenced by L1GctGlobalEnergyAlgos::fetchInput().
{ return m_outputEy; }
etHadType L1GctWheelEnergyFpga::getOutputHt | ( | ) | const [inline] |
get the output Ht
Definition at line 82 of file L1GctWheelEnergyFpga.h.
References m_outputHt.
Referenced by L1GctGlobalEnergyAlgos::fetchInput().
{ return m_outputHt; }
etHadType L1GctWheelEnergyFpga::inputHt | ( | unsigned | leafnum | ) | const [inline] |
get input Ht value from a Leaf card (0-2)
Definition at line 73 of file L1GctWheelEnergyFpga.h.
References m_inputHt.
{ return m_inputHt.at(leafnum); }
void L1GctWheelEnergyFpga::process | ( | ) | [virtual] |
process the data, fill output buffers
Implements L1GctProcessor.
Definition at line 142 of file L1GctWheelEnergyFpga.cc.
References L1GctProcessor::bxRel(), etTotalMaxValue, htTotalMaxValue, m_inputEt, m_inputEx, m_inputEy, m_inputHt, m_outputEt, m_outputEtPipe, m_outputEx, m_outputExPipe, m_outputEy, m_outputEyPipe, m_outputHt, m_outputHtPipe, m_setupOk, L1GctUnsignedInt< nBits >::overFlow(), and L1GctUnsignedInt< nBits >::setValue().
{ if (m_setupOk) { m_outputEx = m_inputEx.at(0) + m_inputEx.at(1) + m_inputEx.at(2); m_outputEy = m_inputEy.at(0) + m_inputEy.at(1) + m_inputEy.at(2); m_outputEt = m_inputEt.at(0) + m_inputEt.at(1) + m_inputEt.at(2); m_outputHt = m_inputHt.at(0) + m_inputHt.at(1) + m_inputHt.at(2); if (m_outputEt.overFlow()) m_outputEt.setValue(etTotalMaxValue); if (m_outputHt.overFlow()) m_outputHt.setValue(htTotalMaxValue); m_outputExPipe.store( m_outputEx, bxRel()); m_outputEyPipe.store( m_outputEy, bxRel()); m_outputEtPipe.store( m_outputEt, bxRel()); m_outputHtPipe.store( m_outputHt, bxRel()); } }
void L1GctWheelEnergyFpga::resetPipelines | ( | ) | [protected, virtual] |
Implements L1GctProcessor.
Definition at line 121 of file L1GctWheelEnergyFpga.cc.
References m_outputEtPipe, m_outputExPipe, m_outputEyPipe, m_outputHtPipe, and L1GctProcessor::numOfBx().
{ m_outputExPipe.reset(numOfBx()); m_outputEyPipe.reset(numOfBx()); m_outputEtPipe.reset(numOfBx()); m_outputHtPipe.reset(numOfBx()); }
void L1GctWheelEnergyFpga::resetProcessor | ( | ) | [protected, virtual] |
Separate reset methods for the processor itself and any data stored in pipelines.
Implements L1GctProcessor.
Definition at line 107 of file L1GctWheelEnergyFpga.cc.
References i, m_inputEt, m_inputEx, m_inputEy, m_inputHt, m_outputEt, m_outputEx, m_outputEy, m_outputHt, MAX_LEAF_CARDS, L1GctUnsignedInt< nBits >::reset(), and L1GctTwosComplement< nBits >::reset().
{ for (unsigned int i=0; i<MAX_LEAF_CARDS; i++) { m_inputEx.at(i).reset(); m_inputEy.at(i).reset(); m_inputEt.at(i).reset(); m_inputHt.at(i).reset(); } m_outputEx.reset(); m_outputEy.reset(); m_outputEt.reset(); m_outputHt.reset(); }
void L1GctWheelEnergyFpga::setInputEnergy | ( | unsigned | i, |
int | ex, | ||
int | ey, | ||
unsigned | et, | ||
unsigned | ht | ||
) |
set input data; not used in normal operation
set input data
Definition at line 162 of file L1GctWheelEnergyFpga.cc.
References m_inputEt, m_inputEx, m_inputEy, m_inputHt, and MAX_LEAF_CARDS.
virtual void L1GctWheelEnergyFpga::setupObjects | ( | ) | [inline, protected, virtual] |
Initialise inputs with null objects for the correct bunch crossing if required.
Implements L1GctProcessor.
Definition at line 97 of file L1GctWheelEnergyFpga.h.
{}
bool L1GctWheelEnergyFpga::setupOk | ( | ) | const [inline] |
check the setup
Reimplemented from L1GctProcessor.
Definition at line 88 of file L1GctWheelEnergyFpga.h.
References m_setupOk.
{ return m_setupOk; }
std::ostream& operator<< | ( | std::ostream & | os, |
const L1GctWheelEnergyFpga & | fpga | ||
) | [friend] |
Overload << operator.
int L1GctWheelEnergyFpga::m_id [private] |
algo ID
Definition at line 103 of file L1GctWheelEnergyFpga.h.
Referenced by L1GctWheelEnergyFpga(), and operator<<().
std::vector< etTotalType > L1GctWheelEnergyFpga::m_inputEt [private] |
Definition at line 111 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), getInputEt(), operator<<(), process(), resetProcessor(), and setInputEnergy().
std::vector< etComponentType > L1GctWheelEnergyFpga::m_inputEx [private] |
the input components from each input card
Definition at line 109 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), getInputEx(), operator<<(), process(), resetProcessor(), and setInputEnergy().
std::vector< etComponentType > L1GctWheelEnergyFpga::m_inputEy [private] |
Definition at line 110 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), getInputEy(), operator<<(), process(), resetProcessor(), and setInputEnergy().
std::vector< etHadType > L1GctWheelEnergyFpga::m_inputHt [private] |
Definition at line 112 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), inputHt(), operator<<(), process(), resetProcessor(), and setInputEnergy().
std::vector<L1GctJetLeafCard*> L1GctWheelEnergyFpga::m_inputLeafCards [private] |
the jet leaf card
Definition at line 106 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), getinputLeafCard(), L1GctWheelEnergyFpga(), and operator<<().
etTotalType L1GctWheelEnergyFpga::m_outputEt [private] |
Definition at line 117 of file L1GctWheelEnergyFpga.h.
Referenced by getOutputEt(), operator<<(), process(), and resetProcessor().
Pipeline< etTotalType > L1GctWheelEnergyFpga::m_outputEtPipe [private] |
Definition at line 126 of file L1GctWheelEnergyFpga.h.
Referenced by getInternalEtSums(), process(), and resetPipelines().
output data
Definition at line 115 of file L1GctWheelEnergyFpga.h.
Referenced by getOutputEx(), operator<<(), process(), and resetProcessor().
Pipeline< etComponentType > L1GctWheelEnergyFpga::m_outputExPipe [private] |
record the output data history
Definition at line 124 of file L1GctWheelEnergyFpga.h.
Referenced by getInternalEtSums(), process(), and resetPipelines().
Definition at line 116 of file L1GctWheelEnergyFpga.h.
Referenced by getOutputEy(), operator<<(), process(), and resetProcessor().
Pipeline< etComponentType > L1GctWheelEnergyFpga::m_outputEyPipe [private] |
Definition at line 125 of file L1GctWheelEnergyFpga.h.
Referenced by getInternalEtSums(), process(), and resetPipelines().
etHadType L1GctWheelEnergyFpga::m_outputHt [private] |
Definition at line 118 of file L1GctWheelEnergyFpga.h.
Referenced by getOutputHt(), operator<<(), process(), and resetProcessor().
Pipeline< etHadType > L1GctWheelEnergyFpga::m_outputHtPipe [private] |
Definition at line 127 of file L1GctWheelEnergyFpga.h.
Referenced by getInternalEtSums(), process(), and resetPipelines().
bool L1GctWheelEnergyFpga::m_setupOk [private] |
check the setup
Definition at line 121 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), L1GctWheelEnergyFpga(), process(), and setupOk().
const unsigned int L1GctWheelEnergyFpga::MAX_LEAF_CARDS = L1GctWheelJetFpga::MAX_LEAF_CARDS [static] |
Max number of leaf card pointers.
Definition at line 44 of file L1GctWheelEnergyFpga.h.
Referenced by fetchInput(), L1GctWheelEnergyFpga(), resetProcessor(), and setInputEnergy().