![]() |
ATLAS Offline Software
|
#include <LArBadChannelParser.h>
Public Member Functions | |
| LArBadChannelParser (const std::string &filename, MsgStream *const log, unsigned int numInts, int numStrings, unsigned int firstWildcard=0) | |
| A parser object must be initialized with the filename that it is to parse. | |
| virtual | ~LArBadChannelParser () |
| bool | fileStatusGood () const |
| You can use this function to check whether file-reading will succeed. | |
| template<typename T> | |
| std::vector< std::pair< std::vector< int >, std::vector< T > > > | parseFile () |
| Parse the file using the following format for each line: First, exactly numInts integers are required. | |
| template<> | |
| bool | convertStrings (std::vector< std::string > &result, const std::vector< std::string >::const_iterator begin, const std::vector< std::string >::const_iterator end) const |
Private Member Functions | |
| LArBadChannelParser () | |
| std::vector< int > | getIdFields (const std::vector< std::string > &words) |
| std::vector< std::string > | parseLine (std::string &line) const |
| template<typename T> | |
| bool | stringToNumber (T &theNumber, const std::string &theStr) const |
| template<typename T> | |
| bool | convertStrings (std::vector< T > &result, const std::vector< std::string >::const_iterator begin, const std::vector< std::string >::const_iterator end) const |
Private Attributes | |
| std::ifstream | m_fin |
| unsigned int | m_linenumber |
| const std::string | m_filename |
| MsgStream *const | m_log |
| const unsigned int | m_numInts |
| const int | m_numStrings |
| const unsigned int | m_firstWildcard |
Definition at line 11 of file LArBadChannelParser.h.
| LArBadChannelParser::LArBadChannelParser | ( | const std::string & | filename, |
| MsgStream *const | log, | ||
| unsigned int | numInts, | ||
| int | numStrings, | ||
| unsigned int | firstWildcard = 0 ) |
A parser object must be initialized with the filename that it is to parse.
It must also be given a MsgStream pointer for logging messages.
Definition at line 10 of file LArBadChannelParser.cxx.
|
virtual |
Definition at line 23 of file LArBadChannelParser.cxx.
|
private |
|
inline |
Definition at line 164 of file LArBadChannelParser.h.
|
inlineprivate |
Definition at line 142 of file LArBadChannelParser.h.
|
inline |
You can use this function to check whether file-reading will succeed.
If false, parseFile() will return an empty vector.
Definition at line 74 of file LArBadChannelParser.h.
|
private |
Definition at line 54 of file LArBadChannelParser.cxx.
|
inline |
Parse the file using the following format for each line: First, exactly numInts integers are required.
Then, if numString is negative, at least std::abs(numString) strings are required, otherwise exactly numString strings are required. These strings are converted to a vector<T>. A vector of all successfully parsed lines is returned. The integer part of a line may contain wildcards, starting from position firstWildcard (where counting begins from 1); firstWildcard = 0 means wildcards are not allowed. The wildcard character in the input file is "*", it is replaced by -1 in the parsed output. Comments in the ASCII file are demarcated with the '#' character. Lines that fail to parse are skipped, with diagnostic messages sent to the message stream.
Definition at line 80 of file LArBadChannelParser.h.
|
private |
Definition at line 28 of file LArBadChannelParser.cxx.
|
inlineprivate |
Definition at line 173 of file LArBadChannelParser.h.
|
private |
Definition at line 64 of file LArBadChannelParser.h.
|
private |
Definition at line 62 of file LArBadChannelParser.h.
|
private |
Definition at line 69 of file LArBadChannelParser.h.
|
private |
Definition at line 63 of file LArBadChannelParser.h.
|
private |
Definition at line 65 of file LArBadChannelParser.h.
|
private |
Definition at line 67 of file LArBadChannelParser.h.
|
private |
Definition at line 68 of file LArBadChannelParser.h.