Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PixelROCTrimBits_h
0002 #define PixelROCTrimBits_h
0003 /*! \file CalibFormats/SiPixelObjects/interface/PixelROCTrimBits.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 "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
0012 #include <string>
0013 
0014 namespace pos {
0015   /*! \class PixelROCTrimBits PixelROCTrimBits.h "interface/PixelROCTrimBits.h"
0016 *   \brief This class implements..
0017 *
0018 *   A longer explanation will be placed here later
0019 */
0020   class PixelROCTrimBits;
0021   std::ostream& operator<<(std::ostream& s, const PixelROCTrimBits& trimbits);
0022 
0023   class PixelROCTrimBits {
0024   public:
0025     PixelROCTrimBits();
0026 
0027     void setROCTrimBits(PixelROCName rocid, std::string bits);
0028 
0029     int read(PixelROCName rocid, std::string in);
0030     int read(PixelROCName rocid, std::ifstream& in);
0031     int read(PixelROCName rocid, std::istringstream& in);
0032 
0033     int readBinary(PixelROCName rocid, std::ifstream& in);
0034 
0035     friend std::ostream& operator<<(std::ostream& s, const PixelROCTrimBits& trimbits);
0036 
0037     unsigned int trim(unsigned int col, unsigned int row) const;
0038 
0039     void setTrim(unsigned int col, unsigned int row, unsigned int trim);
0040 
0041     void writeBinary(std::ofstream& out) const;
0042 
0043     void writeASCII(std::ofstream& out) const;
0044     void writeXML(std::ofstream* out) const;
0045 
0046     PixelROCName name() const { return rocid_; }
0047 
0048   private:
0049     unsigned char bits_[2080];
0050     PixelROCName rocid_;
0051   };
0052 
0053 }  // namespace pos
0054 #endif