Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PixelDACSettings_h
0002 #define PixelDACSettings_h
0003 /**
0004 * \file CalibFormats/SiPixelObjects/interface/PixelDACSettings.h
0005 *   \brief This class provide a base class for the pixel ROC dac data for the pixel FEC configuration
0006 *
0007 *   This is a pure interface (abstract class) that needs to have an implementation.
0008 */
0009 
0010 //
0011 // This class provide a base class for the
0012 // pixel ROC dac data for the pixel FEC configuration
0013 // This is a pure interface (abstract class) that
0014 // needs to have an implementation.
0015 //
0016 //
0017 //
0018 
0019 #include <vector>
0020 #include <string>
0021 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0022 #include "CalibFormats/SiPixelObjects/interface/PixelROCDACSettings.h"
0023 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h"
0024 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
0025 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0026 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
0027 
0028 namespace pos {
0029   /*!  \defgroup ConfigurationObjects "Configuration Objects"
0030 *   \brief This is the base class of all configuration objects
0031 *    
0032 *   A longer explanation of what a 'configuration object' actually is will be 
0033 *   posted here once we find the time to write it....
0034 *
0035 *  @{
0036 *
0037 *  \class PixelDACSettings PixelDACSettings.h
0038 *  \brief This class is responsible for manipulating the DACsettings of a ROC.
0039 *
0040 *  This is a placeholder for a lengthy description of the class, it's methods
0041 *  behavior and additional stuff like images. This description can be arbitrary
0042 *  long and complex, see for eg. \ref page3Sect3. <P>
0043 *  Ut perspiciatis, unde omnis iste natus error sit voluptatem 
0044 *  accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab 
0045 *  illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. 
0046 *
0047 *  \image html temp.png
0048 *
0049 *  Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, 
0050 *  sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, 
0051 *  neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, 
0052 *  adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et 
0053 *  dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum 
0054 *  exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi 
0055 *  consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, 
0056 *  quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo 
0057 *  voluptas nulla pariatur? 
0058 */
0059 
0060   class PixelDACSettings : public PixelConfigBase {
0061   public:
0062     PixelDACSettings(std::string filename);
0063     //Added by Umesh
0064     PixelDACSettings(std::vector<std::vector<std::string> >& tableMat);
0065     // modified by MR on 10-01-2008 14:47:47
0066     PixelDACSettings(PixelROCDACSettings& rocname);
0067     // modified by MR on 24-01-2008 14:28:14
0068     void addROC(PixelROCDACSettings& rocname);
0069 
0070     PixelROCDACSettings getDACSettings(int ROCId) const;
0071     PixelROCDACSettings* getDACSettings(PixelROCName);
0072 
0073     unsigned int numROCs() { return dacsettings_.size(); }
0074 
0075     //Generate the DAC settings
0076     void generateConfiguration(PixelFECConfigInterface* pixelFEC,
0077                                PixelNameTranslation* trans,
0078                                PixelDetectorConfig* detconfig,
0079                                bool HVon = true) const;
0080     void setVcthrDisable(PixelFECConfigInterface* pixelFEC, PixelNameTranslation* trans) const;
0081     void setVcthrEnable(PixelFECConfigInterface* pixelFEC,
0082                         PixelNameTranslation* trans,
0083                         PixelDetectorConfig* detconfig) const;
0084 
0085     void writeBinary(std::string filename) const;
0086 
0087     void writeASCII(std::string dir) const override;
0088     void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0089     void writeXMLHeader(pos::PixelConfigKey key,
0090                         int version,
0091                         std::string path,
0092                         std::ofstream* out,
0093                         std::ofstream* out1 = nullptr,
0094                         std::ofstream* out2 = nullptr) const override;
0095     void writeXML(std::ofstream* out, std::ofstream* out1 = nullptr, std::ofstream* out2 = nullptr) const override;
0096     void writeXMLTrailer(std::ofstream* out,
0097                          std::ofstream* out1 = nullptr,
0098                          std::ofstream* out2 = nullptr) const override;
0099 
0100     friend std::ostream& operator<<(std::ostream& s, const PixelDACSettings& mask);
0101 
0102   private:
0103     std::vector<PixelROCDACSettings> dacsettings_;
0104 
0105     bool rocIsDisabled(const PixelDetectorConfig* detconfig, const PixelROCName rocname) const;
0106   };
0107 }  // namespace pos
0108 
0109 /* @} */
0110 #endif