CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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...
 

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)
 constructor More...
 
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 28 of file L1GctElectronFinalSort.h.

Member Typedef Documentation

Use some definitions from the ElectronSorter in the leaf cards.

Definition at line 31 of file L1GctElectronFinalSort.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 8 of file L1GctElectronFinalSort.cc.

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

9  : L1GctProcessor(),
10  m_emCandsType(iso),
11  m_thePosEtaLeafCard(nullptr),
12  m_theNegEtaLeafCard(nullptr),
13  m_inputCands(16),
14  m_outputCands(4),
15  m_setupOk(true) {
16  if (posEtaCard != nullptr) {
17  m_thePosEtaLeafCard = posEtaCard;
18  } else {
19  m_setupOk = false;
20  if (m_verbose) {
21  edm::LogWarning("L1GctSetupError") << "L1GctElectronFinalSort::Constructor() : 1st EmLeafCard passed is zero";
22  }
23  }
24  if (negEtaCard != nullptr) {
25  m_theNegEtaLeafCard = negEtaCard;
26  } else {
27  m_setupOk = false;
28  if (m_verbose) {
29  edm::LogWarning("L1GctSetupError") << "L1GctElectronFinalSort::Constructor() : 2nd EmLeafCard passed is zero";
30  }
31  }
32  if (!m_setupOk && m_verbose) {
33  edm::LogError("L1GctSetupError") << "L1GctElectronFinalSort has been incorrectly constructed";
34  }
35 }
L1GctEmLeafCard * m_theNegEtaLeafCard
bool m_verbose
Flag to control output messages.
Log< level::Error, false > LogError
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))
Log< level::Warning, false > LogWarning
L1GctElectronFinalSort::~L1GctElectronFinalSort ( )
override

destructor

Definition at line 37 of file L1GctElectronFinalSort.cc.

References m_inputCands, and m_outputCands.

37  {
38  m_inputCands.clear();
39  m_outputCands.contents.clear();
40 }
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 49 of file L1GctElectronFinalSort.cc.

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

Referenced by L1GlobalCaloTrigger::bxProcess().

49  {
50  if (m_setupOk) {
51  for (int k = 0; k < 4; k++) {
52  if (m_emCandsType) {
57  } else {
62  }
63  }
64  }
65 }
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.
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 49 of file L1GctElectronFinalSort.h.

References m_inputCands.

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

return output data

Definition at line 52 of file L1GctElectronFinalSort.h.

References m_outputCands.

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

52 { 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 67 of file L1GctElectronFinalSort.cc.

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

Referenced by L1GlobalCaloTrigger::bxProcess().

67  {
68  if (m_setupOk) {
69  std::vector<prioritisedEmCand> data(m_inputCands.size());
70  // Assign a "priority" for sorting - this assumes the candidates
71  // have already been filled in "priority order"
72  for (unsigned i = 0; i < m_inputCands.size(); i++) {
74  data.at(i) = c;
75  }
76 
77  //Then sort it
78  sort(data.begin(), data.end(), L1GctElectronSorter::rankByGt);
79 
80  //Copy data to output buffer
81  std::vector<L1GctEmCand> temp(4);
82  for (int i = 0; i < 4; i++) {
83  temp.at(i) = data.at(i).emCand;
84  }
85  m_outputCands.store(temp, bxRel());
86  }
87 }
static bool rankByGt(const prioritisedEmCand &x, const prioritisedEmCand &y)
const edm::EventSetup & c
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:79
void L1GctElectronFinalSort::resetPipelines ( )
overrideprotectedvirtual

Implements L1GctProcessor.

Definition at line 47 of file L1GctElectronFinalSort.cc.

References m_outputCands, and L1GctProcessor::numOfBx().

47 { m_outputCands.reset(numOfBx()); }
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 42 of file L1GctElectronFinalSort.cc.

References m_inputCands.

42  {
43  m_inputCands.clear();
44  m_inputCands.resize(16);
45 }
std::vector< L1GctEmCand > m_inputCands
input data
void L1GctElectronFinalSort::setInputEmCand ( unsigned  i,
const L1GctEmCand cand 
)

set input data

Definition at line 89 of file L1GctElectronFinalSort.cc.

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

Referenced by fetchInput().

89  {
90  if ((i < m_inputCands.size()) && (cand.bx() == bxAbs())) {
91  m_inputCands.at(i) = cand;
92  }
93 }
std::vector< L1GctEmCand > m_inputCands
input data
int16_t bx() const
get bunch-crossing index
Definition: L1GctEmCand.h:80
int bxAbs() const
void L1GctElectronFinalSort::setupObjects ( )
inlineoverrideprotectedvirtual

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

Implements L1GctProcessor.

Definition at line 66 of file L1GctElectronFinalSort.h.

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

check setup

Definition at line 58 of file L1GctElectronFinalSort.h.

References m_setupOk.

Referenced by L1GlobalCaloTrigger::setupOk().

58 { 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 95 of file L1GctElectronFinalSort.cc.

95  {
96  s << "===ElectronFinalSort===" << std::endl;
97  s << "Card type = " << (cand.m_emCandsType ? "isolated" : "non-isolated") << std::endl;
98  s << "Pointers to the Electron Leaf cards are: " << std::endl;
99  s << " Pos. eta: " << cand.m_thePosEtaLeafCard;
100  s << " Neg. eta: " << cand.m_theNegEtaLeafCard;
101  s << std::endl;
102  s << "No of Electron Input Candidates " << cand.m_inputCands.size() << std::endl;
103  s << "No of Electron Output Candidates " << cand.m_outputCands.contents.size() << std::endl;
104 
105  return s;
106 }
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 71 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 81 of file L1GctElectronFinalSort.h.

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

bool L1GctElectronFinalSort::m_setupOk
private

Check the setup.

Definition at line 84 of file L1GctElectronFinalSort.h.

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

L1GctEmLeafCard* L1GctElectronFinalSort::m_theNegEtaLeafCard
private

Definition at line 75 of file L1GctElectronFinalSort.h.

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

L1GctEmLeafCard* L1GctElectronFinalSort::m_thePosEtaLeafCard
private

the 1st stage electron sorters

Definition at line 74 of file L1GctElectronFinalSort.h.

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