CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Friends
L1GctEmLeafCard Class Reference

Emulates a leaf card programmed for electron sorting. More...

#include <L1GctEmLeafCard.h>

Inheritance diagram for L1GctEmLeafCard:
L1GctProcessor

Public Member Functions

void fetchInput () override
 fetch input data More...
 
L1GctElectronSortergetIsoElectronSorterU1 ()
 
L1GctElectronSortergetIsoElectronSorterU2 ()
 
L1GctElectronSortergetNonIsoElectronSorterU1 ()
 
L1GctElectronSortergetNonIsoElectronSorterU2 ()
 
std::vector< L1GctEmCandgetOutputIsoEmCands (int fpga)
 get the output candidates More...
 
std::vector< L1GctEmCandgetOutputNonIsoEmCands (int fpga)
 get the output candidates More...
 
int id ()
 get ID More...
 
 L1GctEmLeafCard (int id)
 construct with ID More...
 
void process () override
 process the event More...
 
void reset ()
 clear internal trigger data buffers 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...
 
 ~L1GctEmLeafCard () override
 destruct 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 ()
 

Static Public Attributes

static const unsigned N_SORTERS = 4
 

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

int m_id
 card ID (0 or 1) More...
 
std::vector
< L1GctElectronSorter * > 
m_sorters
 processing - 0,2 are iso sorters, 1,3 are non-iso More...
 

Friends

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

Additional Inherited Members

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

Detailed Description

Emulates a leaf card programmed for electron sorting.

L1GctEmLeafCard This class does the 1st stage sorting of the electron candidates.

Author
Jim Brooke
Date
20/02/06

Definition at line 20 of file L1GctEmLeafCard.h.

Constructor & Destructor Documentation

L1GctEmLeafCard::L1GctEmLeafCard ( int  id)

construct with ID

Definition at line 10 of file L1GctEmLeafCard.cc.

References m_sorters.

10  : m_id(id), m_sorters(4) {
11  // sorters 0 and 1 are in FPGA U1 and deal with RCT crates 4-8 (13-17)
12  m_sorters.at(0) = new L1GctElectronSorter(5, true);
13  m_sorters.at(1) = new L1GctElectronSorter(5, false);
14 
15  // sorters 2 and 3 are in FPGA U2 and deal with RCT crates 0-3 (9-12)
16  m_sorters.at(2) = new L1GctElectronSorter(4, true);
17  m_sorters.at(3) = new L1GctElectronSorter(4, false);
18 }
int m_id
card ID (0 or 1)
Class that sorts electron candidates.
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
L1GctEmLeafCard::~L1GctEmLeafCard ( )
override

destruct

Definition at line 20 of file L1GctEmLeafCard.cc.

References m_sorters.

20  {
21  delete m_sorters.at(0);
22  delete m_sorters.at(1);
23  delete m_sorters.at(2);
24  delete m_sorters.at(3);
25 }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso

Member Function Documentation

void L1GctEmLeafCard::fetchInput ( )
overridevirtual

fetch input data

Implements L1GctProcessor.

Definition at line 52 of file L1GctEmLeafCard.cc.

References mps_fire::i, m_sorters, and N_SORTERS.

52  {
53  for (unsigned i = 0; i < N_SORTERS; i++) {
54  m_sorters.at(i)->fetchInput();
55  }
56 }
static const unsigned N_SORTERS
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
L1GctElectronSorter* L1GctEmLeafCard::getIsoElectronSorterU1 ( )
inline

Definition at line 58 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

58 { return m_sorters.at(0); }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
L1GctElectronSorter* L1GctEmLeafCard::getIsoElectronSorterU2 ( )
inline

Definition at line 60 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

60 { return m_sorters.at(2); }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
L1GctElectronSorter* L1GctEmLeafCard::getNonIsoElectronSorterU1 ( )
inline

Definition at line 59 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

59 { return m_sorters.at(1); }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
L1GctElectronSorter* L1GctEmLeafCard::getNonIsoElectronSorterU2 ( )
inline

Definition at line 61 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

61 { return m_sorters.at(3); }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
vector< L1GctEmCand > L1GctEmLeafCard::getOutputIsoEmCands ( int  fpga)

get the output candidates

