CMS 3D CMS Logo

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 
22  class PixelROCDACSettings;
23  std::ostream& operator<<(std::ostream& s, const PixelROCDACSettings& dacs);
24 
31 
32  public:
33 
35  virtual ~PixelROCDACSettings(){;};
36 
37  PixelROCDACSettings(const PixelROCName& rocid){rocid_= rocid;}
38 
39  //Build the commands needed to configure ROC
40  //Need to use the mask bits also for this
42 
43  int read(std::ifstream& in, const PixelROCName& rocid);
44  int read(std::istringstream& in, const PixelROCName& rocid);
45 
46  int readBinary(std::ifstream& in, const PixelROCName& rocid);
47 
48  void writeBinary(std::ofstream& out) const;
49 
50  void writeASCII(std::ostream& out) const;
52  virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const {;}
53  virtual void writeXML( std::ofstream *out) const ;
54  virtual void writeXMLTrailer( std::ofstream *out) const {;}
55 
56  void getDACs(std::vector<unsigned int>& dacs) const;
57  void getDACs(std::map<std::string, unsigned int>& dacs) const;
58 
59 
60  void setDAC(unsigned int dacaddress, unsigned int dacvalue);
61  void setDACs(std::map<std::string, unsigned int>& dacs) ;
62 
63  void compareDACs(std::map<std::string, unsigned int> & dacs,
64  std::map<std::string, bool> & changes,
65  std::map<std::string, unsigned int> & previous) ;
66 
67  void checkTag(std::string tag,
68  std::string dacName,
69  const PixelROCName& rocid);
70 
71  void setDac(std::string dacName, int value);
72 
73  unsigned int getDac(std::string dacName) const;
74 
75  bits4 getVdd() {return Vdd_;}
76  void setVdd(bits4 vdd) {Vdd_=vdd;}
77 
78  bits8 getVana() {return Vana_;}
79  void setVana(bits8 vana) {Vana_=vana;}
80 
81  bits8 getVsf() {return Vsf_;}
82  void setVsf(bits8 vsf) {Vsf_=vsf;}
83 
84  bits4 getVcomp() {return Vcomp_;}
85  void setVcomp(bits4 vcomp) {Vcomp_=vcomp;}
86 
87  bits8 getVleak() {return Vleak_;}
88  void setVleak(bits8 vleak) {Vleak_=vleak;}
89 
90  bits4 getVrgPr() {return VrgPr_;}
91  void setVrgPr(bits4 vrgPr) {VrgPr_=vrgPr;}
92 
93  bits8 getVwllPr() {return VwllPr_;}
94  void setVwllPr_(bits8 vwllPr) {VwllPr_=vwllPr;}
95 
96  bits4 getVrgSh() {return VrgSh_;}
97  void setVrgSh(bits4 vrgSh) {VrgSh_=vrgSh;}
98 
99  bits8 getVwllSh() {return VwllSh_;}
100  void setVwllSh(bits8 vwllSh) {VwllSh_=vwllSh;}
101 
102  bits8 getVHldDel() {return VHldDel_;}
103  void setVHldDel(bits8 vHldDel) {VHldDel_=vHldDel;}
104 
105  bits8 getVtrim() {return Vtrim_;}
106  void setVtrim(bits8 vtrim) {Vtrim_=vtrim;}
107 
108  bits8 getVcThr() {return VcThr_;}
109  void setVcThr(bits8 vcThr) {VcThr_=vcThr;}
110 
111  bits8 getVIbias_bus() {return VIbias_bus_;}
112  void setVIbias_bus(bits8 vIbias_bus) {VIbias_bus_=vIbias_bus;}
113 
114  bits4 getVIbias_sf() {return VIbias_sf_;}
115  void setVIbias_sf(bits4 vIbias_sf) {VIbias_sf_=vIbias_sf;}
116 
117  bits8 getVOffsetOp() {return VOffsetOp_;}
118  void setVOffsetOp(bits8 vOffsetOp) {VOffsetOp_=vOffsetOp;}
119 
120  bits8 getVbiasOp() {return VbiasOp_;}
121  void setVbiasOp(bits8 vbiasOp) {VbiasOp_=vbiasOp;}
122 
123  bits8 getVOffsetRO() {return VOffsetRO_;}
124  void setVOffsetRO(bits8 vOffsetRO) {VOffsetRO_=vOffsetRO;}
125 
126  bits8 getVIon() {return VIon_;}
127  void setVIon(bits8 vIon) {VIon_=vIon;}
128 
129  bits8 getVIbias_PH() {return VIbias_PH_;}
130  void setVIbias_PH(bits8 vIbias_PH) {VIbias_PH_=vIbias_PH;}
131 
132  bits8 getVIbias_DAC() {return VIbias_DAC_;}
133  void setVIbias_DAC(bits8 vIbias_DAC) {VIbias_DAC_=vIbias_DAC;}
134 
135  bits8 getVIbias_roc() {return VIbias_roc_;}
136  void setVIbias_roc(bits8 vIbias_roc) {VIbias_roc_=vIbias_roc;}
137 
138  bits8 getVIColOr() {return VIColOr_;}
139  void setVIColOr(bits8 vIColOr) {VIColOr_=vIColOr;}
140 
141  bits8 getVnpix() {return Vnpix_;}
142  void setVnpix(bits8 vnpix) {Vnpix_=vnpix;}
143 
144  bits8 getVsumCol() {return VsumCol_;}
145  void setVsumCol(bits8 vsumCol) {VsumCol_=vsumCol;}
146 
147  bits8 getVcal() {return Vcal_;}
148  void setVcal(bits8 vcal) {Vcal_=vcal;}
149 
150  bits8 getCalDel() {return CalDel_;}
151  void setCalDel(bits8 calDel) {CalDel_=calDel;}
152 
153  bits8 getTempRange() {return TempRange_;}
154  void setTempRange(bits8 tempRange) {TempRange_=tempRange;}
155 
156  bits8 getWBC() {return WBC_;}
157  void setWBC(bits8 wbc) {WBC_=wbc;}
158 
159  bits8 getControlRegister() const {return ChipContReg_;}
160  void setControlRegister(bits8 controlregister) {ChipContReg_=controlregister;}
161 
162  PixelROCName getROCName() const {return rocid_;}
163 
164  friend std::ostream& operator<<(std::ostream& s, const PixelROCDACSettings& dacs);
165 
166  private:
167 
169 
170  //The dac settings used by the ROC
171 
172  bits4 Vdd_; //addr 1
173  bits8 Vana_; //addr 2
174  bits8 Vsf_; //addr 3
175  bits4 Vcomp_; //addr 4
176  bits8 Vleak_; //addr 5
177  bits4 VrgPr_; //addr 6
178  bits8 VwllPr_; //addr 7
179  bits4 VrgSh_; //addr 8
180  bits8 VwllSh_; //addr 9
181  bits8 VHldDel_; //addr 10
182  bits8 Vtrim_; //addr 11
183  bits8 VcThr_; //addr 12
184  bits8 VIbias_bus_; //addr 13
185  bits4 VIbias_sf_; //addr 14
186  bits8 VOffsetOp_; //addr 15
187  bits8 VbiasOp_; //addr 16
188  bits8 VOffsetRO_; //addr 17
189  bits8 VIon_; //addr 18
190  bits8 VIbias_PH_; //addr 19
191  bits8 VIbias_DAC_; //addr 20
192  bits8 VIbias_roc_; //addr 21
193  bits8 VIColOr_; //addr 22
194  bits8 Vnpix_; //addr 23
195  bits8 VsumCol_; //addr 24
196  bits8 Vcal_; //addr 25
197  bits8 CalDel_; //addr 26
198  bits8 TempRange_; //addr 27
199  bits8 WBC_; //addr 254
200  bits8 ChipContReg_; //addr 253
201 
203 
204  };
205 }
206 #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
std::ostream & operator<<(std::ostream &s, const PixelCalibConfiguration &calib)
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
void setDACs(std::map< std::string, unsigned int > &dacs)
std::string ToLower(std::string)
unsigned char bits4
Definition: value.py:1
This class implements..
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)
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