CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
pos::PixelCalibConfiguration Class Reference

This class implements the steps that are used in a scan over Threshold and CalDelay. More...

#include "interface/PixelCalibConfiguration.h"

Inheritance diagram for pos::PixelCalibConfiguration:
pos::PixelCalibBase pos::PixelConfigBase

Public Member Functions

void buildROCAndModuleLists (const PixelNameTranslation *translation, const PixelDetectorConfig *detconfig)
 
const std::set< PixelChannel > & channelList () const
 
const std::vector< std::vector
< unsigned int > > & 
columnList () const
 
bool containsScan (std::string name) const
 
std::vector< std::pair
< unsigned int, std::vector
< unsigned int > > > & 
fedCardsAndChannels (unsigned int crate, PixelNameTranslation *translation, PixelFEDConfig *fedconfig, PixelDetectorConfig *detconfig) const
 
std::set< unsigned int > getFECCrates (const PixelNameTranslation *translation, const PixelFECConfig *fecconfig) const
 
std::set< unsigned int > getFEDCrates (const PixelNameTranslation *translation, const PixelFEDConfig *fedconfig) const
 
std::map< unsigned int,
std::set< unsigned int > > 
getFEDsAndChannels (PixelNameTranslation *translation)
 
std::string getStreamedContent (void) const
 
std::set< unsigned int > getTKFECCrates (const PixelPortcardMap *portcardmap, const std::map< std::string, PixelPortCardConfig * > &mapNamePortCard, const PixelTKFECConfig *tkfecconfig) const
 
unsigned int iScan (std::string dac) const
 
unsigned int maxNumHitsPerROC () const
 
std::string mode () const override
 
const std::set< PixelModuleName > & moduleList () const
 
unsigned int nConfigurations () const
 
void nextFECState (std::map< unsigned int, PixelFECConfigInterface * > &pixelFECs, PixelDetectorConfig *detconfig, PixelNameTranslation *trans, std::map< pos::PixelModuleName, pos::PixelMaskBase * > *masks, std::map< pos::PixelModuleName, pos::PixelTrimBase * > *trims, std::map< pos::PixelModuleName, pos::PixelDACSettings * > *dacss, unsigned int state) const
 
bool noHits () const
 
unsigned int nParameters () const
 
unsigned int nPixelPatterns () const
 
unsigned int nROC () const
 
unsigned int nScanPoints (std::string dac) const
 
unsigned int nScanPoints () const
 
unsigned int nTriggersPerPattern () const
 
unsigned int nTriggersTotal () const
 
unsigned int numberOfScanVariables () const
 
std::map< std::string,
std::string > 
parametersList () const
 
std::string parameterValue (std::string parameterName) const
 
 PixelCalibConfiguration (std::string filename="")
 
 PixelCalibConfiguration (std::vector< std::vector< std::string > > &)
 
std::set< std::pair< unsigned
int, unsigned int > > 
pixelsWithHits (unsigned int state) const
 
const std::vector< PixelROCName > & rocList () const
 
const std::vector< std::vector
< unsigned int > > & 
rowList () const
 
unsigned int scanCounter (std::string dac, unsigned int state) const
 
std::string scanName (unsigned int iscan) const
 
bool scanningROCForState (PixelROCName roc, unsigned int state) const
 
unsigned int scanValue (std::string dac, unsigned int state, PixelROCName roc) const
 
unsigned int scanValue (std::string dac, unsigned int state) const
 
double scanValueMax (std::string dac) const
 
double scanValueMin (std::string dac) const
 
std::vector< unsigned int > scanValues (std::string dac) const
 
bool scanValuesMixedAcrossROCs (std::string dac) const
 
double scanValueStep (std::string dac) const
 
bool singleROC () const
 
void writeASCII (std::string dir="") const override
 
void writeXML (pos::PixelConfigKey key, int version, std::string path) const override
 
