CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

L1GctJetSorter Class Reference

#include <L1GctJetSorter.h>

List of all members.

Public Types

typedef std::vector< L1GctJetCandJetVector

Public Member Functions

JetVector getInputJets () const
JetVector getSortedJets () const
 L1GctJetSorter (JetVector &inputJets)
 L1GctJetSorter ()
void setJets (JetVector &inputJets)
 ~L1GctJetSorter ()

Private Attributes

JetVector m_inputJets

Detailed Description

Definition at line 8 of file L1GctJetSorter.h.


Member Typedef Documentation

Definition at line 12 of file L1GctJetSorter.h.


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

L1GctJetSorter::JetVector L1GctJetSorter::getInputJets ( ) const

Definition at line 38 of file L1GctJetSorter.cc.

References m_inputJets.

{ return m_inputJets; }
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; }

Member Data Documentation

Definition at line 25 of file L1GctJetSorter.h.

Referenced by getInputJets(), getSortedJets(), and setJets().