CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/L1Trigger/GlobalCaloTrigger/interface/L1GctWheelEnergyFpga.h

Go to the documentation of this file.
00001 #ifndef L1GCTWHEELENERGYFPGA_H_
00002 #define L1GCTWHEELENERGYFPGA_H_
00003 
00004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtTotal.h"
00005 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
00006 
00007 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
00008 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetLeafCard.h"
00009 #include "L1Trigger/GlobalCaloTrigger/src/L1GctTwosComplement.h"
00010 #include "L1Trigger/GlobalCaloTrigger/src/L1GctUnsignedInt.h"
00011 
00012 #include <vector>
00013 
00014 class L1GctJetLeafCard;
00015 
00030 class L1GctWheelEnergyFpga : public L1GctProcessor
00031 {
00032 public:
00034         typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etTotalType;
00035         typedef L1GctUnsignedInt<L1GctInternEtSum::kTotEtOrHtNBits> etHadType;
00036         typedef L1GctTwosComplement<  L1GctInternEtSum::kMissExOrEyNBits > etComponentType;
00037 
00038         enum maxValues {
00039           etTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue,
00040           htTotalMaxValue = L1GctInternEtSum::kTotEtOrHtMaxValue
00041         };
00042 
00044         static const unsigned int MAX_LEAF_CARDS;
00045 
00047         L1GctWheelEnergyFpga(int id, std::vector<L1GctJetLeafCard*> leafCards);
00049         ~L1GctWheelEnergyFpga();
00050 
00052         friend std::ostream& operator << (std::ostream& os, const L1GctWheelEnergyFpga& fpga);
00053 
00055         virtual void fetchInput();
00056 
00058         virtual void process();
00059 
00061         void setInputEnergy(unsigned i, int ex, int ey, unsigned et, unsigned ht);
00062 
00064         L1GctJetLeafCard* getinputLeafCard(unsigned leafnum) const { return m_inputLeafCards.at(leafnum); }
00065 
00067         inline etComponentType getInputEx(unsigned leafnum) const { return m_inputEx.at(leafnum); }
00069         inline etComponentType getInputEy(unsigned leafnum) const { return m_inputEy.at(leafnum); }
00071         inline etTotalType getInputEt(unsigned leafnum) const { return m_inputEt.at(leafnum); }
00073         inline etHadType inputHt(unsigned leafnum) const { return m_inputHt.at(leafnum); }
00074 
00076         inline etComponentType getOutputEx() const { return m_outputEx; }
00078         inline etComponentType getOutputEy() const { return m_outputEy; }
00080         inline etTotalType getOutputEt() const { return m_outputEt; }    
00082         inline etHadType getOutputHt() const { return m_outputHt; }
00083 
00085         std::vector< L1GctInternEtSum  > getInternalEtSums() const;
00086 
00088         bool setupOk() const { return m_setupOk; }
00089 
00090  protected:
00091 
00093         virtual void resetProcessor();
00094         virtual void resetPipelines();
00095 
00097         virtual void setupObjects() {}
00098 
00099  private:
00100 
00103         int m_id;
00106         std::vector<L1GctJetLeafCard*> m_inputLeafCards;
00109         std::vector< etComponentType > m_inputEx;
00110         std::vector< etComponentType > m_inputEy;
00111         std::vector< etTotalType > m_inputEt;
00112         std::vector< etHadType > m_inputHt;
00115         etComponentType m_outputEx;
00116         etComponentType m_outputEy;
00117         etTotalType m_outputEt;
00118         etHadType m_outputHt;
00119         
00121         bool m_setupOk;
00122 
00124         Pipeline< etComponentType > m_outputExPipe;
00125         Pipeline< etComponentType > m_outputEyPipe;
00126         Pipeline< etTotalType     > m_outputEtPipe;     
00127         Pipeline< etHadType       > m_outputHtPipe;     
00128 };
00129 
00130 std::ostream& operator << (std::ostream& os, const L1GctWheelEnergyFpga& fpga);
00131 
00132 #endif /*L1GCTWHEELENERGYFPGA_H_*/