#include <CondFormats/CSCObjects/interface/CSCReadoutMappingFromFile.h>
Public Member Functions | |
CSCReadoutMappingFromFile () | |
CSCReadoutMappingFromFile (const edm::ParameterSet &ps) | |
Constructor. | |
virtual void | fill (const edm::ParameterSet &ps) |
Fill mapping store. | |
virtual | ~CSCReadoutMappingFromFile () |
Destructor. | |
Private Attributes | |
std::string | theMappingFile |
Find file from FileInPath of ParameterSet passed from calling E_Producer.
Definition at line 15 of file CSCReadoutMappingFromFile.h.
CSCReadoutMappingFromFile::CSCReadoutMappingFromFile | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Constructor.
Definition at line 8 of file CSCReadoutMappingFromFile.cc.
References fill().
00008 { 00009 fill( ps ); 00010 }
CSCReadoutMappingFromFile::CSCReadoutMappingFromFile | ( | ) | [inline] |
CSCReadoutMappingFromFile::~CSCReadoutMappingFromFile | ( | ) | [virtual] |
void CSCReadoutMappingFromFile::fill | ( | const edm::ParameterSet & | ps | ) | [virtual] |
Fill mapping store.
Implements CSCReadoutMapping.
Definition at line 14 of file CSCReadoutMappingFromFile.cc.
References CSCReadoutMapping::addRecord(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), i1, i2, i3, i4, i5, i6, in, parsecf::pyparsing::line(), and theMappingFile.
Referenced by CSCReadoutMappingFromFile().
00014 { 00015 edm::FileInPath fp = ps.getParameter<edm::FileInPath>("theMappingFile"); 00016 theMappingFile = fp.fullPath(); 00017 std::ifstream in( theMappingFile.c_str() ); 00018 std::string line; 00019 const std::string commentFlag = "#"; 00020 if ( !in ) { 00021 edm::LogError("CSC") << " Failed to open file " << theMappingFile << " containing mapping."; 00022 } 00023 else 00024 { 00025 edm::LogInfo("CSC") << " Opened file " << theMappingFile << " containing mapping."; 00026 00027 while ( getline(in, line) ) { // getline() from <string> 00028 // LogDebug("CSC") << line; 00029 if ( line[0] != commentFlag[0] ) { 00030 int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11; 00031 std::istringstream is( line ); 00032 is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10 >> i11; 00033 // LogDebug("CSC") << i1 << " " << i2 << " " << i3 << " " << i4 << " " << 00034 // i5 << " " << i6 << " " << i7 << " " << i8 << " " << i9; 00035 addRecord( i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11 ); 00036 } 00037 } 00038 00039 } 00040 00041 return; 00042 }
std::string CSCReadoutMappingFromFile::theMappingFile [private] |