CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelROCDACSettings.h
Go to the documentation of this file.
1 #ifndef PixelROCDACSettings_h
2 #define PixelROCDACSettings_h
3 
9 #include <string>
10 #include <iostream>
11 #include <vector>
12 #include <map>
13 #include <fstream>
14 #include <sstream>
17 
18 namespace pos{
19  typedef unsigned char bits8;
20  typedef unsigned char bits4;
21 
28 
29  public:
30 
32 
33  PixelROCDACSettings(const PixelROCName& rocid){rocid_= rocid;}
34 
35  //Build the commands needed to configure ROC
36  //Need to use the mask bits also for this
37  std::string getConfigCommand();
38 
39  int read(std::ifstream& in, const PixelROCName& rocid);
40  int read(std::istringstream& in, const PixelROCName& rocid);
41 
42  int readBinary(std::ifstream& in, const PixelROCName& rocid);
43 
44  void writeBinary(std::ofstream& out) const;
45 
46  void writeASCII(std::ostream& out) const;
47  void writeXML( pos::PixelConfigKey key, int version, std::string path) const {;}
48  virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
49  virtual void writeXML( std::ofstream *out) const ;
50  virtual void writeXMLTrailer( std::ofstream *out) const {;}
51 
52  void getDACs(std::vector<unsigned int>& dacs) const;
53  void getDACs(std::map<std::string, unsigned int>& dacs) const;
54 
55 
56  void setDAC(unsigned int dacaddress, unsigned int dacvalue);
57  void setDACs(std::map<std::string, unsigned int>& dacs) ;
58 
59  void compareDACs(std::map<std::string, unsigned int> & dacs,
60  std::map<std::string, bool> & changes,
61  std::map<std::string, unsigned int> & previous) ;
62 
63  void checkTag(std::string tag,
64  std::string dacName,
65  const PixelROCName& rocid);
66 
67  void setDac(std::string dacName, int value);
68 
69  unsigned int getDac(std::string dacName) const;
70 
71  bits4 getVdd() {return Vdd_;}
72  void setVdd(bits4 vdd) {Vdd_=vdd;}
73 
74  bits8 getVana() {return Vana_;}
75  void setVana(bits8 vana) {Vana_=vana;}
76 
77  bits8 getVsf() {return Vsf_;}
78  void setVsf(bits8 vsf) {Vsf_=vsf;}
79 
80  bits4 getVcomp() {return Vcomp_;}
81  void setVcomp(bits4 vcomp) {Vcomp_=vcomp;}
82 
83  bits8 getVleak() {return Vleak_;}
84  void setVleak(bits8 vleak) {Vleak_=vleak;}
85 
86  bits4 getVrgPr() {return VrgPr_;}
87  void setVrgPr(bits4 vrgPr) {VrgPr_=vrgPr;}
88 
89  bits8 getVwllPr() {return VwllPr_;}
90  void setVwllPr_(bits8 vwllPr) {VwllPr_=vwllPr;}
91 
92  bits4 getVrgSh() {return VrgSh_;}
93  void setVrgSh(bits4 vrgSh) {VrgSh_=vrgSh;}
94 
95  bits8 getVwllSh() {return VwllSh_;}
96  void setVwllSh(bits8 vwllSh) {VwllSh_=vwllSh;}
97 
99  void setVHldDel(bits8 vHldDel) {VHldDel_=vHldDel;}
100 
101  bits8 getVtrim() {return Vtrim_;}
102  void setVtrim(bits8 vtrim) {Vtrim_=vtrim;}
103 
104  bits8 getVcThr() {return VcThr_;}
105  void setVcThr(bits8 vcThr) {VcThr_=vcThr;}
106 
108  void setVIbias_bus(bits8 vIbias_bus) {VIbias_bus_=vIbias_bus;}
109 
111  void setVIbias_sf(bits4 vIbias_sf) {VIbias_sf_=vIbias_sf;}
112 
114  void setVOffsetOp(bits8 vOffsetOp) {VOffsetOp_=vOffsetOp;}
115 
117  void setVbiasOp(bits8 vbiasOp) {VbiasOp_=vbiasOp;}
118 
120  void setVOffsetRO(bits8 vOffsetRO) {VOffsetRO_=vOffsetRO;}
121 
122  bits8 getVIon() {return VIon_;}
123  void setVIon(bits8 vIon) {VIon_=vIon;}
124 
126  void setVIbias_PH(bits8 vIbias_PH) {VIbias_PH_=vIbias_PH;}
127 
129  void setVIbias_DAC(bits8 vIbias_DAC) {VIbias_DAC_=vIbias_DAC;}
130 
132  void setVIbias_roc(bits8 vIbias_roc) {VIbias_roc_=vIbias_roc;}
133 
135  void setVIColOr(bits8 vIColOr) {VIColOr_=vIColOr;}
136 
137  bits8 getVnpix() {return Vnpix_;}
138  void setVnpix(bits8 vnpix) {Vnpix_=vnpix;}
139 
141  void setVsumCol(bits8 vsumCol) {VsumCol_=vsumCol;}
142 
143  bits8 getVcal() {return Vcal_;}
144  void setVcal(bits8 vcal) {Vcal_=vcal;}
145 
146  bits8 getCalDel() {return CalDel_;}
147  void setCalDel(bits8 calDel) {CalDel_=calDel;}
148 
150  void setTempRange(bits8 tempRange) {TempRange_=tempRange;}
151 
152  bits8 getWBC() {return WBC_;}
153  void setWBC(bits8 wbc) {WBC_=wbc;}
154 
156  void setControlRegister(bits8 controlregister) {ChipContReg_=controlregister;}
157 
158  PixelROCName getROCName() const {return rocid_;}
159 
160  friend std::ostream& operator<<(std::ostream& s, const PixelROCDACSettings& dacs);
161 
162  private:
163 
165 
166  //The dac settings used by the ROC
167 
168  bits4 Vdd_; //addr 1
169  bits8 Vana_; //addr 2
170  bits8 Vsf_; //addr 3
171  bits4 Vcomp_; //addr 4
172  bits8 Vleak_; //addr 5
173  bits4 VrgPr_; //addr 6
174  bits8 VwllPr_; //addr 7
175  bits4 VrgSh_; //addr 8
176  bits8 VwllSh_; //addr 9
177  bits8 VHldDel_; //addr 10
178  bits8 Vtrim_; //addr 11
179  bits8 VcThr_; //addr 12
180  bits8 VIbias_bus_; //addr 13
181  bits4 VIbias_sf_; //addr 14
182  bits8 VOffsetOp_; //addr 15
183  bits8 VbiasOp_; //addr 16
184  bits8 VOffsetRO_; //addr 17
185  bits8 VIon_; //addr 18
186  bits8 VIbias_PH_; //addr 19
187  bits8 VIbias_DAC_; //addr 20
188  bits8 VIbias_roc_; //addr 21
189  bits8 VIColOr_; //addr 22
190  bits8 Vnpix_; //addr 23
191  bits8 VsumCol_; //addr 24
192  bits8 Vcal_; //addr 25
193  bits8 CalDel_; //addr 26
194  bits8 TempRange_; //addr 27
195  bits8 WBC_; //addr 254
196  bits8 ChipContReg_; //addr 253
197 
198  std::string ToLower(std::string) ;
199 
200  };
201 }
202 #endif
void setVIbias_roc(bits8 vIbias_roc)
unsigned int getDac(std::string dacName) const
void setVwllPr_(bits8 vwllPr)
unsigned char bits8
void setTempRange(bits8 tempRange)
void setVHldDel(bits8 vHldDel)
void setVwllSh(bits8 vwllSh)
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
virtual void writeXMLTrailer(std::ofstream *out) const
void getDACs(std::vector< unsigned int > &dacs) const
int read(std::ifstream &in, const PixelROCName &rocid)
void setDAC(unsigned int dacaddress, unsigned int dacvalue)
void setVbiasOp(bits8 vbiasOp)
void setControlRegister(bits8 controlregister)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
list path
Definition: scaleCards.py:51
void setDACs(std::map< std::string, unsigned int > &dacs)
std::string ToLower(std::string)
unsigned char bits4
This class implements..
tuple out
Definition: dbtoconf.py:99
void setVIbias_sf(bits4 vIbias_sf)
void setVIbias_bus(bits8 vIbias_bus)
void setVsumCol(bits8 vsumCol)
void checkTag(std::string tag, std::string dacName, const PixelROCName &rocid)
void setVIbias_PH(bits8 vIbias_PH)
This class implements the configuration key which actually just is an integer.
PixelROCDACSettings(const PixelROCName &rocid)
void compareDACs(std::map< std::string, unsigned int > &dacs, std::map< std::string, bool > &changes, std::map< std::string, unsigned int > &previous)
void setDac(std::string dacName, int value)
void setVOffsetRO(bits8 vOffsetRO)
This class implements..
Definition: PixelROCName.h:23
void writeBinary(std::ofstream &out) const
friend std::ostream & operator<<(std::ostream &s, const PixelROCDACSettings &dacs)
void setCalDel(bits8 calDel)
list key
Definition: combine.py:13
void setVIbias_DAC(bits8 vIbias_DAC)
int readBinary(std::ifstream &in, const PixelROCName &rocid)
This class implements..
void setVOffsetOp(bits8 vOffsetOp)
void setVIColOr(bits8 vIColOr)
PixelROCName getROCName() const
This class stores the name and related hardware mappings for a ROC.
void writeASCII(std::ostream &out) const