64 return StatusCode::SUCCESS;
69 if (fileWithPath.empty()) {
71 return StatusCode::FAILURE;
76 if (stat(fileWithPath.c_str(), &buffer) != 0) {
78 << fileWithPath.c_str()
79 <<
"\" -> map can not be initialized from this file.");
80 return StatusCode::FAILURE;
84 std::ifstream fin(fileWithPath.c_str(), std::ios::in);
86 bool initializedWithWarnings =
false;
88 while (std::getline(fin, line)) {
90 if (line.empty() || line.compare(0, 1,
"#") == 0 ||
91 line.compare(0, 2,
"//")) {
95 std::stringstream lineStream(line);
98 std::vector<std::string> tokenVector;
99 while (std::getline(lineStream, token,
',')) {
100 tokenVector.push_back(token);
103 if (tokenVector.size() == 2) {
107 Identifier::value_type identifierCompact = std::stoull(tokenVector[0]);
109 float shift = std::stof(tokenVector[1]);
113 << fileWithPath.c_str());
116 initializedWithWarnings =
true;
120 if (initializedWithWarnings) {
122 << fileWithPath.c_str() <<
"\"");
124 ATH_MSG_INFO(
"Successfully initialized shift map from file \""
125 << fileWithPath.c_str() <<
"\"");
127 return StatusCode::SUCCESS;