CMS 3D CMS Logo

PixelFECConfig.h

Go to the documentation of this file.
00001 #ifndef PixelFECConfig_h
00002 #define PixelFECConfig_h
00003 
00009 #include <iostream>
00010 #include <vector>
00011 #include <string>
00012 #include <cassert>
00013 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00014 #include "CalibFormats/SiPixelObjects/interface/PixelFECParameters.h"
00015 
00016 namespace pos{
00024   class PixelFECConfig: public PixelConfigBase {
00025 
00026   public:
00027 
00028     PixelFECConfig(std::string filename);  //  <---- Modified for the conversion from parallel vectors to object that contain the configuration
00029    
00030     PixelFECConfig(std::vector<std::vector<std::string> >& tableMat ); 
00031 
00032     unsigned int getNFECBoards() const;
00033 
00034     unsigned int getFECNumber(unsigned int i) const;
00035     unsigned int getCrate(unsigned int i) const;
00036     unsigned int getVMEBaseAddress(unsigned int i) const;
00037     unsigned int crateFromFECNumber(unsigned int fecnumber) const;
00038     unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const;
00039     unsigned int getFECSlot(unsigned int i) {return FECSlotFromVMEBaseAddress(getVMEBaseAddress(i));}
00040     unsigned int FECSlotFromFECNumber(unsigned int fecnumber) {return FECSlotFromVMEBaseAddress(VMEBaseAddressFromFECNumber(fecnumber));}
00041 
00042     void writeASCII(std::string dir="") const;
00043     void         writeXML(      pos::PixelConfigKey key, int version, std::string path)                     const {;}
00044     virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
00045     virtual void writeXML(                                                              std::ofstream *out) const {;}
00046     virtual void writeXMLTrailer(                                                       std::ofstream *out) const {;}
00047 
00048     //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
00049 
00050   private:
00051 
00052     // VMEBaseAddress = (FEC slot)x(0x8000000)
00053     unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress) {assert(VMEBaseAddress%0x8000000 == 0); return VMEBaseAddress/0x8000000;}
00054 
00055     //Already fixed from parallel vectors to vector of objects .... the object that contains the FEC config is PixelFECParameters       
00056    
00057     //    std::vector<unsigned int> fecnumber_;   
00058     //    std::vector<unsigned int> crate_;   
00059     //    std::vector<unsigned int> vmebaseaddress_;
00060     
00061     std::vector< PixelFECParameters > fecconfig_;
00062     
00063     
00064  
00065   };
00066 }
00067 /* @} */
00068 #endif

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