23 inputFile_.open(filePath.c_str());
25 if (inputFile_.is_open()) {
31 inputFile_ >> detid >> ncols >> nrows;
33 if (!(inputFile_.eof() || inputFile_.fail())) {
34 detIds_.push_back(detid);
41 std::map<uint32_t, std::pair<int, int> >::const_iterator it = detData_.find(detid);
43 if (it == detData_.end()) {
44 detData_[detid] = pair<int, int>(ncols, nrows);
47 edm::LogError(
"SiPixelDetInfoFileReader::SiPixelDetInfoFileReader")
48 <<
"DetId " << detid <<
" already found on file. Ignoring new data" << endl;
52 }
else if (inputFile_.eof()) {
53 edm::LogInfo(
"SiPixelDetInfoFileReader::SiPixelDetInfoFileReader - END of file reached") << endl;
56 }
else if (inputFile_.fail()) {
57 edm::LogError(
"SiPixelDetInfoFileReader::SiPixelDetInfoFileReader - ERROR while reading file") << endl;
65 edm::LogError(
"SiPixelDetInfoFileReader::SiPixelDetInfoFileReader - Unable to open file") << endl;
80 edm::LogInfo(
"SiPixelDetInfoFileReader::~SiPixelDetInfoFileReader");
90 std::map<uint32_t, std::pair<int, int> >::const_iterator it = detData_.find(detId);
92 if (it != detData_.end()) {
96 static const std::pair<int, int> defaultValue(0, 0);
98 "SiPixelDetInfoFileReader::getDetUnitDimensions - Unable to find requested detid. Returning invalid data ")
const std::pair< int, int > & getDetUnitDimensions(uint32_t detId) const
const std::vector< uint32_t > & getAllDetIds() const
string filePath
DQM Environment
Log< level::Error, false > LogError
SiPixelDetInfoFileReader(std::string filePath)
Log< level::Info, false > LogInfo
~SiPixelDetInfoFileReader()
Log< level::Warning, false > LogWarning