void writeXML (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLTrailer (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
 ~PixelCalibConfiguration () override
 
- Public Member Functions inherited from pos::PixelCalibBase
 PixelCalibBase ()
 
virtual ~PixelCalibBase ()
 
- Public Member Functions inherited from pos::PixelConfigBase
std::string creator ()
 
std::string date ()
 
std::string description ()
 
std::string getAuthor () const
 
std::string getComment () const
 
 PixelConfigBase (std::string description, std::string creator, std::string date)
 
void setAuthor (std::string author)
 
void setComment (std::string comment)
 
virtual void writeXML (std::ofstream *out) const
 
virtual void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
 
virtual void writeXMLTrailer (std::ofstream *out) const
 
virtual ~PixelConfigBase ()
 

Private Member Functions

void buildObjectsDependingOnTheNameTranslation (const PixelNameTranslation *aNameTranslation)
 
void buildROCAndModuleListsFromROCSet (const std::set< PixelROCName > &rocSet)
 
unsigned int colCounter (unsigned int state) const
 
void disablePixels (PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
 
void disablePixels (PixelFECConfigInterface *pixelFEC, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
 
void enablePixels (PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCMaskBits *masks, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
 
unsigned int nScanPoints (unsigned int iscan) const
 
unsigned int numROCsCalibratedOnChannel (PixelROCName roc) const
 
unsigned int ROCNumberOnChannelAmongThoseCalibrated (PixelROCName roc) const
 
unsigned int rowCounter (unsigned int state) const
 
unsigned int scanCounter (unsigned int iscan, unsigned int state) const
 
unsigned int scanROC (unsigned int state) const
 
unsigned int scanValue (unsigned int iscan, unsigned int state, unsigned int ROCNumber, unsigned int ROCsOnChannel) const
 
unsigned int scanValue (unsigned int iscan, unsigned int state, PixelROCName roc) const
 
double scanValueMax (unsigned int iscan) const
 
double scanValueMin (unsigned int iscan) const
 
std::vector< unsigned int > scanValues (unsigned int iscan) const
 
bool scanValuesMixedAcrossROCs (unsigned int iscan) const
 
double scanValueStep (unsigned int iscan) const
 

Private Attributes

bool _bufferData
 
std::string calibFileContent_
 
std::set< PixelChannelchannels_
 
std::vector< std::vector
< unsigned int > > 
cols_
 
std::vector< PixelDACScanRangedacs_
 
std::vector< std::pair
< unsigned int, std::vector
< unsigned int > > > 
fedCardsAndChannels_
 
bool highVCalRange_
 
std::set< PixelModuleNamemodules_
 
unsigned int nROC_
 
unsigned int ntrigger_
 
std::map< PixelROCName,
unsigned int > 
numROCsCalibratedOnChannel_
 
bool objectsDependingOnTheNameTranslationBuilt_
 
std::vector< int > old_icols
 
std::vector< int > old_irows
 
std::map< std::string,
std::string > 
parameters_
 
bool rocAndModuleListsBuilt_
 
std::vector< PixelROCInforocInfo_
 
std::vector< std::string > rocListInstructions_
 
std::map< PixelROCName,
unsigned int > 
ROCNumberOnChannelAmongThoseCalibrated_
 
std::vector< PixelROCNamerocs_
 
std::vector< std::vector
< unsigned int > > 
rows_
 
bool singleROC_
 
bool usesROCList_
 

Friends

std::ostream & pos::operator<< (std::ostream &s, const PixelCalibConfiguration &calib)
 

Additional Inherited Members

- Protected Attributes inherited from pos::PixelCalibBase
std::string mode_
 

Detailed Description

This class implements the steps that are used in a scan over Threshold and CalDelay.

" " " " It features a double inheritance, both from ConfigurationObjects and CalibrationObjects

A longer explanation will be placed here later

Definition at line 65 of file PixelCalibConfiguration.h.

Constructor & Destructor Documentation

PixelCalibConfiguration::PixelCalibConfiguration ( std::string  filename = "")

Definition at line 285 of file PixelCalibConfiguration.cc.

References _bufferData, funct::abs(), cms::cuda::assert(), buildROCAndModuleListsFromROCSet(), calibFileContent_, cols_, gather_cfg::cout, dacs_, first, highVCalRange_, recoMuon::in, pos::k_DACName_Vcal, dqmdumpme::last, reco_application_tbsim_DetSim-Digi_cfg::mix, pos::PixelCalibBase::mode_, mergeVDriftHistosByStation::name, ntrigger_, objectsDependingOnTheNameTranslationBuilt_, parameters_, rocAndModuleListsBuilt_, rocListInstructions_, postprocess-scan-build::rows, rows_, pos::PixelDACScanRange::setNegative(), pos::PixelDACScanRange::setRelative(), singleROC_, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, usesROCList_, hgcalPerformanceValidation::val, and makeHLTPrescaleTable::values.

285  : PixelCalibBase(), PixelConfigBase("", "", "") {
286  std::string mthn = "[PixelCalibConfiguration::PixelCalibConfiguration()]\t ";
287 
288  _bufferData = true;
289 
290  std::ifstream in(filename.c_str());
291 
292  if (!in.good()) {
293  std::cout << __LINE__ << "]\t" << mthn << "Could not open:" << filename << std::endl;
294  assert(0);
295  } else {
296  std::cout << __LINE__ << "]\t" << mthn << "Opened:" << filename << std::endl;
297  }
298 
300 
301  in >> tmp;
302 
303  if (tmp == "Mode:") {
304  in >> mode_;
305  std::cout << __LINE__ << "]\t" << mthn << "PixelCalibConfiguration mode=" << mode_ << std::endl;
306  in >> tmp;
307  } else {
308  mode_ = "FEDChannelOffsetPixel";
309  std::cout << __LINE__ << "]\t" << mthn << "PixelCalibConfiguration mode not set, is this an old file? " << __LINE__
310  << "]\t" << std::endl;
311  assert(0);
312  }
313 
314  singleROC_ = false;
315 
316  if (tmp == "SingleROC") {
317  singleROC_ = true;
318  in >> tmp;
319  }
320 
321  // Read in parameters, if any.
322  if (tmp == "Parameters:") {
323  in >> tmp;
324  while (tmp != "Rows:") {
325  assert(!in.eof());
326  std::string paramName = tmp;
327  in >> tmp; // tmp contains the parameter value
328  parameters_[paramName] = tmp;
329  in >> tmp; // tmp contains the next parameter's name, or "Rows:"
330  }
331  }
332 
333  assert(tmp == "Rows:");
334 
335  in >> tmp;
336 
337  std::vector<unsigned int> rows;
338  while (tmp != "Cols:") {
339  if (tmp == "|") {
340  rows_.push_back(rows);
341  rows.clear();
342  } else {
343  if (tmp != "*") {
344  rows.push_back(atoi(tmp.c_str()));
345  }
346  }
347  in >> tmp;
348  }
349  rows_.push_back(rows);
350  rows.clear();
351 
352  in >> tmp;
353 
354  std::vector<unsigned int> cols;
355  while ((tmp != "VcalLow:") && (tmp != "VcalHigh:") && (tmp != "Vcal:") && (tmp != "VcalHigh") && (tmp != "VcalLow")) {
356  if (tmp == "|") {
357  cols_.push_back(cols);
358  cols.clear();
359  } else {
360  if (tmp != "*") {
361  cols.push_back(atoi(tmp.c_str()));
362  }
363  }
364  in >> tmp;
365  }
366  cols_.push_back(cols);
367  cols.clear();
368 
369  highVCalRange_ = true;
370 
371  if (tmp == "VcalLow") {
372  highVCalRange_ = false;
373  in >> tmp;
374  }
375 
376  if (tmp == "VcalHigh") {
377  highVCalRange_ = true;
378  in >> tmp;
379  }
380 
381  if (tmp == "VcalLow:") {
382  highVCalRange_ = false;
383  }
384 
385  if ((tmp == "VcalLow:") || (tmp == "VcalHigh:") || (tmp == "Vcal:")) {
386  unsigned int first, last, step;
387  in >> first >> last >> step;
388  unsigned int index = 1;
389  if (!dacs_.empty()) {
390  index = dacs_.back().index() * dacs_.back().getNPoints();
391  }
392  in >> tmp;
393  bool mix = false;
394  if (tmp == "mix") {
395  mix = true;
396  in >> tmp;
397  }
398  PixelDACScanRange dacrange(pos::k_DACName_Vcal, first, last, step, index, mix);
399  dacs_.push_back(dacrange);
400  } else {
401  //in >> tmp;
402  while (tmp == "Scan:" || tmp == "ScanValues:") {
403  if (tmp == "ScanValues:") {
404  std::string dacname;
405  in >> dacname;
406  vector<unsigned int> values;
407  int val;
408  in >> val;
409  while (val != -1) {
410  values.push_back(val);
411  in >> val;
412  }
413  unsigned int index = 1;
414  if (!dacs_.empty()) {
415  index = dacs_.back().index() * dacs_.back().getNPoints();
416  }
417  PixelDACScanRange dacrange(dacname, values, index, false);
418  dacs_.push_back(dacrange);
419  in >> tmp;
420  } else {
421  std::string dacname;
422  in >> dacname;
423  unsigned int first, last, step;
424  in >> first >> last >> step;
425  unsigned int index = 1;
426  if (!dacs_.empty()) {
427  index = dacs_.back().index() * dacs_.back().getNPoints();
428  }
429  in >> tmp;
430  bool mix = false;
431  if (tmp == "mix") {
432  mix = true;
433  in >> tmp;
434  }
435  PixelDACScanRange dacrange(dacname, first, last, step, index, mix);
436  dacs_.push_back(dacrange);
437  }
438  }
439 
440  while ((tmp == "Set:") || (tmp == "SetRelative:")) {
441  string name;
442  in >> name;
443  int val;
444  in >> val;
445  unsigned int absval = std::abs(val);
446  unsigned int index = 1;
447  if (!dacs_.empty())
448  index = dacs_.back().index() * dacs_.back().getNPoints();
449  PixelDACScanRange dacrange(name, absval, absval, 1, index, false);
450  if (tmp == "SetRelative:") {
451  dacrange.setRelative();
452  if (val < 0) {
453  dacrange.setNegative();
454  }
455  }
456  dacs_.push_back(dacrange);
457  in >> tmp;
458  }
459  }
460 
461  assert(tmp == "Repeat:");
462 
463  in >> ntrigger_;
464 
465  in >> tmp;
466 
467  usesROCList_ = false;
468  bool buildROCListNow = false;
469  if (tmp == "Rocs:") {
470  buildROCListNow = true;
471  usesROCList_ = true;
472  } else {
473  assert(tmp == "ToCalibrate:");
474  buildROCListNow = false;
475  }
476 
477  while (!in.eof()) {
478  tmp = "";
479  in >> tmp;
480 
481  // added by F.Blekman to be able to deal with POS245 style calib.dat files in CMSSW
482  // these files use the syntax:
483  // Rocs:
484  // all
485 
486  if (tmp == "all" || tmp == "+" || tmp == "-") {
487  buildROCListNow = false;
488  }
489  // end of addition by F.B.
490 
491  if (tmp.empty())
492  continue;
493  rocListInstructions_.push_back(tmp);
494  }
495 
496  in.close();
497 
498  rocAndModuleListsBuilt_ = false;
499  if (buildROCListNow) {
500  std::set<PixelROCName> rocSet;
501  for (std::vector<std::string>::iterator rocListInstructions_itr = rocListInstructions_.begin();
502  rocListInstructions_itr != rocListInstructions_.end();
503  ++rocListInstructions_itr) {
504  PixelROCName rocname(*rocListInstructions_itr);
505  rocSet.insert(rocname);
506  }
508  }
509 
511 
512  // Added by Dario as a temporary patch for Debbie (this will disappear in the future)
513  std::ifstream inTmp(filename.c_str());
514  calibFileContent_ = "";
515  while (!inTmp.eof()) {
516  std::string tmpString;
517  getline(inTmp, tmpString);
518  calibFileContent_ += tmpString + "\n";
519  //cout << __LINE__ << "]\t" << "[PixelCalibConfiguration::~PixelCalibConfiguration()]\t\t" << calibFileContent_ << endl ;
520  }
521  inTmp.close();
522  // End of temporary patch
523 
524  return;
525 }
std::vector< std::vector< unsigned int > > rows_
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
assert(be >=bs)
std::vector< PixelDACScanRange > dacs_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::string > rocListInstructions_
const std::string k_DACName_Vcal
Definition: PixelDACNames.h:37
std::map< std::string, std::string > parameters_
This class implements..
Definition: PixelROCName.h:23
tuple filename
Definition: lut2db_cfg.py:20
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:94
tuple last
Definition: dqmdumpme.py:56
tmp
align.sh
Definition: createJobs.py:716
std::vector< std::vector< unsigned int > > cols_
PixelConfigBase(std::string description, std::string creator, std::string date)
PixelCalibConfiguration::PixelCalibConfiguration ( std::vector< std::vector< std::string > > &  tableMat)

EXTENSION_TABLE_NAME: PIXEL_CALIB_CLOB (VIEW: CONF_KEY_PIXEL_CALIB_V)

CONFIG_KEY NOT NULL VARCHAR2(80) KEY_TYPE NOT NULL VARCHAR2(80) KEY_ALIAS NOT NULL VARCHAR2(80) VERSION VARCHAR2(40) KIND_OF_COND NOT NULL VARCHAR2(40) CALIB_TYPE VARCHAR2(200) CALIB_OBJ_DATA_FILE NOT NULL VARCHAR2(200) CALIB_OBJ_DATA_CLOB NOT NULL CLOB

Definition at line 24 of file PixelCalibConfiguration.cc.

References _bufferData, cms::cuda::assert(), buildROCAndModuleListsFromROCSet(), c, calibFileContent_, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, cols_, gather_cfg::cout, dacs_, first, highVCalRange_, recoMuon::in, pos::k_DACName_Vcal, dqmdumpme::last, reco_application_tbsim_DetSim-Digi_cfg::mix, pos::PixelCalibBase::mode_, dqmiodumpmetadata::n, mergeVDriftHistosByStation::name, ntrigger_, objectsDependingOnTheNameTranslationBuilt_, parameters_, rocAndModuleListsBuilt_, rocListInstructions_, postprocess-scan-build::rows, rows_, pos::PixelDACScanRange::setRelative(), singleROC_, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, usesROCList_, hgcalPerformanceValidation::val, and makeHLTPrescaleTable::values.

25  : PixelCalibBase(), PixelConfigBase("", "", "") {
26  std::string mthn = "[PixelCalibConfiguration::PixelCalibConfiguration()]\t ";
27  std::map<std::string, int> colM;
28  std::vector<std::string> colNames;
43  colNames.push_back("CONFIG_KEY");
44  colNames.push_back("KEY_TYPE");
45  colNames.push_back("KEY_ALIAS");
46  colNames.push_back("VERSION");
47  colNames.push_back("KIND_OF_COND");
48  colNames.push_back("CALIB_TYPE");
49  colNames.push_back("CALIB_OBJ_DATA_FILE");
50  colNames.push_back("CALIB_OBJ_DATA_CLOB");
51 
52  for (unsigned int c = 0; c < tableMat[0].size(); c++) {
53  for (unsigned int n = 0; n < colNames.size(); n++) {
54  if (tableMat[0][c] == colNames[n]) {
55  colM[colNames[n]] = c;
56  break;
57  }
58  }
59  } //end for
60  for (unsigned int n = 0; n < colNames.size(); n++) {
61  if (colM.find(colNames[n]) == colM.end()) {
62  std::cerr << mthn << "Couldn't find in the database the column with name " << colNames[n] << std::endl;
63  assert(0);
64  }
65  }
66 
67  _bufferData = true;
68 
69  std::istringstream in;
70  in.str(tableMat[1][colM["CALIB_OBJ_DATA_CLOB"]]);
71 
73 
74  in >> tmp;
75 
76  if (tmp == "Mode:") {
77  in >> mode_;
78  // std::cout << __LINE__ << "]\t" << mthn << "mode=" << mode_ << std::endl;
79  in >> tmp;
80  } else {
81  mode_ = "FEDChannelOffsetPixel";
82  std::cout << __LINE__ << "]\t" << mthn << "mode not set, is this an old file? " << std::endl;
83  assert(0);
84  }
85 
86  singleROC_ = false;
87 
88  if (tmp == "SingleROC") {
89  singleROC_ = true;
90  in >> tmp;
91  }
92 
93  // Read in parameters, if any.
94  if (tmp == "Parameters:") {
95  in >> tmp;
96  while (tmp != "Rows:") {
97  assert(!in.eof());
98  std::string paramName = tmp;
99  in >> tmp; // tmp contains the parameter value
100  parameters_[paramName] = tmp;
101  in >> tmp; // tmp contains the next parameter's name, or "Rows:"
102  }
103  }
104 
105  assert(tmp == "Rows:");
106 
107  in >> tmp;
108 
109  std::vector<unsigned int> rows;
110  while (tmp != "Cols:") {
111  if (tmp == "|") {
112  rows_.push_back(rows);
113  rows.clear();
114  } else {
115  if (tmp != "*") {
116  rows.push_back(atoi(tmp.c_str()));
117  }
118  }
119  in >> tmp;
120  }
121  rows_.push_back(rows);
122  rows.clear();
123 
124  in >> tmp;
125 
126  std::vector<unsigned int> cols;
127  while ((tmp != "VcalLow:") && (tmp != "VcalHigh:") && (tmp != "Vcal:") && (tmp != "VcalHigh") && (tmp != "VcalLow")) {
128  if (tmp == "|") {
129  cols_.push_back(cols);
130  cols.clear();
131  } else {
132  if (tmp != "*") {
133  cols.push_back(atoi(tmp.c_str()));
134  }
135  }
136  in >> tmp;
137  }
138  cols_.push_back(cols);
139  cols.clear();
140 
141  highVCalRange_ = true;
142 
143  if (tmp == "VcalLow") {
144  highVCalRange_ = false;
145  in >> tmp;
146  }
147 
148  if (tmp == "VcalHigh") {
149  highVCalRange_ = true;
150  in >> tmp;
151  }
152 
153  if (tmp == "VcalLow:") {
154  highVCalRange_ = false;
155  }
156 
157  if ((tmp == "VcalLow:") || (tmp == "VcalHigh:") || (tmp == "Vcal:")) {
158  unsigned int first, last, step;
159  in >> first >> last >> step;
160  unsigned int index = 1;
161  if (!dacs_.empty()) {
162  index = dacs_.back().index() * dacs_.back().getNPoints();
163  }
164  in >> tmp;
165  bool mix = false;
166  if (tmp == "mix") {
167  mix = true;
168  in >> tmp;
169  }
170  PixelDACScanRange dacrange(pos::k_DACName_Vcal, first, last, step, index, mix);
171  dacs_.push_back(dacrange);
172  } else {
173  //in >> tmp;
174  while (tmp == "Scan:" || tmp == "ScanValues:") {
175  if (tmp == "ScanValues:") {
176  std::string dacname;
177  in >> dacname;
178  vector<unsigned int> values;
179  int val;
180  in >> val;
181  while (val != -1) {
182  values.push_back(val);
183  in >> val;
184  }
185  unsigned int index = 1;
186  if (!dacs_.empty()) {
187  index = dacs_.back().index() * dacs_.back().getNPoints();
188  }
189  PixelDACScanRange dacrange(dacname, values, index, false);
190  dacs_.push_back(dacrange);
191  in >> tmp;
192  } else {
193  std::string dacname;
194  in >> dacname;
195  unsigned int first, last, step;
196  in >> first >> last >> step;
197  unsigned int index = 1;
198  if (!dacs_.empty()) {
199  index = dacs_.back().index() * dacs_.back().getNPoints();
200  }
201  in >> tmp;
202  bool mix = false;
203  if (tmp == "mix") {
204  mix = true;
205  in >> tmp;
206  }
207  PixelDACScanRange dacrange(dacname, first, last, step, index, mix);
208  dacs_.push_back(dacrange);
209  }
210  }
211 
212  while ((tmp == "Set:") || (tmp == "SetRelative:")) {
213  string name;
214  in >> name;
215  int val;
216  in >> val;
217  unsigned int index = 1;
218  if (!dacs_.empty())
219  index = dacs_.back().index() * dacs_.back().getNPoints();
220  PixelDACScanRange dacrange(name, val, val, 1, index, false);
221  if (tmp == "SetRelative:") {
222  dacrange.setRelative();
223  }
224  dacs_.push_back(dacrange);
225  in >> tmp;
226  }
227  }
228 
229  assert(tmp == "Repeat:");
230 
231  in >> ntrigger_;
232 
233  in >> tmp;
234 
235  usesROCList_ = false;
236  bool buildROCListNow = false;
237  if (tmp == "Rocs:") {
238  buildROCListNow = true;
239  usesROCList_ = true;
240  } else {
241  assert(tmp == "ToCalibrate:");
242  buildROCListNow = false;
243  }
244 
245  while (!in.eof()) {
246  tmp = "";
247  in >> tmp;
248 
249  // added by F.Blekman to be able to deal with POS245 style calib.dat files in CMSSW
250  // these files use the syntax:
251  // Rocs:
252  // all
253 
254  if (tmp == "all" || tmp == "+" || tmp == "-") {
255  buildROCListNow = false;
256  }
257  // end of addition by F.B.
258 
259  if (tmp.empty())
260  continue;
261  rocListInstructions_.push_back(tmp);
262  }
263 
264  rocAndModuleListsBuilt_ = false;
265  if (buildROCListNow) {
266  std::set<PixelROCName> rocSet;
267  for (std::vector<std::string>::iterator rocListInstructions_itr = rocListInstructions_.begin();
268  rocListInstructions_itr != rocListInstructions_.end();
269  ++rocListInstructions_itr) {
270  PixelROCName rocname(*rocListInstructions_itr);
271  rocSet.insert(rocname);
272  }
274  }
275 
277 
278  // Added by Dario as a temporary patch for Debbie (this will disappear in the future)
279  calibFileContent_ = in.str();
280  // End of temporary patch
281 
282  return;
283 }
std::vector< std::vector< unsigned int > > rows_
const edm::EventSetup & c
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
assert(be >=bs)
std::vector< PixelDACScanRange > dacs_
std::vector< std::string > rocListInstructions_
const std::string k_DACName_Vcal
Definition: PixelDACNames.h:37
std::map< std::string, std::string > parameters_
This class implements..
Definition: PixelROCName.h:23
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:94
tuple last
Definition: dqmdumpme.py:56
tmp
align.sh
Definition: createJobs.py:716
std::vector< std::vector< unsigned int > > cols_
PixelConfigBase(std::string description, std::string creator, std::string date)
PixelCalibConfiguration::~PixelCalibConfiguration ( )
override

Definition at line 527 of file PixelCalibConfiguration.cc.

527 {}

Member Function Documentation

void PixelCalibConfiguration::buildObjectsDependingOnTheNameTranslation ( const PixelNameTranslation aNameTranslation)
private

Definition at line 713 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), channels_, pos::PixelNameTranslation::getChannelForROC(), pos::PixelNameTranslation::getROCsFromChannel(), numROCsCalibratedOnChannel_, objectsDependingOnTheNameTranslationBuilt_, rocAndModuleListsBuilt_, ROCNumberOnChannelAmongThoseCalibrated_, and rocs_.

Referenced by buildROCAndModuleLists().

713  {
716  assert(aNameTranslation != nullptr);
717 
718  // Build the channel list.
719  assert(channels_.empty());
720  for (std::vector<PixelROCName>::const_iterator rocs_itr = rocs_.begin(); rocs_itr != rocs_.end(); ++rocs_itr) {
721  channels_.insert(aNameTranslation->getChannelForROC(*rocs_itr));
722  }
723 
724  // Build the maps from ROC to ROC number.
725 
727 
728  std::set<PixelROCName> tempROCs;
729 
730  for (std::vector<PixelROCName>::const_iterator it = rocs_.begin(); it != rocs_.end(); ++it) {
731  tempROCs.insert(*it);
732  }
733 
734  for (std::set<PixelChannel>::const_iterator channels_itr = channels_.begin(); channels_itr != channels_.end();
735  ++channels_itr) {
736  std::vector<PixelROCName> rocsOnChannel = aNameTranslation->getROCsFromChannel(*channels_itr);
737 
738  std::set<PixelROCName> foundROCs;
739 
740  for (std::vector<PixelROCName>::const_iterator rocsOnChannel_itr = rocsOnChannel.begin();
741  rocsOnChannel_itr != rocsOnChannel.end();
742  ++rocsOnChannel_itr) {
743  if (tempROCs.find(*rocsOnChannel_itr) != tempROCs.end()) {
744  ROCNumberOnChannelAmongThoseCalibrated_[*rocsOnChannel_itr] = foundROCs.size();
745  foundROCs.insert(*rocsOnChannel_itr);
746  }
747  }
748 
749  for (std::set<PixelROCName>::const_iterator foundROCs_itr = foundROCs.begin(); foundROCs_itr != foundROCs.end();
750  ++foundROCs_itr) {
751  numROCsCalibratedOnChannel_[*foundROCs_itr] = foundROCs.size();
752  }
753  }
754 
756 }
std::set< PixelChannel > channels_
assert(be >=bs)
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
std::vector< PixelROCName > rocs_
const std::vector< PixelROCName > & getROCsFromChannel(const PixelChannel &aChannel) const
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
void PixelCalibConfiguration::buildROCAndModuleLists ( const PixelNameTranslation translation,
const PixelDetectorConfig detconfig 
)

Definition at line 529 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), buildObjectsDependingOnTheNameTranslation(), buildROCAndModuleListsFromROCSet(), pos::PixelROCStatus::clear(), pos::PixelDetectorConfig::containsModule(), pos::PixelDetectorConfig::getModuleList(), pos::PixelNameTranslation::getROCs(), pos::PixelNameTranslation::getROCsFromModule(), pos::PixelDetectorConfig::getROCsList(), moduleList(), pos::PixelModuleName::modulename(), pos::PixelROCStatus::noAnalogSignal, rocAndModuleListsBuilt_, rocListInstructions_, and AlCaHLTBitMon_QueryRunRegistry::string.

530  {
531  assert(translation != nullptr);
532  assert(detconfig != nullptr);
533 
536  return;
537  }
538 
539  // Build the ROC set from the instructions.
540  std::set<PixelROCName> rocSet;
541  bool addNext = true;
542  const map<PixelROCName, PixelROCStatus>& iroclist = detconfig->getROCsList();
543  for (std::vector<std::string>::iterator rocListInstructions_itr = rocListInstructions_.begin();
544  rocListInstructions_itr != rocListInstructions_.end();
545  ++rocListInstructions_itr) {
546  std::string instruction = *rocListInstructions_itr;
547 
548  if (instruction == "+") {
549  addNext = true;
550  continue;
551  }
552  if (instruction == "-") {
553  addNext = false;
554  continue;
555  }
556 
557  if (instruction == "all") {
558  if (addNext) // add all ROCs in the configuration
559  {
560  const std::vector<PixelModuleName>& moduleList = detconfig->getModuleList();
561  for (std::vector<PixelModuleName>::const_iterator moduleList_itr = moduleList.begin();
562  moduleList_itr != moduleList.end();
563  ++moduleList_itr) {
564  std::vector<PixelROCName> ROCsOnThisModule = translation->getROCsFromModule(*moduleList_itr);
565  for (std::vector<PixelROCName>::const_iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin();
566  ROCsOnThisModule_itr != ROCsOnThisModule.end();
567  ++ROCsOnThisModule_itr) {
568  map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(*ROCsOnThisModule_itr);
569  assert(it != iroclist.end());
570  PixelROCStatus istatus = it->second;
571  if (!istatus.get(PixelROCStatus::noAnalogSignal))
572  rocSet.insert(*ROCsOnThisModule_itr);
573  }
574  }
575  } else // remove all ROCs
576  {
577  rocSet.clear();
578  }
579  addNext = true;
580  continue;
581  }
582 
583  // Assume it's a ROC or module name.
584  PixelModuleName modulename(instruction);
585 
586  // Skip if this module (or the module this ROC is on) isn't in the detector config.
587  if (!(detconfig->containsModule(modulename))) {
588  addNext = true;
589  continue;
590  }
591 
592  if (modulename.modulename() == instruction) // it's a module
593  {
594  std::vector<PixelROCName> ROCsOnThisModule = translation->getROCsFromModule(modulename);
595  for (std::vector<PixelROCName>::iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin();
596  ROCsOnThisModule_itr != ROCsOnThisModule.end();
597  ++ROCsOnThisModule_itr) {
598  if (addNext) {
599  map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(*ROCsOnThisModule_itr);
600  assert(it != iroclist.end());
601  PixelROCStatus istatus = it->second;
602  if (!istatus.get(PixelROCStatus::noAnalogSignal))
603  rocSet.insert(*ROCsOnThisModule_itr);
604  } else
605  rocSet.erase(*ROCsOnThisModule_itr);
606  }
607  addNext = true;
608  continue;
609  } else // it's a ROC
610  {
611  PixelROCName rocname(instruction);
612  if (addNext) {
613  // Only add this ROC if it's in the configuration.
614  bool foundIt = false;
615  std::list<const PixelROCName*> allROCs = translation->getROCs();
616  for (std::list<const PixelROCName*>::iterator allROCs_itr = allROCs.begin(); allROCs_itr != allROCs.end();
617  ++allROCs_itr) {
618  if ((*(*allROCs_itr)) == rocname) {
619  foundIt = true;
620  break;
621  }
622  }
623  if (foundIt) {
624  map<PixelROCName, PixelROCStatus>::const_iterator it = iroclist.find(rocname);
625  assert(it != iroclist.end());
626  PixelROCStatus istatus = it->second;
627  if (!istatus.get(PixelROCStatus::noAnalogSignal))
628  rocSet.insert(rocname);
629  }
630  } else {
631  rocSet.erase(rocname);
632  }
633  addNext = true;
634  continue;
635  }
636 
637  // should never get here
638  assert(0);
639  }
640  // done building ROC set
641 
643 
645 }
std::vector< PixelROCName > getROCsFromModule(const PixelModuleName &aModule) const
const std::set< PixelModuleName > & moduleList() const
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
assert(be >=bs)
std::vector< std::string > rocListInstructions_
const std::vector< PixelModuleName > & getModuleList() const
std::list< const PixelROCName * > getROCs() const
This class implements..
This class implements..
Definition: PixelROCName.h:23
This class implements..
bool containsModule(const PixelModuleName &moduleToFind) const
void buildObjectsDependingOnTheNameTranslation(const PixelNameTranslation *aNameTranslation)
const std::map< PixelROCName, PixelROCStatus > & getROCsList() const
void clear(ROCstatus stat)
void PixelCalibConfiguration::buildROCAndModuleListsFromROCSet ( const std::set< PixelROCName > &  rocSet)
private

Definition at line 647 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), gather_cfg::cout, modules_, nROC_, old_icols, old_irows, rocAndModuleListsBuilt_, rocs_, singleROC_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by buildROCAndModuleLists(), and PixelCalibConfiguration().

647  {
649 
650  std::string mthn = "[PixelCalibConfiguration::buildROCAndModuleListsFromROCSet()] ";
651  // Build the ROC list from the ROC set.
652  for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); ++rocSet_itr) {
653  rocs_.push_back(*rocSet_itr);
654  }
655 
656  //t.stop();
657  //cout << "buildROCAndModuleListsFromROCSet 1 time="<<t.tottime()<<endl;
658  //t.start();
659 
660  // Build the module set from the ROC set.
661  std::map<PixelModuleName, unsigned int> countROC;
662  for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); ++rocSet_itr) {
663  //t1.start();
664  PixelModuleName modulename(*rocSet_itr);
665  //t1.stop();
666  //t2.start();
667  modules_.insert(modulename);
668  countROC[modulename]++;
669  //t2.stop();
670  }
671 
672  //t.stop();
673  //cout << "buildROCAndModuleListsFromROCSet 2 time="<<t.tottime()<<endl;
674  //cout << "buildROCAndModuleListsFromROCSet t1="<<t1.tottime()<<endl;
675  //cout << "buildROCAndModuleListsFromROCSet t2="<<t2.tottime()<<endl;
676  //t.start();
677 
678  // Test printout.
679  /*cout << "\nROC list:\n";
680  for ( std::vector<PixelROCName>::iterator rocs_itr = rocs_.begin();
681  rocs_itr != rocs_.end();
682  rocs_itr++ ){
683  cout << rocs_itr->rocname() << "\n";
684  } cout << "\nModule list:\n";
685  for ( std::set<PixelModuleName>::iterator modules_itr = modules_.begin(); modules_itr != modules_.end(); modules_itr++ )
686  {
687  cout << modules_itr->modulename() << "\n";
688  }
689  cout << "\n";*/
690 
691  // Determine max ROCs on a module for singleROC mode.
692  nROC_ = 1;
693  if (singleROC_) {
694  unsigned maxROCs = 0;
695  for (std::map<PixelModuleName, unsigned int>::iterator imodule = countROC.begin(); imodule != countROC.end();
696  ++imodule) {
697  if (imodule->second > maxROCs)
698  maxROCs = imodule->second;
699  }
700  nROC_ = maxROCs;
701 
702  std::cout << __LINE__ << "]\t" << mthn << "Max ROCs on a module=" << nROC_ << std::endl;
703  }
704 
705  for (unsigned int irocs = 0; irocs < rocs_.size(); irocs++) {
706  old_irows.push_back(-1);
707  old_icols.push_back(-1);
708  }
709 
711 }
assert(be >=bs)
std::set< PixelModuleName > modules_
This class implements..
std::vector< PixelROCName > rocs_
tuple cout
Definition: gather_cfg.py:144
const std::set<PixelChannel>& pos::PixelCalibConfiguration::channelList ( ) const
inline
unsigned int PixelCalibConfiguration::colCounter ( unsigned int  state) const
private

