/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Alignment/SurveyAnalysis/src/SurveyInputTextReader.cc
54 строки
2 KB
Cms Build
Clang-Format
09 май 2019, 07:17
09 май 2019, 07:17
6fda101
Код
Авторство
О чём код?
// System #include <fstream> #include "FWCore/Utilities/interface/Exception.h" #include "Alignment/CommonAlignment/interface/AlignableObjectId.h" #include "Alignment/SurveyAnalysis/interface/SurveyInputTextReader.h" //__________________________________________________________________________________________________ void SurveyInputTextReader::readFile(const std::string& textFileName) { std::ifstream myfile(textFileName.c_str()); if (!myfile.is_open()) throw cms::Exception("FileAccess") << "Unable to open input text file"; // FIXME: - currently defaulting to RunI as this was the previous behaviour // - check this, when resurrecting this code in the future AlignableObjectId alignableObjectId{AlignableObjectId::Geometry::General}; while (!myfile.eof() && myfile.good()) { align::Scalars m_inputs; UniqueId m_uId; char firstchar; firstchar = myfile.peek(); if (firstchar == '#') { std::string line; getline(myfile, line); } else if (firstchar == '!') { std::string firststring; std::string structure; myfile >> firststring >> structure; std::string endofline; getline(myfile, endofline); m_uId.second = alignableObjectId.stringToId(structure.c_str()); } else { myfile >> m_uId.first; for (int i = 0; i < NINPUTS; i++) { float tmpInput; myfile >> tmpInput; m_inputs.push_back(tmpInput); } std::string endofline; getline(myfile, endofline); theMap.insert(PairType(m_uId, m_inputs)); // Check if read succeeded (otherwise, we are at eof) if (myfile.fail()) break; } } }