#include <CondFormats/CSCObjects/interface/CSCTriggerMappingFromFile.h>
Public Member Functions | |
CSCTriggerMappingFromFile () | |
CSCTriggerMappingFromFile (std::string filename) | |
Constructor. | |
virtual void | fill (void) |
Fill mapping store. | |
virtual | ~CSCTriggerMappingFromFile () |
Destructor. | |
Private Attributes | |
std::string | filename_ |
Definition at line 13 of file CSCTriggerMappingFromFile.h.
CSCTriggerMappingFromFile::CSCTriggerMappingFromFile | ( | std::string | filename | ) | [explicit] |
CSCTriggerMappingFromFile::CSCTriggerMappingFromFile | ( | ) | [inline] |
CSCTriggerMappingFromFile::~CSCTriggerMappingFromFile | ( | ) | [virtual] |
Fill mapping store.
Implements CSCTriggerMapping.
Definition at line 11 of file CSCTriggerMappingFromFile.cc.
References CSCTriggerMapping::addRecord(), GenMuonPlsPt100GeV_cfg::cout, CSCTriggerMapping::debugV(), lat::endl(), filename_, i1, i2, i3, i4, i5, i6, in, and parsecf::pyparsing::line().
Referenced by CSCTriggerMappingFromFile().
00011 { 00012 std::ifstream in( filename_.c_str() ); 00013 std::string line; 00014 const std::string commentFlag = "#"; 00015 if ( !in ) { 00016 std::cout << "CSCTriggerMappingFromFile: ERROR! Failed to open file containing mapping, " << 00017 filename_ << std::endl ; 00018 } 00019 else 00020 { 00021 std::cout << "CSCTriggerMappingFromFile: opened file containing mapping, " << 00022 filename_ << std::endl ; 00023 00024 while ( getline(in, line) ) { // getline() from <string> 00025 if ( debugV() ) std::cout << line << std::endl; 00026 if ( line[0] != commentFlag[0] ) { 00027 int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10; 00028 std::istringstream is( line ); 00029 is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10; 00030 if ( debugV() ) std::cout << i1 << " " << i2 << " " << i3 << " " << i4 << " " 00031 << i5 << " " << i6 << " " << i7 << " " << i8 << " " 00032 << i9 << " " << i10 << std::endl; 00033 addRecord( i1, i2, i3, i4, i5, i6, i7, i8, i9 , i10); 00034 } 00035 } 00036 00037 } 00038 00039 return; 00040 }
std::string CSCTriggerMappingFromFile::filename_ [private] |