CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Modules | Functions | Variables | Friends
"Configuration Objects"

This is the base class of all configuration objects. More...

Classes

class  pos::PixelCalibConfiguration
 This class implements the steps that are used in a scan over Threshold and CalDelay. More...
 
class  pos::PixelConfigBase
 This file contains the base class for "pixel configuration data" management. More...
 
class  pos::PixelDACSettings
 This class is responsible for manipulating the DACsettings of a ROC. More...
 
class  pos::PixelDelay25Calib
 This class manages data and files used in the Delay25 calibration. More...
 
class  pos::PixelDetectorConfig
 This is the documentation about PixelDetectorConfig... More...
 
class  pos::PixelFECConfig
 This class specifies which FEC boards are used and how they are addressed. More...
 
class  pos::PixelFEDCard
 This is the documentation about PixelFEDCard... More...
 
class  pos::PixelFEDConfig
 This is the documentation about PixelFEDConfig... More...
 
class  pos::PixelGlobalDelay25
 This class specifies which delay25 channels are delayed over the entire pixel detector and by how much. More...
 
class  pos::PixelLowVoltageMap
 This is the documentation about PixelLowVoltageMap... More...
 
class  pos::PixelLTCConfig
 This is the documentation about PixelLTCConfig... More...
 
class  pos::PixelMaskAllPixels
 This is the documentation about PixelMaskAllPixels... More...
 
class  pos::PixelMaskBase
 This is the documentation about PixelMaskBase... More...
 
class  pos::PixelMaskOverrideBase
 This is the documentation about PixelMaskOverrideBase... More...
 
class  pos::PixelMaxVsf
 This is the documentation about PixelMaxVsf... More...
 
class  pos::PixelNameTranslation
 This is the documentation about PixelNameTranslation... More...
 
class  pos::PixelPortCardConfig
 This is the documentation about PixelNameTranslation... More...
 
class  pos::PixelTBMSettings
 This is the documentation about PixelTBMSettings... More...
 
class  pos::PixelTKFECConfig
 This class specifies which TKFEC boards are used and how they are addressed. More...
 
class  pos::PixelTrimBase
 This class implements.. More...
 
class  pos::PixelTrimCommon
 This class implements.. More...
 

Modules

 "Trim Objects"
 

Functions

void pos::PixelDACSettings::addROC (PixelROCDACSettings &rocname)
 
void pos::PixelDACSettings::generateConfiguration (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans, PixelDetectorConfig *detconfig, bool HVon=true) const
 
PixelROCDACSettings pos::PixelDACSettings::getDACSettings (int ROCId) const
 
PixelROCDACSettingspos::PixelDACSettings::getDACSettings (PixelROCName)
 
unsigned int pos::PixelDACSettings::numROCs ()
 
 pos::PixelDACSettings::PixelDACSettings (std::string filename)
 
 pos::PixelDACSettings::PixelDACSettings (std::vector< std::vector< std::string > > &tableMat)
 
 pos::PixelDACSettings::PixelDACSettings (PixelROCDACSettings &rocname)
 
bool pos::PixelDACSettings::rocIsDisabled (const PixelDetectorConfig *detconfig, const PixelROCName rocname) const
 
void pos::PixelDACSettings::setVcthrDisable (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans) const
 
void pos::PixelDACSettings::setVcthrEnable (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans, PixelDetectorConfig *detconfig) const
 
void pos::PixelDACSettings::writeASCII (std::string dir) const override
 
void pos::PixelDACSettings::writeBinary (std::string filename) const
 
void pos::PixelDACSettings::writeXML (pos::PixelConfigKey key, int version, std::string path) const override
 
void pos::PixelDACSettings::writeXML (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void pos::PixelDACSettings::writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void pos::PixelDACSettings::writeXMLTrailer (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 

Variables

std::vector< PixelROCDACSettings > pos::PixelDACSettings::dacsettings_
 

Friends

std::ostream & pos::PixelDACSettings::operator<< (std::ostream &s, const PixelDACSettings &mask)
 

Detailed Description

This is the base class of all configuration objects.

A longer explanation of what a 'configuration object' actually is will be posted here once we find the time to write it....

Function Documentation

void PixelDACSettings::addROC ( PixelROCDACSettings rocname)

Definition at line 137 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

137 { dacsettings_.push_back(rocname); }
std::vector< PixelROCDACSettings > dacsettings_
void PixelDACSettings::generateConfiguration ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans,
PixelDetectorConfig detconfig,
bool  HVon = true 
) const

Definition at line 496 of file PixelDACSettings.cc.

References pos::PixelFECConfigInterface::calpix(), pos::PixelFECConfigInterface::clrcal(), cuy::col, gather_cfg::cout, pos::PixelDACSettings::dacsettings_, pos::PixelFECConfigInterface::dcolenable(), pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), mps_fire::i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), pos::PixelHdwAddress::rocid(), pos::PixelDACSettings::rocIsDisabled(), and pos::PixelFECConfigInterface::setAllDAC().

