CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_; }
46  void setPortCardName(std::string newName) { portcardname_ = newName; }
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) {
70  setAOHGain(AOHGainStringFromAOHNumber(AOHNumber), 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
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const
bool containsDeviceAddress(unsigned int deviceAddress) const
This file contains the base class for &quot;pixel configuration data&quot; management.
unsigned int getchannelAddress() const
unsigned int getdeviceValues(unsigned int i) const
std::map< std::string, unsigned int > nameToAddress_
void writeASCII(std::string dir="") const override
std::map< std::string, std::string > nameDBtoFileConversion_
unsigned int getccuAddress() const
unsigned int getdeviceValuesForSetting(std::string settingName) const
PixelPortCardConfig(std::vector< std::vector< std::string > > &tableMat)
unsigned int getdeviceAddressForSetting(std::string settingName) const
unsigned int getAOHBias(unsigned int AOHNumber) const
unsigned int AOHBiasAddressFromAOHNumber(unsigned int AOHNumber) const
unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const
void setDataBaseAOHGain(std::string settingName, unsigned int value)
This file contains the base class for &quot;pixel configuration data&quot; management.
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
unsigned int getdeviceAddress(unsigned int i) const
std::string getTKFECID() const
tuple key
prepare the HTCondor submission files and eventually submit them
unsigned int getdevicesize() const
std::string AOHGainStringFromAOHNumber(unsigned int AOHNumber) const
void setdeviceValues(unsigned int address, unsigned int value)
unsigned int getAOHGain(unsigned int AOHNumber) const
const std::string & getPortCardName() const
void setPortCardName(std::string newName)
This is the documentation about PixelNameTranslation...
This class implements..
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
std::vector< std::pair< unsigned int, unsigned int > > device_
bool containsSetting(std::string settingName) const
unsigned int getringAddress() const
std::vector< unsigned int > key_
key used for sorting device_
unsigned int geti2cSpeed() const
void setAOHGain(unsigned int AOHNumber, unsigned int value)
std::string gettype() const
unsigned int getdeviceValuesForAddress(unsigned int address) const