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