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 | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
L1GctJetFinalStage Class Reference

Represents the final stage of L1 jet processing. More...

#include <L1GctJetFinalStage.h>

Inheritance diagram for L1GctJetFinalStage:
L1GctProcessor

Public Types

typedef Pipeline< L1GctJetCandJetPipeline
 
typedef std::vector< L1GctJetCandJetVector
 

Public Member Functions

virtual void fetchInput ()
 get input data from sources More...
 
JetVector getCentralJets () const
 get the central jets output data More...
 
JetVector getForwardJets () const
 get the forward jets output data More...
 
JetVector getInputCentralJets () const
 get the central jets input data More...
 
JetVector getInputForwardJets () const
 get the forward jets input data More...
 
JetVector getInputTauJets () const
 get the tau jets input data More...
 
JetVector getTauJets () const
 get the tau jets output data More...
 
 L1GctJetFinalStage (const std::vector< L1GctWheelJetFpga * > &m_wheelFpgas)
 Takes a vector of 2 wheel jet FPGA pointers, with which to get input data from. More...
 
virtual void process ()
 process the data, fill output buffers More...
 
void setInputCentralJet (int i, const L1GctJetCand &jet)
 set the central jets input data More...
 
void setInputForwardJet (int i, const L1GctJetCand &jet)
 set the forward jets input data More...
 
void setInputTauJet (int i, const L1GctJetCand &jet)
 set the tau jets input data More...
 
bool setupOk () const
 
 ~L1GctJetFinalStage ()
 
- Public Member Functions inherited from L1GctProcessor
 L1GctProcessor ()
 
void reset ()
 complete reset of processor More...
 
void setBxRange (const int firstBx, const int numberOfBx)
 define the bunch crossing range to process More...
 
void setNextBx (const int bxnum)
 clear input data buffers and process a new bunch crossing More...
 
void setTerse ()
 
bool setupOk () const
 Method to check the setup for this processor. Returns true by default. More...
 
void setVerbose ()
 control output messages More...
 
virtual ~L1GctProcessor ()
 

Static Public Attributes

static const unsigned int MAX_WHEEL_FPGAS = 2
 Max number of wheel FPGA pointers. More...
 

Protected Member Functions

virtual void resetPipelines ()
 
virtual void resetProcessor ()
 Separate reset methods for the processor itself and any data stored in pipelines. More...
 
virtual void setupObjects ()
 Initialise inputs with null objects for the correct bunch crossing if required. More...
 
- Protected Member Functions inherited from L1GctProcessor
int bxAbs () const
 
int bxMax () const
 
int bxMin () const
 Support for multiple beam crossing operation. More...
 
int bxRel () const
 
int numOfBx () const
 

Private Member Functions

void storeJets (JetVector &storageVector, const JetVector &jets, unsigned short iWheel)
 Enters jets into the specified storageVector, according to which wheel card we are taking them from. More...
 

Private Attributes

JetPipeline m_centralJets
 
L1GctJetSorterm_centralJetSorter
 Jet sorters. More...
 
JetPipeline m_forwardJets
 
L1GctJetSorterm_forwardJetSorter
 
JetVector m_inputCentralJets
 
JetVector m_inputForwardJets
 
JetVector m_inputTauJets
 
bool m_setupOk
 
JetPipeline m_tauJets
 
L1GctJetSorterm_tauJetSorter
 
std::vector< L1GctWheelJetFpga * > m_wheelFpgas
 wheel jet FPGAs More...
 

Static Private Attributes

static const int MAX_JETS_IN = L1GctJetFinalStage::MAX_WHEEL_FPGAS*L1GctWheelJetFpga::MAX_JETS_OUT
 Max number of jets of each type coming in. More...
 
static const int MAX_JETS_OUT = 4
 Max number of jets of each type going out. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const L1GctJetFinalStage &fpga)
 Overload << operator. More...
 

Additional Inherited Members

- Protected Attributes inherited from L1GctProcessor
bool m_verbose
 Flag to control output messages. More...
 

Detailed Description

Represents the final stage of L1 jet processing.

Takes as input the jet data from the two Wheel Jet FPGAs and outputs the top four of each type of jet - central, forward, and tau - for the whole of the CMS detector.

Author
Jim Brooke & Robert Frazier
Date
June 2006

Definition at line 25 of file L1GctJetFinalStage.h.

Member Typedef Documentation

Definition at line 29 of file L1GctJetFinalStage.h.

Definition at line 28 of file L1GctJetFinalStage.h.

