CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | Friends
L1GctElectronFinalSort Class Reference

#include <L1GctElectronFinalSort.h>

Inheritance diagram for L1GctElectronFinalSort:
L1GctProcessor

Public Types

typedef L1GctElectronSorter::prioritisedEmCand prioritisedEmCand
 Use some definitions from the ElectronSorter in the leaf cards. More...
 
typedef L1GctElectronSorter::rank_gt rank_gt
 

Public Member Functions

void fetchInput () override
 get input data from sources More...
 
std::vector< L1GctEmCandgetInputCands () const
 return input data More...
 
std::vector< L1GctEmCandgetOutputCands () const
 return output data More...
 
 L1GctElectronFinalSort (bool iso, L1GctEmLeafCard *posEtaCard, L1GctEmLeafCard *negEtaCard)
 
void process () override
 process the data, fill output buffers More...
 
void setInputEmCand (unsigned i, const L1GctEmCand &cand)
 set input data More...
 
bool setupOk () const
 check setup More...
 
 ~L1GctElectronFinalSort () override
 destructor More...
 
- 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 ()
 

Protected Member Functions

void resetPipelines () override
 
void resetProcessor () override
 Separate reset methods for the processor itself and any data stored in pipelines. More...
 
void setupObjects () override
 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 Attributes

bool m_emCandsType
 type of electron candidate (iso(0) or non-iso(1)) More...
 
std::vector< L1GctEmCandm_inputCands
 input data More...
 
Pipeline< L1GctEmCandm_outputCands
 output data More...
 
bool m_setupOk
 Check the setup. More...
 
L1GctEmLeafCardm_theNegEtaLeafCard
 
L1GctEmLeafCardm_thePosEtaLeafCard
 the 1st stage electron sorters More...
 

Friends

std::ostream & operator<< (std::ostream &s, const L1GctElectronFinalSort &cand)
 overload of cout operator More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 29 of file L1GctElectronFinalSort.h.

Member Typedef Documentation

Use some definitions from the ElectronSorter in the leaf cards.

Definition at line 33 of file L1GctElectronFinalSort.h.

Definition at line 34 of file L1GctElectronFinalSort.h.

Constructor & Destructor Documentation

L1GctElectronFinalSort::L1GctElectronFinalSort ( bool  iso,
L1GctEmLeafCard posEtaCard,
L1GctEmLeafCard negEtaCard 
)

constructor

Definition at line 9 of file L1GctElectronFinalSort.cc.

References m_setupOk, m_theNegEtaLeafCard, m_thePosEtaLeafCard, and L1GctProcessor::m_verbose.

10  :
12  m_emCandsType(iso),
13  m_thePosEtaLeafCard(nullptr), m_theNegEtaLeafCard(nullptr),
14  m_inputCands(16),
15  m_outputCands(4),
16  m_setupOk(true)
17 {
18  if(posEtaCard!=nullptr){
19  m_thePosEtaLeafCard = posEtaCard;
20  }else{
21  m_setupOk = false;
22  if (m_verbose) {
23  edm::LogWarning("L1GctSetupError")
24  <<"L1GctElectronFinalSort::Constructor() : 1st EmLeafCard passed is zero";
25  }
26  }
27  if(negEtaCard!=nullptr){
28  m_theNegEtaLeafCard = negEtaCard;
29  }else{
30  m_setupOk = false;
31  if (m_verbose) {
32  edm::LogWarning("L1GctSetupError")
33  <<"L1GctElectronFinalSort::Constructor() : 2nd EmLeafCard passed is zero";
34  }
35  }
36  if (!m_setupOk && m_verbose) {
37  edm::LogError("L1GctSetupError") << "L1GctElectronFinalSort has been incorrectly constructed";
38  }
39 }
L1GctEmLeafCard * m_theNegEtaLeafCard
bool m_verbose
Flag to control output messages.
L1GctEmLeafCard * m_thePosEtaLeafCard
the 1st stage electron sorters
bool m_setupOk
Check the setup.
Pipeline< L1GctEmCand > m_outputCands
output data
std::vector< L1GctEmCand > m_inputCands
input data
bool m_emCandsType
type of electron candidate (iso(0) or non-iso(1))
L1GctElectronFinalSort::~L1GctElectronFinalSort ( )
override

destructor

Definition at line 41 of file L1GctElectronFinalSort.cc.

