CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
L1GctJetSorter Class Reference

#include <L1GctJetSorter.h>

Public Types

typedef std::vector< L1GctJetCandJetVector
 

Public Member Functions

JetVector getInputJets () const
 
JetVector getSortedJets () const
 
 L1GctJetSorter ()
 
 L1GctJetSorter (JetVector &inputJets)
 
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.

5  :
6  m_inputJets() {}
JetVector m_inputJets
L1GctJetSorter::L1GctJetSorter ( L1GctJetSorter::JetVector inputJets)

Definition at line 7 of file L1GctJetSorter.cc.

L1GctJetSorter::~L1GctJetSorter ( )

Definition at line 10 of file L1GctJetSorter.cc.

10 {}

Member Function Documentation

L1GctJetSorter::JetVector L1GctJetSorter::getInputJets ( ) const

Definition at line 38 of file L1GctJetSorter.cc.

References m_inputJets.

38 { return m_inputJets; }
JetVector m_inputJets
L1GctJetSorter::JetVector L1GctJetSorter::getSortedJets ( ) const

Definition at line 14 of file L1GctJetSorter.cc.

References m_inputJets, position, and query::result.

Referenced by L1GctJetFinalStage::process(), L1GctWheelJetFpga::process(), and L1GctJetFinderBase::sortJets().

14  {
15  unsigned nJets = m_inputJets.size();
16  std::vector<unsigned> position(nJets, 0);
17  // Replicate the firmware jet sorting algorithm.
18  // If two jets in the input array have equal rank,
19  // the one that occurs first in the array has higher priority.
20  for (unsigned j1=0; j1<nJets; j1++) {
21  for (unsigned j2=j1+1; j2<nJets; j2++) {
22  if (m_inputJets.at(j1).rank() < m_inputJets.at(j2).rank()) {
23  position.at(j1) = position.at(j1) + 1;
24  } else {
25  position.at(j2) = position.at(j2) + 1;
26  }
27  }
28  }
29 
31  for (unsigned j1=0; j1<nJets; j1++) {
32  result.at(position.at(j1)) = m_inputJets.at(j1);
33  }
34 
35  return result;
36 }
JetVector m_inputJets
tuple result
Definition: query.py:137
std::vector< L1GctJetCand > JetVector
static int position[264][3]
Definition: ReadPGInfo.cc:509
void L1GctJetSorter::setJets ( L1GctJetSorter::JetVector inputJets)

Member Data Documentation

JetVector L1GctJetSorter::m_inputJets
private

Definition at line 25 of file L1GctJetSorter.h.

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