File indexing completed on 2024-04-06 11:58:12
0001 #ifndef PixelDACSettings_h
0002 #define PixelDACSettings_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <vector>
0020 #include <string>
0021 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0022 #include "CalibFormats/SiPixelObjects/interface/PixelROCDACSettings.h"
0023 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h"
0024 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
0025 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0026 #include "CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h"
0027
0028 namespace pos {
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 class PixelDACSettings : public PixelConfigBase {
0061 public:
0062 PixelDACSettings(std::string filename);
0063
0064 PixelDACSettings(std::vector<std::vector<std::string> >& tableMat);
0065
0066 PixelDACSettings(PixelROCDACSettings& rocname);
0067
0068 void addROC(PixelROCDACSettings& rocname);
0069
0070 PixelROCDACSettings getDACSettings(int ROCId) const;
0071 PixelROCDACSettings* getDACSettings(PixelROCName);
0072
0073 unsigned int numROCs() { return dacsettings_.size(); }
0074
0075
0076 void generateConfiguration(PixelFECConfigInterface* pixelFEC,
0077 PixelNameTranslation* trans,
0078 PixelDetectorConfig* detconfig,
0079 bool HVon = true) const;
0080 void setVcthrDisable(PixelFECConfigInterface* pixelFEC, PixelNameTranslation* trans) const;
0081 void setVcthrEnable(PixelFECConfigInterface* pixelFEC,
0082 PixelNameTranslation* trans,
0083 PixelDetectorConfig* detconfig) const;
0084
0085 void writeBinary(std::string filename) const;
0086
0087 void writeASCII(std::string dir) const override;
0088 void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0089 void writeXMLHeader(pos::PixelConfigKey key,
0090 int version,
0091 std::string path,
0092 std::ofstream* out,
0093 std::ofstream* out1 = nullptr,
0094 std::ofstream* out2 = nullptr) const override;
0095 void writeXML(std::ofstream* out, std::ofstream* out1 = nullptr, std::ofstream* out2 = nullptr) const override;
0096 void writeXMLTrailer(std::ofstream* out,
0097 std::ofstream* out1 = nullptr,
0098 std::ofstream* out2 = nullptr) const override;
0099
0100 friend std::ostream& operator<<(std::ostream& s, const PixelDACSettings& mask);
0101
0102 private:
0103 std::vector<PixelROCDACSettings> dacsettings_;
0104
0105 bool rocIsDisabled(const PixelDetectorConfig* detconfig, const PixelROCName rocname) const;
0106 };
0107 }
0108
0109
0110 #endif