24 dacs.push_back(Vana_);
26 dacs.push_back(Vcomp_);
27 dacs.push_back(Vleak_);
28 dacs.push_back(VrgPr_);
29 dacs.push_back(VwllPr_);
30 dacs.push_back(VrgSh_);
31 dacs.push_back(VwllSh_);
32 dacs.push_back(VHldDel_);
33 dacs.push_back(Vtrim_);
34 dacs.push_back(VcThr_);
35 dacs.push_back(VIbias_bus_);
36 dacs.push_back(VIbias_sf_);
37 dacs.push_back(VOffsetOp_);
38 dacs.push_back(VbiasOp_);
39 dacs.push_back(VOffsetRO_);
40 dacs.push_back(VIon_);
41 dacs.push_back(VIbias_PH_);
42 dacs.push_back(VIbias_DAC_);
43 dacs.push_back(VIbias_roc_);
44 dacs.push_back(VIColOr_);
45 dacs.push_back(Vnpix_);
46 dacs.push_back(VsumCol_);
47 dacs.push_back(Vcal_);
48 dacs.push_back(CalDel_);
49 dacs.push_back(TempRange_);
51 dacs.push_back(ChipContReg_);
125 std::map<std::string, bool>& changes,
126 std::map<std::string, unsigned int>& previous)
191 std::string mthn =
"[PixelROCDACSettings::setDAC()]\t\t\t\t " ;
192 switch (dacaddress) {
193 case 1: Vdd_ = dacvalue;
break;
194 case 2: Vana_ = dacvalue;
break;
195 case 3: Vsf_ = dacvalue;
break;
196 case 4: Vcomp_ = dacvalue;
break;
197 case 5: Vleak_ = dacvalue;
break;
198 case 6: VrgPr_ = dacvalue;
break;
199 case 7: VwllPr_ = dacvalue;
break;
200 case 8: VrgSh_ = dacvalue;
break;
201 case 9: VwllSh_ = dacvalue;
break;
202 case 10: VHldDel_ = dacvalue;
break;
203 case 11: Vtrim_ = dacvalue;
break;
204 case 12: VcThr_ = dacvalue;
break;
205 case 13: VIbias_bus_ = dacvalue;
break;
206 case 14: VIbias_sf_ = dacvalue;
break;
207 case 15: VOffsetOp_ = dacvalue;
break;
208 case 16: VbiasOp_ = dacvalue;
break;
209 case 17: VOffsetRO_ = dacvalue;
break;
210 case 18: VIon_ = dacvalue;
break;
211 case 19: VIbias_PH_ = dacvalue;
break;
212 case 20: VIbias_DAC_ = dacvalue;
break;
213 case 21: VIbias_roc_ = dacvalue;
break;
214 case 22: VIColOr_ = dacvalue;
break;
215 case 23: Vnpix_ = dacvalue;
break;
216 case 24: VsumCol_ = dacvalue;
break;
217 case 25: Vcal_ = dacvalue;
break;
218 case 26: CalDel_ = dacvalue;
break;
219 case 27: TempRange_ = dacvalue;
break;
220 case 254: WBC_ = dacvalue;
break;
221 case 253: ChipContReg_ = dacvalue;
break;
222 default:
cout << __LINE__ <<
"]\t" << mthn
223 <<
"DAC Address " << dacaddress <<
" does not exist!" << endl;
230 out << (char)rocid_.rocname().size();
231 out.write(rocid_.rocname().c_str(),rocid_.rocname().size());
269 in.read((
char*)&Vdd_,1);
270 in.read((
char*)&Vana_,1);
271 in.read((
char*)&Vsf_,1);
272 in.read((
char*)&Vcomp_,1);
273 in.read((
char*)&Vleak_,1);
274 in.read((
char*)&VrgPr_,1);
275 in.read((
char*)&VwllPr_,1);
276 in.read((
char*)&VrgSh_,1);
277 in.read((
char*)&VwllSh_,1);
278 in.read((
char*)&VHldDel_,1);
279 in.read((
char*)&Vtrim_,1);
280 in.read((
char*)&VcThr_,1);
281 in.read((
char*)&VIbias_bus_,1);
282 in.read((
char*)&VIbias_sf_,1);
283 in.read((
char*)&VOffsetOp_,1);
284 in.read((
char*)&VbiasOp_,1);
285 in.read((
char*)&VOffsetRO_,1);
286 in.read((
char*)&VIon_,1);
287 in.read((
char*)&VIbias_PH_,1);
288 in.read((
char*)&VIbias_DAC_,1);
289 in.read((
char*)&VIbias_roc_,1);
290 in.read((
char*)&VIColOr_,1);
291 in.read((
char*)&Vnpix_,1);
292 in.read((
char*)&VsumCol_,1);
293 in.read((
char*)&Vcal_,1);
294 in.read((
char*)&CalDel_,1);
295 in.read((
char*)&TempRange_,1);
296 in.read((
char*)&WBC_,1);
297 in.read((
char*)&ChipContReg_,1);
305 out <<
"ROC: " << rocid_.rocname() <<endl;
341 std::string mthn =
"[PixelROCDACSettings::writeXML()]\t\t\t " ;
343 *out <<
" <DATA>" << endl ;
344 *out <<
" <ROC_NAME>" << rocid_.rocname() <<
"</ROC_NAME>" << endl ;
345 *out <<
" <VDD>" << (int)Vdd_ <<
"</VDD>" << endl ;
346 *out <<
" <VANA>" << (int)Vana_ <<
"</VANA>" << endl ;
347 *out <<
" <VSF>" << (int)Vsf_ <<
"</VSF>" << endl ;
348 *out <<
" <VCOMP>" << (int)Vcomp_ <<
"</VCOMP>" << endl ;
349 *out <<
" <VLEAK>" << (int)Vleak_ <<
"</VLEAK>" << endl ;
350 *out <<
" <VRGPR>" << (int)VrgPr_ <<
"</VRGPR>" << endl ;
351 *out <<
" <VWLLPR>" << (int)VwllPr_ <<
"</VWLLPR>" << endl ;
352 *out <<
" <VRGSH>" << (int)VrgSh_ <<
"</VRGSH>" << endl ;
353 *out <<
" <VWLLSH>" << (int)VwllSh_ <<
"</VWLLSH>" << endl ;
354 *out <<
" <VHLDDEL>" << (int)VHldDel_ <<
"</VHLDDEL>" << endl ;
355 *out <<
" <VTRIM>" << (int)Vtrim_ <<
"</VTRIM>" << endl ;
356 *out <<
" <VCTHR>" << (int)VcThr_ <<
"</VCTHR>" << endl ;
357 *out <<
" <VIBIAS_BUS>" << (int)VIbias_bus_ <<
"</VIBIAS_BUS>" << endl ;
358 *out <<
" <VIBIAS_SF>" << (int)VIbias_sf_ <<
"</VIBIAS_SF>" << endl ;
359 *out <<
" <VOFFSETOP>" << (int)VOffsetOp_ <<
"</VOFFSETOP>" << endl ;
360 *out <<
" <VBIASOP>" << (int)VbiasOp_ <<
"</VBIASOP>" << endl ;
361 *out <<
" <VOFFSETRO>" << (int)VOffsetRO_ <<
"</VOFFSETRO>" << endl ;
362 *out <<
" <VION>" << (int)VIon_ <<
"</VION>" << endl ;
363 *out <<
" <VIBIAS_PH>" << (int)VIbias_PH_ <<
"</VIBIAS_PH>" << endl ;
364 *out <<
" <VIBIAS_DAC>" << (int)VIbias_DAC_ <<
"</VIBIAS_DAC>" << endl ;
365 *out <<
" <VIBIAS_ROC>" << (int)VIbias_roc_ <<
"</VIBIAS_ROC>" << endl ;
366 *out <<
" <VICOLOR>" << (int)VIColOr_ <<
"</VICOLOR>" << endl ;
367 *out <<
" <VNPIX>" << (int)Vnpix_ <<
"</VNPIX>" << endl ;
368 *out <<
" <VSUMCOL>" << (int)VsumCol_ <<
"</VSUMCOL>" << endl ;
369 *out <<
" <VCAL>" << (int)Vcal_ <<
"</VCAL>" << endl ;
370 *out <<
" <CALDEL>" << (int)CalDel_ <<
"</CALDEL>" << endl ;
371 *out <<
" <TEMPRANGE>" << (int)TempRange_ <<
"</TEMPRANGE>" << endl ;
372 *out <<
" <WBC>" << (int)WBC_ <<
"</WBC>" << endl ;
373 *out <<
" <CHIPCONTREG>" << (int)ChipContReg_ <<
"</CHIPCONTREG>" << endl ;
374 *out <<
" </DATA>" << endl ;
375 *out <<
" " << endl ;
384 std::string mthn =
"[PixelROCDACSettings::checkTag()]\t\t\t\t " ;
387 cout << __LINE__ <<
"]\t" << mthn <<
"Read ROC name : " << tag << endl;
388 cout << __LINE__ <<
"]\t" << mthn <<
"But expected to find: " << dacName << endl;
389 cout << __LINE__ <<
"]\t" << mthn <<
"When reading DAC settings for ROC " << rocid << endl;
397 std::string mthn =
"[PixelROCDACSettings::read()]\t\t\t\t " ;
443 in >>
tmp; VIbias_bus_=
tmp;
446 in >>
tmp; VIbias_sf_=
tmp;
449 in >>
tmp; VOffsetOp_=
tmp;
455 in >>
tmp; VOffsetRO_=
tmp;
461 in >>
tmp; VIbias_PH_=
tmp;
464 in >>
tmp; VIbias_DAC_=
tmp;
467 in >>
tmp; VIbias_roc_=
tmp;
485 static bool first=
true;
487 cout << __LINE__ <<
"]\t" << mthn <<
"**********************************************" << endl;
488 cout << __LINE__ <<
"]\t" << mthn <<
"Did not find TempRange setting in DAC settings" << endl;
489 cout << __LINE__ <<
"]\t" << mthn <<
"Will use a default value of 4." << endl;
490 cout << __LINE__ <<
"]\t" << mthn <<
"This message will only be printed out once" << endl;
491 cout << __LINE__ <<
"]\t" << mthn <<
"**********************************************" << endl;
498 in >>
tmp; TempRange_=
tmp;
505 in >>
tmp; ChipContReg_=
tmp;
512 std::string mthn =
"[PixelROCDACSettings::read()]\t\t\t\t " ;
556 in >>
tmp; VIbias_bus_=
tmp;
559 in >>
tmp; VIbias_sf_=
tmp;
562 in >>
tmp; VOffsetOp_=
tmp;
568 in >>
tmp; VOffsetRO_=
tmp;
574 in >>
tmp; VIbias_PH_=
tmp;
577 in >>
tmp; VIbias_DAC_=
tmp;
580 in >>
tmp; VIbias_roc_=
tmp;
598 static bool first=
true;
600 cout << __LINE__ <<
"]\t" << mthn <<
"**********************************************" << endl;
601 cout << __LINE__ <<
"]\t" << mthn <<
"Did not find TempRange setting in DAC settings" << endl;
602 cout << __LINE__ <<
"]\t" << mthn <<
"Will use a default value of 4." << endl;
603 cout << __LINE__ <<
"]\t" << mthn <<
"This message will only be printed out once" << endl;
604 cout << __LINE__ <<
"]\t" << mthn <<
"**********************************************" << endl;
611 in >>
tmp; TempRange_=
tmp;
618 in >>
tmp; ChipContReg_=
tmp;
707 VIbias_bus_ = dacValue;
710 VIbias_sf_ = dacValue;
713 VOffsetOp_ = dacValue;
719 VOffsetRO_ = dacValue;
725 VIbias_PH_ = dacValue;
728 VIbias_DAC_ = dacValue;
731 VIbias_roc_ = dacValue;
749 TempRange_ = dacValue;
755 ChipContReg_ = dacValue;
759 cout <<
"ERROR in PixelROCDACSettings::setDac: DAC name " << dacName <<
" does not exist." << endl;
855 cout <<
"ERROR in PixelROCDACSettings::getDac: DAC name " << dacName <<
" does not exist." << endl;
864 for(
unsigned int i = 0;
i <
generic.length() ;
i++)
866 result.append(1,(
char)tolower(
generic[
i]) );
const std::string k_DACName_VcThr
const std::string k_DACName_VrgPr
unsigned int getDac(std::string dacName) const
const std::string k_DACName_ChipContReg
const std::string k_DACName_Vsf
const std::string k_DACName_CalDel
const std::string k_DACName_TempRange
const std::string k_DACName_VIbias_sf
const std::string k_DACName_Vtrim
const std::string k_DACName_VIbias_DAC
const std::string k_DACName_VwllSh
const std::string k_DACName_Vnpix
const std::string k_DACName_Vleak
const std::string k_DACName_VIbias_PH
const std::string k_DACName_VOffsetRO
std::string getConfigCommand()
const std::string k_DACName_VIbias_bus
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)
const std::string k_DACName_VIColOr
void setDAC(unsigned int dacaddress, unsigned int dacvalue)
This class provide the data structure for the ROC DAC parameters.
const std::string k_DACName_VOffsetOp
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)
const std::string k_DACName_VbiasOp
const std::string k_DACName_VIbias_roc
const std::string k_DACName_Vcal
const std::string k_DACName_VrgSh
const std::string k_DACName_VIon
const std::string k_DACName_Vcomp
void checkTag(std::string tag, std::string dacName, const PixelROCName &rocid)
const std::string k_DACName_WBC
const std::string k_DACName_Vdd
const std::string k_DACName_VHldDel
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)
const std::string k_DACName_VsumCol
std::vector< std::vector< double > > tmp
void writeBinary(std::ofstream &out) const
int readBinary(std::ifstream &in, const PixelROCName &rocid)
A dummy class with ALL public variables.
const std::string k_DACName_Vana
const std::string k_DACName_VwllPr
void writeASCII(std::ostream &out) const