CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CalibFormats/SiPixelObjects/interface/PixelROCTrimBits.h

Go to the documentation of this file.
00001 #ifndef PixelROCTrimBits_h
00002 #define PixelROCTrimBits_h
00003 
00009 #include <sstream>
00010 #include <fstream>
00011 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
00012 #include <string>
00013 
00014 namespace pos{
00020   class PixelROCTrimBits {
00021 
00022   public:
00023 
00024     PixelROCTrimBits();
00025 
00026     void setROCTrimBits(PixelROCName rocid ,std::string bits);
00027 
00028     int read(PixelROCName rocid, std::string in);
00029     int read(PixelROCName rocid, std::ifstream& in);
00030     int read(PixelROCName rocid, std::istringstream& in);
00031 
00032     int readBinary(PixelROCName rocid, std::ifstream& in);
00033 
00034     friend std::ostream& operator<<(std::ostream& s, const PixelROCTrimBits& trimbits);
00035 
00036     unsigned int trim(unsigned int col, unsigned int row) const;
00037 
00038     void setTrim(unsigned int col, unsigned int row, unsigned int trim);
00039 
00040     void writeBinary(std::ofstream& out) const;
00041 
00042     void writeASCII(std::ofstream& out) const;
00043     void writeXML(  std::ofstream* out) const;
00044 
00045     PixelROCName name() const {return rocid_;}
00046 
00047   private:
00048 
00049     unsigned char bits_[2080];
00050     PixelROCName rocid_;
00051 
00052 
00053   };
00054 
00055 }
00056 #endif