CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
29  public:
30 
31  PixelPortCardConfig(std::vector < std::vector< std::string> > &tableMat);
33 
34  void writeASCII(std::string dir="") const;
36  virtual void writeXMLHeader( pos::PixelConfigKey key,
37  int version,
39  std::ofstream *out,
40  std::ofstream *out1 = NULL,
41  std::ofstream *out2 = NULL
42  ) const ;
43  virtual void writeXML( std::ofstream *out,
44  std::ofstream *out1 = NULL ,
45  std::ofstream *out2 = NULL ) const ;
46  virtual void writeXMLTrailer( std::ofstream *out,
47  std::ofstream *out1 = NULL,
48  std::ofstream *out2 = NULL
49  ) const ;
50 
51  const std::string& getPortCardName() const { return portcardname_; }
52  void setPortCardName(std::string newName) { portcardname_ = newName; }
53 
54  unsigned int getdevicesize() const;
55  std::string getTKFECID() const;
56  unsigned int getringAddress() const;
57  unsigned int getccuAddress() const;
58  unsigned int getchannelAddress() const;
59  unsigned int geti2cSpeed() const;
60  std::string gettype() const;
61  unsigned int getdeviceAddress(unsigned int i) const;
62  unsigned int getdeviceValues(unsigned int i) const;
63  unsigned int getdeviceAddressForSetting(std::string settingName) const;
64  unsigned int getdeviceValuesForSetting(std::string settingName) const;
65  unsigned int getdeviceValuesForAddress(unsigned int address) const;
66  unsigned int getAOHBias(unsigned int AOHNumber) const {return getdeviceValuesForAddress(AOHBiasAddressFromAOHNumber(AOHNumber));}
67  void setdeviceValues(unsigned int address, unsigned int value);
68  void setdeviceValues(std::string settingName, unsigned int value);
69 
70  unsigned int AOHBiasAddressFromAOHNumber(unsigned int AOHNumber) const;
71  unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const;
72 
73  void setAOHGain(unsigned int AOHNumber, unsigned int value) {setAOHGain(AOHGainStringFromAOHNumber(AOHNumber),value);}
74  unsigned int getAOHGain(unsigned int AOHNumber) const;
75 
76  unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const;
77 
78  private:
79  void fillNameToAddress();
80  void fillDBToFileAddress();
81 
82  bool containsDeviceAddress(unsigned int deviceAddress) const;
83  bool containsSetting(std::string settingName) const { return containsDeviceAddress(getdeviceAddressForSetting(settingName)); }
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> nameToAddress_; // translation from name to address, filled in by fillNameToAddress();
107  std::map<std::string, std::string> nameDBtoFileConversion_; // filled by fillDBToFileAddress() ;
108  };
109 }
110 /* @} */
111 #endif
unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const
int i
Definition: DBlmapReader.cc:9
bool containsDeviceAddress(unsigned int deviceAddress) const
This file contains the base class for &quot;pixel configuration data&quot; management.
void writeASCII(std::string dir="") const
unsigned int getchannelAddress() const
unsigned int getdeviceValues(unsigned int i) const
std::map< std::string, unsigned int > nameToAddress_
std::map< std::string, std::string > nameDBtoFileConversion_
unsigned int getccuAddress() const
unsigned int getdeviceValuesForSetting(std::string settingName) const
#define NULL
Definition: scimark2.h:8
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)
std::vector< std::pair< unsigned int, unsigned int > > device_
This file contains the base class for &quot;pixel configuration data&quot; management.
tuple path
else: Piece not in the list, fine.
std::vector< unsigned int > key_
key used for sorting device_
unsigned int getdeviceAddress(unsigned int i) const
std::string getTKFECID() const
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
const std::string & getPortCardName() const
void setPortCardName(std::string newName)
This is the documentation about PixelNameTranslation...
This class implements..
tuple out
Definition: dbtoconf.py:99
bool containsSetting(std::string settingName) const
unsigned int getringAddress() const
unsigned int geti2cSpeed() const
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
dbl *** dir
Definition: mlp_gen.cc:35
void setAOHGain(unsigned int AOHNumber, unsigned int value)
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
std::string gettype() const
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
unsigned int getdeviceValuesForAddress(unsigned int address) const