499  {
500  bool bufferData = true;
501 
502  std::vector<unsigned int> dacs;
503 
504  //pixelFEC->fecDebug(1); //FIXME someday maybe don't want to take the time
505 
506  for (unsigned int i = 0; i < dacsettings_.size(); i++) { // loop over ROCs
507 
508  bool disableRoc = rocIsDisabled(detconfig, dacsettings_[i].getROCName());
509 
510  dacsettings_[i].getDACs(dacs);
511 
512  PixelHdwAddress theROC = *(trans->getHdwAddress(dacsettings_[i].getROCName()));
513 
514  //Need to set readout speed (40MHz) and Vcal range (0-1800 mV) and enable the chip
515 
516  // This is not needed. The ControlReg is programmed in setAllDAC(). d.k. 21.01.11
517  // pixelFEC->progdac(theROC.mfec(),
518  // theROC.mfecchannel(),
519  // theROC.hubaddress(),
520  // theROC.portaddress(),
521  // theROC.rocid(),
522  // 0xfd,
523  // controlreg,
524  // bufferData);
525 
526  if (!HVon || disableRoc)
527  dacs[11] = 0; //set Vcthr DAC to 0 (Vcthr is DAC 12=11+1)
528  // std::cout<<" ; setting VcThr to "<<dacs[11]<<std::endl; //for debugging
529  pixelFEC->setAllDAC(theROC, dacs, bufferData);
530 
531  // start with no pixels on for calibration
532  pixelFEC->clrcal(
533  theROC.mfec(), theROC.mfecchannel(), theROC.hubaddress(), theROC.portaddress(), theROC.rocid(), bufferData);
534 
535  const bool kmeKLUDGE = false;
536  if (kmeKLUDGE) //enable one pixel per ROC for calibration (all the time!)
537  {
538  unsigned int col = 0;
539  //for(unsigned int col=0;col<52;col+=50) //try 0, 50
540  {
541  pixelFEC->calpix(theROC.mfec(),
542  theROC.mfecchannel(),
543  theROC.hubaddress(),
544  theROC.portaddress(),
545  theROC.rocid(),
546  col, //column
547  0, //row
548  1, //caldata
549  bufferData);
550  }
551  }
552 
553  // enable all the double columns
554  for (int dcol = 0; dcol < 26; dcol++) {
555  pixelFEC->dcolenable(theROC.mfec(),
556  theROC.mfecchannel(),
557  theROC.hubaddress(),
558  theROC.portaddress(),
559  theROC.rocid(),
560  dcol,
561  1,
562  bufferData);
563  }
564 
565  if (!HVon || disableRoc) { //HV off
566  int controlreg = dacsettings_[i].getControlRegister();
567  // std::cout << "[PixelDACSettings::generateConfiguration] HV off! ROC control reg to be set to: " << (controlreg|0x2) <<std::endl;
568  pixelFEC->progdac(theROC.mfec(),
569  theROC.mfecchannel(),
570  theROC.hubaddress(),
571  theROC.portaddress(),
572  theROC.rocid(),
573  0xfd,
574  controlreg | 0x2, //=010 in binary. should disable the chip
575  bufferData);
576  } //HV off
577 
578  // Now program (again) the temperature register to make sure it is the last one
579  // and appears in the LastDAC
580  if (readTemperatures) {
581  // std::cout<<"ROC="<<dacsettings_[i].getROCName()<<" ; VcThr set to "<<dacs[11]
582  // << " ROC control reg to be set to: " << dacs[28] <<" LastDAC=Temp"<<std::endl;
583  if ((theROC.mfec() == 1) && (theROC.mfecchannel() == 1) && (theROC.hubaddress() == 0) &&
584  (theROC.portaddress() == 0) && (theROC.rocid()))
585  std::cout << "ROC=" << dacsettings_[i].getROCName() << " ROC control reg to be set to: " << dacs[28]
586  << " LastDAC=Temp " << temperatureReg << std::endl;
587  //int temperatureReg = dacs[26]; // overwrite with the number from DB
588  pixelFEC->progdac(theROC.mfec(),
589  theROC.mfecchannel(),
590  theROC.hubaddress(),
591  theROC.portaddress(),
592  theROC.rocid(),
593  0x1B,
594  temperatureReg,
595  bufferData);
596  } else {
597  // std::cout<<"ROC="<<dacsettings_[i].getROCName()<<" ; VcThr set to "<<dacs[11]
598  // << " ROC control reg to be set to: " << dacs[28] <<" LastDAC=Vcal"<<std::endl;
599  if ((theROC.mfec() == 1) && (theROC.mfecchannel() == 1) && (theROC.hubaddress() == 0) &&
600  (theROC.portaddress() == 0) && (theROC.rocid()))
601  std::cout << "ROC=" << dacsettings_[i].getROCName() << " ROC control reg to be set to: " << dacs[28]
602  << " LastDAC=Vcal" << std::endl;
603  // VCAL
604  pixelFEC->progdac(theROC.mfec(),
605  theROC.mfecchannel(),
606  theROC.hubaddress(),
607  theROC.portaddress(),
608  theROC.rocid(),
609  0x19,
610  200,
611  bufferData);
612  }
613 
614  } // end ROC loop
615 
616  if (bufferData) { // Send data to the FEC
617  pixelFEC->qbufsend();
618  }
619 }
unsigned int mfec() const
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
virtual int clrcal(int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, bool buffermode=false)=0
bool rocIsDisabled(const PixelDetectorConfig *detconfig, const PixelROCName rocname) const
virtual int progdac(int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, int dacaddress, int dacvalue, bool buffermode=false)=0
unsigned int portaddress() const
virtual int calpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, int caldata, bool buffermode=false)=0
virtual int dcolenable(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int dcol, int dcolstate, bool buffermode=false)=0
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
Store mfec, mfecchannel etc.
std::vector< PixelROCDACSettings > dacsettings_
virtual int qbufsend(void)=0
tuple cout
Definition: gather_cfg.py:144
int col
Definition: cuy.py:1009
virtual void setAllDAC(const PixelHdwAddress &theROC, const std::vector< unsigned int > &dacs, const bool buffermode=false)=0
PixelROCDACSettings PixelDACSettings::getDACSettings ( int  ROCId) const

