CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/CalibFormats/SiPixelObjects/interface/PixelDACSettings.h

Go to the documentation of this file.
00001 #ifndef PixelDACSettings_h
00002 #define PixelDACSettings_h
00003 
00010 //
00011 // This class provide a base class for the
00012 // pixel ROC dac data for the pixel FEC configuration
00013 // This is a pure interface (abstract class) that
00014 // needs to have an implementation.
00015 //
00016 //
00017 //
00018 
00019 #include <vector>
00020 #include <string>
00021 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00022 #include "CalibFormats/SiPixelObjects/interface/PixelROCDACSettings.h"
00023 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h"
00024 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
00025 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
00026 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
00027 
00028 
00029 namespace pos{
00061   class PixelDACSettings: public PixelConfigBase {
00062 
00063   public:
00064 
00065     PixelDACSettings(std::string filename);
00066     //Added by Umesh
00067     PixelDACSettings(std::vector<std::vector<std::string> >& tableMat);   
00068     // modified by MR on 10-01-2008 14:47:47
00069     PixelDACSettings(PixelROCDACSettings &rocname);
00070     // modified by MR on 24-01-2008 14:28:14
00071     void addROC(PixelROCDACSettings &rocname);
00072     
00073     PixelROCDACSettings getDACSettings(int ROCId) const;
00074     PixelROCDACSettings* getDACSettings(PixelROCName);
00075 
00076     unsigned int numROCs() {return dacsettings_.size();}
00077 
00078     //Generate the DAC settings
00079     void generateConfiguration(PixelFECConfigInterface* pixelFEC,
00080                                PixelNameTranslation* trans, PixelDetectorConfig* detconfig, bool HVon=true) const;
00081     void setVcthrDisable(PixelFECConfigInterface* pixelFEC, PixelNameTranslation* trans) const;
00082     void setVcthrEnable(PixelFECConfigInterface* pixelFEC, PixelNameTranslation* trans, PixelDetectorConfig* detconfig) const;
00083 
00084     void writeBinary(std::string filename) const;
00085 
00086     void         writeASCII(std::string dir) const;
00087     void         writeXML(        pos::PixelConfigKey key, int version, std::string path) const  {;}
00088     virtual void writeXMLHeader(  pos::PixelConfigKey key, 
00089                                   int version, 
00090                                   std::string path, 
00091                                   std::ofstream *out,
00092                                   std::ofstream *out1 = NULL,
00093                                   std::ofstream *out2 = NULL
00094                                   ) const ;
00095     virtual void writeXML(        std::ofstream *out,                                                       
00096                                   std::ofstream *out1 = NULL ,         
00097                                   std::ofstream *out2 = NULL ) const ; 
00098     virtual void writeXMLTrailer( std::ofstream *out, 
00099                                   std::ofstream *out1 = NULL,
00100                                   std::ofstream *out2 = NULL
00101                                   ) const ;
00102 
00103     friend std::ostream& operator<<(std::ostream& s, const PixelDACSettings& mask);
00104 
00105   private:
00106 
00107     std::vector<PixelROCDACSettings> dacsettings_;
00108 
00109     bool rocIsDisabled(const PixelDetectorConfig* detconfig, const PixelROCName rocname) const;
00110 
00111   };
00112 }
00113 
00114 /* @} */
00115 #endif