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...
 

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

◆ prioritisedEmCand

Use some definitions from the ElectronSorter in the leaf cards.

Definition at line 31 of file L1GctElectronFinalSort.h.

Constructor & Destructor Documentation

◆ L1GctElectronFinalSort()

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

constructor

Definition at line 8 of file L1GctElectronFinalSort.cc.

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 }

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

◆ ~L1GctElectronFinalSort()

L1GctElectronFinalSort::~L1GctElectronFinalSort ( )
override

destructor

Definition at line 37 of file L1GctElectronFinalSort.cc.

37  {
38  m_inputCands.clear();
39  m_outputCands.contents.clear();
40 }

References m_inputCands, and m_outputCands.

Member Function Documentation

◆ fetchInput()

void L1GctElectronFinalSort::fetchInput ( )
overridevirtual

◆ getInputCands()

std::vector<L1GctEmCand> L1GctElectronFinalSort::getInputCands ( ) const
inline

return input data

Definition at line 49 of file L1GctElectronFinalSort.h.

49 { return m_inputCands; }

References m_inputCands.

◆ getOutputCands()

std::vector<L1GctEmCand> L1GctElectronFinalSort::getOutputCands ( ) const
inline

return output data

Definition at line 52 of file L1GctElectronFinalSort.h.

52 { return m_outputCands.contents; }

References m_outputCands.

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

◆ process()

void L1GctElectronFinalSort::process ( )
overridevirtual

process the data, fill output buffers

Implements L1GctProcessor.

Definition at line 67 of file L1GctElectronFinalSort.cc.

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 }

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

Referenced by L1GlobalCaloTrigger::bxProcess().

◆ resetPipelines()

void L1GctElectronFinalSort::resetPipelines ( )
overrideprotectedvirtual

Implements L1GctProcessor.

Definition at line 47 of file L1GctElectronFinalSort.cc.

47 { m_outputCands.reset(numOfBx()); }

References m_outputCands, and L1GctProcessor::numOfBx().

◆ resetProcessor()

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.

42  {
43  m_inputCands.clear();
44  m_inputCands.resize(16);
45 }

References m_inputCands.

◆ setInputEmCand()

void L1GctElectronFinalSort::setInputEmCand ( unsigned  i,
const L1GctEmCand cand 
)

set input data

Definition at line 89 of file L1GctElectronFinalSort.cc.

89  {
90  if ((i < m_inputCands.size()) && (cand.bx() == bxAbs())) {
91  m_inputCands.at(i) = cand;
92  }
93 }

References L1GctProcessor::bxAbs(), mps_fire::i, and m_inputCands.

Referenced by fetchInput().

◆ setupObjects()

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 {}

◆ setupOk()

bool L1GctElectronFinalSort::setupOk ( ) const
inline

check setup

Definition at line 58 of file L1GctElectronFinalSort.h.

58 { return m_setupOk; }

References m_setupOk.

Referenced by L1GlobalCaloTrigger::setupOk().

Friends And Related Function Documentation

◆ operator<<

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 }

Member Data Documentation

◆ m_emCandsType

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().

◆ m_inputCands

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

◆ m_outputCands

Pipeline<L1GctEmCand> L1GctElectronFinalSort::m_outputCands
private

output data

Definition at line 81 of file L1GctElectronFinalSort.h.

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

◆ m_setupOk

bool L1GctElectronFinalSort::m_setupOk
private

Check the setup.

Definition at line 84 of file L1GctElectronFinalSort.h.

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

◆ m_theNegEtaLeafCard

L1GctEmLeafCard* L1GctElectronFinalSort::m_theNegEtaLeafCard
private

Definition at line 75 of file L1GctElectronFinalSort.h.

Referenced by fetchInput(), and L1GctElectronFinalSort().

◆ m_thePosEtaLeafCard

L1GctEmLeafCard* L1GctElectronFinalSort::m_thePosEtaLeafCard
private

the 1st stage electron sorters

Definition at line 74 of file L1GctElectronFinalSort.h.

Referenced by fetchInput(), and L1GctElectronFinalSort().

L1GctElectronFinalSort::m_inputCands
std::vector< L1GctEmCand > m_inputCands
input data
Definition: L1GctElectronFinalSort.h:78
L1GctElectronSorter::getOutputCands
std::vector< L1GctEmCand > getOutputCands()
get output candidates
Definition: L1GctElectronSorter.h:70
L1GctProcessor::L1GctProcessor
L1GctProcessor()
Definition: L1GctProcessor.h:24
L1GctElectronFinalSort::setInputEmCand
void setInputEmCand(unsigned i, const L1GctEmCand &cand)
set input data
Definition: L1GctElectronFinalSort.cc:89
mps_fire.i
i
Definition: mps_fire.py:355
L1GctEmLeafCard::getNonIsoElectronSorterU1
L1GctElectronSorter * getNonIsoElectronSorterU1()
Definition: L1GctEmLeafCard.h:59
L1GctProcessor::numOfBx
int numOfBx() const
Definition: L1GctProcessor.h:79
L1GctProcessor::bxRel
int bxRel() const
Definition: L1GctProcessor.h:81
L1GctElectronFinalSort::m_setupOk
bool m_setupOk
Check the setup.
Definition: L1GctElectronFinalSort.h:84
L1GctElectronFinalSort::prioritisedEmCand
L1GctElectronSorter::prioritisedEmCand prioritisedEmCand
Use some definitions from the ElectronSorter in the leaf cards.
Definition: L1GctElectronFinalSort.h:31
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
L1GctProcessor::bxAbs
int bxAbs() const
Definition: L1GctProcessor.h:80
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctElectronFinalSort::m_emCandsType
bool m_emCandsType
type of electron candidate (iso(0) or non-iso(1))
Definition: L1GctElectronFinalSort.h:71
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::LogWarning
Definition: MessageLogger.h:141
edm::LogError
Definition: MessageLogger.h:183
L1GctProcessor::m_verbose
bool m_verbose
Flag to control output messages.
Definition: L1GctProcessor.h:109
L1GctEmLeafCard::getIsoElectronSorterU1
L1GctElectronSorter * getIsoElectronSorterU1()
Definition: L1GctEmLeafCard.h:58
cand
Definition: decayParser.h:34
L1GctElectronSorter::rankByGt
static bool rankByGt(const prioritisedEmCand &x, const prioritisedEmCand &y)
Definition: L1GctElectronSorter.h:48
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
L1GctElectronFinalSort::m_thePosEtaLeafCard
L1GctEmLeafCard * m_thePosEtaLeafCard
the 1st stage electron sorters
Definition: L1GctElectronFinalSort.h:74
L1GctElectronFinalSort::m_theNegEtaLeafCard
L1GctEmLeafCard * m_theNegEtaLeafCard
Definition: L1GctElectronFinalSort.h:75
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1GctEmLeafCard::getNonIsoElectronSorterU2
L1GctElectronSorter * getNonIsoElectronSorterU2()
Definition: L1GctEmLeafCard.h:61
L1GctElectronFinalSort::m_outputCands
Pipeline< L1GctEmCand > m_outputCands
output data
Definition: L1GctElectronFinalSort.h:81
L1GctEmLeafCard::getIsoElectronSorterU2
L1GctElectronSorter * getIsoElectronSorterU2()
Definition: L1GctEmLeafCard.h:60