CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h

Go to the documentation of this file.
00001 #ifndef PixelDetectorConfig_h
00002 #define PixelDetectorConfig_h
00003 
00011 //
00012 // This class specifies which detector
00013 // components are used in the configuration
00014 // (and eventually should specify which 
00015 // xdaq process controlls which components).
00016 // 
00017 //
00018 //
00019 //
00020 
00021 #include <vector>
00022 #include <set>
00023 #include <map>
00024 #include <string>
00025 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00026 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
00027 #include "CalibFormats/SiPixelObjects/interface/PixelHdwAddress.h"
00028 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
00029 #include "CalibFormats/SiPixelObjects/interface/PixelROCStatus.h"
00030 
00031 namespace pos{
00039   class PixelDetectorConfig: public PixelConfigBase {
00040 
00041   public:
00042 
00043     PixelDetectorConfig(std::vector< std::vector < std::string> > &tableMat);
00044     PixelDetectorConfig(std::string filename);
00045 
00046     unsigned int getNModules() const;
00047 
00048     PixelModuleName getModule(unsigned int i) const;
00049 
00050     const std::vector <PixelModuleName>& getModuleList() const { return modules_; }
00051 
00052     void addROC(   PixelROCName &, std::string statusLabel)                             ; 
00053     void addROC(   PixelROCName &)                                                      ; 
00054     void removeROC(PixelROCName &)                                                      ; 
00055     const std::map<PixelROCName, PixelROCStatus>& getROCsList() const { return rocs_; } ; 
00056 
00057     void writeASCII(std::string dir="") const;
00058     void         writeXML(        pos::PixelConfigKey key, int version, std::string path) const ;
00059     virtual void writeXMLHeader(  pos::PixelConfigKey key, 
00060                                   int version, 
00061                                   std::string path, 
00062                                   std::ofstream *out,
00063                                   std::ofstream *out1 = NULL,
00064                                   std::ofstream *out2 = NULL
00065                                   ) const ;
00066     virtual void writeXML(        std::ofstream *out,                                                       
00067                                   std::ofstream *out1 = NULL ,
00068                                   std::ofstream *out2 = NULL )  const ;
00069     virtual void writeXMLTrailer( std::ofstream *out, 
00070                                   std::ofstream *out1 = NULL,
00071                                   std::ofstream *out2 = NULL
00072                                   ) const ;
00073 
00074     bool containsModule(const PixelModuleName& moduleToFind) const ;
00075 
00076     std::set <unsigned int> getFEDs(PixelNameTranslation* translation) const;
00077     std::map <unsigned int, std::set<unsigned int> > getFEDsAndChannels(PixelNameTranslation* translation) const;
00078 
00079     //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
00080 
00081   private:
00082 
00083     std::vector<PixelModuleName> modules_;   
00084 
00085     std::map<PixelROCName, PixelROCStatus> rocs_;
00086  
00087   };
00088 }
00089 /* @} */
00090 #endif