00001 #ifndef PixelPortcardMap_h
00002 #define PixelPortcardMap_h
00003
00011 #include <string>
00012 #include <vector>
00013 #include <map>
00014 #include <set>
00015 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00016 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
00017 #include "CalibFormats/SiPixelObjects/interface/PixelTBMChannel.h"
00018 #include "CalibFormats/SiPixelObjects/interface/PixelChannel.h"
00019
00020 namespace pos{
00031 class PixelPortcardMap: public PixelConfigBase
00032 {
00033 public:
00034
00035 PixelPortcardMap(std::string filename);
00036
00037 PixelPortcardMap(std::vector< std::vector < std::string> > &tableMat);
00038
00039 virtual ~PixelPortcardMap();
00040
00041
00042 const std::set< std::pair< std::string, int > > PortCardAndAOHs(const PixelModuleName& aModule) const;
00043
00044
00045 const std::set< std::string > portcards(const PixelModuleName& aModule) const;
00046
00047 int numChannels(const PixelModuleName& aModule) {return PortCardAndAOHs(aModule).size();}
00048
00049 const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName& aModule, const std::string& TBMChannel) const;
00050 const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName& aModule, const PixelTBMChannel& TBMChannel) const;
00051 const std::pair< std::string, int > PortCardAndAOH(const PixelChannel& aChannel) const;
00052
00053
00054 std::set< PixelModuleName > modules(std::string portCardName) const;
00055
00056
00057 std::set< std::string > portcards();
00058
00059 virtual void writeASCII(std::string dir) const;
00060 void writeXML( pos::PixelConfigKey key, int version, std::string path) const {;}
00061 virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
00062 virtual void writeXML( std::ofstream *out) const {;}
00063 virtual void writeXMLTrailer( std::ofstream *out) const {;}
00064
00065 private:
00066
00067 std::map< PixelChannel, std::pair<std::string, int> > map_;
00068 };
00069 }
00070
00071 #endif