11 const std::string&
file, MsgStream*
const log,
12 unsigned int numInts,
int numStrings,
unsigned int firstWildcard
20 std::cerr <<
"ERROR \t LArBadChannelParser was given a NULL MsgStream pointer!" << std::endl;
30 std::string::size_type commentPosition = line.find(
'#');
31 if(commentPosition != std::string::npos)
32 line.erase(commentPosition);
35 std::vector<std::string>
result;
37 std::istringstream stringIn(line);
42 result.push_back(readWord);
50 return std::toupper((
unsigned char)c);
58 for(
unsigned int i = 0; i <
m_numInts; ++i)
64 std::transform(w.begin(), w.end(), w.begin(),
upper);
66 if (w.compare(0,3,
"EMB")==0 || w[0]==
'B')
74 else if (w==
"C" || w==
"c")
80 if(canBeWildcard && w ==
"*")
83 result.push_back(idComponent);
86 (*m_log) << MSG::WARNING <<
"LArBadChannelParser REJECTED line " <<
m_linenumber \
87 <<
" -\t word " << i + 1 <<
" must be a non-negative integer " \
88 << (canBeWildcard ?
"or " :
"and not " ) \
89 <<
"a wildcard: " << words[i] <<
endmsg;
std::vector< int > getIdFields(const std::vector< std::string > &words)
const unsigned int m_firstWildcard
std::vector< std::string > parseLine(std::string &line) const
virtual ~LArBadChannelParser()
bool stringToNumber(T &theNumber, const std::string &theStr) const
const unsigned int m_numInts
unsigned int m_linenumber
const std::string m_filename