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);
53 DEBUG(
"Number of entries " <<
in.getEntries() << endl);
54 DEBUG(
"Limit " << inputFile.getLimit() << endl);
56 DEBUG(
"hasNext iteration:");
57 while (
in.hasNext()) {
65 DEBUG(
"indexed iteration:");
66 for (
counter_type i = inputFile.getLowerLimit(); i != inputFile.getUpperLimit(); ++i) {
67 DEBUG(
' ' << setw(2) <<
in.getEntry(i)->getFrameIndex());
71 DEBUG(
"forward iteration:");
72 for (JTreeScanner_t::iterator i =
in.begin(); i !=
in.end(); ++i) {
73 DEBUG(
' ' << setw(2) << i->getFrameIndex());
77 DEBUG(
"reverse iteration:");
78 for (JTreeScanner_t::reverse_iterator i =
in.rbegin(); i !=
in.rend(); ++i) {
79 DEBUG(
' ' << setw(2) << i->getFrameIndex());
85 ASSERT(
in.getEntries() > 1,
"check number of entries");
86 ASSERT(inputFile.getUpperLimit() <
in.getEntries() && inputFile.getLength() > 1,
"check limit");
88 for (JTreeScanner_t::iterator
j =
in.begin(), i =
j++;
j !=
in.end(); ++i, ++
j) {
89 ASSERT(i->getFrameIndex() <
j->getFrameIndex());
92 for (JTreeScanner_t::reverse_iterator
j =
in.rbegin(), i =
j++;
j !=
in.rend(); ++i, ++
j) {
93 ASSERT(i->getFrameIndex() >
j->getFrameIndex());
Utility class to parse command line options.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Long64_t counter_type
Type definition for counter.
Template definition for direct access of elements in ROOT TChain.
int getFrameIndex() const
Get frame index.
Auxiliary class for defining the range of iterations of objects.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Base class for JTreeScanner.
const JLimit & getLimit() const
Get limit.
#define DEBUG(A)
Message macros.