File indexing completed on 2024-04-06 11:58:12
0001 #ifndef PixelDetectorConfig_h
0002 #define PixelDetectorConfig_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <vector>
0022 #include <set>
0023 #include <map>
0024 #include <string>
0025 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0026 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
0027 #include "CalibFormats/SiPixelObjects/interface/PixelHdwAddress.h"
0028 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0029 #include "CalibFormats/SiPixelObjects/interface/PixelROCStatus.h"
0030
0031 namespace pos {
0032
0033
0034
0035
0036
0037
0038
0039 class PixelDetectorConfig : public PixelConfigBase {
0040 public:
0041 PixelDetectorConfig(std::vector<std::vector<std::string> > &tableMat);
0042 PixelDetectorConfig(std::string filename);
0043
0044 unsigned int getNModules() const;
0045
0046 PixelModuleName getModule(unsigned int i) const;
0047
0048 const std::vector<PixelModuleName> &getModuleList() const { return modules_; }
0049
0050 void addROC(PixelROCName &, std::string statusLabel);
0051 void addROC(PixelROCName &);
0052 void removeROC(PixelROCName &);
0053 const std::map<PixelROCName, PixelROCStatus> &getROCsList() const { return rocs_; };
0054
0055 void writeASCII(std::string dir = "") const override;
0056 void writeXML(pos::PixelConfigKey key, int version, std::string path) const override;
0057 void writeXMLHeader(pos::PixelConfigKey key,
0058 int version,
0059 std::string path,
0060 std::ofstream *out,
0061 std::ofstream *out1 = nullptr,
0062 std::ofstream *out2 = nullptr) const override;
0063 void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0064 void writeXMLTrailer(std::ofstream *out,
0065 std::ofstream *out1 = nullptr,
0066 std::ofstream *out2 = nullptr) const override;
0067
0068 bool containsModule(const PixelModuleName &moduleToFind) const;
0069
0070 std::set<unsigned int> getFEDs(PixelNameTranslation *translation) const;
0071 std::map<unsigned int, std::set<unsigned int> > getFEDsAndChannels(PixelNameTranslation *translation) const;
0072
0073
0074
0075 private:
0076 std::vector<PixelModuleName> modules_;
0077
0078 std::map<PixelROCName, PixelROCStatus> rocs_;
0079 };
0080 }
0081
0082 #endif