CMS 3D CMS Logo

L1GctElectronSorter.h
Go to the documentation of this file.
1 #ifndef L1GCTELECTRONSORTER_H_
2 #define L1GCTELECTRONSORTER_H_
3 
5 
8 
9 #include <vector>
10 
11 
28 {
29  public:
30 
35 
38  unsigned short priority;
39 
40  // Define some constructors
41  prioritisedEmCand() : emCand(), priority(0) {}
42  prioritisedEmCand(L1GctEmCand& c, unsigned short p) : emCand(c), priority(p) {}
43  prioritisedEmCand(L1CaloEmCand& c, unsigned short p) : emCand(c), priority(p) {}
44 
45  // Enable some methods
46  unsigned rank() const { return emCand.rank(); }
47 
48  };
49 
52  static bool rankByGt(const prioritisedEmCand& x, const prioritisedEmCand& y) {
53  return ( x.rank() > y.rank() || ( (x.rank() == y.rank()) && (x.priority < y.priority) ) ) ;
54  }
55 
57  L1GctElectronSorter(int nInputs, bool iso);
59  ~L1GctElectronSorter() override;
62  void fetchInput() override;
65  void process() override;
68  void setInputEmCand(const L1CaloEmCand& cand);
71  inline std::vector<L1CaloEmCand> getInputCands() { return m_inputCands; }
74  inline std::vector<L1GctEmCand> getOutputCands() { return m_outputCands; }
77  friend std::ostream& operator<<(std::ostream& s,const L1GctElectronSorter& card);
78  protected:
79 
81  void resetProcessor() override;
82  void resetPipelines() override {}
83 
85  void setupObjects() override;
86 
87  private:
90  int m_id;
96  std::vector<L1CaloEmCand> m_inputCands;
99  std::vector<L1GctEmCand> m_outputCands;
100 
101 };
102 
103 std::ostream& operator<<(std::ostream& s,const L1GctElectronSorter& card);
104 #endif /*L1GCTELECTRONSORTER_H_*/
static bool rankByGt(const prioritisedEmCand &x, const prioritisedEmCand &y)
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
std::vector< L1GctEmCand > m_outputCands
output data
bool m_isolation
type of electron to sort (isolated = 0 or non isolated = 1)
std::vector< L1GctEmCand > getOutputCands()
get output candidates
L1GctElectronSorter(int nInputs, bool iso)
constructor; set type (isolated or non-isolated)
void resetPipelines() override
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:18
std::vector< L1CaloEmCand > m_inputCands
input data
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
ABC for a GCT trigger data processing unit.
unsigned rank() const override
get rank bits
Definition: L1GctEmCand.h:61
std::vector< L1CaloEmCand > getInputCands()
void process() override
process the data, fill output buffers
Class that sorts electron candidates.
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines. ...
void fetchInput() override
get input data from sources
void setInputEmCand(const L1CaloEmCand &cand)
set input candidate
friend std::ostream & operator<<(std::ostream &s, const L1GctElectronSorter &card)
overload of cout operator
int m_id
algo ID (is it FPGA 1 or 2 processing)
prioritisedEmCand(L1CaloEmCand &c, unsigned short p)
prioritisedEmCand(L1GctEmCand &c, unsigned short p)