CMS 3D CMS Logo

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 67 of file PixelCalibConfiguration.h.

Constructor & Destructor Documentation

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

Definition at line 300 of file PixelCalibConfiguration.cc.

References _bufferData, funct::abs(), buildROCAndModuleListsFromROCSet(), calibFileContent_, cols_, gather_cfg::cout, dacs_, plotBeamSpotDB::first, highVCalRange_, recoMuon::in, pos::k_DACName_Vcal, plotBeamSpotDB::last, ecalTB2006H4_GenSimDigiReco_cfg::mix, pos::PixelCalibBase::mode_, dataset::name, ntrigger_, objectsDependingOnTheNameTranslationBuilt_, parameters_, rocAndModuleListsBuilt_, rocListInstructions_, tablePrinter::rows, rows_, pos::PixelDACScanRange::setNegative(), pos::PixelDACScanRange::setRelative(), singleROC_, AlCaHLTBitMon_QueryRunRegistry::string, tmp, usesROCList_, heppy_batch::val, and MuonErrorMatrixValues_cff::values.

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

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

Definition at line 553 of file PixelCalibConfiguration.cc.

553 {}

Member Function Documentation

void PixelCalibConfiguration::buildObjectsDependingOnTheNameTranslation ( const PixelNameTranslation aNameTranslation)
private

Definition at line 747 of file PixelCalibConfiguration.cc.

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

Referenced by buildROCAndModuleLists().

748 {
750  assert( rocAndModuleListsBuilt_ );
751  assert( aNameTranslation != nullptr );
752 
753  // Build the channel list.
754  assert ( channels_.empty() );
755  for (std::vector<PixelROCName>::const_iterator rocs_itr = rocs_.begin(); rocs_itr != rocs_.end(); ++rocs_itr)
756  {
757  channels_.insert( aNameTranslation->getChannelForROC(*rocs_itr) );
758  }
759 
760  // Build the maps from ROC to ROC number.
761 
763 
764  std::set<PixelROCName> tempROCs;
765 
766  for(std::vector<PixelROCName>::const_iterator it=rocs_.begin();it!=rocs_.end();++it){
767  tempROCs.insert(*it);
768  }
769 
770 
771  for ( std::set<PixelChannel>::const_iterator channels_itr = channels_.begin();
772  channels_itr != channels_.end();
773  ++channels_itr ) {
774 
775  std::vector<PixelROCName> rocsOnChannel =
776  aNameTranslation->getROCsFromChannel(*channels_itr);
777 
778  std::set<PixelROCName> foundROCs;
779 
780  for ( std::vector<PixelROCName>::const_iterator rocsOnChannel_itr = rocsOnChannel.begin();
781  rocsOnChannel_itr != rocsOnChannel.end();
782  ++rocsOnChannel_itr ) {
783 
784  if ( tempROCs.find(*rocsOnChannel_itr) != tempROCs.end() ){
785  ROCNumberOnChannelAmongThoseCalibrated_[*rocsOnChannel_itr] = foundROCs.size();
786  foundROCs.insert(*rocsOnChannel_itr);
787  }
788  }
789 
790  for ( std::set<PixelROCName>::const_iterator foundROCs_itr = foundROCs.begin();
791  foundROCs_itr != foundROCs.end();
792  ++foundROCs_itr ) {
793  numROCsCalibratedOnChannel_[*foundROCs_itr] = foundROCs.size();
794  }
795 
796  }
797 
799 }
std::set< PixelChannel > channels_
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 555 of file PixelCalibConfiguration.cc.

References 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.

556 {
557  assert( translation != nullptr );
558  assert( detconfig != nullptr );
559 
561  {
563  return;
564  }
565 
566  // Build the ROC set from the instructions.
567  std::set<PixelROCName> rocSet;
568  bool addNext = true;
569  const map<PixelROCName, PixelROCStatus>& iroclist=detconfig->getROCsList();
570  for(std::vector<std::string>::iterator rocListInstructions_itr = rocListInstructions_.begin(); rocListInstructions_itr != rocListInstructions_.end(); ++rocListInstructions_itr)
571  {
572  std::string instruction = *rocListInstructions_itr;
573 
574  if ( instruction == "+" )
575  {
576  addNext = true;
577  continue;
578  }
579  if ( instruction == "-" )
580  {
581  addNext = false;
582  continue;
583  }
584 
585  if ( instruction == "all" )
586  {
587  if ( addNext ) // add all ROCs in the configuration
588  {
589  const std::vector <PixelModuleName>& moduleList = detconfig->getModuleList();
590  for ( std::vector <PixelModuleName>::const_iterator moduleList_itr = moduleList.begin(); moduleList_itr != moduleList.end(); ++moduleList_itr )
591  {
592  std::vector<PixelROCName> ROCsOnThisModule = translation->getROCsFromModule( *moduleList_itr );
593  for ( std::vector<PixelROCName>::const_iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin(); ROCsOnThisModule_itr != ROCsOnThisModule.end(); ++ROCsOnThisModule_itr ) {
594  map<PixelROCName, PixelROCStatus>::const_iterator it=
595  iroclist.find(*ROCsOnThisModule_itr);
596  assert(it!=iroclist.end());
597  PixelROCStatus istatus = it->second;
598  if ( !istatus.get(PixelROCStatus::noAnalogSignal) )
599  rocSet.insert(*ROCsOnThisModule_itr);
600  }
601  }
602  }
603  else // remove all ROCs
604  {
605  rocSet.clear();
606  }
607  addNext = true;
608  continue;
609  }
610 
611  // Assume it's a ROC or module name.
612  PixelModuleName modulename(instruction);
613 
614  // Skip if this module (or the module this ROC is on) isn't in the detector config.
615  if ( !(detconfig->containsModule(modulename)) )
616  {
617  addNext = true;
618  continue;
619  }
620 
621  if ( modulename.modulename() == instruction ) // it's a module
622  {
623  std::vector<PixelROCName> ROCsOnThisModule = translation->getROCsFromModule( modulename );
624  for ( std::vector<PixelROCName>::iterator ROCsOnThisModule_itr = ROCsOnThisModule.begin(); ROCsOnThisModule_itr != ROCsOnThisModule.end(); ++ROCsOnThisModule_itr )
625  {
626  if ( addNext ) {
627  map<PixelROCName, PixelROCStatus>::const_iterator it= iroclist.find(*ROCsOnThisModule_itr);
628  assert(it!=iroclist.end());
629  PixelROCStatus istatus = it->second;
630  if ( !istatus.get(PixelROCStatus::noAnalogSignal) ) rocSet.insert(*ROCsOnThisModule_itr);
631  }
632  else rocSet.erase( *ROCsOnThisModule_itr);
633  }
634  addNext = true;
635  continue;
636  }
637  else // it's a ROC
638  {
639  PixelROCName rocname(instruction);
640  if ( addNext )
641  {
642  // Only add this ROC if it's in the configuration.
643  bool foundIt = false;
644  std::list<const PixelROCName*> allROCs = translation->getROCs();
645  for ( std::list<const PixelROCName*>::iterator allROCs_itr = allROCs.begin(); allROCs_itr != allROCs.end(); ++allROCs_itr )
646  {
647  if ( (*(*allROCs_itr)) == rocname )
648  {
649  foundIt = true;
650  break;
651  }
652  }
653  if (foundIt) {
654  map<PixelROCName, PixelROCStatus>::const_iterator it= iroclist.find(rocname);
655  assert(it!=iroclist.end());
656  PixelROCStatus istatus = it->second;
657  if ( !istatus.get(PixelROCStatus::noAnalogSignal) ) rocSet.insert(rocname);
658  }
659  }
660  else
661  {
662  rocSet.erase(rocname);
663  }
664  addNext = true;
665  continue;
666  }
667 
668  // should never get here
669  assert(0);
670  }
671  // done building ROC set
672 
674 
676 
677 }
std::vector< PixelROCName > getROCsFromModule(const PixelModuleName &aModule) const
const std::set< PixelModuleName > & moduleList() const
void buildROCAndModuleListsFromROCSet(const std::set< PixelROCName > &rocSet)
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 679 of file PixelCalibConfiguration.cc.

