#include <L1GctElectronFinalSort.h>
Public Types | |
typedef L1GctElectronSorter::prioritisedEmCand | prioritisedEmCand |
Use some definitions from the ElectronSorter in the leaf cards. | |
typedef L1GctElectronSorter::rank_gt | rank_gt |
Public Member Functions | |
virtual void | fetchInput () |
std::vector< L1GctEmCand > | getInputCands () const |
std::vector< L1GctEmCand > | getOutputCands () const |
L1GctElectronFinalSort (bool iso, L1GctEmLeafCard *posEtaCard, L1GctEmLeafCard *negEtaCard) | |
virtual void | process () |
void | setInputEmCand (unsigned i, const L1GctEmCand &cand) |
bool | setupOk () const |
~L1GctElectronFinalSort () | |
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 | |
bool | m_emCandsType |
std::vector< L1GctEmCand > | m_inputCands |
Pipeline< L1GctEmCand > | m_outputCands |
bool | m_setupOk |
Check the setup. | |
L1GctEmLeafCard * | m_theNegEtaLeafCard |
L1GctEmLeafCard * | m_thePosEtaLeafCard |
Friends | |
std::ostream & | operator<< (std::ostream &s, const L1GctElectronFinalSort &cand) |
Definition at line 29 of file L1GctElectronFinalSort.h.
Use some definitions from the ElectronSorter in the leaf cards.
Definition at line 33 of file L1GctElectronFinalSort.h.
Definition at line 34 of file L1GctElectronFinalSort.h.
L1GctElectronFinalSort::L1GctElectronFinalSort | ( | bool | iso, |
L1GctEmLeafCard * | posEtaCard, | ||
L1GctEmLeafCard * | negEtaCard | ||
) |
constructor
Definition at line 9 of file L1GctElectronFinalSort.cc.
References m_setupOk, m_theNegEtaLeafCard, m_thePosEtaLeafCard, and L1GctProcessor::m_verbose.
: L1GctProcessor(), m_emCandsType(iso), m_thePosEtaLeafCard(0), m_theNegEtaLeafCard(0), m_inputCands(16), m_outputCands(4), m_setupOk(true) { if(posEtaCard!=0){ m_thePosEtaLeafCard = posEtaCard; }else{ m_setupOk = false; if (m_verbose) { edm::LogWarning("L1GctSetupError") <<"L1GctElectronFinalSort::Constructor() : 1st EmLeafCard passed is zero"; } } if(negEtaCard!=0){ m_theNegEtaLeafCard = negEtaCard; }else{ m_setupOk = false; if (m_verbose) { edm::LogWarning("L1GctSetupError") <<"L1GctElectronFinalSort::Constructor() : 2nd EmLeafCard passed is zero"; } } if (!m_setupOk && m_verbose) { edm::LogError("L1GctSetupError") << "L1GctElectronFinalSort has been incorrectly constructed"; } }
L1GctElectronFinalSort::~L1GctElectronFinalSort | ( | ) |
destructor
Definition at line 41 of file L1GctElectronFinalSort.cc.
References m_inputCands, and m_outputCands.
{ m_inputCands.clear(); m_outputCands.contents.clear(); }
void L1GctElectronFinalSort::fetchInput | ( | ) | [virtual] |
get input data from sources
loop over candidates from four electron sorter FPGAs
Implements L1GctProcessor.
Definition at line 55 of file L1GctElectronFinalSort.cc.
References L1GctEmLeafCard::getIsoElectronSorterU1(), L1GctEmLeafCard::getIsoElectronSorterU2(), L1GctEmLeafCard::getNonIsoElectronSorterU1(), L1GctEmLeafCard::getNonIsoElectronSorterU2(), L1GctElectronSorter::getOutputCands(), gen::k, m_emCandsType, m_setupOk, m_theNegEtaLeafCard, m_thePosEtaLeafCard, and setInputEmCand().
Referenced by L1GlobalCaloTrigger::bxProcess().
{ if (m_setupOk) { for (int k=0; k<4; k++) { if (m_emCandsType) { setInputEmCand( k , m_thePosEtaLeafCard->getIsoElectronSorterU1()->getOutputCands().at(k)); setInputEmCand( k+4 , m_thePosEtaLeafCard->getIsoElectronSorterU2()->getOutputCands().at(k)); setInputEmCand( k+8 , m_theNegEtaLeafCard->getIsoElectronSorterU1()->getOutputCands().at(k)); setInputEmCand( k+12, m_theNegEtaLeafCard->getIsoElectronSorterU2()->getOutputCands().at(k)); } else { setInputEmCand( k , m_thePosEtaLeafCard->getNonIsoElectronSorterU1()->getOutputCands().at(k)); setInputEmCand( k+4 , m_thePosEtaLeafCard->getNonIsoElectronSorterU2()->getOutputCands().at(k)); setInputEmCand( k+8 , m_theNegEtaLeafCard->getNonIsoElectronSorterU1()->getOutputCands().at(k)); setInputEmCand( k+12, m_theNegEtaLeafCard->getNonIsoElectronSorterU2()->getOutputCands().at(k)); } } } }
std::vector<L1GctEmCand> L1GctElectronFinalSort::getInputCands | ( | ) | const [inline] |
return input data
Definition at line 53 of file L1GctElectronFinalSort.h.
References m_inputCands.
{ return m_inputCands; }
std::vector<L1GctEmCand> L1GctElectronFinalSort::getOutputCands | ( | ) | const [inline] |
return output data
Definition at line 56 of file L1GctElectronFinalSort.h.
References m_outputCands.
Referenced by L1GlobalCaloTrigger::getIsoElectrons(), and L1GlobalCaloTrigger::getNonIsoElectrons().
{ return m_outputCands.contents; }
void L1GctElectronFinalSort::process | ( | ) | [virtual] |
process the data, fill output buffers
Implements L1GctProcessor.
Definition at line 74 of file L1GctElectronFinalSort.cc.
References L1GctProcessor::bxRel(), trackerHits::c, runTheMatrix::data, i, m_inputCands, m_outputCands, m_setupOk, python::multivaluedict::sort(), and cond::rpcobtemp::temp.
Referenced by L1GlobalCaloTrigger::bxProcess().
{ if (m_setupOk) { std::vector<prioritisedEmCand> data(m_inputCands.size()); // Assign a "priority" for sorting - this assumes the candidates // have already been filled in "priority order" for (unsigned i=0; i<m_inputCands.size(); i++) { prioritisedEmCand c(m_inputCands.at(i), i); data.at(i) = c; } //Then sort it sort(data.begin(),data.end(),rank_gt()); //Copy data to output buffer std::vector<L1GctEmCand> temp(4); for(int i = 0; i<4; i++){ temp.at(i) = data.at(i).emCand; } m_outputCands.store(temp, bxRel()); } }
void L1GctElectronFinalSort::resetPipelines | ( | ) | [protected, virtual] |
Implements L1GctProcessor.
Definition at line 51 of file L1GctElectronFinalSort.cc.
References m_outputCands, and L1GctProcessor::numOfBx().
{ m_outputCands.reset(numOfBx()); }
void L1GctElectronFinalSort::resetProcessor | ( | ) | [protected, virtual] |
Separate reset methods for the processor itself and any data stored in pipelines.
Implements L1GctProcessor.
Definition at line 46 of file L1GctElectronFinalSort.cc.
References m_inputCands.
{ m_inputCands.clear(); m_inputCands.resize(16); }
void L1GctElectronFinalSort::setInputEmCand | ( | unsigned | i, |
const L1GctEmCand & | cand | ||
) |
set input data
Definition at line 97 of file L1GctElectronFinalSort.cc.
References L1GctEmCand::bx(), L1GctProcessor::bxAbs(), and m_inputCands.
Referenced by fetchInput().
{ if ((i<m_inputCands.size()) && (cand.bx()==bxAbs())) { m_inputCands.at(i) = cand; } }
virtual void L1GctElectronFinalSort::setupObjects | ( | ) | [inline, protected, virtual] |
Initialise inputs with null objects for the correct bunch crossing if required.
Implements L1GctProcessor.
Definition at line 71 of file L1GctElectronFinalSort.h.
{}
bool L1GctElectronFinalSort::setupOk | ( | ) | const [inline] |
check setup
Reimplemented from L1GctProcessor.
Definition at line 62 of file L1GctElectronFinalSort.h.
References m_setupOk.
Referenced by L1GlobalCaloTrigger::setupOk().
{ return m_setupOk; }
std::ostream& operator<< | ( | std::ostream & | s, |
const L1GctElectronFinalSort & | cand | ||
) | [friend] |
overload of cout operator
Definition at line 104 of file L1GctElectronFinalSort.cc.
{ s << "===ElectronFinalSort===" << std::endl; s << "Card type = " << ( cand.m_emCandsType ? "isolated" : "non-isolated" ) <<std::endl; s << "Pointers to the Electron Leaf cards are: "<<std::endl; s << " Pos. eta: " << cand.m_thePosEtaLeafCard; s << " Neg. eta: " << cand.m_theNegEtaLeafCard; s << std::endl; s << "No of Electron Input Candidates " << cand.m_inputCands.size() << std::endl; s << "No of Electron Output Candidates " << cand.m_outputCands.contents.size() << std::endl; return s; }
bool L1GctElectronFinalSort::m_emCandsType [private] |
type of electron candidate (iso(0) or non-iso(1))
Definition at line 76 of file L1GctElectronFinalSort.h.
Referenced by fetchInput(), and operator<<().
std::vector<L1GctEmCand> L1GctElectronFinalSort::m_inputCands [private] |
input data
Definition at line 83 of file L1GctElectronFinalSort.h.
Referenced by getInputCands(), operator<<(), process(), resetProcessor(), setInputEmCand(), and ~L1GctElectronFinalSort().
output data
Definition at line 86 of file L1GctElectronFinalSort.h.
Referenced by getOutputCands(), operator<<(), process(), resetPipelines(), and ~L1GctElectronFinalSort().
bool L1GctElectronFinalSort::m_setupOk [private] |
Check the setup.
Definition at line 89 of file L1GctElectronFinalSort.h.
Referenced by fetchInput(), L1GctElectronFinalSort(), process(), and setupOk().
Definition at line 80 of file L1GctElectronFinalSort.h.
Referenced by fetchInput(), L1GctElectronFinalSort(), and operator<<().
the 1st stage electron sorters
Definition at line 79 of file L1GctElectronFinalSort.h.
Referenced by fetchInput(), L1GctElectronFinalSort(), and operator<<().