CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondFormats/Calibration/interface/mySiStripNoises.h

Go to the documentation of this file.
00001 #ifndef mySiStripNoises_h
00002 #define mySiStripNoises_h
00003 
00004 #include<vector>
00005 #include<map>
00006 //#include<iostream>
00007 #include<boost/cstdint.hpp>
00008 
00009 
00010 //typedef float SiStripNoise;
00011 //typedef bool  SiStripDisable;
00012 
00013 class mySiStripNoises {
00014 
00015  public:
00016   mySiStripNoises(){}
00017   ~mySiStripNoises(){}
00018 
00019  
00020   struct DetRegistry{
00021     uint32_t detid;
00022     uint32_t ibegin;
00023     uint32_t iend;
00024   };
00025   class StrictWeakOrdering{
00026   public:
00027     bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
00028   };
00029   typedef std::vector<unsigned char>                       SiStripNoiseVector;
00030   typedef SiStripNoiseVector::const_iterator               ContainerIterator;  
00031   typedef std::pair<ContainerIterator, ContainerIterator>  Range;      
00032   typedef std::vector<DetRegistry>                         Registry;
00033   typedef Registry::const_iterator                         RegistryIterator;
00034   typedef const std::vector<short>                         InputVector;
00035   
00036   bool put(const uint32_t detID,InputVector & input);
00037   const Range getRange(const uint32_t& detID) const;
00038   void getDetIds(std::vector<uint32_t>& DetIds) const;
00039   float getNoise  (const uint16_t& strip, const Range& range) const;
00040   void  setData(float noise_, std::vector<short>& vped);
00041   // private:
00042   //SiStripNoiseVector v_noises;
00043   //Registry indexes;
00044   void     encode(InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
00045   uint16_t decode (const uint16_t& strip, const Range& range) const;
00046   std::vector<unsigned char>  v_noises;
00047   std::vector<DetRegistry> indexes;
00048 };
00049 
00050 #endif