This is the documentation about PixelDetectorConfig...
More...
#include <PixelDetectorConfig.h>
|
void | addROC (PixelROCName &, std::string statusLabel) |
|
void | addROC (PixelROCName &) |
|
bool | containsModule (const PixelModuleName &moduleToFind) const |
|
std::set< unsigned int > | getFEDs (PixelNameTranslation *translation) const |
|
std::map< unsigned int,
std::set< unsigned int > > | getFEDsAndChannels (PixelNameTranslation *translation) const |
|
PixelModuleName | getModule (unsigned int i) const |
|
const std::vector
< PixelModuleName > & | getModuleList () const |
|
unsigned int | getNModules () const |
|
const std::map< PixelROCName,
PixelROCStatus > & | getROCsList () const |
|
| PixelDetectorConfig (std::vector< std::vector< std::string > > &tableMat) |
|
| PixelDetectorConfig (std::string filename) |
|
void | removeROC (PixelROCName &) |
|
void | writeASCII (std::string dir="") const |
|
void | writeXML (pos::PixelConfigKey key, int version, std::string path) const |
|
virtual void | writeXML (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual void | writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
virtual void | writeXMLTrailer (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const |
|
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 () |
|
This is the documentation about PixelDetectorConfig...
" "
Definition at line 39 of file PixelDetectorConfig.h.
PixelDetectorConfig::PixelDetectorConfig |
( |
std::vector< std::vector< std::string > > & |
tableMat | ) |
|
Definition at line 22 of file PixelDetectorConfig.cc.
References trackerHits::c, containsModule(), pos::PixelROCStatus::get(), python.rootplot.argparse::module, modules_, n, pos::PixelROCStatus::noInit, alignCSCRings::r, rocs_, pos::PixelROCStatus::set(), and ntuplemaker::status.
24 std::string mthn =
"]\t[PixelDetectorConfig::PixelDetectorConfig()]\t\t " ;
25 std::vector< std::string > ins = tableMat[0];
26 std::map<std::string , int > colM;
27 std::vector<std::string > colNames;
39 colNames.push_back(
"CONFIG_KEY" );
40 colNames.push_back(
"KEY_TYPE" );
41 colNames.push_back(
"KEY_ALIAS" );
42 colNames.push_back(
"VERSION" );
43 colNames.push_back(
"KIND_OF_COND");
44 colNames.push_back(
"ROC_NAME" );
45 colNames.push_back(
"ROC_STATUS" );
47 for(
unsigned int c = 0 ;
c < ins.size() ;
c++){
48 for(
unsigned int n=0;
n<colNames.size();
n++){
49 if(tableMat[0][
c] == colNames[
n]){
50 colM[colNames[
n]] =
c;
68 for(
unsigned int r = 1 ;
r < tableMat.size() ;
r++)
72 std::string
status = tableMat[
r][colM[
"ROC_STATUS"]];
76 if(status.find(
"on") != string::npos)
81 rocstatus.
set(status);
bool get(ROCstatus stat) const
std::map< PixelROCName, PixelROCStatus > rocs_
std::vector< PixelModuleName > modules_
bool containsModule(const PixelModuleName &moduleToFind) const
PixelConfigBase(std::string description, std::string creator, std::string date)
PixelDetectorConfig::PixelDetectorConfig |
( |
std::string |
filename | ) |
|
Definition at line 98 of file PixelDetectorConfig.cc.
References containsModule(), gather_cfg::cout, pos::PixelROCStatus::get(), recoMuon::in, geometryCSVtoXML::line, python.rootplot.argparse::module, modules_, pos::PixelROCStatus::noInit, rocs_, pos::PixelROCStatus::set(), and ntuplemaker::status.
101 std::string mthn =
"[PixelDetectorConfig::PixelDetectorConfig()]\t\t " ;
108 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " <<
filename << std::endl;
109 throw std::runtime_error(
"Failed to open file "+
filename);
116 std::cout << __LINE__ <<
"]\t" << mthn <<
"EOF before reading anything!" << std::endl;
117 throw std::runtime_error(
"File seems to be empty "+
filename);
128 if (module==
"Rocs:") {
129 std::cout << __LINE__ <<
"]\t" << mthn <<
"New format of detconfig"<<std::endl;
139 istringstream instring(line);
142 while (!instring.eof()) {
146 rocstatus.
set(status);
149 rocs_[roc]=rocstatus;
164 if (
in.eof())
std::cout << mthn <<
"EOF after reading first module name" << std::endl;
166 std::cout << __LINE__ <<
"]\t" << mthn <<
"Old format of detconfig"<<std::endl;
bool get(ROCstatus stat) const
std::map< PixelROCName, PixelROCStatus > rocs_
std::vector< PixelModuleName > modules_
bool containsModule(const PixelModuleName &moduleToFind) const
PixelConfigBase(std::string description, std::string creator, std::string date)
void pos::PixelDetectorConfig::addROC |
( |
PixelROCName & |
, |
|
|
std::string |
statusLabel |
|
) |
| |
Definition at line 545 of file PixelDetectorConfig.cc.
References pos::PixelROCStatus::reset(), rocs_, and alignCSCRings::s.
547 std::stringstream
s ; s << __LINE__ <<
"]\t[PixelDetectorConfig::addROC()]\t\t\t\t " ;
548 std::string mthn = s.str() ;
550 std::map<PixelROCName, PixelROCStatus>::iterator theROCIt =
rocs_.find(theROC) ;
551 if( theROCIt ==
rocs_.end() )
555 rocs_[theROC] = theStatus ;
558 theROCIt->second.
reset() ;
std::map< PixelROCName, PixelROCStatus > rocs_
bool PixelDetectorConfig::containsModule |
( |
const PixelModuleName & |
moduleToFind | ) |
const |
std::map< unsigned int, std::set< unsigned int > > PixelDetectorConfig::getFEDsAndChannels |
( |
PixelNameTranslation * |
translation | ) |
const |
const std::vector<PixelModuleName>& pos::PixelDetectorConfig::getModuleList |
( |
| ) |
const |
|
inline |
unsigned int PixelDetectorConfig::getNModules |
( |
| ) |
const |
void PixelDetectorConfig::removeROC |
( |
PixelROCName & |
theROC | ) |
|
Definition at line 584 of file PixelDetectorConfig.cc.
References rocs_, and pos::PixelROCStatus::set().
586 std::string mthn =
"[PixelDetectorConfig::removeROC()]\t\t\t\t " ;
588 std::map<PixelROCName, PixelROCStatus>::iterator theROCIt =
rocs_.find(theROC) ;
589 if( theROCIt !=
rocs_.end() )
591 theROCIt->second.set(
"noInit") ;
595 theStatus.
set(
"noInit") ;
596 rocs_[theROC] = theStatus ;
std::map< PixelROCName, PixelROCStatus > rocs_
void PixelDetectorConfig::writeASCII |
( |
std::string |
dir = "" | ) |
const |
|
virtual |
void PixelDetectorConfig::writeXML |
( |
pos::PixelConfigKey |
key, |
|
|
int |
version, |
|
|
std::string |
path |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelConfigBase.
Definition at line 472 of file PixelDetectorConfig.cc.
References gather_cfg::cout, pos::PixelTimeFormatter::getTime(), modules_, dbtoconf::out, rocs_, and alignCSCRings::s.
474 std::stringstream
s ; s << __LINE__ <<
"]\t[PixelDetectorConfig::writeXML()]\t\t\t " ;
475 std::string mthn = s.str() ;
477 std::stringstream fullPath ;
479 fullPath <<
path <<
"/Pixel_DetectorConfig.xml" ;
480 cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << fullPath.str() << std::endl ;
482 std::ofstream
out(fullPath.str().c_str()) ;
484 out <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
485 out <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
486 out <<
" <HEADER>" << std::endl ;
487 out <<
" <TYPE>" << std::endl ;
488 out <<
" <EXTENSION_TABLE_NAME>PIXEL_DETECTOR_CONFIG</EXTENSION_TABLE_NAME>" << std::endl ;
489 out <<
" <NAME>Pixel Detector Configuration</NAME>" << std::endl ;
490 out <<
" </TYPE>" << std::endl ;
491 out <<
" <RUN>" << std::endl ;
492 out <<
" <RUN_TYPE>Pixel Detector Configuration test</RUN_TYPE>" << std::endl ;
493 out <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
495 out <<
" <COMMENT_DESCRIPTION>Test of DetectorConfig xml</COMMENT_DESCRIPTION>" << std::endl ;
496 out <<
" <LOCATION>CERN TAC</LOCATION>" << std::endl ;
497 out <<
" <CREATED_BY_USER>Dario Menasce</CREATED_BY_USER>" << std::endl ;
498 out <<
" </RUN>" << std::endl ;
499 out <<
" </HEADER>" << std::endl ;
500 out <<
"" << std::endl ;
501 out <<
"" << std::endl ;
503 if(
rocs_.size() == 0)
505 std::vector<PixelModuleName>::const_iterator imodule=
modules_.begin();
508 for (;imodule!=
modules_.end();++imodule)
510 out <<
" <DATA>" << std::endl ;
512 out <<
" <ROC_STATUS>on</ROC_STATUS>" << std::endl ;
513 out <<
" </DATA>" << std::endl ;
514 out <<
" " << std::endl ;
519 std::map<PixelROCName, PixelROCStatus>::const_iterator irocs =
rocs_.begin();
520 for(; irocs !=
rocs_.end() ; irocs++)
522 std::string sts = (irocs->second).statusName() ;
523 if( sts ==
"" ) {sts =
"on" ;}
524 out <<
" <DATA_SET>" << std::endl ;
525 out <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl ;
526 out <<
" <PART>" << std::endl ;
527 out <<
" <NAME_LABEL>" << (irocs->first).rocname() <<
"</NAME_LABEL>" << std::endl ;
528 out <<
" <KIND_OF_PART>ROC</KIND_OF_PART>" << std::endl ;
529 out <<
" </PART>" << std::endl ;
530 out <<
" <DATA>" << std::endl ;
531 out <<
" <ROC_NAME>" << (irocs->first).rocname() <<
"</ROC_NAME>" << std::endl ;
532 out <<
" <ROC_STATUS>" << sts <<
"</ROC_STATUS>" << std::endl ;
533 out <<
" </DATA>" << std::endl ;
534 out <<
" </DATA_SET>" << std::endl ;
535 out <<
" " << std::endl ;
538 out <<
" </DATA_SET>" << std::endl ;
539 out <<
"</ROOT> " << std::endl ;
std::map< PixelROCName, PixelROCStatus > rocs_
std::vector< PixelModuleName > modules_
void PixelDetectorConfig::writeXML |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelConfigBase.
Definition at line 421 of file PixelDetectorConfig.cc.
References modules_, rocs_, and alignCSCRings::s.
425 std::stringstream
s ; s << __LINE__ <<
"]\t[PixelDetectorConfig::writeXML()]\t\t\t " ;
426 std::string mthn = s.str() ;
427 if(
rocs_.size() == 0)
429 std::vector<PixelModuleName>::const_iterator imodule=
modules_.begin();
432 for (;imodule!=
modules_.end();++imodule)
434 *outstream <<
" <DATA>" << std::endl ;
436 *outstream <<
" <ROC_STATUS>on</ROC_STATUS>" << std::endl ;
437 *outstream <<
" </DATA>" << std::endl ;
438 *outstream <<
" " << std::endl ;
443 std::map<PixelROCName, PixelROCStatus>::const_iterator irocs =
rocs_.begin();
444 for(; irocs !=
rocs_.end() ; irocs++)
446 std::string sts = (irocs->second).statusName() ;
447 if( sts ==
"" ) {sts =
"on" ;}
448 *outstream <<
" " << std::endl ;
449 *outstream <<
" <DATA>" << std::endl ;
450 *outstream <<
" <ROC_NAME>" << (irocs->first).rocname() <<
"</ROC_NAME>" << std::endl ;
451 *outstream <<
" <ROC_STATUS>" << sts <<
"</ROC_STATUS>" << std::endl ;
452 *outstream <<
" </DATA>" << std::endl ;
std::map< PixelROCName, PixelROCStatus > rocs_
std::vector< PixelModuleName > modules_
void PixelDetectorConfig::writeXMLHeader |
( |
pos::PixelConfigKey |
key, |
|
|
int |
version, |
|
|
std::string |
path, |
|
|
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelConfigBase.
Definition at line 369 of file PixelDetectorConfig.cc.
References gather_cfg::cout, pos::PixelConfigBase::getAuthor(), pos::PixelConfigBase::getComment(), pos::PixelTimeFormatter::getmSecTime(), and pos::PixelTimeFormatter::getTime().
376 std::string mthn =
"]\t[PixelDetectorConfig::writeXMLHeader()]\t\t\t " ;
377 std::stringstream fullPath ;
379 cout << __LINE__ << mthn <<
"Writing to: " << fullPath.str() << endl ;
381 outstream->open(fullPath.str().c_str()) ;
383 if( !outstream->good() )
385 cout << __LINE__ << mthn <<
"FATAL: could not open file " << fullPath.str() << endl ;
389 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
390 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
391 *outstream <<
"" << std::endl ;
392 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl ;
393 *outstream <<
"" << std::endl ;
394 *outstream <<
" <HEADER>" << std::endl ;
395 *outstream <<
" <TYPE>" << std::endl ;
396 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_DETECTOR_CONFIG</EXTENSION_TABLE_NAME>" << std::endl ;
397 *outstream <<
" <NAME>Pixel Detector Configuration</NAME>" << std::endl ;
398 *outstream <<
" </TYPE>" << std::endl ;
399 *outstream <<
" <RUN>" << std::endl ;
400 *outstream <<
" <RUN_TYPE>Pixel Detector Configuration test</RUN_TYPE>" << std::endl ;
401 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
403 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
404 *outstream <<
" </RUN>" << std::endl ;
405 *outstream <<
" </HEADER>" << std::endl ;
406 *outstream <<
"" << std::endl ;
407 *outstream <<
" <DATA_SET>" << std::endl ;
408 *outstream <<
" " << std::endl ;
409 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl ;
410 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl ;
411 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl ;
412 *outstream <<
" " << std::endl ;
413 *outstream <<
" <PART>" << std::endl ;
414 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
415 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
416 *outstream <<
" </PART>" << std::endl ;
std::string getComment() const
std::string getAuthor() const
void PixelDetectorConfig::writeXMLTrailer |
( |
std::ofstream * |
out, |
|
|
std::ofstream * |
out1 = NULL , |
|
|
std::ofstream * |
out2 = NULL |
|
) |
| const |
|
virtual |
Reimplemented from pos::PixelConfigBase.
Definition at line 458 of file PixelDetectorConfig.cc.
References alignCSCRings::s.
462 std::stringstream
s ; s << __LINE__ <<
"]\t[PixelDetectorConfig::writeXMLTrailer()]\t\t\t " ;
463 std::string mthn = s.str() ;
465 *outstream <<
" " << std::endl ;
466 *outstream <<
" </DATA_SET>" << std::endl ;
467 *outstream <<
"</ROOT> " << std::endl ;