PixelFEDTestDAC

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
#ifndef _PixelFEDTestDAC_h_
#define _PixelFEDTestDAC_h_
/**
*   \file CalibFormats/SiPixelObjects/interface/PixelFEDTestDAC.h
*   \brief This class implements..
*
*   This class specifies which FED boards
*   are used and how they are addressed
*/

#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <cstdlib>
#include "CalibFormats/SiPixelObjects/interface/PixelCalibBase.h"

namespace pos {

  /*! \ingroup CalibrationObjects
*
*   @{
*
*   \class PixelFEDTestDAC PixelFEDTestDAC.h "interface/PixelFEDTestDAC.h"
*   \brief This class implements..
*
*   A longer explanation will be placed here later
*/
  class PixelFEDTestDAC : public PixelCalibBase {
  public:
    PixelFEDTestDAC(std::string filename);
    PixelFEDTestDAC(std::vector<std::vector<std::string> > &);
    std::string mode() const override { return mode_; }
    std::vector<unsigned int> dacs() { return dacs_; }
    void writeXMLHeader(pos::PixelConfigKey key,
                        int version,
                        std::string path,
                        std::ofstream *out,
                        std::ofstream *out1 = nullptr,
                        std::ofstream *out2 = nullptr) const override;
    void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
    void writeXMLTrailer(std::ofstream *out,
                         std::ofstream *out1 = nullptr,
                         std::ofstream *out2 = nullptr) const override;

  private:
    unsigned int levelEncoder(int level);
    std::vector<unsigned int> decimalToBaseX(unsigned int a, unsigned int x, unsigned int length);
    std::vector<unsigned int> dacs_;
  };
}  // namespace pos
/* @} */
#endif