Main Page
Namespaces
Classes
Package Documentation
L1Trigger
GlobalCaloTrigger
src
L1GctJetSorter.cc
Go to the documentation of this file.
1
#include "
L1Trigger/GlobalCaloTrigger/interface/L1GctJetSorter.h
"
2
3
#include "
DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h
"
4
5
L1GctJetSorter::L1GctJetSorter
() :
6
m_inputJets() {}
7
L1GctJetSorter::L1GctJetSorter
(
L1GctJetSorter::JetVector
&
inputJets
) :
8
m_inputJets
(inputJets) {}
9
10
L1GctJetSorter::~L1GctJetSorter
() {}
11
12
void
L1GctJetSorter::setJets
(
L1GctJetSorter::JetVector
&
inputJets
) {
m_inputJets
=
inputJets
; }
13
14
L1GctJetSorter::JetVector
L1GctJetSorter::getSortedJets
()
const
{
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
30
JetVector
result
(
m_inputJets
.size());
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
38
L1GctJetSorter::JetVector
L1GctJetSorter::getInputJets
()
const
{
return
m_inputJets
; }
mps_fire.result
result
Definition:
mps_fire.py:291
L1GctJetSorter.h
L1GctJetSorter::m_inputJets
JetVector m_inputJets
Definition:
L1GctJetSorter.h:25
L1GctJetSorter::getSortedJets
JetVector getSortedJets() const
Definition:
L1GctJetSorter.cc:14
JetEnergyShift_cfi.inputJets
inputJets
Definition:
JetEnergyShift_cfi.py:4
L1GctJetSorter::~L1GctJetSorter
~L1GctJetSorter()
Definition:
L1GctJetSorter.cc:10
L1GctJetSorter::L1GctJetSorter
L1GctJetSorter()
Definition:
L1GctJetSorter.cc:5
L1GctJetCand.h
L1GctJetSorter::getInputJets
JetVector getInputJets() const
Definition:
L1GctJetSorter.cc:38
L1GctJetSorter::JetVector
std::vector< L1GctJetCand > JetVector
Definition:
L1GctJetSorter.h:12
position
static int position[264][3]
Definition:
ReadPGInfo.cc:509
L1GctJetSorter::setJets
void setJets(JetVector &inputJets)
Definition:
L1GctJetSorter.cc:12
Generated for CMSSW Reference Manual by
1.8.11