CMS 3D CMS Logo

PixelPortCardConfig.h

Go to the documentation of this file.
00001 #ifndef PixelTKPCIFECConfig_h
00002 #define PixelTKPCIFECConfig_h
00003 
00009 #include <vector>
00010 #include <string>
00011 #include <map>
00012 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00013 
00014 namespace pos{
00015 
00027   class PixelPortCardConfig: public PixelConfigBase{
00028 
00029   public:
00030   
00031     PixelPortCardConfig(std::vector < std::vector< std::string> >  &tableMat);
00032     PixelPortCardConfig(std::string);
00033 
00034     void         writeASCII(std::string dir="") const;
00035     void         writeXML(      pos::PixelConfigKey key, int version, std::string path)                     const {;}
00036     virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
00037     virtual void writeXML(                                                              std::ofstream *out) const {;}
00038     virtual void writeXMLTrailer(                                                       std::ofstream *out) const {;}
00039   
00040     const std::string& getPortCardName() const { return portcardname_; }
00041     void setPortCardName(std::string newName) { portcardname_ = newName; }
00042     
00043     unsigned int getdevicesize() const;
00044     std::string  getTKFECID() const;
00045     unsigned int getringAddress() const;
00046     unsigned int getccuAddress() const;
00047     unsigned int getchannelAddress() const;
00048     unsigned int geti2cSpeed() const;
00049     std::string  gettype() const;
00050     unsigned int getdeviceAddress(unsigned int i) const;
00051     unsigned int getdeviceValues(unsigned int i) const;
00052     unsigned int getdeviceAddressForSetting(std::string settingName) const;
00053     unsigned int getdeviceValuesForSetting(std::string settingName) const;
00054     unsigned int getdeviceValuesForAddress(unsigned int address) const;
00055     unsigned int getAOHBias(unsigned int AOHNumber) const {return getdeviceValuesForAddress(AOHBiasAddressFromAOHNumber(AOHNumber));}
00056     void setdeviceValues(unsigned int address, unsigned int value);
00057     void setdeviceValues(std::string settingName, unsigned int value);
00058   
00059     unsigned int AOHBiasAddressFromAOHNumber(unsigned int AOHNumber) const;
00060     unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const;
00061     
00062     void setAOHGain(unsigned int AOHNumber, unsigned int value) {setAOHGain(AOHGainStringFromAOHNumber(AOHNumber),value);}
00063     unsigned int getAOHGain(unsigned int AOHNumber) const;
00064     
00065     unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const;
00066     
00067   private:
00068     void fillNameToAddress();
00069     void fillDBToFileAddress();
00070 
00071     bool containsDeviceAddress(unsigned int deviceAddress) const;
00072     bool containsSetting(std::string settingName) const { return containsDeviceAddress(getdeviceAddressForSetting(settingName)); }
00073 
00074     void setAOHGain(std::string settingName, unsigned int value);
00075     void setDataBaseAOHGain(std::string settingName, unsigned int value);
00076     std::string AOHGainStringFromAOHNumber(unsigned int AOHNumber) const;
00077 
00078     std::string portcardname_;
00079  
00080     std::string  TKFECID_;//FEC ID string, as defined in tkfecconfig.dat
00081     unsigned int ringAddress_;//ring #
00082     unsigned int ccuAddress_;//CCU #
00083 
00084     unsigned int channelAddress_;//there are 8? channels on a CCU board
00085     std::vector < std::pair<unsigned int, unsigned int> > device_;//the address on the portcard, and the value of it
00086     unsigned int i2cSpeed_;//for the portcard, the slow i2c speed is 100kHz
00087   
00088     std::string type_; // fpix or bpix, used to determine setting names and addresses
00089   
00090     std::map<std::string, unsigned int> nameToAddress_; // translation from name to address, filled in by fillNameToAddress();
00091     std::map<std::string, std::string> nameDBtoFileConversion_; // filled by fillDBToFileAddress() ;
00092   };
00093 }
00094 /* @} */
00095 #endif

Generated on Tue Jun 9 17:25:24 2009 for CMSSW by  doxygen 1.5.4