References gather_cfg::cout, modules_, nROC_, old_icols, old_irows, rocAndModuleListsBuilt_, rocs_, singleROC_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by buildROCAndModuleLists(), and PixelCalibConfiguration().

680 {
681  assert( !rocAndModuleListsBuilt_ );
682 
683  std::string mthn = "[PixelCalibConfiguration::buildROCAndModuleListsFromROCSet()] " ;
684  // Build the ROC list from the ROC set.
685  for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin();
686  rocSet_itr != rocSet.end();
687  ++rocSet_itr ) {
688  rocs_.push_back(*rocSet_itr);
689  }
690 
691  //t.stop();
692  //cout << "buildROCAndModuleListsFromROCSet 1 time="<<t.tottime()<<endl;
693  //t.start();
694 
695  // Build the module set from the ROC set.
696  std::map <PixelModuleName,unsigned int> countROC;
697  for (std::set<PixelROCName>::iterator rocSet_itr = rocSet.begin(); rocSet_itr != rocSet.end(); ++rocSet_itr ){
698  //t1.start();
699  PixelModuleName modulename(*rocSet_itr);
700  //t1.stop();
701  //t2.start();
702  modules_.insert( modulename );
703  countROC[modulename]++;
704  //t2.stop();
705  }
706 
707  //t.stop();
708  //cout << "buildROCAndModuleListsFromROCSet 2 time="<<t.tottime()<<endl;
709  //cout << "buildROCAndModuleListsFromROCSet t1="<<t1.tottime()<<endl;
710  //cout << "buildROCAndModuleListsFromROCSet t2="<<t2.tottime()<<endl;
711  //t.start();
712 
713  // Test printout.
714  /*cout << "\nROC list:\n";
715  for ( std::vector<PixelROCName>::iterator rocs_itr = rocs_.begin();
716  rocs_itr != rocs_.end();
717  rocs_itr++ ){
718  cout << rocs_itr->rocname() << "\n";
719  } cout << "\nModule list:\n";
720  for ( std::set<PixelModuleName>::iterator modules_itr = modules_.begin(); modules_itr != modules_.end(); modules_itr++ )
721  {
722  cout << modules_itr->modulename() << "\n";
723  }
724  cout << "\n";*/
725 
726  // Determine max ROCs on a module for singleROC mode.
727  nROC_=1;
728  if (singleROC_) {
729  unsigned maxROCs=0;
730  for (std::map<PixelModuleName,unsigned int>::iterator imodule=countROC.begin();imodule!=countROC.end();++imodule) {
731  if (imodule->second>maxROCs) maxROCs=imodule->second;
732  }
733  nROC_=maxROCs;
734 
735  std::cout << __LINE__ << "]\t" << mthn << "Max ROCs on a module="<<nROC_<<std::endl;
736  }
737 
738  for(unsigned int irocs=0;irocs<rocs_.size();irocs++){
739  old_irows.push_back(-1);
740  old_icols.push_back(-1);
741  }
742 
744 
745 }
std::set< PixelModuleName > modules_
This class implements..
std::vector< PixelROCName > rocs_
const std::set<PixelChannel>& pos::PixelCalibConfiguration::channelList ( ) const
inline
unsigned int PixelCalibConfiguration::colCounter ( unsigned int  state) const
private

Definition at line 903 of file PixelCalibConfiguration.cc.

References cols_, nScanPoints(), rowCounter(), rows_, and scanROC().

Referenced by nextFECState(), and pixelsWithHits().

904 {
905  unsigned int i_col=( state - scanROC(state)*cols_.size()*rows_.size()*nScanPoints() - rowCounter(state)*cols_.size()*nScanPoints() )/(nScanPoints());
906  assert(i_col<cols_.size());
907  return i_col;
908 }
std::vector< std::vector< unsigned int > > rows_
unsigned int rowCounter(unsigned int state) const
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 153 of file PixelCalibConfiguration.h.

Referenced by SiPixelCalibConfiguration::SiPixelCalibConfiguration().

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

Definition at line 1663 of file PixelCalibConfiguration.cc.

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

1664 {
1665  for ( unsigned int i = 0; i < numberOfScanVariables(); i++ )
1666  {
1667  if ( scanName(i) == name )
1668  {
1669  return true;
1670  }
1671  }
1672  return false;
1673 }
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 1486 of file PixelCalibConfiguration.cc.

References _bufferData, bits, 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().

1489  {
1490 
1491  for (unsigned int irow=0;irow<rows_[irows].size();irow++){
1492  for (unsigned int icol=0;icol<cols_[icols].size();icol++){
1493  /* std::cout << "Will turn off pixel col="
1494  <<cols_[old_icols][icol]
1495  <<" row="<<rows_[old_irows][irow]<<std::endl;
1496  */
1497  unsigned int bits=trims->trim(cols_[icols][icol],rows_[irows][irow]);
1498  pixelFEC->progpix(theROC.mfec(),
1499  theROC.mfecchannel(),
1500  theROC.hubaddress(),
1501  theROC.portaddress(),
1502  theROC.rocid(),
1503  cols_[icols][icol],
1504  rows_[irows][irow],
1505  bits,_bufferData);
1506  }
1507  }
1508 }
unsigned int mfec() const
std::vector< std::vector< unsigned int > > rows_
unsigned int portaddress() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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 1511 of file PixelCalibConfiguration.cc.

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

1513  {
1514 
1515  //cout<<" disable ROC "<<theROC.hubaddress()<<" "<<theROC.rocid()<<endl;
1516  //FIXME This should be done with more efficient commands!
1517  for (unsigned int row=0;row<80;row++){
1518  for (unsigned int col=0;col<52;col++){
1519  unsigned int bits=trims->trim(col,row);
1520  pixelFEC->progpix(theROC.mfec(),
1521  theROC.mfecchannel(),
1522  theROC.hubaddress(),
1523  theROC.portaddress(),
1524  theROC.rocid(),
1525  col,
1526  row,
1527  bits,_bufferData);
1528  }
1529  }
1530 }
unsigned int mfec() const
unsigned int portaddress() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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
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 1455 of file PixelCalibConfiguration.cc.

