CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/L1Trigger/GlobalCaloTrigger/interface/L1GctGlobalEnergyAlgos.h

Go to the documentation of this file.
00001 #ifndef L1GCTGLOBALENERGYALGOS_H_
00002 #define L1GCTGLOBALENERGYALGOS_H_
00003 
00004 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtTotal.h"
00005 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtHad.h"
00006 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctEtMiss.h"
00007 
00008 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctProcessor.h"
00009 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctMet.h"
00010 
00011 
00012 #include <vector>
00013 
00014 class L1GctWheelEnergyFpga;
00015 class L1GctWheelJetFpga;
00016 class L1GctGlobalHfSumAlgos;
00017 
00034 class L1GctGlobalEnergyAlgos : public L1GctProcessor
00035 {
00036 public:
00037   
00038         typedef L1GctUnsignedInt< L1GctEtTotal::kEtTotalNBits   > etTotalType;
00039         typedef L1GctUnsignedInt<   L1GctEtHad::kEtHadNBits     > etHadType;
00040         typedef L1GctMet::etMissType     etMissType;
00041         typedef L1GctMet::etMissPhiType  etMissPhiType;
00042         typedef L1GctMet::etmiss_vec     etmiss_vec;
00043         typedef L1GctWheelEnergyFpga::etComponentType etComponentType;
00044 
00045         enum maxValues {
00046           etTotalMaxValue = L1GctEtTotal::kEtTotalMaxValue,
00047           etHadMaxValue   =   L1GctEtHad::kEtHadMaxValue,
00048           etMissMaxValue  =  L1GctEtMiss::kEtMissMaxValue
00049         };
00050 
00052          L1GctGlobalEnergyAlgos(std::vector<L1GctWheelEnergyFpga*> WheelFpga,
00053                                std::vector<L1GctWheelJetFpga*> WheelJetFpga);
00055         ~L1GctGlobalEnergyAlgos();
00056 
00058         friend std::ostream& operator << (std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
00059 
00061         void reset();
00062 
00064         virtual void fetchInput();
00065 
00067         virtual void process();
00068 
00070         void setBxRange(const int firstBx, const int numberOfBx);
00071 
00073         void setNextBx(const int bx);
00074 
00076         void setInputWheelEx(unsigned wheel, int energy, bool overflow);
00078         void setInputWheelEy(unsigned wheel, int energy, bool overflow);
00080         void setInputWheelEt(unsigned wheel, unsigned energy, bool overflow);
00082         void setInputWheelHt(unsigned wheel, unsigned energy, bool overflow);
00084         void setInputWheelHx(unsigned wheel, unsigned energy, bool overflow);
00085         void setInputWheelHy(unsigned wheel, unsigned energy, bool overflow);
00086 
00088         void setInputWheelJc(unsigned wheel, unsigned jcnum, unsigned count);
00089 
00091         L1GctWheelEnergyFpga* getPlusWheelFpga() const { return m_plusWheelFpga; }
00093         L1GctWheelEnergyFpga* getMinusWheelFpga() const { return m_minusWheelFpga; }
00095         L1GctWheelJetFpga* getPlusWheelJetFpga() const { return m_plusWheelJetFpga; }
00097         L1GctWheelJetFpga* getMinusWheelJetFpga() const { return m_minusWheelJetFpga; }
00099         L1GctGlobalHfSumAlgos* getHfSumProcessor() const { return m_hfSumProcessor; }
00100 
00102        inline std::vector< etComponentType > getInputExValPlusWheel() const { return m_exValPlusPipe.contents; }
00104        inline std::vector< etComponentType > getInputEyValPlusWheel() const { return m_eyValPlusPipe.contents; }
00106        inline std::vector< etComponentType > getInputExVlMinusWheel() const { return m_exVlMinusPipe.contents; }
00108        inline std::vector< etComponentType > getInputEyVlMinusWheel() const { return m_eyVlMinusPipe.contents; }
00110         inline std::vector< etTotalType > getInputEtValPlusWheel() const { return m_etValPlusPipe.contents; }
00112         inline std::vector< etHadType   > getInputHtValPlusWheel() const { return m_htValPlusPipe.contents; }
00114         inline std::vector< etComponentType > getInputHxValPlusWheel() const { return m_hxValPlusPipe.contents; }
00115         inline std::vector< etComponentType > getInputHyValPlusWheel() const { return m_hyValPlusPipe.contents; }
00117         inline std::vector< etTotalType > getInputEtVlMinusWheel() const { return m_etVlMinusPipe.contents; }
00119         inline std::vector< etHadType   > getInputHtVlMinusWheel() const { return m_htVlMinusPipe.contents; }
00121         inline std::vector< etComponentType > getInputHxVlMinusWheel() const { return m_hxVlMinusPipe.contents; }
00122         inline std::vector< etComponentType > getInputHyVlMinusWheel() const { return m_hyVlMinusPipe.contents; }
00123 
00126         inline std::vector< etMissType >    getEtMissColl()    const { return m_outputEtMiss.contents; }
00128         inline std::vector< etMissPhiType > getEtMissPhiColl() const { return m_outputEtMissPhi.contents; }
00130         inline std::vector< etTotalType >   getEtSumColl()     const { return m_outputEtSum.contents; }
00132         inline std::vector< etHadType >     getEtHadColl()     const { return m_outputEtHad.contents; }
00134         inline std::vector< etMissType >    getHtMissColl()    const { return m_outputHtMiss.contents; }
00136         inline std::vector< etMissPhiType > getHtMissPhiColl() const { return m_outputHtMissPhi.contents; }
00137 
00138         void setJetFinderParams(const L1GctJetFinderParams* const jfpars);
00139         void setHtMissScale(const L1CaloEtScale* const scale);
00140 
00141         // get the missing Ht LUT (used by L1GctPrintLuts)
00142         const L1GctHtMissLut* getHtMissLut() const { return m_mhtComponents.getHtMissLut(); }
00143 
00145         bool setupOk() const;
00146   
00147  protected:
00149         virtual void resetProcessor();
00150         virtual void resetPipelines();
00151 
00153         virtual void setupObjects() {}
00154         
00155  private:
00156         // Here are the algorithm types we get our inputs from
00157         L1GctWheelEnergyFpga* m_plusWheelFpga;
00158         L1GctWheelEnergyFpga* m_minusWheelFpga;
00159         L1GctWheelJetFpga* m_plusWheelJetFpga;
00160         L1GctWheelJetFpga* m_minusWheelJetFpga;
00161 
00162         // Here's the class that does the Hf sums
00163         L1GctGlobalHfSumAlgos* m_hfSumProcessor;
00164 
00165         // Missing Et and missing Ht
00166         L1GctMet m_metComponents;
00167         L1GctMet m_mhtComponents;
00168 
00169         // input data
00170         etComponentType m_exValPlusWheel;
00171         etComponentType m_eyValPlusWheel;
00172         etTotalType m_etValPlusWheel;
00173         etHadType   m_htValPlusWheel;
00174         etComponentType m_hxValPlusWheel;
00175         etComponentType m_hyValPlusWheel;
00176 
00177         etComponentType m_exVlMinusWheel;
00178         etComponentType m_eyVlMinusWheel;
00179         etTotalType m_etVlMinusWheel;
00180         etHadType   m_htVlMinusWheel;
00181         etComponentType m_hxVlMinusWheel;
00182         etComponentType m_hyVlMinusWheel;
00183 
00184         // stored copies of input data
00185         Pipeline< etComponentType > m_exValPlusPipe;
00186         Pipeline< etComponentType > m_eyValPlusPipe;
00187         Pipeline< etTotalType > m_etValPlusPipe;
00188         Pipeline< etHadType >   m_htValPlusPipe;
00189         Pipeline< etComponentType > m_hxValPlusPipe;
00190         Pipeline< etComponentType > m_hyValPlusPipe;
00191 
00192         Pipeline< etComponentType > m_exVlMinusPipe;
00193         Pipeline< etComponentType > m_eyVlMinusPipe;
00194         Pipeline< etTotalType > m_etVlMinusPipe;
00195         Pipeline< etHadType >   m_htVlMinusPipe;
00196         Pipeline< etComponentType > m_hxVlMinusPipe;
00197         Pipeline< etComponentType > m_hyVlMinusPipe;
00198 
00199         // output data
00200         Pipeline<etMissType>    m_outputEtMiss;
00201         Pipeline<etMissPhiType> m_outputEtMissPhi;
00202         Pipeline<etTotalType>   m_outputEtSum;
00203         Pipeline<etHadType>     m_outputEtHad;
00204         Pipeline<etMissType>    m_outputHtMiss;
00205         Pipeline<etMissPhiType> m_outputHtMissPhi;
00206 
00207         bool m_setupOk;
00208 
00209 };
00210 
00211 std::ostream& operator << (std::ostream& os, const L1GctGlobalEnergyAlgos& fpga);
00212 
00213 #endif /*L1GCTGLOBALENERGYALGOS_H_*/