CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DataFormats/L1GlobalCaloTrigger/interface/L1GctJetCand.h

Go to the documentation of this file.
00001 #ifndef L1GCTJETCAND_H
00002 #define L1GCTJETCAND_H
00003 
00004 #include <ostream>
00005 #include <string>
00006 
00007 #include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCand.h"
00008 
00009 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
00010 
00016 
00017 
00018 class L1GctJetCand : public L1GctCand {
00019 public:
00021   L1GctJetCand();
00022 
00024   L1GctJetCand(uint16_t rawData, bool isTau, bool isFor);
00025 
00027   L1GctJetCand(uint16_t rawData, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
00028 
00031   L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor);
00032 
00035   L1GctJetCand(unsigned rank, unsigned phi, unsigned eta, bool isTau, bool isFor, uint16_t block, uint16_t index, int16_t bx);
00036 
00038   virtual ~L1GctJetCand();
00039 
00041   L1CaloRegionDetId regionId() const;
00042 
00044   std::string name() const;
00045 
00047   bool empty() const  { return (rank() == 0); }
00048 
00050   uint16_t raw() const { return m_data; }
00051   
00053   unsigned rank() const  { return m_data & 0x3f; }
00054 
00056   unsigned etaIndex() const { return (m_data>>6) & 0xf; }
00057 
00059   unsigned etaSign() const { return (m_data>>9) & 0x1; }
00060   
00062   unsigned phiIndex() const  { return (m_data>>10) & 0x1f; }
00063 
00065   bool isCentral() const { return (!m_isTau) && (!m_isFor); }
00066 
00068   bool isTau() const { return m_isTau; }
00069 
00071   bool isForward() const { return m_isFor; }
00072 
00074   unsigned capBlock() const { return m_captureBlock; }
00075 
00077   unsigned capIndex() const { return m_captureIndex; }
00078 
00080   int16_t bx() const { return m_bx; }
00081 
00083   int operator==(const L1GctJetCand& c) const { return ((m_data==c.raw() && 
00084                                                 m_isTau==c.isTau() && m_isFor==c.isForward())
00085                                                  || (this->empty() && c.empty())); }
00086 
00088   int operator!=(const L1GctJetCand& c) const { return !(*this == c); }
00089 
00090 private:
00091 
00092   uint16_t m_data;
00093   bool m_isTau;
00094   bool m_isFor;
00095   uint16_t m_captureBlock;
00096   uint8_t m_captureIndex;
00097   int16_t m_bx;
00098 
00099  };
00100 
00101 std::ostream& operator<<(std::ostream& s, const L1GctJetCand& cand);
00102 
00103 #endif