CMS 3D CMS Logo

L1GctWheelJetFpga.h
Go to the documentation of this file.
1 #ifndef L1GCTWHEELJETFPGA_H_
2 #define L1GCTWHEELJETFPGA_H_
3 
19 
22 
24 
25 class L1GctJetSorter;
26 
27 #include <vector>
28 
30 {
31 public:
32  typedef std::vector<L1GctJetCand> JetVector;
35 
37  static const int MAX_JETS_OUT;
38 
40  static const unsigned int MAX_LEAF_CARDS;
41 
43  static const unsigned int MAX_JETS_PER_LEAF;
44 
46  L1GctWheelJetFpga(int id,
47  const std::vector<L1GctJetLeafCard*>& inputLeafCards);
48 
50  ~L1GctWheelJetFpga() override;
51 
53  friend std::ostream& operator << (std::ostream& os, const L1GctWheelJetFpga& fpga);
54 
56  void fetchInput() override;
57 
59  void process() override;
60 
62  void setInputJet(int i, const L1GctJetCand& jet);
63 
65  JetVector getInputJets() const { return m_inputJets; }
66 
68  htComponentType inputHx(unsigned leafnum) const { return m_inputHx.at(leafnum); }
69  htComponentType inputHy(unsigned leafnum) const { return m_inputHy.at(leafnum); }
70 
72  hfTowerSumsType inputHfSums(unsigned leafnum) const { return m_inputHfSums.at(leafnum); }
73 
75  JetVector getCentralJets() const { return m_centralJets; }
76 
78  JetVector getForwardJets() const { return m_forwardJets; }
79 
81  JetVector getTauJets() const { return m_tauJets; }
82 
84  htComponentType getOutputHx() const { return m_outputHx; }
85  htComponentType getOutputHy() const { return m_outputHy; }
86 
88  hfTowerSumsType getOutputHfSums() const { return m_outputHfSums; }
89 
91  bool setupOk() const { return checkSetup(); }
92 
94  std::vector< L1GctInternHtMiss > getInternalHtMiss() const;
95 
96  protected:
97 
99  void resetProcessor() override;
100  void resetPipelines() override;
101 
103  void setupObjects() override;
104 
105 private:
106 
107  static const int MAX_JETS_IN;
108 
110  int m_id;
111 
113  std::vector<L1GctJetLeafCard*> m_inputLeafCards;
114 
119 
121  JetVector m_inputJets;
122 
123  // Holds the all the various inputted jets, re-addressed using proper GCT->GT jet addressing
124  JetVector m_rawCentralJets;
125  JetVector m_rawForwardJets;
126  JetVector m_rawTauJets;
127 
128  // input Ht component sums from each leaf card
129  std::vector< htComponentType > m_inputHx;
130  std::vector< htComponentType > m_inputHy;
131 
132  // input Hf Et sums from each leaf card
133  std::vector< hfTowerSumsType > m_inputHfSums;
134 
135  // output data
136  JetVector m_centralJets;
137  JetVector m_forwardJets;
138  JetVector m_tauJets;
139 
140  // data sent to GlobalEnergyAlgos
141  htComponentType m_outputHx;
142  htComponentType m_outputHy;
143  hfTowerSumsType m_outputHfSums;
144 
147 
148  //PRIVATE METHODS
150  bool checkSetup() const;
152  void storeJets(const JetVector& jets, unsigned short iLeaf, unsigned short offset);
154  void classifyJets();
156  void setupJetsVectors(const int16_t bx);
157 };
158 
159 std::ostream& operator << (std::ostream& os, const L1GctWheelJetFpga& fpga);
160 
161 #endif /*L1GCTWHEELJETFPGA_H_*/
hfTowerSumsType inputHfSums(unsigned leafnum) const
get the input Hf Sums
L1GctWheelJetFpga(int id, const std::vector< L1GctJetLeafCard * > &inputLeafCards)
id must be 0 / 1 for -ve/+ve eta halves of CMS
L1GctJetLeafCard::hfTowerSumsType hfTowerSumsType
void setupJetsVectors(const int16_t bx)
Initialises all the jet vectors with jets of the correct type.
htComponentType m_outputHy
void setupObjects() override
Initialise inputs with null objects for the correct bunch crossing if required.
htComponentType getOutputHy() const
JetVector getTauJets() const
get the output jets
JetVector getCentralJets() const
get the output jets
Represents a GCT Wheel Jet FPGA.
L1GctTwosComplement< L1GctInternHtMiss::kMissHxOrHyNBits > htComponentType
static const unsigned int MAX_LEAF_CARDS
Max number of leaf card pointers.
std::vector< htComponentType > m_inputHy
void process() override
process the data, fill output buffers
Level-1 Trigger jet candidate.
Definition: L1GctJetCand.h:18
JetVector m_inputJets
input data. Jets 0-5 from leaf card 0, jetfinderA. Jets 6-11 from leaf card 0, jetfinder B...
htComponentType inputHy(unsigned leafnum) const
void fetchInput() override
get input data from sources
std::vector< L1GctInternHtMiss > getInternalHtMiss() const
get the Et sums in internal component format
std::vector< L1GctJetCand > JetVector
void resetPipelines() override
ABC for a GCT trigger data processing unit.
void resetProcessor() override
Separate reset methods for the processor itself and any data stored in pipelines. ...
void storeJets(const JetVector &jets, unsigned short iLeaf, unsigned short offset)
Puts the output from a jetfinder into the correct index range of the m_inputJets array.
htComponentType inputHx(unsigned leafnum) const
get the input Ht components
L1GctJetSorter * m_centralJetSorter
Jet sorters.
Pipeline< htComponentType > m_outputHyPipe
vector< PseudoJet > jets
htComponentType m_outputHx
friend std::ostream & operator<<(std::ostream &os, const L1GctWheelJetFpga &fpga)
Overload << operator.
std::vector< hfTowerSumsType > m_inputHfSums
Pipeline< htComponentType > m_outputHxPipe
hfTowerSumsType getOutputHfSums() const
get the output Hf Sums
std::vector< htComponentType > m_inputHx
JetVector getInputJets() const
get the input jets. Jets 0-5 from leaf card 0, jetfinderA. Jets 6-11 from leaf card 0...
void setInputJet(int i, const L1GctJetCand &jet)
set input data
~L1GctWheelJetFpga() override
destructor
static const int MAX_JETS_IN
Maximum number of jets we can have as input.
static const int MAX_JETS_OUT
Max number of jets of each type we output.
htComponentType getOutputHx() const
get the output Ht components
std::vector< L1GctJetLeafCard * > m_inputLeafCards
the jet leaf cards
L1GctJetSorter * m_tauJetSorter
JetVector getForwardJets() const
get the output jets
hfTowerSumsType m_outputHfSums
bool checkSetup() const
Check the setup, independently of how we have been constructed.
static const unsigned int MAX_JETS_PER_LEAF
Max number of jets input from each leaf card.
L1GctJetSorter * m_forwardJetSorter
void classifyJets()
Classifies jets into central, forward or tau.
bool setupOk() const
Public access to setup check.