Constructor & Destructor Documentation

L1GctJetFinalStage::L1GctJetFinalStage ( const std::vector< L1GctWheelJetFpga * > &  m_wheelFpgas)

Takes a vector of 2 wheel jet FPGA pointers, with which to get input data from.

Definition at line 16 of file L1GctJetFinalStage.cc.

References i, m_setupOk, L1GctProcessor::m_verbose, m_wheelFpgas, and MAX_WHEEL_FPGAS.

16  :
18  m_wheelFpgas(wheelFpgas),
28  m_setupOk(true)
29 {
30  if(m_wheelFpgas.size() != MAX_WHEEL_FPGAS)
31  {
32  m_setupOk = false;
33  if (m_verbose) {
34  edm::LogWarning("L1GctSetupError")
35  << "L1GctJetFinalStage::L1GctJetFinalStage() : Jet Final Stage instance has been incorrectly constructed!\n"
36  << "This class needs " << MAX_WHEEL_FPGAS << " wheel jet FPGA pointers, yet only " << m_wheelFpgas.size()
37  << " wheel jet FPGA pointers are present.\n";
38  }
39  }
40 
41  for(unsigned int i=0; i < MAX_WHEEL_FPGAS; ++i)
42  {
43  if(m_wheelFpgas.at(i) == 0)
44  {
45  m_setupOk = false;
46  if (m_verbose) {
47  edm::LogWarning("L1GctSetupError")
48  << "L1GctJetFinalStage::L1GctJetFinalStage() : Jet Final Stage instance has been incorrectly constructed!\n"
49  << "Wheel jet FPGA pointer " << i << " has not been set!\n";
50  }
51  }
52  }
53  if (!m_setupOk && m_verbose) {
54  edm::LogError("L1GctSetupError") << "L1GctJetFinalStage has been incorrectly constructed";
55  }
56 }
int i
Definition: DBlmapReader.cc:9
bool m_verbose
Flag to control output messages.
static const int MAX_JETS_OUT
Max number of jets of each type going out.
static const int MAX_JETS_IN
Max number of jets of each type coming in.
L1GctJetSorter * m_forwardJetSorter
L1GctJetSorter * m_tauJetSorter
L1GctJetSorter * m_centralJetSorter
Jet sorters.
std::vector< L1GctWheelJetFpga * > m_wheelFpgas
wheel jet FPGAs
static const unsigned int MAX_WHEEL_FPGAS
Max number of wheel FPGA pointers.
L1GctJetFinalStage::~L1GctJetFinalStage ( )

Definition at line 58 of file L1GctJetFinalStage.cc.

References m_centralJetSorter, m_forwardJetSorter, and m_tauJetSorter.

59 {
60  if (m_centralJetSorter != 0) delete m_centralJetSorter;
61  if (m_forwardJetSorter != 0) delete m_forwardJetSorter;
62  if (m_tauJetSorter != 0) delete m_tauJetSorter;
63 }
L1GctJetSorter * m_forwardJetSorter
L1GctJetSorter * m_tauJetSorter
L1GctJetSorter * m_centralJetSorter
Jet sorters.

Member Function Documentation

void L1GctJetFinalStage::fetchInput ( )
virtual

get input data from sources

Implements L1GctProcessor.

Definition at line 124 of file L1GctJetFinalStage.cc.

References m_inputCentralJets, m_inputForwardJets, m_inputTauJets, m_setupOk, m_wheelFpgas, MAX_WHEEL_FPGAS, and storeJets().

Referenced by L1GlobalCaloTrigger::bxProcess().

125 {
126  if (m_setupOk) {
127  // We fetch and store the negative eta jets first. This ensures they have
128  // higher priority when sorting equal rank jets.
129  for(unsigned short iWheel=0; iWheel < MAX_WHEEL_FPGAS; ++iWheel)
130  {
131  storeJets(m_inputCentralJets, m_wheelFpgas.at(iWheel)->getCentralJets(), iWheel);
132  storeJets(m_inputForwardJets, m_wheelFpgas.at(iWheel)->getForwardJets(), iWheel);
133  storeJets(m_inputTauJets, m_wheelFpgas.at(iWheel)->getTauJets(), iWheel);
134  }
135  }
136 }
void storeJets(JetVector &storageVector, const JetVector &jets, unsigned short iWheel)
Enters jets into the specified storageVector, according to which wheel card we are taking them from...
std::vector< L1GctWheelJetFpga * > m_wheelFpgas
wheel jet FPGAs
static const unsigned int MAX_WHEEL_FPGAS
Max number of wheel FPGA pointers.
JetVector L1GctJetFinalStage::getCentralJets ( ) const
inline