Definition at line 844 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), cols_, nScanPoints(), rowCounter(), rows_, and scanROC().

Referenced by nextFECState(), and pixelsWithHits().

844  {
845  unsigned int i_col = (state - scanROC(state) * cols_.size() * rows_.size() * nScanPoints() -
846  rowCounter(state) * cols_.size() * nScanPoints()) /
847  (nScanPoints());
848  assert(i_col < cols_.size());
849  return i_col;
850 }
std::vector< std::vector< unsigned int > > rows_
unsigned int rowCounter(unsigned int state) const
assert(be >=bs)
unsigned int scanROC(unsigned int state) const
std::vector< std::vector< unsigned int > > cols_
const std::vector<std::vector<unsigned int> >& pos::PixelCalibConfiguration::columnList ( ) const
inline

Definition at line 158 of file PixelCalibConfiguration.h.

References cols_.

Referenced by SiPixelCalibConfiguration::SiPixelCalibConfiguration().

158 { return cols_; }
std::vector< std::vector< unsigned int > > cols_
bool PixelCalibConfiguration::containsScan ( std::string  name) const

Definition at line 1570 of file PixelCalibConfiguration.cc.

References mps_fire::i, mergeVDriftHistosByStation::name, numberOfScanVariables(), and scanName().

1570  {
1571  for (unsigned int i = 0; i < numberOfScanVariables(); i++) {
1572  if (scanName(i) == name) {
1573  return true;
1574  }
1575  }
1576  return false;
1577 }
unsigned int numberOfScanVariables() const
std::string scanName(unsigned int iscan) const
void PixelCalibConfiguration::disablePixels ( PixelFECConfigInterface pixelFEC,
unsigned int  irows,
unsigned int  icols,
pos::PixelROCTrimBits trims,
const PixelHdwAddress theROC 
) const
private