References _bufferData, bits, 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().

1460  {
1461 
1462  for (unsigned int irow=0;irow<rows_[irows].size();irow++){
1463  for (unsigned int icol=0;icol<cols_[icols].size();icol++){
1464  /* std::cout << "Will turn on pixel col="
1465  <<cols_[icols][icol]
1466  <<" row="<<rows_[irows][irow]<<std::endl;
1467  */
1468  unsigned int bits=trims->trim(cols_[icols][icol],rows_[irows][irow]);
1469 
1470  //if masks==0 always enable pixel
1471  if (masks==nullptr||
1472  masks->mask(cols_[icols][icol],rows_[irows][irow])) bits|=0x80;
1473 
1474  pixelFEC->progpix(theROC.mfec(),
1475  theROC.mfecchannel(),
1476  theROC.hubaddress(),
1477  theROC.portaddress(),
1478  theROC.rocid(),
1479  cols_[icols][icol],
1480  rows_[irows][irow],
1481  bits,_bufferData);
1482  }
1483  }
1484 }
unsigned int mfec() const
std::vector< std::vector< unsigned int > > rows_
unsigned int portaddress() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
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 1265 of file PixelCalibConfiguration.cc.

References pos::PixelDetectorConfig::containsModule(), pos::PixelFEDConfig::crateFromFEDNumber(), fedCardsAndChannels_, pos::PixelHdwAddress::fedchannel(), pos::PixelHdwAddress::fednumber(), plotBeamSpotDB::first, runEdmFileComparison::found, pos::PixelNameTranslation::getHdwAddress(), mps_fire::i, gen::k, rocAndModuleListsBuilt_, rocs_, and tmp.

1268  {
1269 
1270  assert(rocAndModuleListsBuilt_);
1271 
1272  assert(!rocs_.empty());
1273 
1274  for(unsigned int i=0;i<rocs_.size();i++){
1275  PixelModuleName module(rocs_[i].rocname());
1276  if (!detconfig->containsModule(module)) continue;
1277  const PixelHdwAddress* hdw=translation->getHdwAddress(rocs_[i]);
1278  assert(hdw!=nullptr);
1279  //std::cout << "ROC, fednumber:"<<rocs_[i]<<" "<<hdw->fednumber()
1280  // << std::endl;
1281  //first check if fed associated with the roc is in the right crate
1282  if (fedconfig->crateFromFEDNumber(hdw->fednumber())!=crate) continue;
1283  //next look if we have already found fed number
1284  unsigned int index=fedCardsAndChannels_.size();
1285  for(unsigned int j=0;j<fedCardsAndChannels_.size();j++){
1286  if (fedCardsAndChannels_[j].first==hdw->fednumber()){
1287  index=j;
1288  break;
1289  }
1290  }
1291  //If we didn't find the fedcard we will create it
1292  if (index==fedCardsAndChannels_.size()){
1293  std::vector<unsigned int> tmp;
1294  tmp.push_back(hdw->fedchannel());
1295  std::pair<unsigned int, std::vector<unsigned int> > tmp2(hdw->fednumber(),tmp);
1296  fedCardsAndChannels_.push_back(tmp2);
1297  continue;
1298  }
1299  //Now look and see if the channel has been added
1300  std::vector<unsigned int>& channels=fedCardsAndChannels_[index].second;
1301  bool found=false;
1302  for(unsigned int k=0;k<channels.size();k++){
1303  if (channels[k]==hdw->fedchannel()) {
1304  found=true;
1305  break;
1306  }
1307  }
1308  if (found) continue;
1309  channels.push_back(hdw->fedchannel());
1310 
1311  }
1312 
1313 
1314  return fedCardsAndChannels_;
1315 
1316 }
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
unsigned int fedchannel() const
Store mfec, mfecchannel etc.
int k[5][pyjets_maxn]
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
This class implements..
std::vector< PixelROCName > rocs_
bool containsModule(const PixelModuleName &moduleToFind) const
Definition: vlib.h:208
std::set< unsigned int > PixelCalibConfiguration::getFECCrates ( const PixelNameTranslation translation,
const PixelFECConfig fecconfig 
) const

Definition at line 1358 of file PixelCalibConfiguration.cc.

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