get the central jets output data

Definition at line 53 of file L1GctJetFinalStage.h.

References m_centralJets.

Referenced by L1GlobalCaloTrigger::getCentralJets().

JetVector L1GctJetFinalStage::getForwardJets ( ) const
inline

get the forward jets output data

Definition at line 54 of file L1GctJetFinalStage.h.

References m_forwardJets.

Referenced by L1GlobalCaloTrigger::getForwardJets().

JetVector L1GctJetFinalStage::getInputCentralJets ( ) const
inline

get the central jets input data

Definition at line 49 of file L1GctJetFinalStage.h.

References m_inputCentralJets.

JetVector L1GctJetFinalStage::getInputForwardJets ( ) const
inline

get the forward jets input data

Definition at line 50 of file L1GctJetFinalStage.h.

References m_inputForwardJets.

JetVector L1GctJetFinalStage::getInputTauJets ( ) const
inline

get the tau jets input data

Definition at line 51 of file L1GctJetFinalStage.h.

References m_inputTauJets.

JetVector L1GctJetFinalStage::getTauJets ( ) const
inline

get the tau jets output data

Definition at line 55 of file L1GctJetFinalStage.h.

References m_tauJets.

Referenced by L1GlobalCaloTrigger::getTauJets().

void L1GctJetFinalStage::process ( )
virtual

process the data, fill output buffers

Implements L1GctProcessor.

Definition at line 138 of file L1GctJetFinalStage.cc.

