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