1358  {
1359 
1360  assert(rocAndModuleListsBuilt_);
1361 
1362  std::set<unsigned int> feccrates;
1363  assert(!modules_.empty());
1364  std::set<PixelModuleName>::iterator imodule=modules_.begin();
1365 
1366  for (;imodule!=modules_.end();++imodule)
1367  {
1368  std::set<PixelChannel> channelsOnThisModule = translation->getChannelsOnModule(*imodule);
1369  for ( std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin(); channelsOnThisModule_itr != channelsOnThisModule.end(); ++channelsOnThisModule_itr )
1370  {
1371  const PixelHdwAddress& channel_hdwaddress = translation->getHdwAddress(*channelsOnThisModule_itr);
1372  unsigned int fecnumber=channel_hdwaddress.fecnumber();
1373  feccrates.insert(fecconfig->crateFromFECNumber(fecnumber));
1374  }
1375  }
1376 
1377  return feccrates;
1378 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
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 1336 of file PixelCalibConfiguration.cc.

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

1336  {
1337 
1338  assert(rocAndModuleListsBuilt_);
1339 
1340  std::set<unsigned int> fedcrates;
1341  assert(!modules_.empty());
1342  std::set<PixelModuleName>::iterator imodule=modules_.begin();
1343 
1344  for (;imodule!=modules_.end();++imodule)
1345  {
1346  std::set<PixelChannel> channelsOnThisModule = translation->getChannelsOnModule(*imodule);
1347  for ( std::set<PixelChannel>::const_iterator channelsOnThisModule_itr = channelsOnThisModule.begin(); channelsOnThisModule_itr != channelsOnThisModule.end(); ++channelsOnThisModule_itr )
1348  {
1349  const PixelHdwAddress& channel_hdwaddress = translation->getHdwAddress(*channelsOnThisModule_itr);
1350  unsigned int fednumber=channel_hdwaddress.fednumber();
1351  fedcrates.insert(fedconfig->crateFromFEDNumber(fednumber));
1352  }
1353  }
1354 
1355  return fedcrates;
1356 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int crateFromFEDNumber(unsigned int fednumber) const
unsigned int fednumber() const
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 1318 of file PixelCalibConfiguration.cc.

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

1318  {
1319 
1320  assert(rocAndModuleListsBuilt_);
1321 
1322  std::map <unsigned int, std::set<unsigned int> > fedsChannels;
1323  assert(!rocs_.empty());
1324  std::vector<PixelROCName>::iterator iroc=rocs_.begin();
1325 
1326  for (;iroc!=rocs_.end();++iroc){
1327  const PixelHdwAddress *roc_hdwaddress=translation->getHdwAddress(*iroc);
1328  unsigned int fednumber=roc_hdwaddress->fednumber();
1329  unsigned int fedchannel=roc_hdwaddress->fedchannel();
1330  fedsChannels[fednumber].insert(fedchannel);
1331  }
1332 
1333  return fedsChannels;
1334 }
const PixelHdwAddress * getHdwAddress(const PixelROCName &aROC) const
unsigned int fednumber() const
unsigned int fedchannel() const
Store mfec, mfecchannel etc.
std::vector< PixelROCName > rocs_
std::string pos::PixelCalibConfiguration::getStreamedContent ( void  ) const
inline
std::set< unsigned int > PixelCalibConfiguration::getTKFECCrates ( const PixelPortcardMap portcardmap,
const std::map< std::string, PixelPortCardConfig * > &  mapNamePortCard,
const PixelTKFECConfig tkfecconfig 
) const

Definition at line 1380 of file PixelCalibConfiguration.cc.

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

1380  {
1381 
1382  assert(rocAndModuleListsBuilt_);
1383 
1384  std::set<unsigned int> tkfeccrates;
1385  assert(!modules_.empty());
1386  std::set<PixelModuleName>::iterator imodule=modules_.begin();
1387 
1388  for (;imodule!=modules_.end();++imodule)
1389  {
1390  // implement this by module --(PixelPortcardMap)-> port card(s) --(PixelPortCardConfig)-> FEC # --(PixelFECConfig theTKFECConfiguration_)-> crate
1391  const std::set< std::string > portCards = portcardmap->portcards(*imodule);
1392  for ( std::set< std::string >::const_iterator portCards_itr = portCards.begin(); portCards_itr != portCards.end(); ++portCards_itr)
1393  {
1394  const std::string portcardname=*portCards_itr;
1395  std::map<std::string,PixelPortCardConfig*>::const_iterator portcardconfig_itr = mapNamePortCard.find(portcardname);
1396  assert(portcardconfig_itr != mapNamePortCard.end());
1397  PixelPortCardConfig* portcardconfig = portcardconfig_itr->second;
1398  std::string TKFECID = portcardconfig->getTKFECID();
1399  tkfeccrates.insert(tkfecconfig->crateFromTKFECID(TKFECID));
1400  }
1401  }
1402 
1403  return tkfeccrates;
1404 }
unsigned int crateFromTKFECID(std::string TKFECID) const
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 801 of file PixelCalibConfiguration.cc.

References gather_cfg::cout, dacs_, mps_fire::i, and dataset::name.

801  {
802 
803  for (unsigned int i=0;i<dacs_.size();i++){
804  if (dac==dacs_[i].name()) return i;
805  }
806 
807  std::cout << __LINE__ << "]\t[PixelCalibConfiguration::iScan()]\t\t could not find dac="
808  << dac <<std::endl;
809 
810  assert(0);
811 
812  return 0;
813 
814 }
std::vector< PixelDACScanRange > dacs_
unsigned int PixelCalibConfiguration::maxNumHitsPerROC ( ) const

Definition at line 1633 of file PixelCalibConfiguration.cc.

References cols_, SiStripPI::max, and rows_.

1634 {
1635  unsigned int returnValue = 0;
1636  for ( std::vector<std::vector<unsigned int> >::const_iterator rows_itr = rows_.begin(); rows_itr != rows_.end(); ++rows_itr )
1637  {
1638  for ( std::vector<std::vector<unsigned int> >::const_iterator cols_itr = cols_.begin(); cols_itr != cols_.end(); ++cols_itr )
1639  {
1640  unsigned int theSize = rows_itr->size()*cols_itr->size();
1641  returnValue = max( returnValue, theSize );
1642  }
1643  }
1644  return returnValue;
1645 }
std::vector< std::vector< unsigned int > > rows_
std::vector< std::vector< unsigned int > > cols_
std::string pos::PixelCalibConfiguration::mode ( ) const
inlineoverridevirtual

Reimplemented from pos::PixelCalibBase.

Definition at line 159 of file PixelCalibConfiguration.h.

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

159 {return mode_;}
const std::set<PixelModuleName>& pos::PixelCalibConfiguration::moduleList ( ) const
inline

Definition at line 156 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleLists().

unsigned int pos::PixelCalibConfiguration::nConfigurations ( ) const
inline

Definition at line 112 of file PixelCalibConfiguration.h.

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

112 { 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 910 of file PixelCalibConfiguration.cc.

References _bufferData, cuy::col, colCounter(), cols_, gather_cfg::cout, dacs_, pos::PixelROCInfo::defaultDACs_, disablePixels(), enablePixels(), pos::PixelHdwAddress::fecnumber(), plotBeamSpotDB::first, pos::PixelNameTranslation::getChannelForROC(), pos::PixelNameTranslation::getHdwAddress(), pos::PixelROCInfo::hdwadd_, highVCalRange_, pos::PixelHdwAddress::hubaddress(), mps_fire::i, cuy::ii, pos::k_DACAddress_WBC, pos::PixelROCInfo::masks_, SiStripPI::max, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), mode(), gen::n, dataset::name, create_public_lumi_plots::ncol, 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_.

917  {
918 
919  std::string mthn = "[PixelCalibConfiguration::nextFECState()]\t\t " ;
920  std::string modeName=parameterValue("ScanMode");
921 
922  int mode=-1;
923 
924  if (modeName=="maskAllPixel") mode=0;
925  if (modeName=="useAllPixel"||modeName=="") mode=1;
926  if (modeName=="default") mode=2;
927 
928  static bool first=true;
929 
930  if (first) {
931  cout << __LINE__ << "]\t" << mthn << "mode="<<mode<<endl;
932  first=false;
933  }
934 
935  if (mode==-1) {
936  cout << __LINE__ << "]\t" << mthn << "ScanMode=" << modeName
937  << " not understood."<< endl;
938  ::abort();
939  }
940 
941  if (rocInfo_.empty()){
942  //here we will do some initialization...
943  for(unsigned int i=0;i<rocs_.size();i++){
944  const PixelHdwAddress* hdwadd=trans->getHdwAddress(rocs_[i]);
945  PixelROCInfo rocInfo;
946  rocInfo.use_=true;
947  //FIXME This is very inefficient
948  PixelModuleName module(rocs_[i].rocname());
949 
950  std::map<pos::PixelModuleName,pos::PixelMaskBase*>::const_iterator foundMask = masks->find(module);
951  if (foundMask==masks->end()){
952  rocInfo.use_=false;
953  rocInfo_.push_back(rocInfo);
954  continue;
955  }
956 
957 
958 
959  rocInfo.hdwadd_=hdwadd;
960  rocInfo.trims_=(*trims)[module]->getTrimBits(rocs_[i]);
961  rocInfo.masks_=(*masks)[module]->getMaskBits(rocs_[i]);
962 
963 #ifdef BPIX
964  const PixelChannel channel = trans->getChannelForROC(rocs_[i]);
965  string tbmChannel = channel.TBMChannelString();
966  //cout<<" tbm channel "<<tbmChannel<<endl;
967  rocInfo.tbmChannel_ = tbmChannel;
968 #endif
969 
970  std::map<std::string, unsigned int> defaultDACValues;
971  (*dacs)[PixelModuleName(rocs_[i].rocname())]->getDACSettings(rocs_[i])->getDACs(defaultDACValues);
972 
973  for ( std::vector<PixelDACScanRange>::const_iterator dacs_itr = dacs_.begin(); dacs_itr != dacs_.end(); ++dacs_itr )
974  {
975  std::map<std::string, unsigned int>::const_iterator foundThisDAC = defaultDACValues.find(dacs_itr->name());
976  assert( foundThisDAC != defaultDACValues.end() );
977 
978  pair<unsigned int, unsigned int>
979  dacchannelAndValue(dacs_itr->dacchannel(),
980  foundThisDAC->second);
981 
982  rocInfo.defaultDACs_.push_back(dacchannelAndValue);
983  }
984  rocInfo_.push_back(rocInfo);
985  }
986  }
987 
988  assert(rocs_.size()==rocInfo_.size());
989 
990  bool changedWBC=false;
991 
992  //std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC=pixelFECs.begin();
993  //for(;iPixelFEC!=pixelFECs.end();++iPixelFEC){
994  //iPixelFEC->second->fecDebug(1);
995  //}
996 
997  //unsigned long version=0;
998  //pixelFEC->getversion(&version);
999  //std::cout<<"mfec firmware version:"<<version<<std::endl;
1000 
1001  assert(rocAndModuleListsBuilt_);
1002 
1003  assert(state<nConfigurations());
1004 
1005  // Which set of rows we're on.
1006  unsigned int i_row=rowCounter(state);
1007 
1008  // Which set of columns we're on.
1009  unsigned int i_col=colCounter(state);
1010 
1011  // Whether we're beginning a new scan over the DACs after changing which ROC or which pixel pattern.
1012  unsigned int first_scan=true;
1013  for (unsigned int i=0;i<dacs_.size();i++){
1014  if (scanCounter(i,state)!=0) first_scan=false;
1015  }
1016 
1017  // Disable all pixels at the beginning.
1018  if (state==0&&(mode==0||mode==1)) {
1019 
1020  for(unsigned int i=0;i<rocs_.size();i++){
1021 
1022  if (!rocInfo_[i].use_) continue;
1023 
1024  PixelHdwAddress theROC=*rocInfo_[i].hdwadd_;
1025  PixelROCTrimBits* rocTrims=rocInfo_[i].trims_;
1026 
1027  //Turn off all pixels
1028  disablePixels(pixelFECs[theROC.fecnumber()], rocTrims, theROC);
1029 
1030  }
1031 
1032  // reset
1033  //cout<<"finish init"<<endl;
1034  //sleep(1);
1035  //pixelFEC->injectrstroc(7,1);
1036  // or do pixelFEC->rocreset(theROC.mfec(),
1037  // theROC.mfecchannel(),
1038  // 14, //FIXME hardcode for Channel A
1039  // theROC.hubaddress());
1040 
1041 
1042  }
1043 
1044  // When a scan is complete for a given ROC or pixel pattern, reset the DACs to default values and disable the previously-enabled pixels.
1045  if (first_scan && state!=0 && mode!=2){
1046 
1047  unsigned int previousState=state-1;
1048 
1049  unsigned int i_row_previous=rowCounter(previousState);
1050 
1051  unsigned int i_col_previous=colCounter(previousState);
1052 
1053  for(unsigned int i=0;i<rocs_.size();i++){
1054 
1055  if (!rocInfo_[i].use_) continue;
1056 
1057  PixelHdwAddress theROC=*rocInfo_[i].hdwadd_;
1058 
1059  if ( !scanningROCForState(rocs_[i], previousState) ) continue;
1060 
1061  // Set the DACs back to their default values when we're done with a scan.
1062  for ( unsigned int j=0; j< dacs_.size(); j++ ) {
1063 
1064 
1065  //Try to not reprogram DACs as often..
1066  if (state!=0){
1067  if (scanCounter(dacs_[j].name(),state)==scanCounter(dacs_[j].name(),state-1)){
1068  continue;
1069  }
1070  }
1071 
1072  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1073  theROC.mfecchannel(),
1074  theROC.hubaddress(),
1075  theROC.portaddress(),
1076  theROC.rocid(),
1077  rocInfo_[i].defaultDACs_[j].first,
1078  rocInfo_[i].defaultDACs_[j].second,
1079  _bufferData);
1080 
1081  if (dacs_[j].dacchannel()==k_DACAddress_WBC) {
1082  changedWBC=true;
1083  //cout << "Changed WBC 1"<<endl;
1084  }
1085 
1086  }
1087 
1088  PixelROCTrimBits* rocTrims=rocInfo_[i].trims_;
1089 
1090  disablePixels(pixelFECs[theROC.fecnumber()],
1091  i_row_previous,
1092  i_col_previous,
1093  rocTrims,
1094  theROC);
1095 
1096  }
1097  }
1098 
1099  // Set each ROC with the new settings for this state.
1100  for(unsigned int i=0;i<rocs_.size();i++){
1101 
1102  if (!rocInfo_[i].use_) continue;
1103 
1104 
1105  PixelHdwAddress theROC=*rocInfo_[i].hdwadd_;
1106 
1107 
1108  // Skip this ROC if we're in SingleROC mode and we're not on this ROC number.
1109  if ( !scanningROCForState(rocs_[i], state) ) continue;
1110 
1111  // std::cout << "Will call progdac for vcal:"<< vcal << std::endl;
1112 
1113  // Program all the DAC values.
1114  for (unsigned int ii=0;ii<dacs_.size();ii++){
1115 
1116  //Try to not reprogram DACs as often..
1117  if (state!=0){
1118  if (scanCounter(dacs_[ii].name(),state)==scanCounter(dacs_[ii].name(),state-1)){
1119  continue;
1120  }
1121  }
1122 
1123  int dacvalue = scanValue(ii, state, rocs_[i]);
1124 
1125  //cout << "dacname ii:"<<dacs_[ii].name()<<" "<<ii<<endl;
1126 
1127  if (dacs_[ii].relative()){
1128 
1129  //We have to find the default DAC setting so that we can
1130  //add the offset as we are in relative mode.
1131 
1132  if (dacs_[ii].negative()) dacvalue=-dacvalue;
1133 
1134  dacvalue+=rocInfo_[i].defaultDACs_[ii].second;
1135  //cout << "[PixelCalibConfiguration::nextFECState] ROC="<<rocs_[i]
1136  // << " dac="<<dacs_[ii].name()<<" new value="<<dacvalue<<endl;
1137  }
1138 
1139  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1140  theROC.mfecchannel(),
1141  theROC.hubaddress(),
1142  theROC.portaddress(),
1143  theROC.rocid(),
1144  rocInfo_[i].defaultDACs_[ii].first,
1145  dacvalue,_bufferData);
1146 
1147  if (dacs_[ii].dacchannel()==k_DACAddress_WBC) {
1148  changedWBC=true;
1149  //cout << "Changed WBC 2"<<endl;
1150  }
1151 
1152  }
1153 
1154  // At the beginning of a scan, set the pixel pattern.
1155  if (first_scan){
1156 
1157  // Set masks and trims.
1158  if (mode!=2){
1159 
1160 
1161  PixelROCMaskBits* rocMasks=rocInfo_[i].masks_;
1162  PixelROCTrimBits* rocTrims=rocInfo_[i].trims_;
1163 
1164  if (mode==1) rocMasks=nullptr;
1165 
1166  //std::cout << "Will enable pixels!" <<std::endl;
1167  enablePixels(pixelFECs[theROC.fecnumber()],
1168  i_row,
1169  i_col,
1170  rocMasks,
1171  rocTrims,
1172  theROC);
1173 
1174  }
1175 
1176  // Set high or low Vcal range.
1177 
1178  if (state==0) {
1179 
1180  PixelModuleName module(rocs_[i].rocname());
1181 
1182  unsigned int roccontrolword=(*dacs)[module]->getDACSettings(rocs_[i])->getControlRegister();
1183 
1184  //range is controlled here by one bit, but rest must match config
1185  //bit 0 on/off= 20/40 MHz speed; bit 1 on/off=disabled/enable; bit 3=Vcal range
1186 
1187  if (highVCalRange_) roccontrolword|=0x4; //turn range bit on
1188  else roccontrolword&=0xfb; //turn range bit off
1189 
1190  pixelFECs[theROC.fecnumber()]->progdac(theROC.mfec(),
1191  theROC.mfecchannel(),
1192  theROC.hubaddress(),
1193  theROC.portaddress(),
1194  theROC.rocid(),
1195  0xfd,
1196  roccontrolword,_bufferData);
1197 
1198 
1199  }
1200 
1201  // Clear all pixels before setting the pixel pattern.
1202  pixelFECs[theROC.fecnumber()]->clrcal(theROC.mfec(),
1203  theROC.mfecchannel(),
1204  theROC.hubaddress(),
1205  theROC.portaddress(),
1206  theROC.rocid(),_bufferData);
1207 
1208  // Program the pixel pattern.
1209  unsigned int nrow=rows_[i_row].size();
1210  unsigned int ncol=cols_[i_col].size();
1211  unsigned int nmax=std::max(nrow,ncol);
1212  if (nrow==0||ncol==0) nmax=0;
1213  for (unsigned int n=0;n<nmax;n++){
1214  unsigned int irow=n;
1215  unsigned int icol=n;
1216  if (irow>=nrow) irow=nrow-1;
1217  if (icol>=ncol) icol=ncol-1;
1218  unsigned int row=rows_[i_row][irow];
1219  unsigned int col=cols_[i_col][icol];
1220 
1221  pixelFECs[theROC.fecnumber()]->calpix(theROC.mfec(),
1222  theROC.mfecchannel(),
1223  theROC.hubaddress(),
1224  theROC.portaddress(),
1225  theROC.rocid(),
1226  col,
1227  row,
1228  1,_bufferData);
1229  }
1230 
1231  } // end of instructions for the beginning of a scan
1232  } // end of loop over ROCs
1233 
1234  if (_bufferData) {
1235  std::map<unsigned int, PixelFECConfigInterface*>::iterator iPixelFEC=pixelFECs.begin();
1236  for(;iPixelFEC!=pixelFECs.end();++iPixelFEC){
1237  iPixelFEC->second->qbufsend();
1238  }
1239  }
1240 
1241  if (changedWBC){
1242  for(unsigned int i=0;i<rocs_.size();i++){
1243 
1244  if (!rocInfo_[i].use_) continue;
1245 
1246  PixelHdwAddress theROC=*rocInfo_[i].hdwadd_;
1247 
1248  int tbmRegister = 14; // define for TBM-A
1249 #ifdef BPIX
1250  string tbmChannel = rocInfo_[i].tbmChannel_; // get TBM channel
1251  if( tbmChannel=="B") tbmRegister = 15; // for TBM=B
1252 #endif
1253 
1254  pixelFECs[theROC.fecnumber()]->rocreset(theROC.mfec(),
1255  theROC.mfecchannel(),
1256  tbmRegister,
1257  theROC.hubaddress());
1258  } // for rocs
1259  }
1260 
1261  return;
1262 }
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
std::string mode() const override
unsigned int portaddress() const
std::vector< PixelROCInfo > rocInfo_
unsigned int rowCounter(unsigned int state) const
unsigned int rocid() const
std::string TBMChannelString() const
Definition: PixelChannel.h:33
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_
ii
Definition: cuy.py:589
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_
col
Definition: cuy.py:1009
unsigned int fecnumber() const
unsigned int scanValue(std::string dac, unsigned int state, PixelROCName roc) const
Definition: vlib.h:208
std::vector< std::vector< unsigned int > > cols_
const PixelChannel & getChannelForROC(const PixelROCName &aROC) const
bool pos::PixelCalibConfiguration::noHits ( ) const
inline

