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  {
33  public:
34 
36 
37  PixelPortcardMap(std::vector< std::vector < std::string> > &tableMat);
38 
39  ~PixelPortcardMap() override;
40 
41  // Get the port card and AOH associated with this module. If the module has one(two) channels, this vector contains one(two) element(s).
42  const std::set< std::pair< std::string, int > > PortCardAndAOHs(const PixelModuleName& aModule) const;
43  // portcardname, aoh #
44 
45  const std::set< std::string > portcards(const PixelModuleName& aModule) const;
46 
47  int numChannels(const PixelModuleName& aModule) {return PortCardAndAOHs(aModule).size();}
48 
49  const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName& aModule, const std::string& TBMChannel) const;
50  const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName& aModule, 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
70  ) const override ;
71  void writeXML( std::ofstream *out,
72  std::ofstream *out1 = nullptr ,
73  std::ofstream *out2 = nullptr ) const override ;
74  void writeXMLTrailer( std::ofstream *out,
75  std::ofstream *out1 = nullptr,
76  std::ofstream *out2 = nullptr
77  ) const override ;
78 
79  private:
80  // portcardname, AOH #
81  std::map< PixelChannel, std::pair<std::string, int> > map_;
82 
83  };
84 }
85 /* @} */
86 #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.
PixelPortcardMap(std::string filename)
void writeASCII(std::string dir) const override
This class implements...
This class implements..
std::set< PixelModuleName > modules(std::string portCardName) const
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
This file contains the base class for "pixel configuration data" management.
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
This is the documentation about PixelDetectorConfig...
const std::pair< std::string, int > PortCardAndAOH(const PixelModuleName &aModule, const std::string &TBMChannel) const
This class implements..
const std::set< std::pair< std::string, int > > PortCardAndAOHs(const PixelModuleName &aModule) const
This class implements..
const std::set< std::string > portcards(const PixelModuleName &aModule) const
Simple class to hold either "A" or "B" for the TBM channel.
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
int numChannels(const PixelModuleName &aModule)
dbl *** dir
Definition: mlp_gen.cc:35
std::map< PixelChannel, std::pair< std::string, int > > map_
bool getName(std::string moduleName, std::string &portcardName)
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override