References L1GctProcessor::bxRel(), L1GctJetSorter::getSortedJets(), m_centralJets, m_centralJetSorter, m_forwardJets, m_forwardJetSorter, m_inputCentralJets, m_inputForwardJets, m_inputTauJets, m_setupOk, m_tauJets, m_tauJetSorter, L1GctJetSorter::setJets(), and L1GctProcessor::Pipeline< T >::store().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), L1GlobalCaloTrigger::bxProcess(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

139 {
140  if (m_setupOk) {
141  //Process jets
145 
149  }
150 }
void store(const T &thisBx, const int bxNum)
int bxRel() const
JetVector getSortedJets() const
L1GctJetSorter * m_forwardJetSorter
L1GctJetSorter * m_tauJetSorter
L1GctJetSorter * m_centralJetSorter
Jet sorters.
void setJets(JetVector &inputJets)
void L1GctJetFinalStage::resetPipelines ( )
protectedvirtual

Implements L1GctProcessor.

Definition at line 118 of file L1GctJetFinalStage.cc.

References m_centralJets, m_forwardJets, m_tauJets, L1GctProcessor::numOfBx(), and L1GctProcessor::Pipeline< T >::reset().

118  {
121  m_tauJets.reset (numOfBx());
122 }
int numOfBx() const
void reset(const unsigned nBx)
void L1GctJetFinalStage::resetProcessor ( )
protectedvirtual

Separate reset methods for the processor itself and any data stored in pipelines.

Implements L1GctProcessor.

Definition at line 107 of file L1GctJetFinalStage.cc.

References m_inputCentralJets, m_inputForwardJets, m_inputTauJets, and MAX_JETS_IN.

107  {
108  //Clear all jet data
109  m_inputCentralJets.clear();
110  m_inputForwardJets.clear();
111  m_inputTauJets.clear();
112  //Resize the vectors
115  m_inputTauJets.resize(MAX_JETS_IN);
116 }
static const int MAX_JETS_IN
Max number of jets of each type coming in.
void L1GctJetFinalStage::setInputCentralJet ( int  i,
const L1GctJetCand jet 
)

set the central jets input data

Definition at line 152 of file L1GctJetFinalStage.cc.

References L1GctJetCand::bx(), L1GctProcessor::bxAbs(), L1GctJetCand::empty(), L1GctJetCand::isCentral(), metsig::jet, m_inputCentralJets, and MAX_JETS_IN.

153 {
154  if( ((jet.isCentral() && jet.bx() == bxAbs()) || jet.empty())
155  && (i >= 0 && i < MAX_JETS_IN))
156  {
157  m_inputCentralJets.at(i) = jet;
158  }
159 }
int i
Definition: DBlmapReader.cc:9
int16_t bx() const
get bunch-crossing index
Definition: L1GctJetCand.h:80
static const int MAX_JETS_IN
Max number of jets of each type coming in.
bool empty() const
was an object really found?
Definition: L1GctJetCand.h:47
int bxAbs() const
bool isCentral() const
check if this is a central jet
Definition: L1GctJetCand.h:65
void L1GctJetFinalStage::setInputForwardJet ( int  i,
const L1GctJetCand jet 
)

set the forward jets input data

Definition at line 161 of file L1GctJetFinalStage.cc.

References L1GctJetCand::bx(), L1GctProcessor::bxAbs(), L1GctJetCand::empty(), L1GctJetCand::isForward(), metsig::jet, m_inputForwardJets, and MAX_JETS_IN.

162 {
163  if( ((jet.isForward() && jet.bx() == bxAbs()) || jet.empty())
164  && (i >= 0 && i < MAX_JETS_IN))
165  {
166  m_inputForwardJets.at(i) = jet;
167  }
168 }
int i
Definition: DBlmapReader.cc:9
int16_t bx() const
get bunch-crossing index
Definition: L1GctJetCand.h:80
bool isForward() const
check if this is a forward jet
Definition: L1GctJetCand.h:71
static const int MAX_JETS_IN
Max number of jets of each type coming in.
bool empty() const
was an object really found?
Definition: L1GctJetCand.h:47
int bxAbs() const
void L1GctJetFinalStage::setInputTauJet ( int  i,
const L1GctJetCand jet 
)

set the tau jets input data

Definition at line 170 of file L1GctJetFinalStage.cc.

References L1GctJetCand::bx(), L1GctProcessor::bxAbs(), L1GctJetCand::empty(), L1GctJetCand::isTau(), metsig::jet, m_inputTauJets, and MAX_JETS_IN.

171 {
172  if( ((jet.isTau() && jet.bx() == bxAbs()) || jet.empty())
173  && (i >= 0 && i < MAX_JETS_IN))
174  {
175  m_inputTauJets.at(i) = jet;
176  }
177 }
int i
Definition: DBlmapReader.cc:9
bool isTau() const
check if this is a tau
Definition: L1GctJetCand.h:68
int16_t bx() const
get bunch-crossing index
Definition: L1GctJetCand.h:80
static const int MAX_JETS_IN
Max number of jets of each type coming in.
bool empty() const
was an object really found?
Definition: L1GctJetCand.h:47
int bxAbs() const
virtual void L1GctJetFinalStage::setupObjects ( )
inlineprotectedvirtual

Initialise inputs with null objects for the correct bunch crossing if required.

Implements L1GctProcessor.

Definition at line 65 of file L1GctJetFinalStage.h.

65 {}
bool L1GctJetFinalStage::setupOk ( ) const
inline

Definition at line 57 of file L1GctJetFinalStage.h.

References m_setupOk.

Referenced by L1GlobalCaloTrigger::setupOk().

57 { return m_setupOk; }
void L1GctJetFinalStage::storeJets ( JetVector storageVector,
const JetVector jets,
unsigned short  iWheel 
)
private

Enters jets into the specified storageVector, according to which wheel card we are taking them from.

Definition at line 179 of file L1GctJetFinalStage.cc.

References L1GctProcessor::bxAbs(), and L1GctWheelJetFpga::MAX_JETS_OUT.

Referenced by fetchInput().

180 {
181  for(unsigned short iJet = 0; iJet < L1GctWheelJetFpga::MAX_JETS_OUT; ++iJet)
182  {
183  if (jets.at(iJet).bx() == bxAbs()) {
184  storageVector.at((iWheel*L1GctWheelJetFpga::MAX_JETS_OUT) + iJet) = jets.at(iJet);
185  }
186  }
187 }
vector< PseudoJet > jets
static const int MAX_JETS_OUT
Max number of jets of each type we output.
int bxAbs() const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const L1GctJetFinalStage fpga 
)
friend

Overload << operator.

Definition at line 65 of file L1GctJetFinalStage.cc.

