CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GctJetSorter.cc
Go to the documentation of this file.
2 
4 
6  m_inputJets() {}
8  m_inputJets(inputJets) {}
9 
11 
13 
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 }
37 
JetVector m_inputJets
JetVector getSortedJets() const
tuple result
Definition: query.py:137
JetVector getInputJets() const
std::vector< L1GctJetCand > JetVector
static int position[264][3]
Definition: ReadPGInfo.cc:509
void setJets(JetVector &inputJets)