7 #include "GaudiKernel/MsgStream.h"
11 m_linenumber(0), m_filename(
file), m_log(
log)
15 std::cerr <<
"WARNING \t LArBadChannelParser was given a NULL MsgStream pointer!" << std::endl;
29 std::vector< LArBadChannelParser2::ISLine>
33 std::vector< LArBadChannelParser2::ISLine>
result;
35 while (
m_fin.good()) {
37 std::getline(
m_fin, readLine);
42 if (
parseLine( readLine, parsedLine, nint, minString, firstWildcard)) {
43 result.push_back(parsedLine);
47 (*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " << readLine <<
endmsg;
54 int nint,
int minString,
int firstWildcard)
56 std::string::size_type commentPosition = readLine.find(
'#');
57 if(commentPosition != std::string::npos)
58 readLine.erase(commentPosition);
61 std::vector<std::string>
command;
63 std::istringstream stringIn(readLine);
78 int nint,
int minString,
int firstWildcard)
80 if((
int)
command.size() < nint+minString) {
81 (*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " <<
m_linenumber \
82 <<
":\t not enough parameters given" <<
endmsg;
86 for(
int i=0;
i<nint;
i++) {
88 if (firstWildcard >=0 &&
i>=firstWildcard &&
command[
i] ==
"*") {
89 parsedLine.
intVec.push_back(-1);
92 parsedLine.
intVec.push_back( nextInt);
95 (*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " <<
m_linenumber \
96 <<
":\t word " <<
i + 1 <<
" must be a non-negative integer: " <<
command[
i] <<
endmsg;