CMS 3D CMS Logo

PixelPortcardMap.h
Go to the documentation of this file.
1 #ifndef PixelPortcardMap_h
2 #define PixelPortcardMap_h
3 
11 #include <string>
12 #include <vector>
13 #include <map>
14 #include <set>
20 namespace pos {
32  public:
34 
35  PixelPortcardMap(std::vector<std::vector<std::string> > &tableMat);
36 
37  ~PixelPortcardMap() override;
38 
39  // Get the port card and AOH associated with this module. If the module has one(two) channels, this vector contains one(two) element(s).
40  const std::set<std::pair<std::string, int> > PortCardAndAOHs(const PixelModuleName &aModule) const;
41  // portcardname, aoh #
42 
43  const std::set<std::string> portcards(const PixelModuleName &aModule) const;
44 
45  int numChannels(const PixelModuleName &aModule) { return PortCardAndAOHs(aModule).size(); }
46 
47  const std::pair<std::string, int> PortCardAndAOH(const PixelModuleName &aModule,
48  const std::string &TBMChannel) const;
49  const std::pair<std::string, int> PortCardAndAOH(const PixelModuleName &aModule,
50  const PixelTBMChannel &TBMChannel) const;
51  const std::pair<std::string, int> PortCardAndAOH(const PixelChannel &aChannel) const;
52 
53  // set of all modules attached to a port card
54  std::set<PixelModuleName> modules(std::string portCardName) const;
55 
56  // all port cards in the map
57  std::set<std::string> portcards(const PixelDetectorConfig *detconfig = nullptr);
58 
59  // Added by Dario for Debbie (the PixelPortcardMap::portcards is way to slow for the interactive tool)
60  bool getName(std::string moduleName, std::string &portcardName);
61 
62  void writeASCII(std::string dir) const override;
63  void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
65  int version,
67  std::ofstream *out,
68  std::ofstream *out1 = nullptr,
69  std::ofstream *out2 = nullptr) const override;
70  void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
71  void writeXMLTrailer(std::ofstream *out,
72  std::ofstream *out1 = nullptr,
73  std::ofstream *out2 = nullptr) const override;
74 
75  private:
76  // portcardname, AOH #
77  std::map<PixelChannel, std::pair<std::string, int> > map_;
78  };
79 } // namespace pos
80 /* @} */
81 #endif
This class specifies which detector components are used in the configuration (and eventually should s...
This file contains the base class for "pixel configuration data" management.
Simple class to hold either "A" or "B" for the TBM channel.
void writeASCII(std::string dir) const override
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
PixelPortcardMap(std::string filename)
This class implements...
This class implements..
This file contains the base class for "pixel configuration data" management.
This is the documentation about PixelDetectorConfig...
key
prepare the HTCondor submission files and eventually submit them
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
std::set< PixelModuleName > modules(std::string portCardName) const
This class implements..
const std::set< std::string > portcards(const PixelModuleName &aModule) const
const std::set< std::pair< std::string, int > > PortCardAndAOHs(const PixelModuleName &aModule) const
This class implements..
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Simple class to hold either "A" or "B" for the TBM channel.
int numChannels(const PixelModuleName &aModule)
const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName &aModule, const std::string &TBMChannel) const
bool getName(std::string moduleName, std::string &portcardName)
std::map< PixelChannel, std::pair< std::string, int > > map_