References m_inputCands, and m_outputCands.

41  {
42  m_inputCands.clear();
43  m_outputCands.contents.clear();
44 }
Pipeline< L1GctEmCand > m_outputCands
output data
std::vector< L1GctEmCand > m_inputCands
input data

Member Function Documentation

void L1GctElectronFinalSort::fetchInput ( )
overridevirtual

get input data from sources

loop over candidates from four electron sorter FPGAs

Implements L1GctProcessor.

Definition at line 55 of file L1GctElectronFinalSort.cc.

References L1GctEmLeafCard::getIsoElectronSorterU1(), L1GctEmLeafCard::getIsoElectronSorterU2(), L1GctEmLeafCard::getNonIsoElectronSorterU1(), L1GctEmLeafCard::getNonIsoElectronSorterU2(), L1GctElectronSorter::getOutputCands(), gen::k, m_emCandsType, m_setupOk, m_theNegEtaLeafCard, m_thePosEtaLeafCard, and setInputEmCand().

Referenced by L1GlobalCaloTrigger::bxProcess().

55  {
56  if (m_setupOk) {
57  for (int k=0; k<4; k++) {
58  if (m_emCandsType) {
63  }
64  else {
69  }
70  }
71  }
72 }
L1GctElectronSorter * getNonIsoElectronSorterU1()
L1GctEmLeafCard * m_theNegEtaLeafCard
std::vector< L1GctEmCand > getOutputCands()
get output candidates
L1GctElectronSorter * getNonIsoElectronSorterU2()
L1GctEmLeafCard * m_thePosEtaLeafCard
the 1st stage electron sorters
L1GctElectronSorter * getIsoElectronSorterU1()
bool m_setupOk
Check the setup.
int k[5][pyjets_maxn]
void setInputEmCand(unsigned i, const L1GctEmCand &cand)
set input data
bool m_emCandsType
type of electron candidate (iso(0) or non-iso(1))
L1GctElectronSorter * getIsoElectronSorterU2()
std::vector<L1GctEmCand> L1GctElectronFinalSort::getInputCands ( ) const
inline

return input data

Definition at line 53 of file L1GctElectronFinalSort.h.

References m_inputCands.

53 { return m_inputCands; }
std::vector< L1GctEmCand > m_inputCands
input data
std::vector<L1GctEmCand> L1GctElectronFinalSort::getOutputCands ( ) const
inline

return output data

Definition at line 56 of file L1GctElectronFinalSort.h.

References m_outputCands, operator<<, and alignCSCRings::s.

Referenced by L1GlobalCaloTrigger::getIsoElectrons(), and L1GlobalCaloTrigger::getNonIsoElectrons().

56 { return m_outputCands.contents; }
Pipeline< L1GctEmCand > m_outputCands
output data
void L1GctElectronFinalSort::process ( )
overridevirtual

process the data, fill output buffers

Implements L1GctProcessor.

Definition at line 74 of file L1GctElectronFinalSort.cc.

References L1GctProcessor::bxRel(), EnergyCorrector::c, data, mps_fire::i, m_inputCands, m_outputCands, m_setupOk, and groupFilesInBlocks::temp.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), L1GlobalCaloTrigger::bxProcess(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), 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().

74  {
75 
76  if (m_setupOk) {
77  std::vector<prioritisedEmCand> data(m_inputCands.size());
78  // Assign a "priority" for sorting - this assumes the candidates
79  // have already been filled in "priority order"
80  for (unsigned i=0; i<m_inputCands.size(); i++) {
82  data.at(i) = c;
83  }
84 
85  //Then sort it
86  sort(data.begin(),data.end(),rank_gt());
87 
88  //Copy data to output buffer
89  std::vector<L1GctEmCand> temp(4);
90  for(int i = 0; i<4; i++){
91  temp.at(i) = data.at(i).emCand;
92  }
93  m_outputCands.store(temp, bxRel());
94  }
95 }
L1GctElectronSorter::rank_gt rank_gt
int bxRel() const
L1GctElectronSorter::prioritisedEmCand prioritisedEmCand
Use some definitions from the ElectronSorter in the leaf cards.
bool m_setupOk
Check the setup.
Pipeline< L1GctEmCand > m_outputCands
output data
std::vector< L1GctEmCand > m_inputCands
input data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void L1GctElectronFinalSort::resetPipelines ( )
overrideprotectedvirtual

