#include <CSCTriggerElectronicsMappingFromFile.h>
Public Member Functions | |
CSCTriggerElectronicsMappingFromFile (std::string filename) | |
Constructor. | |
CSCTriggerElectronicsMappingFromFile () | |
virtual void | fill (void) |
Fill mapping store. | |
virtual | ~CSCTriggerElectronicsMappingFromFile () |
Destructor. | |
Private Attributes | |
std::string | filename_ |
Definition at line 13 of file CSCTriggerElectronicsMappingFromFile.h.
CSCTriggerElectronicsMappingFromFile::CSCTriggerElectronicsMappingFromFile | ( | std::string | filename | ) | [explicit] |
CSCTriggerElectronicsMappingFromFile::CSCTriggerElectronicsMappingFromFile | ( | ) | [inline] |
Definition at line 18 of file CSCTriggerElectronicsMappingFromFile.h.
{}
CSCTriggerElectronicsMappingFromFile::~CSCTriggerElectronicsMappingFromFile | ( | ) | [virtual] |
void CSCTriggerElectronicsMappingFromFile::fill | ( | void | ) | [virtual] |
Fill mapping store.
Implements CSCTriggerMapping.
Definition at line 11 of file CSCTriggerElectronicsMappingFromFile.cc.
References CSCTriggerMapping::addRecord(), gather_cfg::cout, CSCTriggerMapping::debugV(), filename_, recoMuon::in, and geometryCSVtoXML::line.
Referenced by CSCTriggerElectronicsMappingFromFile().
{ std::ifstream in( filename_.c_str() ); std::string line; const std::string commentFlag = "#"; if ( !in ) { std::cout << "CSCTriggerElectronicsMappingFromFile: ERROR! Failed to open file containing mapping, " << filename_ << std::endl ; } else { std::cout << "CSCTriggerElectronicsMappingFromFile: opened file containing mapping, " << filename_ << std::endl ; while ( getline(in, line) ) { // getline() from <string> if ( debugV() ) std::cout << line << std::endl; if ( line[0] != commentFlag[0] ) { int i1, i2, i3, i6, i7, i8, i9, i10; std::istringstream is( line ); is >> i1 >> i2 >> i3 >> i6 >> i7 >> i8 >> i9 >> i10; if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " " << i6 << " " << i7 << " " << i8 << " " << i9 << " " << i10 << std::endl; addRecord( i1, i2, i3, 0, 0, i6, i7, i8, i9 , i10); } } } return; }
std::string CSCTriggerElectronicsMappingFromFile::filename_ [private] |
Definition at line 27 of file CSCTriggerElectronicsMappingFromFile.h.
Referenced by fill().