Definition at line 1401 of file PixelCalibConfiguration.cc.

References _bufferData, cols_, pos::PixelHdwAddress::hubaddress(), pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progpix(), pos::PixelHdwAddress::rocid(), rows_, and pos::PixelROCTrimBits::trim().

Referenced by nextFECState().

1405  {
1406  for (unsigned int irow = 0; irow < rows_[irows].size(); irow++) {
1407  for (unsigned int icol = 0; icol < cols_[icols].size(); icol++) {
1408  /* std::cout << "Will turn off pixel col="
1409  <<cols_[old_icols][icol]
1410  <<" row="<<rows_[old_irows][irow]<<std::endl;
1411  */
1412  unsigned int bits = trims->trim(cols_[icols][icol], rows_[irows][irow]);
1413  pixelFEC->progpix(theROC.mfec(),
1414  theROC.mfecchannel(),
1415  theROC.hubaddress(),
1416  theROC.portaddress(),
1417  theROC.rocid(),
1418  cols_[icols][icol],
1419  rows_[irows][irow],
1420  bits,
1421  _bufferData);
1422  }
1423  }
1424 }
unsigned int mfec() const
std::vector< std::vector< unsigned int > > rows_
unsigned int portaddress() const
unsigned int trim(unsigned int col, unsigned int row) const
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
virtual int progpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, unsigned char databyte, bool buffermode=false)=0
std::vector< std::vector< unsigned int > > cols_
void PixelCalibConfiguration::disablePixels ( PixelFECConfigInterface pixelFEC,
pos::PixelROCTrimBits trims,
const PixelHdwAddress theROC 
) const
private

Definition at line 1426 of file PixelCalibConfiguration.cc.

References _bufferData, cuy::col, pos::PixelHdwAddress::hubaddress(), pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progpix(), pos::PixelHdwAddress::rocid(), and pos::PixelROCTrimBits::trim().

1428  {
1429  //cout<<" disable ROC "<<theROC.hubaddress()<<" "<<theROC.rocid()<<endl;
1430  //FIXME This should be done with more efficient commands!
1431  for (unsigned int row = 0; row < 80; row++) {
1432  for (unsigned int col = 0; col < 52; col++) {
1433  unsigned int bits = trims->trim(col, row);
1434  pixelFEC->progpix(theROC.mfec(),
1435  theROC.mfecchannel(),
1436  theROC.hubaddress(),
1437  theROC.portaddress(),
1438  theROC.rocid(),
1439  col,
1440  row,
1441  bits,
1442  _bufferData);
1443  }
1444  }
1445 }
unsigned int mfec() const
unsigned int portaddress() const
unsigned int trim(unsigned int col, unsigned int row) const
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
virtual int progpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, unsigned char databyte, bool buffermode=false)=0
int col
Definition: cuy.py:1009
void PixelCalibConfiguration::enablePixels ( PixelFECConfigInterface pixelFEC,
unsigned int  irows,
unsigned int  icols,
pos::PixelROCMaskBits masks,
pos::PixelROCTrimBits trims,
const PixelHdwAddress theROC 
) const
private

Definition at line 1370 of file PixelCalibConfiguration.cc.

References _bufferData, cols_, pos::PixelHdwAddress::hubaddress(), pos::PixelROCMaskBits::mask(), pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progpix(), pos::PixelHdwAddress::rocid(), rows_, and pos::PixelROCTrimBits::trim().

Referenced by nextFECState().

1375  {
1376  for (unsigned int irow = 0; irow < rows_[irows].size(); irow++) {
1377  for (unsigned int icol = 0; icol < cols_[icols].size(); icol++) {
1378  /* std::cout << "Will turn on pixel col="
1379  <<cols_[icols][icol]
1380  <<" row="<<rows_[irows][irow]<<std::endl;
1381  */
1382  unsigned int bits = trims->trim(cols_[icols][icol], rows_[irows][irow]);
1383 
1384  //if masks==0 always enable pixel
1385  if (masks == nullptr || masks->mask(cols_[icols][icol], rows_[irows][irow]))
1386  bits |= 0x80;
1387 
1388  pixelFEC->progpix(theROC.mfec(),
1389  theROC.mfecchannel(),
1390  theROC.hubaddress(),
1391  theROC.portaddress(),
1392  theROC.rocid(),
1393  cols_[icols][icol],
1394  rows_[irows][irow],
1395  bits,
1396  _bufferData);
1397  }
1398  }
1399 }
unsigned int mfec() const
std::vector< std::vector< unsigned int > > rows_
unsigned int portaddress() const
unsigned int trim(unsigned int col, unsigned int row) const
unsigned int rocid() const
unsigned int mfecchannel() const
unsigned int hubaddress() const
virtual int progpix(int mfec, int mfecchannel, int hubaddress, int portaddress, int rocid, int coladdr, int rowaddress, unsigned char databyte, bool buffermode=false)=0
unsigned int mask(unsigned int col, unsigned int row) const
std::vector< std::vector< unsigned int > > cols_
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > & PixelCalibConfiguration::fedCardsAndChannels ( unsigned int  crate,
PixelNameTranslation translation,
PixelFEDConfig fedconfig,
PixelDetectorConfig detconfig 
) const

Definition at line 1182 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), pos::PixelDetectorConfig::containsModule(), pos::PixelFEDConfig::crateFromFEDNumber(), fedCardsAndChannels_, pos::PixelHdwAddress::fedchannel(), pos::PixelHdwAddress::fednumber(), first, newFWLiteAna::found, pos::PixelNameTranslation::getHdwAddress(), mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, callgraph::module, rocAndModuleListsBuilt_, rocs_, and createJobs::tmp.

1186  {
1188 
1189  assert(!rocs_.empty());
1190 
1191  for (unsigned int i = 0; i < rocs_.size(); i++) {
1192  PixelModuleName module(rocs_[i].rocname());
1193  if (!detconfig->containsModule(module))
1194  continue;
1195  const PixelHdwAddress* hdw = translation->getHdwAddress(rocs_[i]);
1196  assert(hdw != nullptr);
1197  //std::cout << "ROC, fednumber:"<<rocs_[i]<<" "<<hdw->fednumber()
1198  // << std::endl;
1199  //first check if fed associated with the roc is in the right crate
1200  if (fedconfig->crateFromFEDNumber(hdw->fednumber()) != crate)
1201  continue;
1202  //next look if we have already found fed number
1203  unsigned int index = fedCardsAndChannels_.size();
1204  for (unsigned int j = 0; j < fedCardsAndChannels_.size(); j++) {
1205  if (fedCardsAndChannels_[j].first == hdw->fednumber()) {
1206  index = j;
1207  break;
1208  }
1209  }
1210  //If we didn't find the fedcard we will create it
1211  if (index == fedCardsAndChannels_.size()) {
1212  std::vector<unsigned int> tmp;
1213  tmp.push_back(hdw->fedchannel());
1214  std::pair<unsigned int, std::vector<unsigned int> > tmp2(hdw->fednumber(), tmp);
1215  fedCardsAndChannels_.push_back(tmp2);
1216  continue;
1217  }
1218  //Now look and see if the channel has been added
1219  std::vector<unsigned int>& channels = fedCardsAndChannels_[index].second;
1220  bool found = false;
1221  for (unsigned int k = 0; k < channels.size(); k++) {
1222  if (channels[k] == hdw->fedchannel()) {
1223  found = true;
1224  break;
1225  }
1226  }
1227  if (found)
1228  continue;
1229  channels.push_back(hdw->fedchannel());
1230  }
1231 
1232  return fedCardsAndChannels_;
1233 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int crateFromFEDNumber(unsigned int fednumber) const
std::vector< std::pair< unsigned int, std::vector< unsigned int > > > fedCardsAndChannels_
unsigned int fednumber() const
assert(be >=bs)
unsigned int fedchannel() const
Store mfec, mfecchannel etc.
This class implements..
std::vector< PixelROCName > rocs_
bool containsModule(const PixelModuleName &moduleToFind) const
tmp
align.sh
Definition: createJobs.py:716
tuple module
Definition: callgraph.py:69
std::set< unsigned int > PixelCalibConfiguration::getFECCrates ( const PixelNameTranslation translation,
const PixelFECConfig fecconfig 
) const

Definition at line 1275 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), pos::PixelFECConfig::crateFromFECNumber(), pos::PixelHdwAddress::fecnumber(), pos::PixelNameTranslation::getChannelsOnModule(), pos::PixelNameTranslation::getHdwAddress(), modules_, and rocAndModuleListsBuilt_.

1276  {
1278 
1279  std::set<unsigned int> feccrates;
1280  assert(!modules_.empty());
1281  std::set<PixelModuleName>::iterator imodule = modules_.begin();
1282 
1283  for (; imodule != modules_.end(); ++imodule) {
1284  std::set<PixelChannel> channelsOnThisModule = translation->getChannelsOnModule(*imodule);
1285  for (std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin();
1286  channelsOnThisModule_itr != channelsOnThisModule.end();
1287  ++channelsOnThisModule_itr) {
1288  const PixelHdwAddress& channel_hdwaddress = translation->getHdwAddress(*channelsOnThisModule_itr);
1289  unsigned int fecnumber = channel_hdwaddress.fecnumber();
1290  feccrates.insert(fecconfig->crateFromFECNumber(fecnumber));
1291  }
1292  }
1293 
1294  return feccrates;
1295 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
assert(be >=bs)
unsigned int crateFromFECNumber(unsigned int fecnumber) const
Store mfec, mfecchannel etc.
std::set< PixelModuleName > modules_
std::set< PixelChannel > getChannelsOnModule(const PixelModuleName &aModule) const
unsigned int fecnumber() const
std::set< unsigned int > PixelCalibConfiguration::getFEDCrates ( const PixelNameTranslation translation,
const PixelFEDConfig fedconfig 
) const

Definition at line 1253 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), pos::PixelFEDConfig::crateFromFEDNumber(), pos::PixelHdwAddress::fednumber(), pos::PixelNameTranslation::getChannelsOnModule(), pos::PixelNameTranslation::getHdwAddress(), modules_, and rocAndModuleListsBuilt_.