Definition at line 342 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

Referenced by operator<<().

342 { return dacsettings_[ROCId]; }
std::vector< PixelROCDACSettings > dacsettings_
PixelROCDACSettings * PixelDACSettings::getDACSettings ( PixelROCName  name)

Definition at line 344 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, mps_fire::i, and mergeVDriftHistosByStation::name.

344  {
345  for (unsigned int i = 0; i < dacsettings_.size(); i++) {
346  if (dacsettings_[i].getROCName() == name)
347  return &(dacsettings_[i]);
348  }
349 
350  return nullptr;
351 }
std::vector< PixelROCDACSettings > dacsettings_
unsigned int pos::PixelDACSettings::numROCs ( )
inline

Definition at line 73 of file PixelDACSettings.h.

References pos::PixelDACSettings::dacsettings_.

73 { return dacsettings_.size(); }
std::vector< PixelROCDACSettings > dacsettings_
PixelDACSettings::PixelDACSettings ( std::string  filename)

Definition at line 32 of file PixelDACSettings.cc.

References cms::cuda::assert(), c, gather_cfg::cout, pos::PixelDACSettings::dacsettings_, mps_fire::i, recoMuon::in, pos::PixelROCDACSettings::read(), pos::PixelROCDACSettings::readBinary(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and createJobs::tmp.

32  : PixelConfigBase("", "", "") {
33  std::string mthn = "[PixelDACSettings::PixelDACSettings()]\t\t\t ";
34 
35  if (filename[filename.size() - 1] == 't') {
36  std::ifstream in(filename.c_str());
37 
38  if (!in.good()) {
39  std::cout << __LINE__ << "]\t" << mthn << "Could not open: " << filename << std::endl;
40  // assert(0); //in case of failure, we don't want POS to die here
41  throw std::runtime_error("Failed to open file " + filename);
42  } else {
43  // std::cout << "Opened:"<<filename<<std::endl;
44  }
45 
46  dacsettings_.clear();
47 
49 
50  in >> tag;
51 
52  while (!in.eof()) {
53  PixelROCName rocid(in);
54 
55  // std::cout << "[PixelDACSettings::PixelDACSettings()] DAC setting ROC id:"<<rocid<<std::endl;
56 
58 
59  tmp.read(in, rocid);
60 
61  // std::cout << "[PixelDACSettings::PixelDACSettings()] DACSetting: " << std::endl << tmp << std::endl ;
62  dacsettings_.push_back(tmp);
63 
64  in >> tag;
65 
66  assert(dacsettings_.size() < 100);
67  }
68 
69  in.close();
70 
71  } else {
72  std::ifstream in(filename.c_str(), std::ios::binary);
73 
74  if (!in.good()) {
75  std::cout << __LINE__ << "]\t" << mthn << "Could not open: " << filename << std::endl;
76  assert(0);
77  } else {
78  std::cout << __LINE__ << "]\t" << mthn << "Opened: " << filename << std::endl;
79  }
80 
81  char nchar;
82 
83  in.read(&nchar, 1);
84 
85  std::string s1;
86 
87  //wrote these lines of code without ref. needs to be fixed
88  for (int i = 0; i < nchar; i++) {
89  char c;
90  in >> c;
91  s1.push_back(c);
92  }
93 
94  //std::cout << __LINE__ << "]\t" << mthn << "READ ROC name: " << s1 << std::endl;
95 
96  dacsettings_.clear();
97 
98  while (!in.eof()) {
99  //std::cout << __LINE__ << "]\t" << mthn << "read s1 : " << s1 << std::endl;
100 
101  PixelROCName rocid(s1);
102 
103  //std::cout << __LINE__ << "]\t" << mthn << "read rocid: " << rocid << std::endl;
104 
106 
107  tmp.readBinary(in, rocid);
108 
109  dacsettings_.push_back(tmp);
110 
111  in.read(&nchar, 1);
112 
113  s1.clear();
114 
115  if (in.eof())
116  continue;
117 
118  //wrote these lines of code without ref. needs to be fixed
119  for (int i = 0; i < nchar; i++) {
120  char c;
121  in >> c;
122  s1.push_back(c);
123  }
124  }
125 
126  in.close();
127  }
128 
129  //std::cout << __LINE__ << "]\t" << mthn << "Read dac settings for "<<dacsettings_.size()<<" ROCs"<<std::endl;
130 }
const edm::EventSetup & c
assert(be >=bs)
int read(std::ifstream &in, const PixelROCName &rocid)
std::vector< PixelROCDACSettings > dacsettings_
This class implements..
Definition: PixelROCName.h:23
tuple filename
Definition: lut2db_cfg.py:20
int readBinary(std::ifstream &in, const PixelROCName &rocid)
This class implements..
tuple cout
Definition: gather_cfg.py:144
tmp
align.sh
Definition: createJobs.py:716
PixelConfigBase(std::string description, std::string creator, std::string date)
PixelDACSettings::PixelDACSettings ( std::vector< std::vector< std::string > > &  tableMat)

Definition at line 139 of file PixelDACSettings.cc.

References cms::cuda::assert(), c, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, pos::PixelDACSettings::dacsettings_, cuy::ins, pos::k_DACName_CalDel, pos::k_DACName_ChipContReg, pos::k_DACName_TempRange, pos::k_DACName_Vana, pos::k_DACName_VbiasOp, pos::k_DACName_Vcal, pos::k_DACName_Vcomp, pos::k_DACName_VcThr, pos::k_DACName_Vdd, pos::k_DACName_VHldDel, pos::k_DACName_VIbias_bus, pos::k_DACName_VIbias_DAC, pos::k_DACName_VIbias_PH, pos::k_DACName_VIbias_roc, pos::k_DACName_VIbias_sf, pos::k_DACName_VIColOr, pos::k_DACName_VIon, pos::k_DACName_Vleak, pos::k_DACName_Vnpix, pos::k_DACName_VOffsetOp, pos::k_DACName_VOffsetRO, pos::k_DACName_VrgPr, pos::k_DACName_VrgSh, pos::k_DACName_Vsf, pos::k_DACName_VsumCol, pos::k_DACName_Vtrim, pos::k_DACName_VwllPr, pos::k_DACName_VwllSh, pos::k_DACName_WBC, dqmiodumpmetadata::n, alignCSCRings::r, pos::PixelROCDACSettings::read(), AlCaHLTBitMon_QueryRunRegistry::string, and createJobs::tmp.

139  : PixelConfigBase("", "", "") {
140  /*
141  EXTENSION_TABLE_NAME: ROC_DAC_SETTINGS_COL (VIEW: CONF_KEY_ROCDAC_COL_V)
142 
143  CONFIG_KEY NOT NULL VARCHAR2(80)
144  KEY_TYPE NOT NULL VARCHAR2(80)
145  KEY_ALIAS NOT NULL VARCHAR2(80)
146  VERSION VARCHAR2(40)
147  KIND_OF_COND NOT NULL VARCHAR2(40)
148  ROC_NAME VARCHAR2(200)
149  VDD NOT NULL NUMBER(38)
150  VANA NOT NULL NUMBER(38)
151  VSF NOT NULL NUMBER(38)
152  VCOMP NOT NULL NUMBER(38)
153  VLEAK NOT NULL NUMBER(38)
154  VRGPR NOT NULL NUMBER(38)
155  VWLLPR NOT NULL NUMBER(38)
156  VRGSH NOT NULL NUMBER(38)
157  VWLLSH NOT NULL NUMBER(38)
158  VHLDDEL NOT NULL NUMBER(38)
159  VTRIM NOT NULL NUMBER(38)
160  VCTHR NOT NULL NUMBER(38)
161  VIBIAS_BUS NOT NULL NUMBER(38)
162  VIBIAS_SF NOT NULL NUMBER(38)
163  VOFFSETOP NOT NULL NUMBER(38)
164  VBIASOP NOT NULL NUMBER(38)
165  VOFFSETRO NOT NULL NUMBER(38)
166  VION NOT NULL NUMBER(38)
167  VIBIAS_PH NOT NULL NUMBER(38)
168  VIBIAS_DAC NOT NULL NUMBER(38)
169  VIBIAS_ROC NOT NULL NUMBER(38)
170  VICOLOR NOT NULL NUMBER(38)
171  VNPIX NOT NULL NUMBER(38)
172  VSUMCOL NOT NULL NUMBER(38)
173  VCAL NOT NULL NUMBER(38)
174  CALDEL NOT NULL NUMBER(38)
175  TEMPRANGE NOT NULL NUMBER(38)
176  WBC NOT NULL NUMBER(38)
177  CHIPCONTREG NOT NULL NUMBER(38)
178 */
179  // std::multimap<std::string,std::pair<std::string,int > > pDSM;
180  // std::stringstream currentRocName;
181  std::vector<std::string> ins = tableMat[0];
182  std::string mthn("[PixelDACSettings::PixelDACSettings()] ");
183  std::string dacName;
184  std::istringstream dbin;
185  // int dacValue;
186  int skipColumns = 0;
187  std::map<std::string, int> colM;
188  std::vector<std::string> colNames;
189  std::map<std::string, std::string> nameTranslation;
190 
191  colNames.push_back("CONFIG_KEY");
192  colNames.push_back("KEY_TYPE");
193  colNames.push_back("KEY_ALIAS");
194  colNames.push_back("VERSION");
195  colNames.push_back("KIND_OF_COND");
196  colNames.push_back("ROC_NAME");
197  colNames.push_back("VDD");
198  colNames.push_back("VANA");
199  colNames.push_back("VSF");
200  colNames.push_back("VCOMP");
201  colNames.push_back("VLEAK");
202  colNames.push_back("VRGPR");
203  colNames.push_back("VWLLPR");
204  colNames.push_back("VRGSH");
205  colNames.push_back("VWLLSH");
206  colNames.push_back("VHLDDEL");
207  colNames.push_back("VTRIM");
208  colNames.push_back("VCTHR");
209  colNames.push_back("VIBIAS_BUS");
210  colNames.push_back("VIBIAS_SF");
211  colNames.push_back("VOFFSETOP");
212  colNames.push_back("VBIASOP");
213  colNames.push_back("VOFFSETRO");
214  colNames.push_back("VION");
215  colNames.push_back("VIBIAS_PH");
216  colNames.push_back("VIBIAS_DAC");
217  colNames.push_back("VIBIAS_ROC");
218  colNames.push_back("VICOLOR");
219  colNames.push_back("VNPIX");
220  colNames.push_back("VSUMCOL");
221  colNames.push_back("VCAL");
222  colNames.push_back("CALDEL");
223  colNames.push_back("TEMPRANGE");
224  colNames.push_back("WBC");
225  colNames.push_back("CHIPCONTREG");
226 
227  nameTranslation["VDD"] = k_DACName_Vdd;
228  nameTranslation["VANA"] = k_DACName_Vana;
229  nameTranslation["VSF"] = k_DACName_Vsf;
230  nameTranslation["VCOMP"] = k_DACName_Vcomp;
231  nameTranslation["VLEAK"] = k_DACName_Vleak;
232  nameTranslation["VRGPR"] = k_DACName_VrgPr;
233  nameTranslation["VWLLPR"] = k_DACName_VwllPr;
234  nameTranslation["VRGSH"] = k_DACName_VrgSh;
235  nameTranslation["VWLLSH"] = k_DACName_VwllSh;
236  nameTranslation["VHLDDEL"] = k_DACName_VHldDel;
237  nameTranslation["VTRIM"] = k_DACName_Vtrim;
238  nameTranslation["VCTHR"] = k_DACName_VcThr;
239  nameTranslation["VIBIAS_BUS"] = k_DACName_VIbias_bus;
240  nameTranslation["VIBIAS_SF"] = k_DACName_VIbias_sf;
241  nameTranslation["VOFFSETOP"] = k_DACName_VOffsetOp;
242  nameTranslation["VBIASOP"] = k_DACName_VbiasOp;
243  nameTranslation["VOFFSETRO"] = k_DACName_VOffsetRO;
244  nameTranslation["VION"] = k_DACName_VIon;
245  nameTranslation["VIBIAS_PH"] = k_DACName_VIbias_PH;
246  nameTranslation["VIBIAS_DAC"] = k_DACName_VIbias_DAC;
247  nameTranslation["VIBIAS_ROC"] = k_DACName_VIbias_roc;
248  nameTranslation["VICOLOR"] = k_DACName_VIColOr;
249  nameTranslation["VNPIX"] = k_DACName_Vnpix;
250  nameTranslation["VSUMCOL"] = k_DACName_VsumCol;
251  nameTranslation["VCAL"] = k_DACName_Vcal;
252  nameTranslation["CALDEL"] = k_DACName_CalDel;
253  nameTranslation["TEMPRANGE"] = k_DACName_TempRange;
254  nameTranslation["WBC"] = k_DACName_WBC;
255  nameTranslation["CHIPCONTREG"] = k_DACName_ChipContReg;
256 
257  // modified by MR on 25-02-2008 10:00:45
258  // colM stores the index (referred to tableMat) where the specified dac setting is store!!!
259  for (unsigned int c = skipColumns; c < ins.size(); c++) {
260  for (unsigned int n = 0; n < colNames.size(); n++) {
261  if (tableMat[0][c] == colNames[n]) {
262  colM[colNames[n]] = c;
263  break;
264  }
265  }
266  } //end for
267  for (unsigned int n = skipColumns; n < colNames.size(); n++) {
268  if (colM.find(colNames[n]) == colM.end()) {
269  std::cerr << "[PixelDACSettings::PixelDACSettings()]\tCouldn't find in the database the column with name "
270  << colNames[n] << std::endl;
271  assert(0);
272  }
273  }
274 
275  dacsettings_.clear();
276  // struct timeval start_time ;
277  // struct timeval end_time ;
278  // gettimeofday(&start_time, (struct timezone *)0 );
279  for (unsigned int r = 1; r < tableMat.size(); r++) { //Goes to every row of the Matrix
280  // currentRocName.str("");
281  // currentRocName << tableMat[r][colM["NAME"]] ;
282  //currentRocName << "FPix_BmI_D" << tableMat[r][colM["HDISK_POSN"]]
283  // << "_BLD" << tableMat[r][colM["BLD_POSN"]]
284  // << "_PNL" << tableMat[r][colM["PANEL_POSITION"]]
285  // << "_PLQ" << tableMat[r][colM["PLAQ_POS"]]
286  // << "_ROC" << tableMat[r][colM["ROC_POSN"]];
287 
288  // modified by MR on 25-02-2008 10:04:55
289  PixelROCName rocid(tableMat[r][colM["ROC_NAME"]]);
290  PixelROCDACSettings tmp(rocid);
291  std::ostringstream dacs("");
292  // +6 to get rid of the first 5 columns not pertaining DAC Settings...
293  for (unsigned int n = skipColumns + 6; n < colNames.size(); n++) {
294  dacs << nameTranslation[colNames[n]] << ": " << atoi(tableMat[r][colM[colNames[n]]].c_str()) << std::endl;
295  // dacName = colNames[n];
296  // dacValue = atoi(tableMat[r][colM[colNames[n]]].c_str());
297  // pDSM.insert(std::pair<std::string,std::pair<std::string,int> >(tableMat[r][colM["ROC_NAME"]],std::pair<std::string,int>(dacName,dacValue)));
298  // std::cout << "On " << tableMat[r][colM["ROC_NAME"]] << " DAC:\t" << dacName << " value:\t" << dacValue<< std::endl ;
299  // tmp.setDac(dacName, dacValue) ;
300  }
301  // tmp.setDACs(tmpDACs) ;
302  dbin.str(dacs.str());
303  tmp.read(dbin, rocid);
304  dacsettings_.push_back(tmp);
305  } //end for r
306  // gettimeofday(&end_time, (struct timezone *)0 );
307  // int total_usecs = (end_time.tv_sec - start_time.tv_sec)*1000000 + (end_time.tv_usec - start_time.tv_usec);
308  // std::cout << mthn << "Time taken : " << total_usecs / 1000000. << " secs" << std::endl;
309 
310  // dacsettings_.clear();
311  // std::string currentRocName2 = "";
312  // for(std::multimap<std::string,std::pair<std::string,int> >::iterator tableMapIt=pDSM.begin(); tableMapIt!= pDSM.end(); tableMapIt++){
313  // if(currentRocName2 != tableMapIt->first){
314  // std::cout << tableMapIt->first << std::endl;
315  // std::cout << tableMapIt->second.first << std::endl;
316  // std::cout << tableMapIt->second.second << std::endl;
317  // currentRocName2 = tableMapIt->first;
318  // PixelROCName rocid(currentRocName2);
319 
320  // // std::cout << "DAC setting ROC id:"<<rocid<<std::endl;
321 
322  // PixelROCDACSettings tmp(rocid);
323 
324  // // tmp.read(in,rocid);
325 
326  // dacsettings_.push_back(tmp);
327  // }//end if
328  // dacsettings_[dacsettings_.size()-1].setDac(tableMapIt->second.first,tableMapIt->second.second);
329  // }//end for
330 
331  // for(unsigned int w = 0 ; w < dacsettings_.size() ; w++)
332  // {
333 
334  // PixelROCDACSettings tmp2 = dacsettings_[w];
335  // // std::cout<<tmp2<<std::endl;
336  // }
337  // std::cout<<"Number of ROCs in the PixelDACSettings::PixelDACSettings(vector <vector<string> >):"<<dacsettings_.size()<<std::endl;
338  // std::cout << "[PixelDACSettings::PixelDACSettings(std::vector)] before end of constructor" << std::endl ;
339 } //end PDSMatrix constructor
const std::string k_DACName_VcThr
Definition: PixelDACNames.h:24
const std::string k_DACName_VrgPr
Definition: PixelDACNames.h:18
const edm::EventSetup & c
const std::string k_DACName_ChipContReg
Definition: PixelDACNames.h:41
const std::string k_DACName_Vsf
Definition: PixelDACNames.h:15
const std::string k_DACName_CalDel
Definition: PixelDACNames.h:38
const std::string k_DACName_TempRange
Definition: PixelDACNames.h:39
const std::string k_DACName_VIbias_sf
Definition: PixelDACNames.h:26
const std::string k_DACName_Vtrim
Definition: PixelDACNames.h:23
const std::string k_DACName_VIbias_DAC
Definition: PixelDACNames.h:32
const std::string k_DACName_VwllSh
Definition: PixelDACNames.h:21
const std::string k_DACName_Vnpix
Definition: PixelDACNames.h:35
const std::string k_DACName_Vleak
Definition: PixelDACNames.h:17
const std::string k_DACName_VIbias_PH
Definition: PixelDACNames.h:31
const std::string k_DACName_VOffsetRO
Definition: PixelDACNames.h:29
const std::string k_DACName_VIbias_bus
Definition: PixelDACNames.h:25
assert(be >=bs)
const std::string k_DACName_VIColOr
Definition: PixelDACNames.h:34
const std::string k_DACName_VOffsetOp
Definition: PixelDACNames.h:27
tuple ins
Definition: cuy.py:313
std::vector< PixelROCDACSettings > dacsettings_
const std::string k_DACName_VbiasOp
Definition: PixelDACNames.h:28
const std::string k_DACName_VIbias_roc
Definition: PixelDACNames.h:33
const std::string k_DACName_Vcal
Definition: PixelDACNames.h:37
const std::string k_DACName_VrgSh
Definition: PixelDACNames.h:20
const std::string k_DACName_VIon
Definition: PixelDACNames.h:30
const std::string k_DACName_Vcomp
Definition: PixelDACNames.h:16
const std::string k_DACName_WBC
Definition: PixelDACNames.h:40
const std::string k_DACName_Vdd
Definition: PixelDACNames.h:13
const std::string k_DACName_VHldDel
Definition: PixelDACNames.h:22
const std::string k_DACName_VsumCol
Definition: PixelDACNames.h:36
This class implements..
Definition: PixelROCName.h:23
This class implements..
tmp
align.sh
Definition: createJobs.py:716
const std::string k_DACName_Vana
Definition: PixelDACNames.h:14
PixelConfigBase(std::string description, std::string creator, std::string date)
const std::string k_DACName_VwllPr
Definition: PixelDACNames.h:19
PixelDACSettings::PixelDACSettings ( PixelROCDACSettings rocname)

Definition at line 132 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

132  : PixelConfigBase("", "", "") {
133  dacsettings_.push_back(rocname);
134 }
std::vector< PixelROCDACSettings > dacsettings_
PixelConfigBase(std::string description, std::string creator, std::string date)
bool PixelDACSettings::rocIsDisabled ( const PixelDetectorConfig detconfig,
const PixelROCName  rocname 
) const
private

Definition at line 766 of file PixelDACSettings.cc.

References cms::cuda::assert(), pos::PixelROCStatus::get(), pos::PixelDetectorConfig::getROCsList(), and pos::PixelROCStatus::noAnalogSignal.

Referenced by pos::PixelDACSettings::generateConfiguration(), and pos::PixelDACSettings::setVcthrEnable().

766  {
767  const std::map<PixelROCName, PixelROCStatus>& roclist = detconfig->getROCsList();
768  const std::map<PixelROCName, PixelROCStatus>::const_iterator iroc = roclist.find(rocname);
769  assert(iroc != roclist.end()); // the roc name should always be found
770  PixelROCStatus thisROCstatus = iroc->second;
771 
772  return thisROCstatus.get(PixelROCStatus::noAnalogSignal);
773 }
bool get(ROCstatus stat) const
assert(be >=bs)
This class implements..
const std::map< PixelROCName, PixelROCStatus > & getROCsList() const
void PixelDACSettings::setVcthrDisable ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans 
) const

