00001 #ifndef L1GCTWHEELJETFPGA_H_ 00002 #define L1GCTWHEELJETFPGA_H_ 00003 00017 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h" 00018 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtHad.h" 00019 00020 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h" 00021 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetLeafCard.h" 00022 00023 #include "L1Trigger/GlobalCaloTrigger/src/L1GctUnsignedInt.h" 00024 00025 class L1GctJetSorter; 00026 00027 #include <vector> 00028 00029 class L1GctWheelJetFpga : public L1GctProcessor 00030 { 00031 public: 00032 typedef std::vector<L1GctJetCand> JetVector; 00033 typedef L1GctTwosComplement< L1GctInternHtMiss::kMissHxOrHyNBits > htComponentType; 00034 typedef L1GctJetLeafCard::hfTowerSumsType hfTowerSumsType; 00035 00037 static const int MAX_JETS_OUT; 00038 00040 static const unsigned int MAX_LEAF_CARDS; 00041 00043 static const unsigned int MAX_JETS_PER_LEAF; 00044 00046 L1GctWheelJetFpga(int id, 00047 std::vector<L1GctJetLeafCard*> inputLeafCards); 00048 00050 ~L1GctWheelJetFpga(); 00051 00053 friend std::ostream& operator << (std::ostream& os, const L1GctWheelJetFpga& fpga); 00054 00056 virtual void fetchInput(); 00057 00059 virtual void process(); 00060 00062 void setInputJet(int i, L1GctJetCand jet); 00063 00065 JetVector getInputJets() const { return m_inputJets; } 00066 00068 htComponentType inputHx(unsigned leafnum) const { return m_inputHx.at(leafnum); } 00069 htComponentType inputHy(unsigned leafnum) const { return m_inputHy.at(leafnum); } 00070 00072 hfTowerSumsType inputHfSums(unsigned leafnum) const { return m_inputHfSums.at(leafnum); } 00073 00075 JetVector getCentralJets() const { return m_centralJets; } 00076 00078 JetVector getForwardJets() const { return m_forwardJets; } 00079 00081 JetVector getTauJets() const { return m_tauJets; } 00082 00084 htComponentType getOutputHx() const { return m_outputHx; } 00085 htComponentType getOutputHy() const { return m_outputHy; } 00086 00088 hfTowerSumsType getOutputHfSums() const { return m_outputHfSums; } 00089 00091 bool setupOk() const { return checkSetup(); } 00092 00094 std::vector< L1GctInternHtMiss > getInternalHtMiss() const; 00095 00096 protected: 00097 00099 virtual void resetProcessor(); 00100 virtual void resetPipelines(); 00101 00103 virtual void setupObjects(); 00104 00105 private: 00106 00107 static const int MAX_JETS_IN; 00108 00110 int m_id; 00111 00113 std::vector<L1GctJetLeafCard*> m_inputLeafCards; 00114 00116 L1GctJetSorter* m_centralJetSorter; 00117 L1GctJetSorter* m_forwardJetSorter; 00118 L1GctJetSorter* m_tauJetSorter; 00119 00121 JetVector m_inputJets; 00122 00123 // Holds the all the various inputted jets, re-addressed using proper GCT->GT jet addressing 00124 JetVector m_rawCentralJets; 00125 JetVector m_rawForwardJets; 00126 JetVector m_rawTauJets; 00127 00128 // input Ht component sums from each leaf card 00129 std::vector< htComponentType > m_inputHx; 00130 std::vector< htComponentType > m_inputHy; 00131 00132 // input Hf Et sums from each leaf card 00133 std::vector< hfTowerSumsType > m_inputHfSums; 00134 00135 // output data 00136 JetVector m_centralJets; 00137 JetVector m_forwardJets; 00138 JetVector m_tauJets; 00139 00140 // data sent to GlobalEnergyAlgos 00141 htComponentType m_outputHx; 00142 htComponentType m_outputHy; 00143 hfTowerSumsType m_outputHfSums; 00144 00145 Pipeline< htComponentType > m_outputHxPipe; 00146 Pipeline< htComponentType > m_outputHyPipe; 00147 00148 //PRIVATE METHODS 00150 bool checkSetup() const; 00152 void storeJets(JetVector jets, unsigned short iLeaf, unsigned short offset); 00154 void classifyJets(); 00156 void setupJetsVectors(const int16_t bx); 00157 }; 00158 00159 std::ostream& operator << (std::ostream& os, const L1GctWheelJetFpga& fpga); 00160 00161 #endif /*L1GCTWHEELJETFPGA_H_*/