Definition at line 115 of file PixelCalibConfiguration.h.

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

Definition at line 163 of file PixelCalibConfiguration.h.

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

Definition at line 102 of file PixelCalibConfiguration.h.

102 { 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
unsigned int pos::PixelCalibConfiguration::nScanPoints ( std::string  dac) const
inline

Definition at line 104 of file PixelCalibConfiguration.h.

References nScanPoints().

Referenced by nScanPoints().

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

Definition at line 106 of file PixelCalibConfiguration.h.

References mps_fire::i, and hiPixelPairStep_cff::points.

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

106  {unsigned int points=1;
107  for(unsigned int i=0;i<dacs_.size();i++) {
108  points*=nScanPoints(i);
109  }
110  return points;
111  }
std::vector< PixelDACScanRange > dacs_
unsigned int pos::PixelCalibConfiguration::nScanPoints ( unsigned int  iscan) const
inlineprivate

Definition at line 204 of file PixelCalibConfiguration.h.

204 { 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 113 of file PixelCalibConfiguration.h.

unsigned int nTriggersPerPattern() const
unsigned int pos::PixelCalibConfiguration::numberOfScanVariables ( ) const
inline

Definition at line 139 of file PixelCalibConfiguration.h.

References dataset::name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by containsScan().

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

Definition at line 870 of file PixelCalibConfiguration.cc.

References numROCsCalibratedOnChannel_, and objectsDependingOnTheNameTranslationBuilt_.

Referenced by scanValue().

871 {
873  std::map <PixelROCName, unsigned int>::const_iterator foundROC = numROCsCalibratedOnChannel_.find(roc);
874  assert( foundROC != numROCsCalibratedOnChannel_.end() );
875  return foundROC->second;
876 }
std::map< PixelROCName, unsigned int > numROCsCalibratedOnChannel_
std::map<std::string, std::string> pos::PixelCalibConfiguration::parametersList ( ) const
inline

Definition at line 166 of file PixelCalibConfiguration.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 1532 of file PixelCalibConfiguration.cc.

References parameters_.

Referenced by nextFECState().

1533 {
1534  std::map<std::string, std::string>::const_iterator itr = parameters_.find(parameterName);
1535  if (itr == parameters_.end()) // parameterName is not in the list
1536  {
1537  return "";
1538  }
1539  else
1540  {
1541  return itr->second;
1542  }
1543 }
std::map< std::string, std::string > parameters_
std::set< std::pair< unsigned int, unsigned int > > PixelCalibConfiguration::pixelsWithHits ( unsigned int  state) const

Definition at line 1647 of file PixelCalibConfiguration.cc.

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

1648 {
1649  std::set< std::pair<unsigned int, unsigned int> > pixels;
1650  // column # row #
1651 
1652  for ( std::vector<unsigned int>::const_iterator col_itr = cols_[colCounter(state)].begin(); col_itr != cols_[colCounter(state)].end(); ++col_itr )
1653  {
1654  for ( std::vector<unsigned int>::const_iterator row_itr = rows_[rowCounter(state)].begin(); row_itr != rows_[rowCounter(state)].end(); ++row_itr )
1655  {
1656  pixels.insert( std::pair<unsigned int, unsigned int>( *col_itr, *row_itr ) );
1657  }
1658  }
1659 
1660  return pixels;
1661 }
std::vector< std::vector< unsigned int > > rows_
unsigned int rowCounter(unsigned int state) const
unsigned int colCounter(unsigned int state) const
#define begin
Definition: vmac.h:32
std::vector< std::vector< unsigned int > > cols_
const std::vector<PixelROCName>& pos::PixelCalibConfiguration::rocList ( ) const
inline

Definition at line 155 of file PixelCalibConfiguration.h.

unsigned int PixelCalibConfiguration::ROCNumberOnChannelAmongThoseCalibrated ( PixelROCName  roc) const
private

Definition at line 862 of file PixelCalibConfiguration.cc.

References objectsDependingOnTheNameTranslationBuilt_, and ROCNumberOnChannelAmongThoseCalibrated_.

Referenced by scanningROCForState(), and scanValue().

863 {
865  std::map <PixelROCName, unsigned int>::const_iterator foundROC = ROCNumberOnChannelAmongThoseCalibrated_.find(roc);
866  assert( foundROC != ROCNumberOnChannelAmongThoseCalibrated_.end() );
867  return foundROC->second;
868 }
std::map< PixelROCName, unsigned int > ROCNumberOnChannelAmongThoseCalibrated_
unsigned int PixelCalibConfiguration::rowCounter ( unsigned int  state) const
private

Definition at line 896 of file PixelCalibConfiguration.cc.

References cols_, nScanPoints(), rows_, and scanROC().

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

897 {
898  unsigned int i_row=( state - scanROC(state)*cols_.size()*rows_.size()*nScanPoints() )/( cols_.size()*nScanPoints() );
899  assert(i_row<rows_.size());
900  return i_row;
901 }
std::vector< std::vector< unsigned int > > rows_
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 154 of file PixelCalibConfiguration.h.

Referenced by SiPixelCalibConfiguration::SiPixelCalibConfiguration().

154 {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 125 of file PixelCalibConfiguration.h.

Referenced by nextFECState(), and scanValue().

125  {
126  return scanCounter(iScan(dac),state);
127  }
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 878 of file PixelCalibConfiguration.cc.

References mps_fire::i, nConfigurations(), and nScanPoints().

879  {
880 
881 
882  assert(state<nConfigurations());
883 
884  unsigned int i_scan=state%nScanPoints();
885 
886  for(unsigned int i=0;i<iscan;i++){
887  i_scan/=nScanPoints(i);
888  }
889 
890  unsigned int i_threshold=i_scan%nScanPoints(iscan);
891 
892  return i_threshold;
893 
894 }
std::string pos::PixelCalibConfiguration::scanName ( unsigned int  iscan) const
inline

Definition at line 143 of file PixelCalibConfiguration.h.

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

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

Definition at line 846 of file PixelCalibConfiguration.cc.

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

Referenced by nextFECState().

847 {
848  if (!singleROC_) return true;
849  return scanROC(state) == ROCNumberOnChannelAmongThoseCalibrated(roc);
850 }
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 818 of file PixelCalibConfiguration.cc.

References cols_, nConfigurations(), nScanPoints(), and rows_.

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

818  {
819 
820  assert(state<nConfigurations());
821 
822  unsigned int i_ROC=state/(cols_.size()*rows_.size()*nScanPoints());
823 
824  return i_ROC;
825 }
std::vector< std::vector< unsigned int > > rows_
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 129 of file PixelCalibConfiguration.h.

Referenced by nextFECState(), and scanValue().

129  {
130  return scanValue(iScan(dac), state, roc);
131  }
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 134 of file PixelCalibConfiguration.h.

134  {
135  assert( !(dacs_[iScan(dac)].mixValuesAcrossROCs()) );
136  return scanValue(iScan(dac), state, 0, 1);
137  }
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 828 of file PixelCalibConfiguration.cc.

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

831  {
832 
833  unsigned int i_threshold = scanCounter(iscan, state);
834 
835  // Spread the DAC values on the different ROCs uniformly across the scan range.
836  if ( dacs_[iscan].mixValuesAcrossROCs() ) i_threshold = (i_threshold + (nScanPoints(iscan)*ROCNumber)/ROCsOnChannel)%nScanPoints(iscan);
837 
838  unsigned int threshold=dacs_[iscan].value(i_threshold);
839 
840  //assert(threshold==dacs_[iscan].first()+i_threshold*dacs_[iscan].step());
841 
842  return threshold;
843 
844 }
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 852 of file PixelCalibConfiguration.cc.

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

854  {
855 
856  unsigned int ROCNumber = ROCNumberOnChannelAmongThoseCalibrated(roc);
857  unsigned int ROCsOnChannel = numROCsCalibratedOnChannel(roc);
858 
859  return scanValue( iscan, state, ROCNumber, ROCsOnChannel );
860 }
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 147 of file PixelCalibConfiguration.h.

References scanValueMax().

Referenced by scanValueMax().

147 {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 214 of file PixelCalibConfiguration.h.

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

Definition at line 146 of file PixelCalibConfiguration.h.

References scanValueMin().

Referenced by scanValueMin().

146 {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 213 of file PixelCalibConfiguration.h.

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

Definition at line 144 of file PixelCalibConfiguration.h.

References scanValues().

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

144 {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 211 of file PixelCalibConfiguration.h.

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

Definition at line 149 of file PixelCalibConfiguration.h.

References scanValuesMixedAcrossROCs(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by scanValuesMixedAcrossROCs().

149 {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 217 of file PixelCalibConfiguration.h.

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

Definition at line 148 of file PixelCalibConfiguration.h.

References scanValueStep().

Referenced by scanValueStep().

148 {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 216 of file PixelCalibConfiguration.h.

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

Definition at line 161 of file PixelCalibConfiguration.h.

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

Implements pos::PixelConfigBase.

Definition at line 1545 of file PixelCalibConfiguration.cc.

References cols_, dacs_, corrVsCorr::filename, plotBeamSpotDB::first, highVCalRange_, mps_fire::i, pos::PixelCalibBase::mode_, ntrigger_, MillePedeFileConverter_cfg::out, parameters_, rocListInstructions_, rows_, singleROC_, AlCaHLTBitMon_QueryRunRegistry::string, and usesROCList_.

Referenced by writeXMLHeader().

1545  {
1546 
1547 
1548  //FIXME this is not tested for all the use cases...
1549 
1550  if (dir!="") dir+="/";
1551  std::string filename=dir+"calib.dat";
1552  std::ofstream out(filename.c_str());
1553 
1554  out << "Mode: "<<mode_<<endl;
1555  if (singleROC_) out << "SingleROC"<<endl;
1556  if (!parameters_.empty()){
1557  out << "Parameters:"<<endl;
1558  std::map<std::string, std::string>::const_iterator it=parameters_.begin();
1559  for (;it!=parameters_.end();++it){
1560  out << it->first << " " << it->second <<endl;
1561  }
1562  }
1563  out << "Rows:" <<endl;
1564  for (unsigned int i=0;i<rows_.size();i++){
1565  for (unsigned int j=0;j<rows_[i].size();j++){
1566  out << rows_[i][j] <<" ";
1567  }
1568  if (i!=rows_.size()-1) out <<"|";
1569  out <<endl;
1570  }
1571  out << "Cols:" <<endl;
1572  for (unsigned int i=0;i<cols_.size();i++){
1573  for (unsigned int j=0;j<cols_[i].size();j++){
1574  out << cols_[i][j] <<" ";
1575  }
1576  if (i!=cols_.size()-1) out <<"|";
1577  out <<endl;
1578  }
1579 
1580  if (highVCalRange_) {
1581  out << "VcalHigh" << endl;
1582  }
1583  else {
1584  out << "VcalLow" << endl;
1585  }
1586 
1587 
1588  for (unsigned int i=0;i<dacs_.size();i++){
1589  if (dacs_[i].uniformSteps()) {
1590  if (dacs_[i].first()!=dacs_[i].last()) {
1591  out << "Scan: "<<dacs_[i].name()<<" ";
1592  out <<dacs_[i].first()<<" ";
1593  out <<dacs_[i].last()<<" ";
1594  out <<dacs_[i].step()<<endl;
1595  }
1596  else {
1597  out << "Set: "<<dacs_[i].name()<<" ";
1598  out <<dacs_[i].first()<<endl;
1599  }
1600  }
1601  else {
1602  out << "ScanValues: "<<dacs_[i].name()<<" ";
1603  for(unsigned int ival=0;ival<dacs_[i].getNPoints();ival++){
1604  out << dacs_[i].value(ival)<<" ";
1605  }
1606  out<<" -1"<<endl;
1607  }
1608  }
1609 
1610  out << "Repeat:" <<endl;
1611  out << ntrigger_ << endl;
1612 
1613  if (usesROCList_){
1614  out << "Rocs:"<< endl;
1615  }
1616  else{
1617  out << "ToCalibrate:"<< endl;
1618  }
1619  for (unsigned int i=0;i<rocListInstructions_.size();i++){
1620  out << rocListInstructions_[i] <<endl;
1621  if (rocListInstructions_[i]=="+"||rocListInstructions_[i]=="-"){
1622  out << " ";
1623  }
1624  else {
1625  out << endl;
1626  }
1627  }
1628 
1629  out.close();
1630 
1631 }
std::vector< std::vector< unsigned int > > rows_
std::vector< PixelDACScanRange > dacs_
std::vector< std::string > rocListInstructions_
std::map< std::string, std::string > parameters_
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< std::vector< unsigned int > > cols_
void pos::PixelCalibConfiguration::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual
void PixelCalibConfiguration::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelCalibBase.

Definition at line 1725 of file PixelCalibConfiguration.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

1728 {
1729  std::string mthn = "[PixelCalibConfiguration::writeXML()]\t\t " ;
1730 
1731 
1732  *outstream << " " << std::endl ;
1733  *outstream << " <DATA>" << std::endl ;
1734  *outstream << " <CALIB_OBJ_DATA_FILE>./calib.dat</CALIB_OBJ_DATA_FILE>" << std::endl ;
1735  *outstream << " <CALIB_TYPE>calib</CALIB_TYPE>" << std::endl ;
1736  *outstream << " </DATA>" << std::endl ;
1737  *outstream << " " << std::endl ;
1738 }
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 1676 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().

1682 {
1683  std::string mthn = "[PixelCalibConfiguration::writeXMLHeader()]\t\t " ;
1684  std::stringstream maskFullPath ;
1685 
1686  writeASCII(path) ;
1687 
1688  maskFullPath << path << "/PixelCalib_Test_" << PixelTimeFormatter::getmSecTime() << ".xml";
1689  std::cout << __LINE__ << "]\t" << mthn << "Writing to: " << maskFullPath.str() << std::endl ;
1690 
1691  outstream->open(maskFullPath.str().c_str()) ;
1692 
1693  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
1694  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
1695  *outstream << "" << std::endl ;
1696  *outstream << " <!-- " << mthn << "-->" << std::endl ;
1697  *outstream << "" << std::endl ;
1698  *outstream << " <HEADER>" << std::endl ;
1699  *outstream << " <TYPE>" << std::endl ;
1700  *outstream << " <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl ;
1701  *outstream << " <NAME>Calibration Object Clob</NAME>" << std::endl ;
1702  *outstream << " </TYPE>" << std::endl ;
1703  *outstream << " <RUN>" << std::endl ;
1704  *outstream << " <RUN_TYPE>Gain Calibration</RUN_TYPE>" << std::endl ;
1705  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
1706  *outstream << " <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl ;
1707  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl ;
1708  *outstream << " </RUN>" << std::endl ;
1709  *outstream << " </HEADER>" << std::endl ;
1710  *outstream << "" << std::endl ;
1711  *outstream << " <DATA_SET>" << std::endl ;
1712  *outstream << "" << std::endl ;
1713  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl ;
1714  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl ;
1715  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl ;
1716  *outstream << "" << std::endl ;
1717  *outstream << " <PART>" << std::endl ;
1718  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
1719  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
1720  *outstream << " </PART>" << std::endl ;
1721 
1722 }
static std::string getmSecTime(void)
void writeASCII(std::string dir="") const override
static std::string getTime(void)
std::string getComment() const
std::string getAuthor() const
void PixelCalibConfiguration::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelCalibBase.

Definition at line 1741 of file PixelCalibConfiguration.cc.

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

1744 {
1745  std::string mthn = "[PixelCalibConfiguration::writeXMLTrailer()]\t\t " ;
1746 
1747  *outstream << " </DATA_SET>" << std::endl ;
1748  *outstream << "</ROOT>" << std::endl ;
1749 
1750  outstream->close() ;
1751  std::cout << __LINE__ << "]\t" << mthn << "Data written " << std::endl ;
1752 
1753 }

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 288 of file PixelCalibConfiguration.h.

Referenced by 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 244 of file PixelCalibConfiguration.h.

Referenced by fedCardsAndChannels().

bool pos::PixelCalibConfiguration::highVCalRange_
private

Definition at line 260 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 258 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleListsFromROCSet().

unsigned int pos::PixelCalibConfiguration::ntrigger_
private

Definition at line 257 of file PixelCalibConfiguration.h.

Referenced by pos::operator<<(), PixelCalibConfiguration(), and writeASCII().

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 278 of file PixelCalibConfiguration.h.

Referenced by buildROCAndModuleListsFromROCSet().

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

Definition at line 277 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 233 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 285 of file PixelCalibConfiguration.h.

Referenced by PixelCalibConfiguration(), and writeASCII().