Definition at line 621 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), mps_fire::i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), and pos::PixelHdwAddress::rocid().

621  {
622  //the point here is to set Vcthr to 0
623  //then disable the ROCs
624 
625  //note -- no need to look at the detconfig here, because we're going to disable everything no matter what
626 
627  bool bufferData = true;
628 
629  std::vector<unsigned int> dacs;
630 
631  for (unsigned int i = 0; i < dacsettings_.size(); i++) { //loop over the ROCs
632 
633  dacsettings_[i].getDACs(dacs);
634  int controlreg = dacsettings_[i].getControlRegister();
635 
636  PixelHdwAddress theROC = *(trans->getHdwAddress(dacsettings_[i].getROCName()));
637 
638  //std::cout<<"disabling ROC="<<dacsettings_[i].getROCName()<<std::endl;
639  pixelFEC->progdac(theROC.mfec(),
640  theROC.mfecchannel(),
641  theROC.hubaddress(),
642  theROC.portaddress(),
643  theROC.rocid(),
644  12, //12 == Vcthr
645  0, //set Vcthr to 0
646  bufferData);
647 
648  //this should disable the roc
649  pixelFEC->progdac(theROC.mfec(),
650  theROC.mfecchannel(),
651  theROC.hubaddress(),
652  theROC.portaddress(),
653  theROC.rocid(),
654  0xfd,
655  controlreg | 0x2,
656  bufferData);
657 
658  // Now program (again) the temperature register to make sure it is the last one
659  // and appears in the LastDAC
660  if (readTemperatures) {
661  //int temperatureReg = dacs[26]; // value from DB
662  pixelFEC->progdac(theROC.mfec(),
663  theROC.mfecchannel(),
664  theROC.hubaddress(),
665  theROC.portaddress(),
666  theROC.rocid(),
667  0x1B,
668  temperatureReg,
669  bufferData);
670  } else {
671  // VCAL
672  pixelFEC->progdac(theROC.mfec(),
673  theROC.mfecchannel(),
674  theROC.hubaddress(),
675  theROC.portaddress(),
676  theROC.rocid(),
677  0x19,
678  200,
679  bufferData);
680  }
681  }
682 
683  if (bufferData) { //just copying the way it was done in the existing method
684  pixelFEC->qbufsend();
685  }
686 }
unsigned int mfec() const
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
virtual int progdac(int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, int dacaddress, int dacvalue, bool buffermode=false)=0
unsigned int portaddress() const
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
Store mfec, mfecchannel etc.
std::vector< PixelROCDACSettings > dacsettings_
virtual int qbufsend(void)=0
void PixelDACSettings::setVcthrEnable ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans,
PixelDetectorConfig detconfig 
) const

