#include <L1GctJetSorter.h>
Public Types | |
typedef std::vector< L1GctJetCand > | JetVector |
Public Member Functions | |
JetVector | getInputJets () const |
JetVector | getSortedJets () const |
L1GctJetSorter (JetVector &inputJets) | |
L1GctJetSorter () | |
void | setJets (JetVector &inputJets) |
~L1GctJetSorter () | |
Private Attributes | |
JetVector | m_inputJets |
Definition at line 8 of file L1GctJetSorter.h.
typedef std::vector<L1GctJetCand> L1GctJetSorter::JetVector |
Definition at line 12 of file L1GctJetSorter.h.
L1GctJetSorter::L1GctJetSorter | ( | ) |
Definition at line 5 of file L1GctJetSorter.cc.
: m_inputJets() {}
L1GctJetSorter::L1GctJetSorter | ( | L1GctJetSorter::JetVector & | inputJets | ) |
Definition at line 7 of file L1GctJetSorter.cc.
: m_inputJets(inputJets) {}
L1GctJetSorter::~L1GctJetSorter | ( | ) |
Definition at line 10 of file L1GctJetSorter.cc.
{}
L1GctJetSorter::JetVector L1GctJetSorter::getInputJets | ( | ) | const |
L1GctJetSorter::JetVector L1GctJetSorter::getSortedJets | ( | ) | const |
Definition at line 14 of file L1GctJetSorter.cc.
References m_inputJets, position, and query::result.
Referenced by L1GctWheelJetFpga::process(), L1GctJetFinalStage::process(), and L1GctJetFinderBase::sortJets().
{ unsigned nJets = m_inputJets.size(); std::vector<unsigned> position(nJets, 0); // Replicate the firmware jet sorting algorithm. // If two jets in the input array have equal rank, // the one that occurs first in the array has higher priority. for (unsigned j1=0; j1<nJets; j1++) { for (unsigned j2=j1+1; j2<nJets; j2++) { if (m_inputJets.at(j1).rank() < m_inputJets.at(j2).rank()) { position.at(j1) = position.at(j1) + 1; } else { position.at(j2) = position.at(j2) + 1; } } } JetVector result(m_inputJets.size()); for (unsigned j1=0; j1<nJets; j1++) { result.at(position.at(j1)) = m_inputJets.at(j1); } return result; }
void L1GctJetSorter::setJets | ( | L1GctJetSorter::JetVector & | inputJets | ) |
Definition at line 12 of file L1GctJetSorter.cc.
References m_inputJets.
Referenced by L1GctWheelJetFpga::process(), and L1GctJetFinalStage::process().
{ m_inputJets = inputJets; }
JetVector L1GctJetSorter::m_inputJets [private] |
Definition at line 25 of file L1GctJetSorter.h.
Referenced by getInputJets(), getSortedJets(), and setJets().