1254  {
1256 
1257  std::set<unsigned int> fedcrates;
1258  assert(!modules_.empty());
1259  std::set<PixelModuleName>::iterator imodule = modules_.begin();
1260 
1261  for (; imodule != modules_.end(); ++imodule) {
1262  std::set<PixelChannel> channelsOnThisModule = translation->getChannelsOnModule(*imodule);
1263  for (std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin();
1264  channelsOnThisModule_itr != channelsOnThisModule.end();
1265  ++channelsOnThisModule_itr) {
1266  const PixelHdwAddress& channel_hdwaddress = translation->getHdwAddress(*channelsOnThisModule_itr);
1267  unsigned int fednumber = channel_hdwaddress.fednumber();
1268  fedcrates.insert(fedconfig->crateFromFEDNumber(fednumber));
1269  }
1270  }
1271 
1272  return fedcrates;
1273 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int crateFromFEDNumber(unsigned int fednumber) const
unsigned int fednumber() const
assert(be >=bs)
Store mfec, mfecchannel etc.
std::set< PixelModuleName > modules_
std::set< PixelChannel > getChannelsOnModule(const PixelModuleName &aModule) const
std::map< unsigned int, std::set< unsigned int > > PixelCalibConfiguration::getFEDsAndChannels ( PixelNameTranslation translation)

Definition at line 1235 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), pos::PixelHdwAddress::fedchannel(), pos::PixelHdwAddress::fednumber(), pos::PixelNameTranslation::getHdwAddress(), rocAndModuleListsBuilt_, and rocs_.

1236  {
1238 
1239  std::map<unsigned int, std::set<unsigned int> > fedsChannels;
1240  assert(!rocs_.empty());
1241  std::vector<PixelROCName>::iterator iroc = rocs_.begin();
1242 
1243  for (; iroc != rocs_.end(); ++iroc) {
1244  const PixelHdwAddress* roc_hdwaddress = translation->getHdwAddress(*iroc);
1245  unsigned int fednumber = roc_hdwaddress->fednumber();
1246  unsigned int fedchannel = roc_hdwaddress->fedchannel();
1247  fedsChannels[fednumber].insert(fedchannel);
1248  }
1249 
1250  return fedsChannels;
1251 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int fednumber() const
assert(be >=bs)
unsigned int fedchannel() const
Store mfec, mfecchannel etc.
std::vector< PixelROCName > rocs_
std::string pos::PixelCalibConfiguration::getStreamedContent ( void  ) const
inline

Definition at line 185 of file PixelCalibConfiguration.h.

References calibFileContent_.

185 { return calibFileContent_; };
std::set< unsigned int > PixelCalibConfiguration::getTKFECCrates ( const PixelPortcardMap portcardmap,
const std::map< std::string, PixelPortCardConfig * > &  mapNamePortCard,
const PixelTKFECConfig tkfecconfig 
) const

Definition at line 1297 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), pos::PixelTKFECConfig::crateFromTKFECID(), modules_, pos::PixelPortcardMap::portcards(), rocAndModuleListsBuilt_, and AlCaHLTBitMon_QueryRunRegistry::string.

1300  {
1302 
1303  std::set<unsigned int> tkfeccrates;
1304  assert(!modules_.empty());
1305  std::set<PixelModuleName>::iterator imodule = modules_.begin();
1306 
1307  for (; imodule != modules_.end(); ++imodule) {
1308  // implement this by module --(PixelPortcardMap)-> port card(s) --(PixelPortCardConfig)-> FEC # --(PixelFECConfig theTKFECConfiguration_)-> crate
1309  const std::set<std::string> portCards = portcardmap->portcards(*imodule);
1310  for (std::set<std::string>::const_iterator portCards_itr = portCards.begin(); portCards_itr != portCards.end();
1311  ++portCards_itr) {
1312  const std::string portcardname = *portCards_itr;
1313  std::map<std::string, PixelPortCardConfig*>::const_iterator portcardconfig_itr =
1314  mapNamePortCard.find(portcardname);
1315  assert(portcardconfig_itr != mapNamePortCard.end());
1316  PixelPortCardConfig* portcardconfig = portcardconfig_itr->second;
1317  std::string TKFECID = portcardconfig->getTKFECID();
1318  tkfeccrates.insert(tkfecconfig->crateFromTKFECID(TKFECID));
1319  }
1320  }
1321 
1322  return tkfeccrates;
1323 }
unsigned int crateFromTKFECID(std::string TKFECID) const
assert(be >=bs)
This is the documentation about PixelNameTranslation...
std::set< PixelModuleName > modules_
const std::set< std::string > portcards(const PixelModuleName &aModule) const
unsigned int PixelCalibConfiguration::iScan ( std::string  dac) const

Definition at line 758 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), gather_cfg::cout, dacs_, mps_fire::i, and mergeVDriftHistosByStation::name.

Referenced by nScanPoints(), scanCounter(), scanValue(), scanValueMax(), scanValueMin(), scanValues(), scanValuesMixedAcrossROCs(), and scanValueStep().

758  {
759  for (unsigned int i = 0; i < dacs_.size(); i++) {
760  if (dac == dacs_[i].name())
761  return i;
762  }
763 
764  std::cout << __LINE__ << "]\t[PixelCalibConfiguration::iScan()]\t\t could not find dac=" << dac << std::endl;
765 
766  assert(0);
767 
768  return 0;
769 }
assert(be >=bs)
std::vector< PixelDACScanRange > dacs_
tuple cout
Definition: gather_cfg.py:144
unsigned int PixelCalibConfiguration::maxNumHitsPerROC ( ) const

Definition at line 1540 of file PixelCalibConfiguration.cc.

References cols_, SiStripPI::max, rows_, and trackerHitRTTI::vector.

Referenced by noHits().

1540  {
1541  unsigned int returnValue = 0;
1542  for (std::vector<std::vector<unsigned int> >::const_iterator rows_itr = rows_.begin(); rows_itr != rows_.end();
1543  ++rows_itr) {
1544  for (std::vector<std::vector<unsigned int> >::const_iterator cols_itr = cols_.begin(); cols_itr != cols_.end();
1545  ++cols_itr) {
1546  unsigned int theSize = rows_itr->size() * cols_itr->size();
1547  returnValue = max(returnValue, theSize);
1548  }
1549  }
1550  return returnValue;
1551 }
std::vector< std::vector< unsigned int > > rows_
std::vector< std::vector< unsigned int > > cols_
std::string pos::PixelCalibConfiguration::mode ( ) const
inlineoverridevirtual
const std::set<PixelModuleName>& pos::PixelCalibConfiguration::moduleList ( ) const
inline

Definition at line 164 of file PixelCalibConfiguration.h.

References cms::cuda::assert(), modules_, and rocAndModuleListsBuilt_.

Referenced by buildROCAndModuleLists().

164  {
166  return modules_;
167  }
assert(be >=bs)
std::set< PixelModuleName > modules_
unsigned int pos::PixelCalibConfiguration::nConfigurations ( ) const
inline

Definition at line 118 of file PixelCalibConfiguration.h.

References nPixelPatterns(), nROC(), and nScanPoints().

Referenced by nextFECState(), nTriggersTotal(), scanCounter(), and scanROC().

118 { return nPixelPatterns() * nScanPoints() * nROC(); }
void PixelCalibConfiguration::nextFECState ( std::map< unsigned int, PixelFECConfigInterface * > &  pixelFECs,
PixelDetectorConfig detconfig,
PixelNameTranslation trans,
std::map< pos::PixelModuleName, pos::PixelMaskBase * > *  masks,
std::map< pos::PixelModuleName, pos::PixelTrimBase * > *  trims,
std::map< pos::PixelModuleName, pos::PixelDACSettings * > *  dacss,
unsigned int  state 
) const

Definition at line 852 of file PixelCalibConfiguration.cc.

References _bufferData, cms::cuda::assert(), cuy::col, colCounter(), cols_, gather_cfg::cout, dacs_, pos::PixelROCInfo::defaultDACs_, disablePixels(), enablePixels(), pos::PixelHdwAddress::fecnumber(), first, pos::PixelNameTranslation::getChannelForROC(), pos::PixelNameTranslation::getHdwAddress(), pos::PixelROCInfo::hdwadd_, highVCalRange_, pos::PixelHdwAddress::hubaddress(), mps_fire::i, cuy::ii, dqmiolumiharvest::j, pos::k_DACAddress_WBC, pos::PixelROCInfo::masks_, SiStripPI::max, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), mode(), callgraph::module, dqmiodumpmetadata::n, mergeVDriftHistosByStation::name, nConfigurations(), parameterValue(), pos::PixelHdwAddress::portaddress(), relativeConstraints::relative, rocAndModuleListsBuilt_, pos::PixelHdwAddress::rocid(), rocInfo_, rocs_, rowCounter(), rows_, scanCounter(), scanningROCForState(), scanValue(), AlCaHLTBitMon_QueryRunRegistry::string, pos::PixelROCInfo::tbmChannel_, pos::PixelChannel::TBMChannelString(), pos::PixelROCInfo::trims_, and pos::PixelROCInfo::use_.