Definition at line 688 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), mps_fire::i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), pos::PixelHdwAddress::rocid(), and pos::PixelDACSettings::rocIsDisabled().

690  {
691  //the point here is to set Vcthr to the nominal values
692  //then enable the ROCs
693 
694  bool bufferData = true;
695 
696  std::vector<unsigned int> dacs;
697 
698  for (unsigned int i = 0; i < dacsettings_.size(); i++) { //loop over the ROCs
699 
700  bool disableRoc =
701  rocIsDisabled(detconfig, dacsettings_[i].getROCName()); //don't enable ROCs that are disabled in the detconfig
702 
703  //std::cout<<"ROC="<<dacsettings_[i].getROCName()<<" ; VcThr set to "<<dacs[11]
704  // << " ; ROC control reg to be set to: " << controlreg <<std::endl;
705 
706  if (!disableRoc) { // Disable
707 
708  dacsettings_[i].getDACs(dacs);
709  int controlreg = dacsettings_[i].getControlRegister();
710 
711  PixelHdwAddress theROC = *(trans->getHdwAddress(dacsettings_[i].getROCName()));
712 
713  pixelFEC->progdac(theROC.mfec(),
714  theROC.mfecchannel(),
715  theROC.hubaddress(),
716  theROC.portaddress(),
717  theROC.rocid(),
718  12, //12 == Vcthr
719  dacs[11],
720  bufferData);
721 
722  //enable the roc (assuming controlreg was set for the roc to be enabled)
723 
724  pixelFEC->progdac(theROC.mfec(),
725  theROC.mfecchannel(),
726  theROC.hubaddress(),
727  theROC.portaddress(),
728  theROC.rocid(),
729  0xfd,
730  controlreg,
731  bufferData);
732 
733  // Now program (again) the temperature register to make sure it is the last one
734  // and appears in the LastDAC
735  if (readTemperatures) {
736  //int temperatureReg = dacs[26]; // value from DB
737  pixelFEC->progdac(theROC.mfec(),
738  theROC.mfecchannel(),
739  theROC.hubaddress(),
740  theROC.portaddress(),
741  theROC.rocid(),
742  0x1B,
743  temperatureReg,
744  bufferData);
745  } else {
746  // VCAL
747  pixelFEC->progdac(theROC.mfec(),
748  theROC.mfecchannel(),
749  theROC.hubaddress(),
750  theROC.portaddress(),
751  theROC.rocid(),
752  0x19,
753  200,
754  bufferData);
755  }
756 
757  } // end disable
758 
759  } // loop over ROCs
760 
761  if (bufferData) { // Send data to FEC
762  pixelFEC->qbufsend();
763  }
764 }
unsigned int mfec() const
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
bool rocIsDisabled(const PixelDetectorConfig *detconfig, const PixelROCName rocname) const
virtual int progdac(int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, int dacaddress, int dacvalue, bool buffermode=false)=0
unsigned int portaddress() const
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
Store mfec, mfecchannel etc.
std::vector< PixelROCDACSettings > dacsettings_
virtual int qbufsend(void)=0
void PixelDACSettings::writeASCII ( std::string  dir) const
overridevirtual

