23 int main(
int argc,
char **argv)
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);
56 DEBUG(
"Limit " << inputFile.getLimit() << endl);
58 DEBUG(
"hasNext iteration:");
59 while (
in.hasNext()) {
67 DEBUG(
"indexed iteration:");
68 for (
counter_type i = inputFile.getLowerLimit(); i != inputFile.getUpperLimit(); ++i) {
69 DEBUG(
' ' << setw(2) <<
in.getEntry(i)->getFrameIndex());
73 DEBUG(
"forward iteration:");
74 for (JTreeScanner_t::iterator i =
in.begin(); i !=
in.end(); ++i) {
75 DEBUG(
' ' << setw(2) << i->getFrameIndex());
79 DEBUG(
"reverse iteration:");
80 for (JTreeScanner_t::reverse_iterator i =
in.rbegin(); i !=
in.rend(); ++i) {
81 DEBUG(
' ' << setw(2) << i->getFrameIndex());
87 ASSERT(
in.getEntries() > 1,
"check number of entries");
88 ASSERT(inputFile.getUpperLimit() <
in.getEntries() && inputFile.getLength() > 1,
"check limit");
93 for (JTreeScanner_t::iterator
j =
in.begin(), i =
j++;
j !=
in.end(); ++i, ++
j) {
94 ASSERT(i->getFrameIndex() <
j->getFrameIndex());
97 for (JTreeScanner_t::reverse_iterator
j =
in.rbegin(), i =
j++;
j !=
in.rend(); ++i, ++
j) {
98 ASSERT(i->getFrameIndex() >
j->getFrameIndex());
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
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
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Base class for JTreeScanner.
Utility class to parse command line options.
const JLimit & getLimit() const
Get limit.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
#define DEBUG(A)
Message macros.