Go to the documentation of this file.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 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
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(const PixelDetectorConfig* detconfig=0);
00058
00059
00060 bool getName(std::string moduleName, std::string &portcardName) ;
00061
00062 virtual void writeASCII(std::string dir) const;
00063 void writeXML( pos::PixelConfigKey key, int version, std::string path) const {;}
00064 virtual void writeXMLHeader( pos::PixelConfigKey key,
00065 int version,
00066 std::string path,
00067 std::ofstream *out,
00068 std::ofstream *out1 = NULL,
00069 std::ofstream *out2 = NULL
00070 ) const ;
00071 virtual void writeXML( std::ofstream *out,
00072 std::ofstream *out1 = NULL ,
00073 std::ofstream *out2 = NULL ) const ;
00074 virtual void writeXMLTrailer( std::ofstream *out,
00075 std::ofstream *out1 = NULL,
00076 std::ofstream *out2 = NULL
00077 ) const ;
00078
00079 private:
00080
00081 std::map< PixelChannel, std::pair<std::string, int> > map_;
00082
00083 };
00084 }
00085
00086 #endif