24{
28
30 JLimit_t& numberOfEvents = inputFile.getLimit();
32
33 try {
34
35 JParser<> zap(
"Program to test iteration from a ROOT TTree.");
36
40
42 }
43 catch(const exception& error) {
45 }
46
48
49
50
52
53 DEBUG(
"Number of entries " << in.getEntries() <<
endl);
56 DEBUG(
"Limit " << inputFile.getLimit() <<
endl);
57
58 DEBUG(
"hasNext iteration:");
59 while (in.hasNext()) {
60
62
64 }
66
67 DEBUG(
"indexed iteration:");
68 for (
counter_type i = inputFile.getLowerLimit(); i != inputFile.getUpperLimit(); ++i) {
69 DEBUG(
' ' <<
setw(2) << in.getEntry(i)->getFrameIndex());
70 }
72
73 DEBUG(
"forward iteration:");
74 for (JTreeScanner_t::iterator i = in.begin(); i != in.end(); ++i) {
75 DEBUG(
' ' <<
setw(2) << i->getFrameIndex());
76 }
78
79 DEBUG(
"reverse iteration:");
80 for (JTreeScanner_t::reverse_iterator i = in.rbegin(); i != in.rend(); ++i) {
81 DEBUG(
' ' <<
setw(2) << i->getFrameIndex());
82 }
84
85
86
87 ASSERT(in.getEntries() > 1,
"check number of entries");
88 ASSERT(inputFile.getUpperLimit() < in.getEntries() && inputFile.getLength() > 1,
"check limit");
89
90 ASSERT(
distance(in. begin(), in. end()), inputFile.getLimit().getLength());
91 ASSERT(
distance(in.rbegin(), in.rend()), inputFile.getLimit().getLength());
92
93 for (JTreeScanner_t::iterator
j = in.begin(), i =
j++;
j != in.end(); ++i, ++
j) {
94 ASSERT(i->getFrameIndex() <
j->getFrameIndex());
95 }
96
97 for (JTreeScanner_t::reverse_iterator
j = in.rbegin(), i =
j++;
j != in.rend(); ++i, ++
j) {
98 ASSERT(i->getFrameIndex() >
j->getFrameIndex());
99 }
100
101 return 0;
102}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Base class for JTreeScanner.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Auxiliary class for defining the range of iterations of objects.
static counter_type max()
Get maximum counter value.