Implements pos::PixelConfigBase.

Definition at line 361 of file PixelDACSettings.cc.

References gather_cfg::cout, pos::PixelDACSettings::dacsettings_, lut2db_cfg::filename, mps_fire::i, callgraph::module, pos::PixelModuleName::modulename(), submitPVResolutionJobs::out, and AlCaHLTBitMon_QueryRunRegistry::string.

361  {
362  std::string mthn = "[PixelDACSettings::writeASCII()]\t\t\t ";
363  PixelModuleName module(dacsettings_[0].getROCName().rocname());
364 
365  std::string filename = dir + "/ROC_DAC_module_" + module.modulename() + ".dat";
366  std::cout << __LINE__ << "]\t" << mthn << "Writing to file " << filename << std::endl;
367  std::ofstream out(filename.c_str());
368 
369  for (unsigned int i = 0; i < dacsettings_.size(); i++) {
370  dacsettings_[i].writeASCII(out);
371  }
372 }
std::vector< PixelROCDACSettings > dacsettings_
This class implements..
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:144
tuple module
Definition: callgraph.py:69
void PixelDACSettings::writeBinary ( std::string  filename) const

Definition at line 353 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, mps_fire::i, and submitPVResolutionJobs::out.

353  {
354  std::ofstream out(filename.c_str(), std::ios::binary);
355 
356  for (unsigned int i = 0; i < dacsettings_.size(); i++) {
357  dacsettings_[i].writeBinary(out);
358  }
359 }
std::vector< PixelROCDACSettings > dacsettings_
tuple filename
Definition: lut2db_cfg.py:20
void pos::PixelDACSettings::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 88 of file PixelDACSettings.h.