859  {
860  std::string mthn = "[PixelCalibConfiguration::nextFECState()]\t\t ";
861  std::string modeName = parameterValue("ScanMode");
862 
863  int mode = -1;
864 
865  if (modeName == "maskAllPixel")
866  mode = 0;
867  if (modeName == "useAllPixel" || modeName.empty())
868  mode = 1;
869  if (modeName == "default")
870  mode = 2;
871 
872  static bool first = true;
873 
874  if (first) {
875  cout << __LINE__ << "]\t" << mthn << "mode=" << mode << endl;
876  first = false;
877  }
878 
879  if (mode == -1) {
880  cout << __LINE__ << "]\t" << mthn << "ScanMode=" << modeName << " not understood." << endl;
881  ::abort();
882  }
883 
884  if (rocInfo_.empty()) {
885  //here we will do some initialization...
886  for (unsigned int i = 0; i < rocs_.size(); i++) {
887  const PixelHdwAddress* hdwadd = trans->getHdwAddress(rocs_[i]);
888  PixelROCInfo rocInfo;
889  rocInfo.use_ = true;
890  //FIXME This is very inefficient
891  PixelModuleName module(rocs_[i].rocname());
892 
893  std::map<pos::PixelModuleName, pos::PixelMaskBase*>::const_iterator foundMask = masks->find(module);
894  if (foundMask == masks->end()) {
895  rocInfo.use_ = false;
896  rocInfo_.push_back(rocInfo);
897  continue;
898  }
899 
900  rocInfo.hdwadd_ = hdwadd;
901  rocInfo.trims_ = (*trims)[module]->getTrimBits(rocs_[i]);
902  rocInfo.masks_ = (*masks)[module]->getMaskBits(rocs_[i]);
903 
904 #ifdef BPIX
905  const PixelChannel channel = trans->getChannelForROC(rocs_[i]);
906  string tbmChannel = channel.TBMChannelString();
907  //cout<<" tbm channel "<<tbmChannel<<endl;
908  rocInfo.tbmChannel_ = tbmChannel;
909 #endif
910 
911  std::map<std::string, unsigned int> defaultDACValues;
912  (*dacs)[PixelModuleName(rocs_[i].rocname())]->getDACSettings(rocs_[i])->getDACs(defaultDACValues);
913 
914  for (std::vector<PixelDACScanRange>::const_iterator dacs_itr = dacs_.begin(); dacs_itr != dacs_.end();
915  ++dacs_itr) {
916  std::map<std::string, unsigned int>::const_iterator foundThisDAC = defaultDACValues.find(dacs_itr->name());
917  assert(foundThisDAC != defaultDACValues.end());
918 
919  pair<unsigned int, unsigned int> dacchannelAndValue(dacs_itr->dacchannel(), foundThisDAC->second);
920 
921  rocInfo.defaultDACs_.push_back(dacchannelAndValue);
922  }
923  rocInfo_.push_back(rocInfo);
924  }
925  }
926 
927  assert(rocs_.size() == rocInfo_.size());
928 
929  bool changedWBC = false;
930 
931  //std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC=pixelFECs.begin();
932  //for(;iPixelFEC!=pixelFECs.end();++iPixelFEC){
933  //iPixelFEC->second->fecDebug(1);
934  //}
935 
936  //unsigned long version=0;
937  //pixelFEC->getversion(&version);
938  //std::cout<<"mfec firmware version:"<<version<<std::endl;
939 
941 
943 
944  // Which set of rows we're on.
945  unsigned int i_row = rowCounter(state);
946 
947  // Which set of columns we're on.
948  unsigned int i_col = colCounter(state);
949 
950  // Whether we're beginning a new scan over the DACs after changing which ROC or which pixel pattern.
951  unsigned int first_scan = true;
952  for (unsigned int i = 0; i < dacs_.size(); i++) {
953  if (scanCounter(i, state) != 0)
954  first_scan = false;
955  }
956 
957  // Disable all pixels at the beginning.
958  if (state == 0 && (mode == 0 || mode == 1)) {
959  for (unsigned int i = 0; i < rocs_.size(); i++) {
960  if (!rocInfo_[i].use_)
961  continue;
962 
963  PixelHdwAddress theROC = *rocInfo_[i].hdwadd_;
964  PixelROCTrimBits* rocTrims = rocInfo_[i].trims_;
965 
966  //Turn off all pixels
967  disablePixels(pixelFECs[theROC.fecnumber()], rocTrims, theROC);
968  }
969 
970  // reset
971  //cout<<"finish init"<<endl;
972  //sleep(1);
973  //pixelFEC->injectrstroc(7,1);
974  // or do pixelFEC->rocreset(theROC.mfec(),
975  // theROC.mfecchannel(),
976  // 14, //FIXME hardcode for Channel A
977  // theROC.hubaddress());
978  }
979 
980  // When a scan is complete for a given ROC or pixel pattern, reset the DACs to default values and disable the previously-enabled pixels.
981  if (first_scan && state != 0 && mode != 2) {
982  unsigned int previousState = state - 1;
983 
984  unsigned int i_row_previous = rowCounter(previousState);
985 
986  unsigned int i_col_previous = colCounter(previousState);
987 
988  for (unsigned int i = 0; i < rocs_.size(); i++) {
989  if (!rocInfo_[i].use_)
990  continue;
991 
992  PixelHdwAddress theROC = *rocInfo_[i].hdwadd_;
993 
994  if (!scanningROCForState(rocs_[i], previousState))
995  continue;
996 
997  // Set the DACs back to their default values when we're done with a scan.
998  for (unsigned int j = 0; j < dacs_.size(); j++) {
999  //Try to not reprogram DACs as often..
1000  if (state != 0) {
1001  if (scanCounter(dacs_[j].name(), state) == scanCounter(dacs_[j].name(), state - 1)) {
1002  continue;
1003  }
1004  }
1005 
1006  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1007  theROC.mfecchannel(),
1008  theROC.hubaddress(),
1009  theROC.portaddress(),
1010  theROC.rocid(),
1011  rocInfo_[i].defaultDACs_[j].first,
1012  rocInfo_[i].defaultDACs_[j].second,
1013  _bufferData);
1014 
1015  if (dacs_[j].dacchannel() == k_DACAddress_WBC) {
1016  changedWBC = true;
1017  //cout << "Changed WBC 1"<<endl;
1018  }
1019  }
1020 
1021  PixelROCTrimBits* rocTrims = rocInfo_[i].trims_;
1022 
1023  disablePixels(pixelFECs[theROC.fecnumber()], i_row_previous, i_col_previous, rocTrims, theROC);
1024  }
1025  }
1026 
1027  // Set each ROC with the new settings for this state.
1028  for (unsigned int i = 0; i < rocs_.size(); i++) {
1029  if (!rocInfo_[i].use_)
1030  continue;
1031 
1032  PixelHdwAddress theROC = *rocInfo_[i].hdwadd_;
1033 
1034  // Skip this ROC if we're in SingleROC mode and we're not on this ROC number.
1035  if (!scanningROCForState(rocs_[i], state))
1036  continue;
1037 
1038  // std::cout << "Will call progdac for vcal:"<< vcal << std::endl;
1039 
1040  // Program all the DAC values.
1041  for (unsigned int ii = 0; ii < dacs_.size(); ii++) {
1042  //Try to not reprogram DACs as often..
1043  if (state != 0) {
1044  if (scanCounter(dacs_[ii].name(), state) == scanCounter(dacs_[ii].name(), state - 1)) {
1045  continue;
1046  }
1047  }
1048 
1049  int dacvalue = scanValue(ii, state, rocs_[i]);
1050 
1051  //cout << "dacname ii:"<<dacs_[ii].name()<<" "<<ii<<endl;
1052 
1053  if (dacs_[ii].relative()) {
1054  //We have to find the default DAC setting so that we can
1055  //add the offset as we are in relative mode.
1056 
1057  if (dacs_[ii].negative())
1058  dacvalue = -dacvalue;
1059 
1060  dacvalue += rocInfo_[i].defaultDACs_[ii].second;
1061  //cout << "[PixelCalibConfiguration::nextFECState] ROC="<<rocs_[i]
1062  // << " dac="<<dacs_[ii].name()<<" new value="<<dacvalue<<endl;
1063  }
1064 
1065  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1066  theROC.mfecchannel(),
1067  theROC.hubaddress(),
1068  theROC.portaddress(),
1069  theROC.rocid(),
1070  rocInfo_[i].defaultDACs_[ii].first,
1071  dacvalue,
1072  _bufferData);
1073 
1074  if (dacs_[ii].dacchannel() == k_DACAddress_WBC) {
1075  changedWBC = true;
1076  //cout << "Changed WBC 2"<<endl;
1077  }
1078  }
1079 
1080  // At the beginning of a scan, set the pixel pattern.
1081  if (first_scan) {
1082  // Set masks and trims.
1083  if (mode != 2) {
1084  PixelROCMaskBits* rocMasks = rocInfo_[i].masks_;
1085  PixelROCTrimBits* rocTrims = rocInfo_[i].trims_;
1086 
1087  if (mode == 1)
1088  rocMasks = nullptr;
1089 
1090  //std::cout << "Will enable pixels!" <<std::endl;
1091  enablePixels(pixelFECs[theROC.fecnumber()], i_row, i_col, rocMasks, rocTrims, theROC);
1092  }
1093 
1094  // Set high or low Vcal range.
1095 
1096  if (state == 0) {
1097  PixelModuleName module(rocs_[i].rocname());
1098 
1099  unsigned int roccontrolword = (*dacs)[module]->getDACSettings(rocs_[i])->getControlRegister();
1100 
1101  //range is controlled here by one bit, but rest must match config
1102  //bit 0 on/off= 20/40 MHz speed; bit 1 on/off=disabled/enable; bit 3=Vcal range
1103 
1104  if (highVCalRange_)
1105  roccontrolword |= 0x4; //turn range bit on
1106  else
1107  roccontrolword &= 0xfb; //turn range bit off
1108 
1109  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1110  theROC.mfecchannel(),
1111  theROC.hubaddress(),
1112  theROC.portaddress(),
1113  theROC.rocid(),
1114  0xfd,
1115  roccontrolword,
1116  _bufferData);
1117  }
1118 
1119  // Clear all pixels before setting the pixel pattern.
1120  pixelFECs[theROC.fecnumber()]->clrcal(
1121  theROC.mfec(), theROC.mfecchannel(), theROC.hubaddress(), theROC.portaddress(), theROC.rocid(), _bufferData);
1122 
1123  // Program the pixel pattern.
1124  unsigned int nrow = rows_[i_row].size();
1125  unsigned int ncol = cols_[i_col].size();
1126  unsigned int nmax = std::max(nrow, ncol);
1127  if (nrow == 0 || ncol == 0)
1128  nmax = 0;
1129  for (unsigned int n = 0; n < nmax; n++) {
1130  unsigned int irow = n;
1131  unsigned int icol = n;
1132  if (irow >= nrow)
1133  irow = nrow - 1;
1134  if (icol >= ncol)
1135  icol = ncol - 1;
1136  unsigned int row = rows_[i_row][irow];
1137  unsigned int col = cols_[i_col][icol];
1138 
1139  pixelFECs[theROC.fecnumber()]->calpix(theROC.mfec(),
1140  theROC.mfecchannel(),
1141  theROC.hubaddress(),
1142  theROC.portaddress(),
1143  theROC.rocid(),
1144  col,
1145  row,
1146  1,
1147  _bufferData);
1148  }
1149 
1150  } // end of instructions for the beginning of a scan
1151  } // end of loop over ROCs
1152 
1153  if (_bufferData) {
1154  std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC = pixelFECs.begin();
1155  for (; iPixelFEC != pixelFECs.end(); ++iPixelFEC) {
1156  iPixelFEC->second->qbufsend();
1157  }
1158  }
1159 
1160  if (changedWBC) {
1161  for (unsigned int i = 0; i < rocs_.size(); i++) {
1162  if (!rocInfo_[i].use_)
1163  continue;
1164 
1165  PixelHdwAddress theROC = *rocInfo_[i].hdwadd_;
1166 
1167  int tbmRegister = 14; // define for TBM-A
1168 #ifdef BPIX
1169  string tbmChannel = rocInfo_[i].tbmChannel_; // get TBM channel
1170  if (tbmChannel == "B")
1171  tbmRegister = 15; // for TBM=B
1172 #endif
1173 
1174  pixelFECs[theROC.fecnumber()]->rocreset(theROC.mfec(), theROC.mfecchannel(), tbmRegister, theROC.hubaddress());
1175  } // for rocs
1176  }
1177 
1178  return;
1179 }
unsigned int mfec() const
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
std::vector< std::vector< unsigned int > > rows_
bool scanningROCForState(PixelROCName roc, unsigned int state) const
void disablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
PixelROCTrimBits * trims_
const unsigned int k_DACAddress_WBC
Definition: PixelDACNames.h:70
unsigned int portaddress() const
std::string mode() const override
std::vector< PixelROCInfo > rocInfo_
unsigned int rowCounter(unsigned int state) const
unsigned int rocid() const
std::string TBMChannelString() const
Definition: PixelChannel.h:31
int ii
Definition: cuy.py:589
assert(be >=bs)
std::vector< PixelDACScanRange > dacs_
unsigned int mfecchannel() const
const PixelHdwAddress * hdwadd_
std::vector< std::pair< unsigned int, unsigned int > > defaultDACs_
unsigned int hubaddress() const
unsigned int colCounter(unsigned int state) const
Store mfec, mfecchannel etc.
std::string parameterValue(std::string parameterName) const
PixelROCMaskBits * masks_
unsigned int scanCounter(std::string dac, unsigned int state) const
void enablePixels(PixelFECConfigInterface *pixelFEC, unsigned int irows, unsigned int icols, pos::PixelROCMaskBits *masks, pos::PixelROCTrimBits *trims, const PixelHdwAddress &theROC) const
This class implements..
This class implements..
This class implements..
std::vector< PixelROCName > rocs_
unsigned int fecnumber() const
tuple cout
Definition: gather_cfg.py:144
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
int col
Definition: cuy.py:1009
std::vector< std::vector< unsigned int > > cols_
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
tuple module
Definition: callgraph.py:69
bool pos::PixelCalibConfiguration::noHits ( ) const
inline

Definition at line 121 of file PixelCalibConfiguration.h.

References maxNumHitsPerROC().

121 { return (maxNumHitsPerROC() == 0); } // returns true if no hits will be produced
unsigned int pos::PixelCalibConfiguration::nParameters ( ) const
inline

Definition at line 177 of file PixelCalibConfiguration.h.

References parameters_.

177 { return parameters_.size(); }
std::map< std::string, std::string > parameters_
unsigned int pos::PixelCalibConfiguration::nPixelPatterns ( ) const
inline

Definition at line 107 of file PixelCalibConfiguration.h.

References cols_, and rows_.

Referenced by nConfigurations().

107 { return rows_.size() * cols_.size(); }
std::vector< std::vector< unsigned int > > rows_
std::vector< std::vector< unsigned int > > cols_
unsigned int pos::PixelCalibConfiguration::nROC ( ) const
inline

Definition at line 103 of file PixelCalibConfiguration.h.

References cms::cuda::assert(), nROC_, and rocAndModuleListsBuilt_.

Referenced by nConfigurations().

unsigned int pos::PixelCalibConfiguration::nScanPoints ( std::string  dac) const
inline

Definition at line 109 of file PixelCalibConfiguration.h.

References iScan(), and nScanPoints().

Referenced by nScanPoints().

109 { return nScanPoints(iScan(dac)); }
unsigned int iScan(std::string dac) const
unsigned int pos::PixelCalibConfiguration::nScanPoints ( ) const
inline

