CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/L1Trigger/GlobalCaloTrigger/interface/L1GctGlobalHfSumAlgos.h

Go to the documentation of this file.
00001 #ifndef L1GCTGLOBALHFSUMALGOS_H_
00002 #define L1GCTGLOBALHFSUMALGOS_H_
00003 
00004 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
00005 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetFinderBase.h"
00006 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctHfEtSumsLut.h"
00007 
00008 #include <vector>
00009 #include <map>
00010 
00011 class L1GctWheelJetFpga;
00012 class L1GctHfLutSetup;
00013 class L1GctHfBitCountsLut;
00014 
00027 class L1GctGlobalHfSumAlgos : public L1GctProcessor
00028 {
00029  public:
00030 
00031   typedef L1GctJetFinderBase::hfTowerSumsType hfTowerSumsType;
00032   
00034   L1GctGlobalHfSumAlgos(std::vector<L1GctWheelJetFpga*> WheelJetFpga);
00036   ~L1GctGlobalHfSumAlgos();
00037 
00039   friend std::ostream& operator << (std::ostream& os, const L1GctGlobalHfSumAlgos& fpga);
00040 
00042   virtual void fetchInput();
00043 
00045   virtual void process();
00046 
00048   std::vector<uint16_t> hfSumsOutput(const L1GctHfEtSumsLut::hfLutType type) const;
00049   std::vector<unsigned> hfSumsWord() const;
00050 
00052   void setupLuts(const L1CaloEtScale* scale);
00053 
00055   const L1GctHfBitCountsLut* getBCLut(const L1GctHfEtSumsLut::hfLutType type) const;
00056   const L1GctHfEtSumsLut* getESLut(const L1GctHfEtSumsLut::hfLutType type) const;
00057 
00059   std::vector<double> getThresholds(const L1GctHfEtSumsLut::hfLutType type) const;
00060 
00062   L1GctWheelJetFpga* getPlusWheelJetFpga() const { return m_plusWheelJetFpga; }
00064   L1GctWheelJetFpga* getMinusWheelJetFpga() const { return m_minusWheelJetFpga; }
00065 
00067   bool setupOk() const { return m_setupOk; }
00068   
00069  protected:
00071   virtual void resetProcessor();
00072   virtual void resetPipelines();
00073 
00075   virtual void setupObjects() {}
00076         
00077  private:
00078   // Here are the algorithm types we get our inputs from
00079   L1GctWheelJetFpga* m_plusWheelJetFpga;
00080   L1GctWheelJetFpga* m_minusWheelJetFpga;
00081 
00082   // Here are the lookup tables
00083   std::map<L1GctHfEtSumsLut::hfLutType, const L1GctHfBitCountsLut*> m_bitCountLuts;
00084   std::map<L1GctHfEtSumsLut::hfLutType, const L1GctHfEtSumsLut*> m_etSumLuts;
00085 
00086   // Input data for one bunch crossing
00087   hfTowerSumsType m_hfInputSumsPlusWheel;
00088   hfTowerSumsType m_hfInputSumsMinusWheel;
00089 
00090   // Output data
00091   std::map<L1GctHfEtSumsLut::hfLutType, Pipeline<uint16_t> > m_hfOutputSumsPipe;
00092 
00093   bool m_setupOk;
00094 
00095   // private methods
00096   // Convert bit count value using LUT and store in the pipeline
00097   void storeBitCount(L1GctHfEtSumsLut::hfLutType type, uint16_t value);
00098   // Convert et sum value using LUT and store in the pipeline
00099   void storeEtSum(L1GctHfEtSumsLut::hfLutType type, uint16_t value);
00100 
00101 };
00102 
00103 std::ostream& operator << (std::ostream& os, const L1GctGlobalHfSumAlgos& fpga);
00104 
00105 #endif /*L1GCTGLOBALHFSUMALGOS_H_*/