Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:13

0001 #ifndef PixelTBMSettings_h
0002 #define PixelTBMSettings_h
0003 /**
0004 * \file CalibFormats/SiPixelObjects/interface/PixelTBMSettings.h
0005 * \brief This class implements..
0006 *
0007 *   A longer explanation will be placed here later
0008 *
0009 */
0010 
0011 #include <vector>
0012 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0013 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h"
0014 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0015 
0016 namespace pos {
0017   /*!  \ingroup ConfigurationObjects "Configuration Objects"
0018 *    
0019 *  @{
0020 *
0021 *  \class PixelTBMSettings PixelTBMSettings.h
0022 *  \brief This is the documentation about PixelTBMSettings...
0023 *
0024 *   A longer explanation will be placed here later
0025 *
0026 */
0027   class PixelTBMSettings : public PixelConfigBase {
0028   public:
0029     PixelTBMSettings(std::vector<std::vector<std::string> > &tableMat);
0030     PixelTBMSettings(std::string filename);
0031     // modified by MR on 29-04-2008 16:43:30
0032     PixelTBMSettings() : PixelConfigBase("", "", "") { ; }
0033 
0034     ~PixelTBMSettings() override {}
0035 
0036     //Generate the DAC settings
0037     void generateConfiguration(PixelFECConfigInterface *pixelFEC,
0038                                PixelNameTranslation *trans,
0039                                bool physics = false,
0040                                bool doResets = true) const;
0041 
0042     void writeBinary(std::string filename) const;
0043 
0044     void writeASCII(std::string dir) const override;
0045     void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0046     void writeXMLHeader(pos::PixelConfigKey key,
0047                         int version,
0048                         std::string path,
0049                         std::ofstream *out,
0050                         std::ofstream *out1 = nullptr,
0051                         std::ofstream *out2 = nullptr) const override;
0052     void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0053     void writeXMLTrailer(std::ofstream *out,
0054                          std::ofstream *out1 = nullptr,
0055                          std::ofstream *out2 = nullptr) const override;
0056 
0057     unsigned char getAnalogInputBias() const { return analogInputBias_; }
0058     void setAnalogInputBias(unsigned char analogInputBias) { analogInputBias_ = analogInputBias; }
0059 
0060     unsigned char getAnalogOutputBias() const { return analogOutputBias_; }
0061     void setAnalogOutputBias(unsigned char analogOutputBias) { analogOutputBias_ = analogOutputBias; }
0062 
0063     unsigned char getAnalogOutputGain() const { return analogOutputGain_; }
0064     void setAnalogOutputGain(unsigned char analogOutputGain) { analogOutputGain_ = analogOutputGain; }
0065 
0066     // Added by Dario (Apr 2008)
0067     bool getMode(void) const { return singlemode_; }
0068     void setMode(bool mode) { singlemode_ = mode; }
0069     PixelROCName const &getROCName() const { return rocid_; }
0070     void setROCName(std::string rocname) {
0071       PixelROCName tmp(rocname);
0072       rocid_ = tmp;
0073     }
0074     void setTBMGenericValue(std::string, int);
0075 
0076   private:
0077     PixelROCName rocid_;
0078     PixelModuleName moduleId_;
0079 
0080     unsigned char analogInputBias_;
0081     unsigned char analogOutputBias_;
0082     unsigned char analogOutputGain_;
0083     bool singlemode_;
0084   };
0085 
0086   std::ostream &operator<<(std::ostream &s, const PixelTBMSettings &mask);
0087 }  // namespace pos
0088 /* @} */
0089 #endif