CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/L1CaloTrigger/interface/L1CaloMipQuietRegion.h

Go to the documentation of this file.
00001 #ifndef L1CALOMIPQUIETREGION_H
00002 #define L1CALOMIPQUIETREGION_H
00003 
00004 #include <ostream>
00005 
00006 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
00007 
00017 class L1CaloMipQuietRegion
00018 {
00019 public:
00020 
00021   // ** Constructors/Destructors **
00022 
00024   L1CaloMipQuietRegion();
00025 
00027   L1CaloMipQuietRegion(bool mip, bool quiet, unsigned crate, unsigned card, unsigned rgn, int16_t bx);
00028 
00030   L1CaloMipQuietRegion(bool mip, bool quiet, unsigned ieta, unsigned iphi, int16_t bx=0);
00031 
00033   ~L1CaloMipQuietRegion() {}
00034   
00035   
00036   // ** Operators **
00037   
00039   bool operator==(const L1CaloMipQuietRegion& rhs) const;
00040 
00042   bool operator!=(const L1CaloMipQuietRegion& rhs) const { return !(*this == rhs); }
00043 
00044 
00045   // ** Get methods for the data **
00046 
00047   uint8_t raw() const { return m_data; }  
00048 
00049   bool mip() const { return (m_data & 0x1)!=0; }  
00050 
00051   bool quiet() const { return ((m_data>>1) & 0x1)!=0; }  
00052   
00053   int16_t bx() const { return m_bx; }  
00054 
00055 
00056   // ** Set methods for the data **
00057 
00058   void setMip(bool mip) { mip ? m_data|=1 : m_data&=~1; }  
00059 
00060   void setQuiet(bool quiet) { quiet ? m_data|=2 : m_data&=~2; }  
00061 
00062   void setBx(int16_t bx) { m_bx = bx; }  
00063 
00064 
00065   // ** Get methods for geographical information **
00066 
00067   L1CaloRegionDetId id() const { return m_id; }  
00068 
00069   unsigned rctCrate() const { return m_id.rctCrate(); }  
00070 
00071   unsigned rctCard() const { return m_id.rctCard(); }  
00072 
00073   unsigned rctRegionIndex() const { return m_id.rctRegion(); }  
00074 
00075   unsigned rctEta() const { return m_id.rctEta(); }  
00076 
00077   unsigned rctPhi() const { return m_id.rctPhi(); }  
00078 
00079   unsigned gctEta() const { return m_id.ieta(); }  
00080 
00081   unsigned gctPhi() const { return m_id.iphi(); }  
00082 
00083 
00084   // ** Misc **
00085 
00087   bool empty() const { return false; }
00088 
00090   void reset() { m_data = 0; m_bx = 0; }
00091 
00092 
00093 private:
00094 
00095   // ** Private Data **
00096   
00097   L1CaloRegionDetId m_id;  
00098   
00099   uint8_t m_data;  
00100   
00101   int16_t m_bx;  
00102 
00103 
00104   // ** Private Methods **
00105   
00107   void pack(bool mip, bool quiet) { m_data = (mip?1:0)|(quiet?2:0); }
00108 
00109 };  
00110 
00112 std::ostream& operator<< (std::ostream& os, const L1CaloMipQuietRegion& rhs);
00113 
00114 
00115 
00116 #endif /*L1CALOMIPQUIETREGION_H*/