88 { ; }
void PixelDACSettings::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 422 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, mps_fire::i, and AlCaHLTBitMon_QueryRunRegistry::string.

422  {
423  std::string mthn = "[PixelDACSettings::writeXML()]\t\t\t ";
424 
425  for (unsigned int i = 0; i < dacsettings_.size(); i++) {
426  dacsettings_[i].writeXML(outstream);
427  }
428 }
std::vector< PixelROCDACSettings > dacsettings_
void PixelDACSettings::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 375 of file PixelDACSettings.cc.

References gather_cfg::cout, contentValuesFiles::fullPath, pos::PixelConfigBase::getAuthor(), pos::PixelConfigBase::getComment(), pos::PixelTimeFormatter::getmSecTime(), pos::PixelTimeFormatter::getTime(), and AlCaHLTBitMon_QueryRunRegistry::string.

380  {
381  std::string mthn = "[PixelDACSettings::writeXMLHeader()]\t\t\t ";
382  std::stringstream fullPath;
383 
384  fullPath << path << "/Pixel_RocDacSettings_" << PixelTimeFormatter::getmSecTime() << ".xml";
385  std::cout << __LINE__ << "]\t" << mthn << "Writing to: " << fullPath.str() << std::endl;
386 
387  outstream->open(fullPath.str().c_str());
388 
389  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
390  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
391  *outstream << "" << std::endl;
392  *outstream << " <!-- " << mthn << "-->" << std::endl;
393  *outstream << "" << std::endl;
394  *outstream << " <HEADER>" << std::endl;
395  *outstream << " <TYPE>" << std::endl;
396  *outstream << " <EXTENSION_TABLE_NAME>ROC_DAC_SETTINGS_COL</EXTENSION_TABLE_NAME>" << std::endl;
397  *outstream << " <NAME>ROC DAC Settings Col</NAME>" << std::endl;
398  *outstream << " </TYPE>" << std::endl;
399  *outstream << " <RUN>" << std::endl;
400  *outstream << " <RUN_TYPE>ROC DAC Settings</RUN_TYPE>" << std::endl;
401  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
402  *outstream << " <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl;
403  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl;
404  *outstream << " </RUN>" << std::endl;
405  *outstream << " </HEADER>" << std::endl;
406  *outstream << "" << std::endl;
407  *outstream << " <DATA_SET>" << std::endl;
408  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl;
409  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl;
410  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl;
411  *outstream << " " << std::endl;
412  *outstream << " <PART>" << std::endl;
413  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
414  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
415  *outstream << " </PART>" << std::endl;
416  *outstream << " " << std::endl;
417 
418  std::cout << __LINE__ << "]\t" << mthn << "Header written" << std::endl;
419 }
static std::string getmSecTime(void)
static std::string getTime(void)
std::string getComment() const
std::string getAuthor() const
tuple cout
Definition: gather_cfg.py:144
void PixelDACSettings::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 431 of file PixelDACSettings.cc.

References gather_cfg::cout, and AlCaHLTBitMon_QueryRunRegistry::string.

433  {
434  std::string mthn = "[PixelDACSettings::writeXMLTrailer()]\t\t\t ";
435 
436  *outstream << " </DATA_SET>" << std::endl;
437  *outstream << "</ROOT>" << std::endl;
438 
439  outstream->close();
440  std::cout << __LINE__ << "]\t" << mthn << "Data written" << std::endl;
441 }
tuple cout
Definition: gather_cfg.py:144

Variable Documentation

std::vector<PixelROCDACSettings> pos::PixelDACSettings::dacsettings_
private

Friends

std::ostream& operator<< ( std::ostream &  s,
const PixelDACSettings mask 
)
friend

Definition at line 775 of file PixelDACSettings.cc.

775  {
776  s << dacs.getDACSettings(0) << std::endl;
777 
778  return s;
779 }