CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/CondFormats/SiStripObjects/interface/SiStripDetVOff.h

Go to the documentation of this file.
00001 #ifndef SiStripDetVOff_h
00002 #define SiStripDetVOff_h
00003 
00004 #include<vector>
00005 #include<map>
00006 #include<iostream>
00007 #include<boost/cstdint.hpp>
00008 #include <string>
00009 
00027 class SiStripDetVOff
00028 {
00029  public:
00030 
00031   typedef std::vector<uint32_t>::iterator       vOffIterator;
00032   typedef std::vector<uint32_t>::const_iterator constVoffIterator;
00033   typedef std::vector<int>::const_iterator     constVboolIterator;
00034 
00035   // Bitmasks used to retrieve LV and HV information
00036   static const short LVmask = 0x1;    // <--- 01
00037   static const unsigned int LVonMask = 0xFFFFFFFE;    // <--- the last 4 bits are 1110. All the other bits are 1.
00038   static const short HVmask = 0x2;    // <--- 10
00039   static const unsigned int HVonMask = 0xFFFFFFFD;    // <--- the last 4 bits are 1101. All the other bits are 1.
00040   static const unsigned int allOnMask = 0x03;   // <--- 2 bits are 11.
00041   static const unsigned int eightBitMask = 0xFFFFFFFF;
00042   static const short bitShift = 2;
00043 
00044   SiStripDetVOff() {}
00045   ~SiStripDetVOff() {}
00046   SiStripDetVOff( const SiStripDetVOff & toCopy ) { toCopy.getVoff(v_Voff); }
00047 
00049   void getVoff(std::vector<uint32_t>& vOff_) const { vOff_ = v_Voff; }
00050 
00052   bool put(const uint32_t DetId, const int HVoff, const int LVoff);
00053 
00055   bool put(std::vector<uint32_t>& DetId, std::vector<int>& HVoff, std::vector<int>& LVoff);
00056 
00057   bool operator == (const SiStripDetVOff& d) const { return d.v_Voff==v_Voff; } 
00058 
00059   void getDetIds(std::vector<uint32_t>& DetIds_) const;
00060 
00062   bool IsModuleVOff(const uint32_t DetID) const;
00063 
00064   bool IsModuleHVOff(const uint32_t DetID) const;
00065 
00066   bool IsModuleLVOff(const uint32_t DetID) const;
00067 
00068   void printDebug(std::stringstream & ss) const;
00069   void printSummary(std::stringstream & ss) const;
00070 
00072   int getLVoffCounts() const;
00074   int getHVoffCounts() const;
00075 
00077   void setBits( uint32_t & enDetId, const int HVoff, const int LVoff );
00078 
00079  private:
00080 
00081   std::vector<uint32_t> v_Voff; 
00082 };
00083 
00084 #endif