#include <CalibTracker/SiStripCommon/interface/SiStripFedIdListReader.h>
Public Member Functions | |
const std::vector< uint16_t > & | fedIds () const |
SiStripFedIdListReader & | operator= (const SiStripFedIdListReader &) |
SiStripFedIdListReader (const SiStripFedIdListReader &) | |
SiStripFedIdListReader (std::string filePath) | |
~SiStripFedIdListReader () | |
Private Member Functions | |
SiStripFedIdListReader () | |
Private Attributes | |
std::vector< uint16_t > | fedIds_ |
std::ifstream | inputFile_ |
Definition at line 18 of file SiStripFedIdListReader.h.
SiStripFedIdListReader::SiStripFedIdListReader | ( | std::string | filePath | ) | [explicit] |
Definition at line 7 of file SiStripFedIdListReader.cc.
References lat::endl(), fedIds_, find(), inputFile_, and it.
00007 { 00008 fedIds_.clear(); 00009 inputFile_.open( filePath.c_str() ); 00010 00011 if ( inputFile_.is_open() ) { 00012 00013 for(;;) { 00014 00015 uint32_t fed_id; 00016 inputFile_ >> fed_id; 00017 00018 if ( !( inputFile_.eof() || inputFile_.fail() ) ) { 00019 00020 std::vector<uint16_t>::const_iterator it = find( fedIds_.begin(), fedIds_.end(), fed_id ); 00021 if( it == fedIds_.end() ) { fedIds_.push_back(fed_id); } 00022 else { 00023 edm::LogWarning("Unknown") 00024 << "[SiStripFedIdListReader::" << __func__ << "]" 00025 << " FedId " << fed_id << " has already been found in file!" << std::endl; 00026 continue; 00027 } 00028 00029 } else if ( inputFile_.eof() ) { 00030 edm::LogVerbatim("Unknown") 00031 << "[SiStripFedIdListReader::" << __func__ << "]" 00032 << " End of file reached! Found " << fedIds_.size() 00033 << " valid FedIds!" << std::endl; 00034 break; 00035 } else if ( inputFile_.fail() ) { 00036 edm::LogVerbatim("Unknown") 00037 << "[SiStripFedIdListReader::" << __func__ << "]" 00038 << " Error while reading file \"" << filePath << "\"!" << std::endl; 00039 break; 00040 } 00041 } 00042 00043 inputFile_.close(); 00044 } else { 00045 edm::LogVerbatim("Unknown") 00046 << "[SiStripFedIdListReader::" << __func__ << "]" 00047 << " Unable to open file \"" << filePath << "\"!" << std::endl; 00048 return; 00049 00050 } 00051 00052 }
SiStripFedIdListReader::SiStripFedIdListReader | ( | const SiStripFedIdListReader & | copy | ) | [explicit] |
Definition at line 56 of file SiStripFedIdListReader.cc.
References fedIds_.
00056 { 00057 edm::LogVerbatim("Unknown") 00058 << "[SiStripFedIdListReader::" << __func__ << "]"; 00059 fedIds_ = copy.fedIds_; 00060 }
SiStripFedIdListReader::~SiStripFedIdListReader | ( | ) |
Definition at line 73 of file SiStripFedIdListReader.cc.
00073 { 00074 edm::LogVerbatim("Unknown") 00075 << "[SiStripFedIdListReader::" << __func__ << "]"; 00076 }
SiStripFedIdListReader::SiStripFedIdListReader | ( | ) | [inline, explicit, private] |
const std::vector< uint16_t > & SiStripFedIdListReader::fedIds | ( | ) | const [inline] |
Definition at line 48 of file SiStripFedIdListReader.h.
References fedIds_.
Referenced by operator<<().
00048 { return fedIds_; }
SiStripFedIdListReader & SiStripFedIdListReader::operator= | ( | const SiStripFedIdListReader & | copy | ) |
Definition at line 64 of file SiStripFedIdListReader.cc.
References fedIds_.
00064 { 00065 edm::LogVerbatim("Unknown") 00066 << "[SiStripFedIdListReader::" << __func__ << "]"; 00067 fedIds_ = copy.fedIds_; 00068 return *this; 00069 }
std::vector<uint16_t> SiStripFedIdListReader::fedIds_ [private] |
Definition at line 44 of file SiStripFedIdListReader.h.
Referenced by fedIds(), operator=(), and SiStripFedIdListReader().
std::ifstream SiStripFedIdListReader::inputFile_ [private] |