CMS 3D CMS Logo

PixelPortCardConfig.h
Go to the documentation of this file.
1 #ifndef PixelPortCardConfig_h
2 #define PixelPortCardConfig_h
3 
9 #include <vector>
10 #include <string>
11 #include <map>
13 
14 namespace pos {
15 
28  public:
29  PixelPortCardConfig(std::vector<std::vector<std::string> > &tableMat);
31 
32  void writeASCII(std::string dir = "") const override;
33  void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
35  int version,
37  std::ofstream *out,
38  std::ofstream *out1 = nullptr,
39  std::ofstream *out2 = nullptr) const override;
40  void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
41  void writeXMLTrailer(std::ofstream *out,
42  std::ofstream *out1 = nullptr,
43  std::ofstream *out2 = nullptr) const override;
44 
45  const std::string &getPortCardName() const { return portcardname_; }
47 
48  unsigned int getdevicesize() const;
49  std::string getTKFECID() const;
50  unsigned int getringAddress() const;
51  unsigned int getccuAddress() const;
52  unsigned int getchannelAddress() const;
53  unsigned int geti2cSpeed() const;
54  std::string gettype() const;
55  unsigned int getdeviceAddress(unsigned int i) const;
56  unsigned int getdeviceValues(unsigned int i) const;
57  unsigned int getdeviceAddressForSetting(std::string settingName) const;
58  unsigned int getdeviceValuesForSetting(std::string settingName) const;
59  unsigned int getdeviceValuesForAddress(unsigned int address) const;
60  unsigned int getAOHBias(unsigned int AOHNumber) const {
62  }
63  void setdeviceValues(unsigned int address, unsigned int value);
64  void setdeviceValues(std::string settingName, unsigned int value);
65 
66  unsigned int AOHBiasAddressFromAOHNumber(unsigned int AOHNumber) const;
67  unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const;
68 
69  void setAOHGain(unsigned int AOHNumber, unsigned int value) {
71  }
72  unsigned int getAOHGain(unsigned int AOHNumber) const;
73 
74  unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const;
75 
76  private:
77  void fillNameToAddress();
78  void fillDBToFileAddress();
79 
80  bool containsDeviceAddress(unsigned int deviceAddress) const;
81  bool containsSetting(std::string settingName) const {
83  }
84 
85  void setAOHGain(std::string settingName, unsigned int value);
86  void setDataBaseAOHGain(std::string settingName, unsigned int value);
87  std::string AOHGainStringFromAOHNumber(unsigned int AOHNumber) const;
88 
90 
91  std::string TKFECID_; //FEC ID string, as defined in tkfecconfig.dat
92  unsigned int ringAddress_; //ring #
93  unsigned int ccuAddress_; //CCU #
94 
95  unsigned int channelAddress_; //there are 8? channels on a CCU board
96  std::vector<std::pair<unsigned int, unsigned int> > device_; //the address on the portcard, and the value of it
97  unsigned int i2cSpeed_; //for the portcard, the slow i2c speed is 100kHz
98 
100  std::vector<unsigned int> key_;
101  unsigned int aohcount_;
102  void sortDeviceList();
103 
104  std::string type_; // fpix or bpix, used to determine setting names and addresses
105 
106  std::map<std::string, unsigned int>
107  nameToAddress_; // translation from name to address, filled in by fillNameToAddress();
108  std::map<std::string, std::string> nameDBtoFileConversion_; // filled by fillDBToFileAddress() ;
109  };
110 } // namespace pos
111 /* @} */
112 #endif
pos::PixelPortCardConfig::getdeviceAddress
unsigned int getdeviceAddress(unsigned int i) const
Definition: PixelPortCardConfig.cc:1128
pos::PixelPortCardConfig::containsSetting
bool containsSetting(std::string settingName) const
Definition: PixelPortCardConfig.h:81
pos::PixelPortCardConfig::nameDBtoFileConversion_
std::map< std::string, std::string > nameDBtoFileConversion_
Definition: PixelPortCardConfig.h:108
mps_fire.i
i
Definition: mps_fire.py:355
pos::PixelPortCardConfig
This is the documentation about PixelNameTranslation...
Definition: PixelPortCardConfig.h:27
pos::PixelPortCardConfig::fillNameToAddress
void fillNameToAddress()
Definition: PixelPortCardConfig.cc:658
pos::PixelPortCardConfig::getccuAddress
unsigned int getccuAddress() const
Definition: PixelPortCardConfig.cc:1120
pos::PixelPortCardConfig::portcardname_
std::string portcardname_
Definition: PixelPortCardConfig.h:89
pos::PixelPortCardConfig::PixelPortCardConfig
PixelPortCardConfig(std::vector< std::vector< std::string > > &tableMat)
pos::PixelPortCardConfig::writeXML
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
Definition: PixelPortCardConfig.h:33
pos::PixelPortCardConfig::getPortCardName
const std::string & getPortCardName() const
Definition: PixelPortCardConfig.h:45
pos::PixelPortCardConfig::ccuAddress_
unsigned int ccuAddress_
Definition: PixelPortCardConfig.h:93
pos::PixelPortCardConfig::fillDBToFileAddress
void fillDBToFileAddress()
Definition: PixelPortCardConfig.cc:747
pos::PixelPortCardConfig::nameToAddress_
std::map< std::string, unsigned int > nameToAddress_
Definition: PixelPortCardConfig.h:107
pos
Definition: PixelAliasList.h:18
pos::PixelPortCardConfig::ringAddress_
unsigned int ringAddress_
Definition: PixelPortCardConfig.h:92
pos::PixelPortCardConfig::writeXMLTrailer
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Definition: PixelPortCardConfig.cc:1614
pos::PixelConfigBase
This file contains the base class for "pixel configuration data" management.
Definition: PixelConfigBase.h:32
pos::PixelPortCardConfig::AOHGainStringFromAOHNumber
std::string AOHGainStringFromAOHNumber(unsigned int AOHNumber) const
Definition: PixelPortCardConfig.cc:1272
pos::PixelPortCardConfig::setAOHGain
void setAOHGain(unsigned int AOHNumber, unsigned int value)
Definition: PixelPortCardConfig.h:69
pos::PixelPortCardConfig::setPortCardName
void setPortCardName(std::string newName)
Definition: PixelPortCardConfig.h:46
pos::PixelPortCardConfig::gettype
std::string gettype() const
Definition: PixelPortCardConfig.cc:1126
pos::PixelPortCardConfig::getdeviceValuesForAddress
unsigned int getdeviceValuesForAddress(unsigned int address) const
Definition: PixelPortCardConfig.cc:1171
pos::PixelPortCardConfig::getdevicesize
unsigned int getdevicesize() const
Definition: PixelPortCardConfig.cc:1114
pos::PixelPortCardConfig::sortDeviceList
void sortDeviceList()
Definition: PixelPortCardConfig.cc:461
pos::PixelPortCardConfig::writeASCII
void writeASCII(std::string dir="") const override
Definition: PixelPortCardConfig.cc:987
pos::PixelPortCardConfig::aohcount_
unsigned int aohcount_
Definition: PixelPortCardConfig.h:101
PixelConfigBase.h
This file contains the base class for "pixel configuration data" management.
pos::PixelPortCardConfig::new_PLL_CTR2_value
unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const
Definition: PixelPortCardConfig.cc:481
pos::PixelPortCardConfig::getchannelAddress
unsigned int getchannelAddress() const
Definition: PixelPortCardConfig.cc:1122
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pos::PixelPortCardConfig::device_
std::vector< std::pair< unsigned int, unsigned int > > device_
Definition: PixelPortCardConfig.h:96
pos::PixelPortCardConfig::getAOHGain
unsigned int getAOHGain(unsigned int AOHNumber) const
Definition: PixelPortCardConfig.cc:1435
pos::PixelConfigKey
This class implements..
Definition: PixelConfigKey.h:20
pos::PixelPortCardConfig::channelAddress_
unsigned int channelAddress_
Definition: PixelPortCardConfig.h:95
pos::PixelPortCardConfig::TKFECID_
std::string TKFECID_
Definition: PixelPortCardConfig.h:91
pos::PixelPortCardConfig::setDataBaseAOHGain
void setDataBaseAOHGain(std::string settingName, unsigned int value)
Definition: PixelPortCardConfig.cc:576
value
Definition: value.py:1
pos::PixelPortCardConfig::getdeviceValues
unsigned int getdeviceValues(unsigned int i) const
Definition: PixelPortCardConfig.cc:1133
pos::PixelPortCardConfig::setdeviceValues
void setdeviceValues(unsigned int address, unsigned int value)
Definition: PixelPortCardConfig.cc:1138
mps_merge.newName
string newName
Definition: mps_merge.py:86
pos::PixelPortCardConfig::AOHBiasAddressFromAOHNumber
unsigned int AOHBiasAddressFromAOHNumber(unsigned int AOHNumber) const
Definition: PixelPortCardConfig.cc:1192
pos::PixelPortCardConfig::getdeviceValuesForSetting
unsigned int getdeviceValuesForSetting(std::string settingName) const
Definition: PixelPortCardConfig.cc:1167
PointingDoubleMultiSkim_cfg.out2
out2
Definition: PointingDoubleMultiSkim_cfg.py:85
PointingDoubleMultiSkim_cfg.out1
out1
Definition: PointingDoubleMultiSkim_cfg.py:57
pos::PixelPortCardConfig::getringAddress
unsigned int getringAddress() const
Definition: PixelPortCardConfig.cc:1118
pos::PixelPortCardConfig::getdeviceAddressForSetting
unsigned int getdeviceAddressForSetting(std::string settingName) const
Definition: PixelPortCardConfig.cc:1160
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
pos::PixelPortCardConfig::AOHGainAddressFromAOHNumber
unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const
Definition: PixelPortCardConfig.cc:1352
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
pos::PixelPortCardConfig::i2cSpeed_
unsigned int i2cSpeed_
Definition: PixelPortCardConfig.h:97
pos::PixelPortCardConfig::writeXMLHeader
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
Definition: PixelPortCardConfig.cc:1449
pos::PixelPortCardConfig::type_
std::string type_
Definition: PixelPortCardConfig.h:104
crabWrapper.key
key
Definition: crabWrapper.py:19
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
pos::PixelPortCardConfig::getAOHBias
unsigned int getAOHBias(unsigned int AOHNumber) const
Definition: PixelPortCardConfig.h:60
pos::PixelPortCardConfig::getTKFECID
std::string getTKFECID() const
Definition: PixelPortCardConfig.cc:1116
pos::PixelPortCardConfig::geti2cSpeed
unsigned int geti2cSpeed() const
Definition: PixelPortCardConfig.cc:1124
pos::PixelPortCardConfig::containsDeviceAddress
bool containsDeviceAddress(unsigned int deviceAddress) const
Definition: PixelPortCardConfig.cc:1182
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
pos::PixelPortCardConfig::key_
std::vector< unsigned int > key_
key used for sorting device_
Definition: PixelPortCardConfig.h:100