PixelROCMaskBits

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#ifndef PixelROCMaskBits_h
#define PixelROCMaskBits_h
/*! \file CalibFormats/SiPixelObjects/interface/PixelROCMaskBits.h
*   \brief This class implements..
*
*   A longer explanation will be placed here later
*/

#include <sstream>
#include <fstream>
#include <string>
#include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"

namespace pos {

  class PixelROCMaskBits;
  std::ostream& operator<<(std::ostream& s, const PixelROCMaskBits& maskbits);

  /*! \class PixelROCMaskBits PixelROCMaskBits.h "interface/PixelROCMaskBits.h"
*   \brief This class implements..
*
*   A longer explanation will be placed here later
*/
  class PixelROCMaskBits {
  public:
    PixelROCMaskBits();

    void setROCMaskBits(PixelROCName& rocid, std::string bits);

    int read(const PixelROCName& rocid, std::string in);
    int read(const PixelROCName& rocid, std::ifstream& in);
    int read(const PixelROCName& rocid, std::istringstream& in);

    int readBinary(const PixelROCName& rocid, std::ifstream& in);

    unsigned int mask(unsigned int col, unsigned int row) const;

    void setMask(unsigned int col, unsigned int row, unsigned int mask);

    void writeBinary(std::ofstream& out) const;

    void writeASCII(std::ofstream& out) const;
    void writeXML(std::ofstream* out) const;

    PixelROCName name() const { return rocid_; }

    friend std::ostream& operator<<(std::ostream& s, const PixelROCMaskBits& maskbits);

  private:
    PixelROCName rocid_;
    unsigned char bits_[520];
  };
}  // namespace pos

#endif