Definition at line 111 of file PixelCalibConfiguration.h.

References dacs_, and mps_fire::i.

Referenced by colCounter(), nConfigurations(), rowCounter(), scanCounter(), scanROC(), scanValue(), and scanValueMax().

111  {
112  unsigned int points = 1;
113  for (unsigned int i = 0; i < dacs_.size(); i++) {
114  points *= nScanPoints(i);
115  }
116  return points;
117  }
std::vector< PixelDACScanRange > dacs_
unsigned int pos::PixelCalibConfiguration::nScanPoints ( unsigned int  iscan) const
inlineprivate

Definition at line 212 of file PixelCalibConfiguration.h.

References dacs_.

212 { return dacs_[iscan].getNPoints(); }
std::vector< PixelDACScanRange > dacs_
unsigned int pos::PixelCalibConfiguration::nTriggersPerPattern ( ) const
inline
unsigned int pos::PixelCalibConfiguration::nTriggersTotal ( ) const
inline

Definition at line 119 of file PixelCalibConfiguration.h.

References nConfigurations(), and nTriggersPerPattern().

119 { return nConfigurations() * nTriggersPerPattern(); }
unsigned int nTriggersPerPattern() const
unsigned int pos::PixelCalibConfiguration::numberOfScanVariables ( ) const
inline

Definition at line 144 of file PixelCalibConfiguration.h.

References dacs_.

Referenced by containsScan().

144 { return dacs_.size(); }
std::vector< PixelDACScanRange > dacs_
unsigned int PixelCalibConfiguration::numROCsCalibratedOnChannel ( PixelROCName  roc) const
private

Definition at line 816 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), numROCsCalibratedOnChannel_, and objectsDependingOnTheNameTranslationBuilt_.

Referenced by scanValue().

816  {
818  std::map<PixelROCName, unsigned int>::const_iterator foundROC = numROCsCalibratedOnChannel_.find(roc);
819  assert(foundROC != numROCsCalibratedOnChannel_.end());
820  return foundROC->second;
821 }
assert(be >=bs)
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
std::map<std::string, std::string> pos::PixelCalibConfiguration::parametersList ( ) const
inline

Definition at line 180 of file PixelCalibConfiguration.h.

References parameters_.

180 { return parameters_; }
std::map< std::string, std::string > parameters_
std::string PixelCalibConfiguration::parameterValue ( std::string  parameterName) const

Definition at line 1447 of file PixelCalibConfiguration.cc.

References parameters_.

Referenced by nextFECState().

1447  {
1448  std::map<std::string, std::string>::const_iterator itr = parameters_.find(parameterName);
1449  if (itr == parameters_.end()) // parameterName is not in the list
1450  {
1451  return "";
1452  } else {
1453  return itr->second;
1454  }
1455 }
std::map< std::string, std::string > parameters_
std::set< std::pair< unsigned int, unsigned int > > PixelCalibConfiguration::pixelsWithHits ( unsigned int  state) const

Definition at line 1553 of file PixelCalibConfiguration.cc.

References SplitLinear::begin, colCounter(), cols_, rowCounter(), and rows_.

1553  {
1554  std::set<std::pair<unsigned int, unsigned int> > pixels;
1555  // column # row #
1556 
1557  for (std::vector<unsigned int>::const_iterator col_itr = cols_[colCounter(state)].begin();
1558  col_itr != cols_[colCounter(state)].end();
1559  ++col_itr) {
1560  for (std::vector<unsigned int>::const_iterator row_itr = rows_[rowCounter(state)].begin();
1561  row_itr != rows_[rowCounter(state)].end();
1562  ++row_itr) {
1563  pixels.insert(std::pair<unsigned int, unsigned int>(*col_itr, *row_itr));
1564  }
1565  }
1566 
1567  return pixels;
1568 }
std::vector< std::vector< unsigned int > > rows_
unsigned int rowCounter(unsigned int state) const
unsigned int colCounter(unsigned int state) const
std::vector< std::vector< unsigned int > > cols_
const std::vector<PixelROCName>& pos::PixelCalibConfiguration::rocList ( ) const
inline

Definition at line 160 of file PixelCalibConfiguration.h.

References cms::cuda::assert(), rocAndModuleListsBuilt_, and rocs_.

160  {
162  return rocs_;
163  }
assert(be >=bs)
std::vector< PixelROCName > rocs_
unsigned int PixelCalibConfiguration::ROCNumberOnChannelAmongThoseCalibrated ( PixelROCName  roc) const
private

Definition at line 809 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), objectsDependingOnTheNameTranslationBuilt_, and ROCNumberOnChannelAmongThoseCalibrated_.

Referenced by scanningROCForState(), and scanValue().

809  {
811  std::map<PixelROCName, unsigned int>::const_iterator foundROC = ROCNumberOnChannelAmongThoseCalibrated_.find(roc);
813  return foundROC->second;
814 }
assert(be >=bs)
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
unsigned int PixelCalibConfiguration::rowCounter ( unsigned int  state) const
private

Definition at line 837 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), cols_, nScanPoints(), rows_, and scanROC().

Referenced by colCounter(), nextFECState(), and pixelsWithHits().

837  {
838  unsigned int i_row =
839  (state - scanROC(state) * cols_.size() * rows_.size() * nScanPoints()) / (cols_.size() * nScanPoints());
840  assert(i_row < rows_.size());
841  return i_row;
842 }
std::vector< std::vector< unsigned int > > rows_
assert(be >=bs)
unsigned int scanROC(unsigned int state) const
std::vector< std::vector< unsigned int > > cols_
const std::vector<std::vector<unsigned int> >& pos::PixelCalibConfiguration::rowList ( ) const
inline

Definition at line 159 of file PixelCalibConfiguration.h.

References rows_.

Referenced by SiPixelCalibConfiguration::SiPixelCalibConfiguration().

159 { return rows_; }
std::vector< std::vector< unsigned int > > rows_
unsigned int pos::PixelCalibConfiguration::scanCounter ( std::string  dac,
unsigned int  state 
) const
inline

Definition at line 132 of file PixelCalibConfiguration.h.

References iScan(), and scanCounter().

Referenced by nextFECState(), scanCounter(), and scanValue().

132 { return scanCounter(iScan(dac), state); }
unsigned int iScan(std::string dac) const
unsigned int scanCounter(std::string dac, unsigned int state) const
unsigned int PixelCalibConfiguration::scanCounter ( unsigned int  iscan,
unsigned int  state 
) const
private

Definition at line 823 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), mps_fire::i, nConfigurations(), and nScanPoints().

823  {
825 
826  unsigned int i_scan = state % nScanPoints();
827 
828  for (unsigned int i = 0; i < iscan; i++) {
829  i_scan /= nScanPoints(i);
830  }
831 
832  unsigned int i_threshold = i_scan % nScanPoints(iscan);
833 
834  return i_threshold;
835 }
assert(be >=bs)
std::string pos::PixelCalibConfiguration::scanName ( unsigned int  iscan) const
inline

Definition at line 148 of file PixelCalibConfiguration.h.

References dacs_.

Referenced by containsScan(), and SiPixelCalibConfiguration::SiPixelCalibConfiguration().

148 { return dacs_[iscan].name(); }
std::vector< PixelDACScanRange > dacs_
bool PixelCalibConfiguration::scanningROCForState ( PixelROCName  roc,
unsigned int  state 
) const

Definition at line 796 of file PixelCalibConfiguration.cc.

References ROCNumberOnChannelAmongThoseCalibrated(), scanROC(), and singleROC_.

Referenced by nextFECState().

796  {
797  if (!singleROC_)
798  return true;
800 }
unsigned int ROCNumberOnChannelAmongThoseCalibrated(PixelROCName roc) const
unsigned int scanROC(unsigned int state) const
unsigned int PixelCalibConfiguration::scanROC ( unsigned int  state) const
private

Definition at line 771 of file PixelCalibConfiguration.cc.

References cms::cuda::assert(), cols_, nConfigurations(), nScanPoints(), and rows_.

Referenced by colCounter(), rowCounter(), and scanningROCForState().

771  {
773 
774  unsigned int i_ROC = state / (cols_.size() * rows_.size() * nScanPoints());
775 
776  return i_ROC;
777 }
std::vector< std::vector< unsigned int > > rows_
assert(be >=bs)
std::vector< std::vector< unsigned int > > cols_
unsigned int pos::PixelCalibConfiguration::scanValue ( std::string  dac,
unsigned int  state,
PixelROCName  roc 
) const
inline

Definition at line 134 of file PixelCalibConfiguration.h.

References iScan().

Referenced by nextFECState(), and scanValue().

134  {
135  return scanValue(iScan(dac), state, roc);
136  }
unsigned int iScan(std::string dac) const
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
unsigned int pos::PixelCalibConfiguration::scanValue ( std::string  dac,
unsigned int  state 
) const
inline

Definition at line 139 of file PixelCalibConfiguration.h.

References cms::cuda::assert(), dacs_, iScan(), and scanValue().

139  {
140  assert(!(dacs_[iScan(dac)].mixValuesAcrossROCs()));
141  return scanValue(iScan(dac), state, 0, 1);
142  }
assert(be >=bs)
std::vector< PixelDACScanRange > dacs_
unsigned int iScan(std::string dac) const
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
unsigned int PixelCalibConfiguration::scanValue ( unsigned int  iscan,
unsigned int  state,
unsigned int  ROCNumber,
unsigned int  ROCsOnChannel 
) const
private

Definition at line 779 of file PixelCalibConfiguration.cc.

References dacs_, nScanPoints(), scanCounter(), and dtDQMClient_cfg::threshold.

782  {
783  unsigned int i_threshold = scanCounter(iscan, state);
784 
785  // Spread the DAC values on the different ROCs uniformly across the scan range.
786  if (dacs_[iscan].mixValuesAcrossROCs())
787  i_threshold = (i_threshold + (nScanPoints(iscan) * ROCNumber) / ROCsOnChannel) % nScanPoints(iscan);
788 
789  unsigned int threshold = dacs_[iscan].value(i_threshold);
790 
791  //assert(threshold==dacs_[iscan].first()+i_threshold*dacs_[iscan].step());
792 
793  return threshold;
794 }
std::vector< PixelDACScanRange > dacs_
unsigned int scanCounter(std::string dac, unsigned int state) const
unsigned int PixelCalibConfiguration::scanValue ( unsigned int  iscan,
unsigned int  state,
PixelROCName  roc 
) const
private

Definition at line 802 of file PixelCalibConfiguration.cc.

References numROCsCalibratedOnChannel(), ROCNumberOnChannelAmongThoseCalibrated(), and scanValue().

802  {
803  unsigned int ROCNumber = ROCNumberOnChannelAmongThoseCalibrated(roc);
804  unsigned int ROCsOnChannel = numROCsCalibratedOnChannel(roc);
805 
806  return scanValue(iscan, state, ROCNumber, ROCsOnChannel);
807 }
unsigned int numROCsCalibratedOnChannel(PixelROCName roc) const
unsigned int ROCNumberOnChannelAmongThoseCalibrated(PixelROCName roc) const
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
double pos::PixelCalibConfiguration::scanValueMax ( std::string  dac) const
inline

Definition at line 152 of file PixelCalibConfiguration.h.

References iScan(), and scanValueMax().

Referenced by scanValueMax().

152 { return scanValueMax(iScan(dac)); }
unsigned int iScan(std::string dac) const
double scanValueMax(std::string dac) const
double pos::PixelCalibConfiguration::scanValueMax ( unsigned int  iscan) const
inlineprivate

Definition at line 225 of file PixelCalibConfiguration.h.

References dacs_, and nScanPoints().

225  {
226  return dacs_[iscan].first() + dacs_[iscan].step() * (nScanPoints(iscan) - 1);
227  }
std::vector< PixelDACScanRange > dacs_
double pos::PixelCalibConfiguration::scanValueMin ( std::string  dac) const
inline

Definition at line 151 of file PixelCalibConfiguration.h.

References iScan(), and scanValueMin().

Referenced by scanValueMin().

151 { return scanValueMin(iScan(dac)); }
unsigned int iScan(std::string dac) const
double scanValueMin(std::string dac) const
double pos::PixelCalibConfiguration::scanValueMin ( unsigned int  iscan) const
inlineprivate

Definition at line 224 of file PixelCalibConfiguration.h.

References dacs_.

224 { return dacs_[iscan].first(); }
std::vector< PixelDACScanRange > dacs_
std::vector<unsigned int> pos::PixelCalibConfiguration::scanValues ( std::string  dac) const
inline