Implements L1GctProcessor.

Definition at line 51 of file L1GctElectronFinalSort.cc.

References m_outputCands, and L1GctProcessor::numOfBx().

Referenced by setupOk().

51  {
52  m_outputCands.reset(numOfBx());
53 }
int numOfBx() const
Pipeline< L1GctEmCand > m_outputCands
output data
void L1GctElectronFinalSort::resetProcessor ( )
overrideprotectedvirtual

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

Implements L1GctProcessor.

Definition at line 46 of file L1GctElectronFinalSort.cc.

References m_inputCands.

Referenced by setupOk().

46  {
47  m_inputCands.clear();
48  m_inputCands.resize(16);
49 }
std::vector< L1GctEmCand > m_inputCands
input data
void L1GctElectronFinalSort::setInputEmCand ( unsigned  i,
const L1GctEmCand cand 
)

set input data

Definition at line 97 of file L1GctElectronFinalSort.cc.

References L1GctEmCand::bx(), L1GctProcessor::bxAbs(), and m_inputCands.

Referenced by fetchInput().

97  {
98  if ((i<m_inputCands.size())
99  && (cand.bx()==bxAbs())) {
100  m_inputCands.at(i) = cand;
101  }
102 }
std::vector< L1GctEmCand > m_inputCands
input data
int16_t bx() const
get bunch-crossing index
Definition: L1GctEmCand.h:82
int bxAbs() const
void L1GctElectronFinalSort::setupObjects ( )
inlineoverrideprotectedvirtual

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

Implements L1GctProcessor.

Definition at line 71 of file L1GctElectronFinalSort.h.

71 {}
bool L1GctElectronFinalSort::setupOk ( ) const
inline

check setup

Definition at line 62 of file L1GctElectronFinalSort.h.

References m_setupOk, resetPipelines(), and resetProcessor().

Referenced by L1GlobalCaloTrigger::setupOk().

62 { return m_setupOk; }
bool m_setupOk
Check the setup.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const L1GctElectronFinalSort cand 
)
friend

overload of cout operator

Definition at line 104 of file L1GctElectronFinalSort.cc.

Referenced by getOutputCands().

104  {
105  s << "===ElectronFinalSort===" << std::endl;
106  s << "Card type = " << ( cand.m_emCandsType ? "isolated" : "non-isolated" ) <<std::endl;
107  s << "Pointers to the Electron Leaf cards are: "<<std::endl;
108  s << " Pos. eta: " << cand.m_thePosEtaLeafCard;
109  s << " Neg. eta: " << cand.m_theNegEtaLeafCard;
110  s << std::endl;
111  s << "No of Electron Input Candidates " << cand.m_inputCands.size() << std::endl;
112  s << "No of Electron Output Candidates " << cand.m_outputCands.contents.size() << std::endl;
113 
114  return s;
115 }
L1GctEmLeafCard * m_theNegEtaLeafCard
L1GctEmLeafCard * m_thePosEtaLeafCard
the 1st stage electron sorters
Pipeline< L1GctEmCand > m_outputCands
output data
std::vector< L1GctEmCand > m_inputCands
input data
bool m_emCandsType
type of electron candidate (iso(0) or non-iso(1))

Member Data Documentation

bool L1GctElectronFinalSort::m_emCandsType
private

type of electron candidate (iso(0) or non-iso(1))

Definition at line 76 of file L1GctElectronFinalSort.h.

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

std::vector<L1GctEmCand> L1GctElectronFinalSort::m_inputCands
private
Pipeline<L1GctEmCand> L1GctElectronFinalSort::m_outputCands
private

output data

Definition at line 86 of file L1GctElectronFinalSort.h.

Referenced by getOutputCands(), operator<<(), process(), resetPipelines(), and ~L1GctElectronFinalSort().

bool L1GctElectronFinalSort::m_setupOk
private

Check the setup.

Definition at line 89 of file L1GctElectronFinalSort.h.

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

L1GctEmLeafCard* L1GctElectronFinalSort::m_theNegEtaLeafCard
private

Definition at line 80 of file L1GctElectronFinalSort.h.

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

L1GctEmLeafCard* L1GctElectronFinalSort::m_thePosEtaLeafCard
private

the 1st stage electron sorters

Definition at line 79 of file L1GctElectronFinalSort.h.

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