5 #ifndef LArBadChannelParser_H
6 #define LArBadChannelParser_H
8 #include "GaudiKernel/MsgStream.h"
21 unsigned int numInts,
int numStrings,
unsigned int firstWildcard = 0);
45 std::vector< std::pair<std::vector<int>, std::vector<T> > >
parseFile();
60 const std::vector<std::string>::const_iterator
end)
const;
82 typedef std::pair< std::vector<int>, std::vector<T> > LineData;
83 std::vector<LineData>
result;
87 (*m_log) << MSG::ERROR <<
"LArBadChannelParser - Could not open file: " <<
m_filename <<
endmsg;
102 if(
input.size() != 0)
103 {(*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " <<
m_linenumber \
104 <<
" -\t not enough parameters given: " <<
input.size() <<
endmsg;}
111 if(parsedData.first.size() == 0)
115 const std::vector<std::string>::const_iterator
stop = \
116 (m_numStrings < 0) ? static_cast<const std::vector<std::string>::const_iterator>(
input.end()) : (
start +
m_numStrings);
120 if(!convertStrings<T>(parsedData.second,
start,
stop))
125 (*m_log) << MSG::WARNING <<
"LArBadChannelParser IGNORED unexpected input on line " <<
m_linenumber <<
"." <<
endmsg;
127 result.push_back(parsedData);
143 const std::vector<std::string>::const_iterator
begin,
const std::vector<std::string>::const_iterator
end)
const
147 for(std::vector<std::string>::const_iterator iter =
begin; iter !=
end; ++iter)
150 if(stringToNumber<T>(element, *iter))
151 result.push_back(element);
154 (*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " <<
m_linenumber \
155 <<
" -\t failed to extract status." <<
endmsg;
165 const std::vector<std::string>::const_iterator
begin,
const std::vector<std::string>::const_iterator
end)
const
175 std::istringstream iss(theString);
177 return !(iss >> std::dec >> theNumber).
fail();
181 #endif //end of #ifndef LArBadChannelParser_H