Definition at line 149 of file PixelCalibConfiguration.h.

References iScan(), and scanValues().

Referenced by scanValues(), and SiPixelCalibConfiguration::SiPixelCalibConfiguration().

149 { return scanValues(iScan(dac)); }
unsigned int iScan(std::string dac) const
std::vector< unsigned int > scanValues(std::string dac) const
std::vector<unsigned int> pos::PixelCalibConfiguration::scanValues ( unsigned int  iscan) const
inlineprivate

Definition at line 222 of file PixelCalibConfiguration.h.

References dacs_.

222 { return dacs_[iscan].values(); }
std::vector< PixelDACScanRange > dacs_
bool pos::PixelCalibConfiguration::scanValuesMixedAcrossROCs ( std::string  dac) const
inline

Definition at line 154 of file PixelCalibConfiguration.h.

References iScan(), and scanValuesMixedAcrossROCs().

Referenced by scanValuesMixedAcrossROCs().

154 { return scanValuesMixedAcrossROCs(iScan(dac)); }
bool scanValuesMixedAcrossROCs(std::string dac) const
unsigned int iScan(std::string dac) const
bool pos::PixelCalibConfiguration::scanValuesMixedAcrossROCs ( unsigned int  iscan) const
inlineprivate

Definition at line 229 of file PixelCalibConfiguration.h.

References dacs_.

229 { return dacs_[iscan].mixValuesAcrossROCs(); }
std::vector< PixelDACScanRange > dacs_
double pos::PixelCalibConfiguration::scanValueStep ( std::string  dac) const
inline

Definition at line 153 of file PixelCalibConfiguration.h.

References iScan(), and scanValueStep().

Referenced by scanValueStep().

153 { return scanValueStep(iScan(dac)); }
unsigned int iScan(std::string dac) const
double scanValueStep(std::string dac) const
double pos::PixelCalibConfiguration::scanValueStep ( unsigned int  iscan) const
inlineprivate

Definition at line 228 of file PixelCalibConfiguration.h.

References dacs_.

228 { return dacs_[iscan].step(); }
std::vector< PixelDACScanRange > dacs_
bool pos::PixelCalibConfiguration::singleROC ( ) const
inline

Definition at line 175 of file PixelCalibConfiguration.h.

References singleROC_.

void PixelCalibConfiguration::writeASCII ( std::string  dir = "") const
overridevirtual

Implements pos::PixelConfigBase.

Definition at line 1457 of file PixelCalibConfiguration.cc.

References cols_, dacs_, lut2db_cfg::filename, first, highVCalRange_, mps_fire::i, dqmiolumiharvest::j, pos::PixelCalibBase::mode_, ntrigger_, submitPVResolutionJobs::out, parameters_, rocListInstructions_, rows_, singleROC_, AlCaHLTBitMon_QueryRunRegistry::string, and usesROCList_.

Referenced by writeXMLHeader().

1457  {
1458  //FIXME this is not tested for all the use cases...
1459 
1460  if (!dir.empty())
1461  dir += "/";
1462  std::string filename = dir + "calib.dat";
1463  std::ofstream out(filename.c_str());
1464 
1465  out << "Mode: " << mode_ << endl;
1466  if (singleROC_)
1467  out << "SingleROC" << endl;
1468  if (!parameters_.empty()) {
1469  out << "Parameters:" << endl;
1470  std::map<std::string, std::string>::const_iterator it = parameters_.begin();
1471  for (; it != parameters_.end(); ++it) {
1472  out << it->first << " " << it->second << endl;
1473  }
1474  }
1475  out << "Rows:" << endl;
1476  for (unsigned int i = 0; i < rows_.size(); i++) {
1477  for (unsigned int j = 0; j < rows_[i].size(); j++) {
1478  out << rows_[i][j] << " ";
1479  }
1480  if (i != rows_.size() - 1)
1481  out << "|";
1482  out << endl;
1483  }
1484  out << "Cols:" << endl;
1485  for (unsigned int i = 0; i < cols_.size(); i++) {
1486  for (unsigned int j = 0; j < cols_[i].size(); j++) {
1487  out << cols_[i][j] << " ";
1488  }
1489  if (i != cols_.size() - 1)
1490  out << "|";
1491  out << endl;
1492  }
1493 
1494  if (highVCalRange_) {
1495  out << "VcalHigh" << endl;
1496  } else {
1497  out << "VcalLow" << endl;
1498  }
1499 
1500  for (unsigned int i = 0; i < dacs_.size(); i++) {
1501  if (dacs_[i].uniformSteps()) {
1502  if (dacs_[i].first() != dacs_[i].last()) {
1503  out << "Scan: " << dacs_[i].name() << " ";
1504  out << dacs_[i].first() << " ";
1505  out << dacs_[i].last() << " ";
1506  out << dacs_[i].step() << endl;
1507  } else {
1508  out << "Set: " << dacs_[i].name() << " ";
1509  out << dacs_[i].first() << endl;
1510  }
1511  } else {
1512  out << "ScanValues: " << dacs_[i].name() << " ";
1513  for (unsigned int ival = 0; ival < dacs_[i].getNPoints(); ival++) {
1514  out << dacs_[i].value(ival) << " ";
1515  }
1516  out << " -1" << endl;
1517  }
1518  }
1519 
1520  out << "Repeat:" << endl;
1521  out << ntrigger_ << endl;
1522 
1523  if (usesROCList_) {
1524  out << "Rocs:" << endl;
1525  } else {
1526  out << "ToCalibrate:" << endl;
1527  }
1528  for (unsigned int i = 0; i < rocListInstructions_.size(); i++) {
1529  out << rocListInstructions_[i] << endl;
1530  if (rocListInstructions_[i] == "+" || rocListInstructions_[i] == "-") {
1531  out << " ";
1532  } else {
1533  out << endl;
1534  }
1535  }
1536 
1537  out.close();
1538 }
std::vector< std::vector< unsigned int > > rows_
std::vector< PixelDACScanRange > dacs_
std::vector< std::string > rocListInstructions_
std::map< std::string, std::string > parameters_
tuple filename
Definition: lut2db_cfg.py:20
std::vector< std::vector< unsigned int > > cols_
void pos::PixelCalibConfiguration::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 190 of file PixelCalibConfiguration.h.

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

Reimplemented from pos::PixelCalibBase.

Definition at line 1627 of file PixelCalibConfiguration.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

1629  {
1630  std::string mthn = "[PixelCalibConfiguration::writeXML()]\t\t ";
1631 
1632  *outstream << " " << std::endl;
1633  *outstream << " <DATA>" << std::endl;
1634  *outstream << " <CALIB_OBJ_DATA_FILE>./calib.dat</CALIB_OBJ_DATA_FILE>" << std::endl;
1635  *outstream << " <CALIB_TYPE>calib</CALIB_TYPE>" << std::endl;
1636  *outstream << " </DATA>" << std::endl;
1637  *outstream << " " << std::endl;
1638 }
void PixelCalibConfiguration::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::PixelCalibBase.

Definition at line 1580 of file PixelCalibConfiguration.cc.

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

1585  {
1586  std::string mthn = "[PixelCalibConfiguration::writeXMLHeader()]\t\t ";
1587  std::stringstream maskFullPath;
1588 
1589  writeASCII(path);
1590 
1591  maskFullPath << path << "/PixelCalib_Test_" << PixelTimeFormatter::getmSecTime() << ".xml";
1592  std::cout << __LINE__ << "]\t" << mthn << "Writing to: " << maskFullPath.str() << std::endl;
1593 
1594  outstream->open(maskFullPath.str().c_str());
1595 
1596  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
1597  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
1598  *outstream << "" << std::endl;
1599  *outstream << " <!-- " << mthn << "-->" << std::endl;
1600  *outstream << "" << std::endl;
1601  *outstream << " <HEADER>" << std::endl;
1602  *outstream << " <TYPE>" << std::endl;
1603  *outstream << " <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl;
1604  *outstream << " <NAME>Calibration Object Clob</NAME>" << std::endl;
1605  *outstream << " </TYPE>" << std::endl;
1606  *outstream << " <RUN>" << std::endl;
1607  *outstream << " <RUN_TYPE>Gain Calibration</RUN_TYPE>" << std::endl;
1608  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
1609  *outstream << " <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl;
1610  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl;
1611  *outstream << " </RUN>" << std::endl;
1612  *outstream << " </HEADER>" << std::endl;
1613  *outstream << "" << std::endl;
1614  *outstream << " <DATA_SET>" << std::endl;
1615  *outstream << "" << std::endl;
1616  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl;
1617  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl;
1618  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl;
1619  *outstream << "" << std::endl;
1620  *outstream << " <PART>" << std::endl;
1621  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
1622  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
1623  *outstream << " </PART>" << std::endl;
1624 }
static std::string getmSecTime(void)
static std::string getTime(void)
std::string getComment() const
std::string getAuthor() const
void writeASCII(std::string dir="") const override
tuple cout
Definition: gather_cfg.py:144
void PixelCalibConfiguration::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelCalibBase.

Definition at line 1641 of file PixelCalibConfiguration.cc.

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

1643  {
1644  std::string mthn = "[PixelCalibConfiguration::writeXMLTrailer()]\t\t ";
1645 
1646  *outstream << " </DATA_SET>" << std::endl;
1647  *outstream << "</ROOT>" << std::endl;
1648 
1649  outstream->close();
1650  std::cout << __LINE__ << "]\t" << mthn << "Data written " << std::endl;
1651 }
tuple cout
Definition: gather_cfg.py:144

Friends And Related Function Documentation

std::ostream& pos::operator<< ( std::ostream &  s,
const PixelCalibConfiguration calib 
)
friend

Member Data Documentation

bool pos::PixelCalibConfiguration::_bufferData
private
std::string pos::PixelCalibConfiguration::calibFileContent_
private

Definition at line 301 of file PixelCalibConfiguration.h.

Referenced by getStreamedContent(), and PixelCalibConfiguration().

std::set<PixelChannel> pos::PixelCalibConfiguration::channels_
private
std::vector<std::vector<unsigned int> > pos::PixelCalibConfiguration::cols_
private
std::vector<PixelDACScanRange> pos::PixelCalibConfiguration::dacs_
private
std::vector<std::pair<unsigned int, std::vector<unsigned int> > > pos::PixelCalibConfiguration::fedCardsAndChannels_
mutableprivate

Definition at line 256 of file PixelCalibConfiguration.h.

Referenced by fedCardsAndChannels().

bool pos::PixelCalibConfiguration::highVCalRange_
private

Definition at line 271 of file PixelCalibConfiguration.h.

Referenced by nextFECState(), PixelCalibConfiguration(), and writeASCII().

std::set<PixelModuleName> pos::PixelCalibConfiguration::modules_
private
unsigned int pos::PixelCalibConfiguration::nROC_
private

Definition at line 269 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleListsFromROCSet(), and nROC().

unsigned int pos::PixelCalibConfiguration::ntrigger_
private
std::map<PixelROCName, unsigned int> pos::PixelCalibConfiguration::numROCsCalibratedOnChannel_
private
bool pos::PixelCalibConfiguration::objectsDependingOnTheNameTranslationBuilt_
private
std::vector<int> pos::PixelCalibConfiguration::old_icols
mutableprivate

Definition at line 291 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleListsFromROCSet().

std::vector<int> pos::PixelCalibConfiguration::old_irows
mutableprivate

Definition at line 290 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleListsFromROCSet().

std::map<std::string, std::string> pos::PixelCalibConfiguration::parameters_
private
bool pos::PixelCalibConfiguration::rocAndModuleListsBuilt_
private
std::vector<PixelROCInfo> pos::PixelCalibConfiguration::rocInfo_
mutableprivate

Definition at line 245 of file PixelCalibConfiguration.h.

Referenced by nextFECState().

std::vector<std::string> pos::PixelCalibConfiguration::rocListInstructions_
private
std::map<PixelROCName, unsigned int> pos::PixelCalibConfiguration::ROCNumberOnChannelAmongThoseCalibrated_
private
std::vector<PixelROCName> pos::PixelCalibConfiguration::rocs_
mutableprivate
std::vector<std::vector<unsigned int> > pos::PixelCalibConfiguration::rows_
private
bool pos::PixelCalibConfiguration::singleROC_
private
bool pos::PixelCalibConfiguration::usesROCList_
private

Definition at line 298 of file PixelCalibConfiguration.h.

Referenced by PixelCalibConfiguration(), and writeASCII().