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