Definition at line 66 of file L1GctEmLeafCard.cc.

References m_sorters.

66  {
67  if (fpga < 2) {
68  return m_sorters.at(2 * fpga)->getOutputCands();
69  } else {
70  return vector<L1GctEmCand>(0);
71  }
72 }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
vector< L1GctEmCand > L1GctEmLeafCard::getOutputNonIsoEmCands ( int  fpga)

get the output candidates

Definition at line 75 of file L1GctEmLeafCard.cc.

References m_sorters.

75  {
76  if (fpga < 2) {
77  return m_sorters.at(2 * fpga + 1)->getOutputCands();
78  } else {
79  return vector<L1GctEmCand>(0);
80  }
81 }
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
int L1GctEmLeafCard::id ( void  )
inline

get ID

Definition at line 47 of file L1GctEmLeafCard.h.

References m_id.

47 { return m_id; }
int m_id
card ID (0 or 1)
void L1GctEmLeafCard::process ( )
overridevirtual

process the event

Implements L1GctProcessor.

Definition at line 59 of file L1GctEmLeafCard.cc.

References mps_fire::i, m_sorters, and N_SORTERS.

59  {
60  for (unsigned i = 0; i < N_SORTERS; i++) {
61  m_sorters.at(i)->process();
62  }
63 }
static const unsigned N_SORTERS
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
void L1GctEmLeafCard::reset ( void  )

clear internal trigger data buffers

clear buffers

Definition at line 28 of file L1GctEmLeafCard.cc.

References mps_fire::i, m_sorters, N_SORTERS, and L1GctProcessor::reset().

28  {
30  for (unsigned i = 0; i < N_SORTERS; i++) {
31  m_sorters.at(i)->reset();
32  }
33 }
void reset()
complete reset of processor
static const unsigned N_SORTERS
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
void L1GctEmLeafCard::resetPipelines ( )
inlineoverrideprotectedvirtual

Implements L1GctProcessor.

Definition at line 66 of file L1GctEmLeafCard.h.

66 {}
void L1GctEmLeafCard::resetProcessor ( )
inlineoverrideprotectedvirtual

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

Implements L1GctProcessor.

Definition at line 65 of file L1GctEmLeafCard.h.

65 {}
void L1GctEmLeafCard::setBxRange ( const int  firstBx,
const int  numberOfBx 
)

define the bunch crossing range to process

partially clear buffers

Definition at line 36 of file L1GctEmLeafCard.cc.

References mps_fire::i, m_sorters, N_SORTERS, and L1GctProcessor::setBxRange().

36  {
37  L1GctProcessor::setBxRange(firstBx, numberOfBx);
38  for (unsigned i = 0; i < N_SORTERS; i++) {
39  m_sorters.at(i)->setBxRange(firstBx, numberOfBx);
40  }
41 }
static const unsigned N_SORTERS
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
void L1GctEmLeafCard::setNextBx ( const int  bxnum)

clear input data buffers and process a new bunch crossing

partially clear buffers

Definition at line 44 of file L1GctEmLeafCard.cc.

References mps_fire::i, m_sorters, N_SORTERS, and L1GctProcessor::setNextBx().

44  {
46  for (unsigned i = 0; i < N_SORTERS; i++) {
47  m_sorters.at(i)->setNextBx(bx);
48  }
49 }
static const unsigned N_SORTERS
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
void setNextBx(const int bxnum)
clear input data buffers and process a new bunch crossing
void L1GctEmLeafCard::setupObjects ( )
inlineoverrideprotectedvirtual

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

Implements L1GctProcessor.

Definition at line 69 of file L1GctEmLeafCard.h.

69 {}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const L1GctEmLeafCard card 
)
friend

overload of cout operator

Member Data Documentation

int L1GctEmLeafCard::m_id
private

card ID (0 or 1)

Definition at line 73 of file L1GctEmLeafCard.h.

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

std::vector<L1GctElectronSorter*> L1GctEmLeafCard::m_sorters
private
const unsigned L1GctEmLeafCard::N_SORTERS = 4
static

Definition at line 22 of file L1GctEmLeafCard.h.

Referenced by fetchInput(), process(), reset(), setBxRange(), and setNextBx().