CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
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  struct rank_gt : public std::binary_function<prioritisedEmCand, prioritisedEmCand, bool> {
54  return ( x.rank() > y.rank() || ( (x.rank() == y.rank()) && (x.priority < y.priority) ) ) ;
55  }
56  };
57 
59  L1GctElectronSorter(int nInputs, bool iso);
64  virtual void fetchInput();
67  virtual void process();
70  void setInputEmCand(const L1CaloEmCand& cand);
73  inline std::vector<L1CaloEmCand> getInputCands() { return m_inputCands; }
76  inline std::vector<L1GctEmCand> getOutputCands() { return m_outputCands; }
79  friend std::ostream& operator<<(std::ostream& s,const L1GctElectronSorter& card);
80  protected:
81 
83  virtual void resetProcessor();
84  virtual void resetPipelines() {}
85 
87  virtual void setupObjects();
88 
89  private:
92  int m_id;
98  std::vector<L1CaloEmCand> m_inputCands;
101  std::vector<L1GctEmCand> m_outputCands;
102 
103 };
104 
105 std::ostream& operator<<(std::ostream& s,const L1GctElectronSorter& card);
106 #endif /*L1GCTELECTRONSORTER_H_*/
virtual void resetProcessor()
Separate reset methods for the processor itself and any data stored in pipelines. ...
std::vector< L1GctEmCand > m_outputCands
output data
bool m_isolation
type of electron to sort (isolated = 0 or non isolated = 1)
unsigned rank() const
get rank bits
Definition: L1GctEmCand.h:61
std::vector< L1GctEmCand > getOutputCands()
get output candidates
L1GctElectronSorter(int nInputs, bool iso)
constructor; set type (isolated or non-isolated)
virtual void setupObjects()
Initialise inputs with null objects for the correct bunch crossing if required.
Level-1 Region Calorimeter Trigger EM candidate.
Definition: L1CaloEmCand.h:18
bool operator()(const prioritisedEmCand &x, const prioritisedEmCand &y)
std::vector< L1CaloEmCand > m_inputCands
input data
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
Level-1 Trigger EM candidate at output of GCT.
Definition: L1GctEmCand.h:22
ABC for a GCT trigger data processing unit.
virtual void process()
process the data, fill output buffers
std::vector< L1CaloEmCand > getInputCands()
virtual void fetchInput()
get input data from sources
Class that sorts electron candidates.
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)
virtual void resetPipelines()
x
Definition: VDTMath.h:216
prioritisedEmCand(L1GctEmCand &c, unsigned short p)