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 00027 00028 namespace pos{ 00060 class PixelDACSettings: public PixelConfigBase { 00061 00062 public: 00063 00064 PixelDACSettings(std::string filename); 00065 //Added by Umesh 00066 PixelDACSettings(std::vector<std::vector<std::string> >& tableMat); 00067 // modified by MR on 10-01-2008 14:47:47 00068 PixelDACSettings(PixelROCDACSettings &rocname); 00069 // modified by MR on 24-01-2008 14:28:14 00070 void addROC(PixelROCDACSettings &rocname); 00071 00072 PixelROCDACSettings getDACSettings(int ROCId) const; 00073 PixelROCDACSettings* getDACSettings(PixelROCName); 00074 00075 unsigned int numROCs() {return dacsettings_.size();} 00076 00077 //Generate the DAC settings 00078 void generateConfiguration(PixelFECConfigInterface* pixelFEC, 00079 PixelNameTranslation* trans) const; 00080 00081 void writeBinary(std::string filename) const; 00082 00083 void writeASCII(std::string dir) const; 00084 void writeXML( pos::PixelConfigKey key, int version, std::string path) const ; 00085 virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const ; 00086 virtual void writeXML( std::ofstream *out) const ; 00087 virtual void writeXMLTrailer( std::ofstream *out) const ; 00088 00089 friend std::ostream& operator<<(std::ostream& s, const PixelDACSettings& mask); 00090 00091 private: 00092 00093 std::vector<PixelROCDACSettings> dacsettings_; 00094 00095 }; 00096 } 00097 00098 /* @} */ 00099 #endif