File indexing completed on 2024-04-06 11:58:13
0001 #ifndef PixelPortcardMap_h
0002 #define PixelPortcardMap_h
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <string>
0012 #include <vector>
0013 #include <map>
0014 #include <set>
0015 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0016 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
0017 #include "CalibFormats/SiPixelObjects/interface/PixelTBMChannel.h"
0018 #include "CalibFormats/SiPixelObjects/interface/PixelChannel.h"
0019 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
0020 namespace pos {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 class PixelPortcardMap : public PixelConfigBase {
0032 public:
0033 PixelPortcardMap(std::string filename);
0034
0035 PixelPortcardMap(std::vector<std::vector<std::string> > &tableMat);
0036
0037 ~PixelPortcardMap() override;
0038
0039
0040 const std::set<std::pair<std::string, int> > PortCardAndAOHs(const PixelModuleName &aModule) const;
0041
0042
0043 const std::set<std::string> portcards(const PixelModuleName &aModule) const;
0044
0045 int numChannels(const PixelModuleName &aModule) { return PortCardAndAOHs(aModule).size(); }
0046
0047 const std::pair<std::string, int> PortCardAndAOH(const PixelModuleName &aModule,
0048 const std::string &TBMChannel) const;
0049 const std::pair<std::string, int> PortCardAndAOH(const PixelModuleName &aModule,
0050 const PixelTBMChannel &TBMChannel) const;
0051 const std::pair<std::string, int> PortCardAndAOH(const PixelChannel &aChannel) const;
0052
0053
0054 std::set<PixelModuleName> modules(std::string portCardName) const;
0055
0056
0057 std::set<std::string> portcards(const PixelDetectorConfig *detconfig = nullptr);
0058
0059
0060 bool getName(std::string moduleName, std::string &portcardName);
0061
0062 void writeASCII(std::string dir) const override;
0063 void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0064 void writeXMLHeader(pos::PixelConfigKey key,
0065 int version,
0066 std::string path,
0067 std::ofstream *out,
0068 std::ofstream *out1 = nullptr,
0069 std::ofstream *out2 = nullptr) const override;
0070 void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0071 void writeXMLTrailer(std::ofstream *out,
0072 std::ofstream *out1 = nullptr,
0073 std::ofstream *out2 = nullptr) const override;
0074
0075 private:
0076
0077 std::map<PixelChannel, std::pair<std::string, int> > map_;
0078 };
0079 }
0080
0081 #endif