Program to test iteration using JSUPPORT::JTreeScanner.
More...
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Program to test iteration using JSUPPORT::JTreeScanner.
- Author
- mdejong
Definition in file JTreeIterator.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 23 of file JTreeIterator.cc.
27 using namespace KM3NETDAQ;
35 JParser<> zap(
"Program to test iteration from a ROOT TTree.");
38 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
43 catch(
const exception& error) {
44 FATAL(error.what() << endl);
47 typedef JTreeScanner<JDAQEvent, JDAQEvaluator> JTreeScanner_t;
51 JTreeScanner_t in(inputFile, inputFile.getLimit());
53 NOTICE(
"forward iteration:" << endl);
55 for (JTreeScanner_t::iterator i = in.begin(); i != in.end(); ++i) {
56 NOTICE(setw(6) << i->getFrameIndex() << endl);
59 NOTICE(
"reverse iteration:" << endl);
61 for (JTreeScanner_t::reverse_iterator i = in.rbegin(); i != in.rend(); ++i) {
62 NOTICE(setw(6) << i->getFrameIndex() << endl);
65 ASSERT(in.getEntries() > 1);
67 for (JTreeScanner_t::iterator j = in.begin(), i = j++; j != in.end(); ++i, ++j) {
68 ASSERT(i->getFrameIndex() < j->getFrameIndex());
71 for (JTreeScanner_t::reverse_iterator j = in.rbegin(), i = j++; j != in.rend(); ++i, ++j) {
72 ASSERT(i->getFrameIndex() > j->getFrameIndex());
Utility class to parse command line options.
JLimit JLimit_t
Type definition of limit.
#define ASSERT(A)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const JLimit & getLimit() const
Get limit.