Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef _PixelFEDTestDAC_h_
0002 #define _PixelFEDTestDAC_h_
0003 /**
0004 *   \file CalibFormats/SiPixelObjects/interface/PixelFEDTestDAC.h
0005 *   \brief This class implements..
0006 *
0007 *   This class specifies which FED boards
0008 *   are used and how they are addressed
0009 */
0010 
0011 #include <iostream>
0012 #include <string>
0013 #include <vector>
0014 #include <fstream>
0015 #include <cstdlib>
0016 #include "CalibFormats/SiPixelObjects/interface/PixelCalibBase.h"
0017 
0018 namespace pos {
0019 
0020   /*! \ingroup CalibrationObjects
0021 *
0022 *   @{
0023 *
0024 *   \class PixelFEDTestDAC PixelFEDTestDAC.h "interface/PixelFEDTestDAC.h"
0025 *   \brief This class implements..
0026 *
0027 *   A longer explanation will be placed here later
0028 */
0029   class PixelFEDTestDAC : public PixelCalibBase {
0030   public:
0031     PixelFEDTestDAC(std::string filename);
0032     PixelFEDTestDAC(std::vector<std::vector<std::string> > &);
0033     std::string mode() const override { return mode_; }
0034     std::vector<unsigned int> dacs() { return dacs_; }
0035     void writeXMLHeader(pos::PixelConfigKey key,
0036                         int version,
0037                         std::string path,
0038                         std::ofstream *out,
0039                         std::ofstream *out1 = nullptr,
0040                         std::ofstream *out2 = nullptr) const override;
0041     void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0042     void writeXMLTrailer(std::ofstream *out,
0043                          std::ofstream *out1 = nullptr,
0044                          std::ofstream *out2 = nullptr) const override;
0045 
0046   private:
0047     unsigned int levelEncoder(int level);
0048     std::vector<unsigned int> decimalToBaseX(unsigned int a, unsigned int x, unsigned int length);
0049     std::vector<unsigned int> dacs_;
0050   };
0051 }  // namespace pos
0052 /* @} */
0053 #endif