CMS 3D CMS Logo

L1GctEmLeafCard.cc
Go to the documentation of this file.
2 #include <vector>
3 
4 using std::endl;
5 using std::ostream;
6 using std::vector;
7 
8 const unsigned L1GctEmLeafCard::N_SORTERS = 4;
9 
10 L1GctEmLeafCard::L1GctEmLeafCard(int id) : 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 }
19 
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 }
26 
30  for (unsigned i = 0; i < N_SORTERS; i++) {
31  m_sorters.at(i)->reset();
32  }
33 }
34 
36 void L1GctEmLeafCard::setBxRange(const int firstBx, const int numberOfBx) {
37  L1GctProcessor::setBxRange(firstBx, numberOfBx);
38  for (unsigned i = 0; i < N_SORTERS; i++) {
39  m_sorters.at(i)->setBxRange(firstBx, numberOfBx);
40  }
41 }
42 
44 void L1GctEmLeafCard::setNextBx(const int bx) {
46  for (unsigned i = 0; i < N_SORTERS; i++) {
47  m_sorters.at(i)->setNextBx(bx);
48  }
49 }
50 
53  for (unsigned i = 0; i < N_SORTERS; i++) {
54  m_sorters.at(i)->fetchInput();
55  }
56 }
57 
60  for (unsigned i = 0; i < N_SORTERS; i++) {
61  m_sorters.at(i)->process();
62  }
63 }
64 
66 vector<L1GctEmCand> L1GctEmLeafCard::getOutputIsoEmCands(int fpga) {
67  if (fpga < 2) {
68  return m_sorters.at(2 * fpga)->getOutputCands();
69  } else {
70  return vector<L1GctEmCand>(0);
71  }
72 }
73 
75 vector<L1GctEmCand> L1GctEmLeafCard::getOutputNonIsoEmCands(int fpga) {
76  if (fpga < 2) {
77  return m_sorters.at(2 * fpga + 1)->getOutputCands();
78  } else {
79  return vector<L1GctEmCand>(0);
80  }
81 }
82 
83 ostream& operator<<(ostream& s, const L1GctEmLeafCard& card) {
84  s << "===L1GctEmLeafCard===" << endl;
85  s << "ID = " << card.m_id << endl;
86  s << "No of Electron Sorters = " << card.m_sorters.size() << endl;
87  for (unsigned i = 0; i < card.m_sorters.size(); i++) {
88  s << std::endl;
89  s << "===ElectronSorter===" << std::endl;
90  s << "ElectronSorter no: " << i << endl << (*card.m_sorters.at(i));
91  }
92  s << endl;
93  return s;
94 }
L1GctEmLeafCard::getOutputNonIsoEmCands
std::vector< L1GctEmCand > getOutputNonIsoEmCands(int fpga)
get the output candidates
Definition: L1GctEmLeafCard.cc:75
mps_fire.i
i
Definition: mps_fire.py:428
L1GctProcessor::setNextBx
void setNextBx(const int bxnum)
clear input data buffers and process a new bunch crossing
Definition: L1GctProcessor.h:51
operator<<
ostream & operator<<(ostream &s, const L1GctEmLeafCard &card)
Definition: L1GctEmLeafCard.cc:83
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
L1GctProcessor::setBxRange
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
Definition: L1GctProcessor.h:44
L1GctEmLeafCard::m_sorters
std::vector< L1GctElectronSorter * > m_sorters
processing - 0,2 are iso sorters, 1,3 are non-iso
Definition: L1GctEmLeafCard.h:76
L1GctEmLeafCard::getOutputIsoEmCands
std::vector< L1GctEmCand > getOutputIsoEmCands(int fpga)
get the output candidates
Definition: L1GctEmLeafCard.cc:66
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1GctEmLeafCard::setBxRange
void setBxRange(const int firstBx, const int numberOfBx)
define the bunch crossing range to process
Definition: L1GctEmLeafCard.cc:36
L1GctEmLeafCard::N_SORTERS
static const unsigned N_SORTERS
Definition: L1GctEmLeafCard.h:22
L1GctProcessor::reset
void reset()
complete reset of processor
Definition: L1GctProcessor.h:28
L1GctEmLeafCard.h
L1GctEmLeafCard::setNextBx
void setNextBx(const int bxnum)
clear input data buffers and process a new bunch crossing
Definition: L1GctEmLeafCard.cc:44
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
L1GctElectronSorter
Class that sorts electron candidates.
Definition: L1GctElectronSorter.h:26
L1GctEmLeafCard::L1GctEmLeafCard
L1GctEmLeafCard(int id)
construct with ID
Definition: L1GctEmLeafCard.cc:10
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
L1GctEmLeafCard
Emulates a leaf card programmed for electron sorting.
Definition: L1GctEmLeafCard.h:20
L1GctEmLeafCard::fetchInput
void fetchInput() override
fetch input data
Definition: L1GctEmLeafCard.cc:52
L1GctEmLeafCard::~L1GctEmLeafCard
~L1GctEmLeafCard() override
destruct
Definition: L1GctEmLeafCard.cc:20
L1GctEmLeafCard::process
void process() override
process the event
Definition: L1GctEmLeafCard.cc:59
L1GctEmLeafCard::reset
void reset()
clear internal trigger data buffers
Definition: L1GctEmLeafCard.cc:28
L1GctEmLeafCard::m_id
int m_id
card ID (0 or 1)
Definition: L1GctEmLeafCard.h:73