66 {
67  os << "===L1GctJetFinalStage===" << endl;
68  os << "No. of Wheel Jet FPGAs " << fpga.m_wheelFpgas.size() << std::endl;
69  for(unsigned i=0; i < fpga.m_wheelFpgas.size(); i++)
70  {
71  os << "WheelJetFpga* " << i << " = " << fpga.m_wheelFpgas.at(i) << endl;
72  }
73  os << "No. of input central Jets " << fpga.m_inputCentralJets.size() << std::endl;
74  for(unsigned i=0; i < fpga.m_inputCentralJets.size(); i++)
75  {
76  os << fpga.m_inputCentralJets.at(i);
77  }
78  os << "No. of input forward Jets " << fpga.m_inputForwardJets.size() << std::endl;
79  for(unsigned i=0; i < fpga.m_inputForwardJets.size(); i++)
80  {
81  os << fpga.m_inputForwardJets.at(i);
82  }
83  os << "No. of raw tau Jets " << fpga.m_inputTauJets.size() << std::endl;
84  for(unsigned i=0; i < fpga.m_inputTauJets.size(); i++)
85  {
86  os << fpga.m_inputTauJets.at(i);
87  }
88  os << "No. of output central Jets " << fpga.m_centralJets.contents.size() << std::endl;
89  for(unsigned i=0; i < fpga.m_centralJets.contents.size(); i++)
90  {
91  os << fpga.m_centralJets.contents.at(i);
92  }
93  os << "No. of output forward Jets " << fpga.m_forwardJets.contents.size() << std::endl;
94  for(unsigned i=0; i < fpga.m_forwardJets.contents.size(); i++)
95  {
96  os << fpga.m_forwardJets.contents.at(i);
97  }
98  os << "No. of output tau Jets " << fpga.m_tauJets.contents.size() << std::endl;
99  for(unsigned i=0; i < fpga.m_tauJets.contents.size(); i++)
100  {
101  os << fpga.m_tauJets.contents.at(i);
102  }
103  os << endl;
104  return os;
105 }
int i
Definition: DBlmapReader.cc:9
std::vector< L1GctWheelJetFpga * > m_wheelFpgas
wheel jet FPGAs
std::vector< T > contents

Member Data Documentation

JetPipeline L1GctJetFinalStage::m_centralJets
private

Definition at line 85 of file L1GctJetFinalStage.h.

Referenced by getCentralJets(), operator<<(), process(), and resetPipelines().

L1GctJetSorter* L1GctJetFinalStage::m_centralJetSorter
private

Jet sorters.

Definition at line 75 of file L1GctJetFinalStage.h.

Referenced by process(), and ~L1GctJetFinalStage().

JetPipeline L1GctJetFinalStage::m_forwardJets
private

Definition at line 86 of file L1GctJetFinalStage.h.

Referenced by getForwardJets(), operator<<(), process(), and resetPipelines().

L1GctJetSorter* L1GctJetFinalStage::m_forwardJetSorter
private

Definition at line 76 of file L1GctJetFinalStage.h.

Referenced by process(), and ~L1GctJetFinalStage().

JetVector L1GctJetFinalStage::m_inputCentralJets
private
JetVector L1GctJetFinalStage::m_inputForwardJets
private
JetVector L1GctJetFinalStage::m_inputTauJets
private
bool L1GctJetFinalStage::m_setupOk
private

Definition at line 90 of file L1GctJetFinalStage.h.

Referenced by fetchInput(), L1GctJetFinalStage(), process(), and setupOk().

JetPipeline L1GctJetFinalStage::m_tauJets
private

Definition at line 87 of file L1GctJetFinalStage.h.

Referenced by getTauJets(), operator<<(), process(), and resetPipelines().

L1GctJetSorter* L1GctJetFinalStage::m_tauJetSorter
private

Definition at line 77 of file L1GctJetFinalStage.h.

Referenced by process(), and ~L1GctJetFinalStage().

std::vector<L1GctWheelJetFpga*> L1GctJetFinalStage::m_wheelFpgas
private

wheel jet FPGAs

Definition at line 72 of file L1GctJetFinalStage.h.

Referenced by fetchInput(), L1GctJetFinalStage(), and operator<<().

const int L1GctJetFinalStage::MAX_JETS_IN = L1GctJetFinalStage::MAX_WHEEL_FPGAS*L1GctWheelJetFpga::MAX_JETS_OUT
staticprivate

Max number of jets of each type coming in.

Definition at line 68 of file L1GctJetFinalStage.h.

Referenced by resetProcessor(), setInputCentralJet(), setInputForwardJet(), and setInputTauJet().

const int L1GctJetFinalStage::MAX_JETS_OUT = 4
staticprivate

Max number of jets of each type going out.

Definition at line 69 of file L1GctJetFinalStage.h.

const unsigned int L1GctJetFinalStage::MAX_WHEEL_FPGAS = 2
static

Max number of wheel FPGA pointers.

Definition at line 30 of file L1GctJetFinalStage.h.

Referenced by fetchInput(), and L1GctJetFinalStage().