Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:23

0001 #ifndef PixelROCMaskBits_h
0002 #define PixelROCMaskBits_h
0003 /*! \file CalibFormats/SiPixelObjects/interface/PixelROCMaskBits.h
0004 *   \brief This class implements..
0005 *
0006 *   A longer explanation will be placed here later
0007 */
0008 
0009 #include <sstream>
0010 #include <fstream>
0011 #include <string>
0012 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
0013 
0014 namespace pos {
0015 
0016   class PixelROCMaskBits;
0017   std::ostream& operator<<(std::ostream& s, const PixelROCMaskBits& maskbits);
0018 
0019   /*! \class PixelROCMaskBits PixelROCMaskBits.h "interface/PixelROCMaskBits.h"
0020 *   \brief This class implements..
0021 *
0022 *   A longer explanation will be placed here later
0023 */
0024   class PixelROCMaskBits {
0025   public:
0026     PixelROCMaskBits();
0027 
0028     void setROCMaskBits(PixelROCName& rocid, std::string bits);
0029 
0030     int read(const PixelROCName& rocid, std::string in);
0031     int read(const PixelROCName& rocid, std::ifstream& in);
0032     int read(const PixelROCName& rocid, std::istringstream& in);
0033 
0034     int readBinary(const PixelROCName& rocid, std::ifstream& in);
0035 
0036     unsigned int mask(unsigned int col, unsigned int row) const;
0037 
0038     void setMask(unsigned int col, unsigned int row, unsigned int mask);
0039 
0040     void writeBinary(std::ofstream& out) const;
0041 
0042     void writeASCII(std::ofstream& out) const;
0043     void writeXML(std::ofstream* out) const;
0044 
0045     PixelROCName name() const { return rocid_; }
0046 
0047     friend std::ostream& operator<<(std::ostream& s, const PixelROCMaskBits& maskbits);
0048 
0049   private:
0050     PixelROCName rocid_;
0051     unsigned char bits_[520];
0052   };
0053 }  // namespace pos
0054 
0055 #endif