Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JPrintTreeScanner.cc File Reference

Program to test ordered reading using JSUPPORT::JTreeScanner. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQEvaluator.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JAutoTreeScanner.hh"
#include "Jeep/JTimer.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to test ordered reading using JSUPPORT::JTreeScanner.

Author
mdejong

Definition in file JPrintTreeScanner.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 26 of file JPrintTreeScanner.cc.

27{
28 using namespace std;
29 using namespace JPP;
30 using namespace KM3NETDAQ;
31
32 JMultipleFileScanner<> inputFile;
33 JROOTClassSelector selector;
34 JLimit numberOfEvents;
35 int debug;
36
37 try {
38
39 JParser<> zap("Program to test ordered reading from a ROOT TTree.");
40
41 zap['f'] = make_field(inputFile);
43 zap['n'] = make_field(numberOfEvents) = JLimit();
44 zap['d'] = make_field(debug) = 2;
45
46 zap(argc, argv);
47 }
48 catch(const exception& error) {
49 FATAL(error.what() << endl);
50 }
51
52
54
56
57 JTreeScannerInterface<JDAQTimeslice>* ps = zmap[selector];
58
59 JTimer timer;
60
61 timer.start();
62
63 ps->configure(inputFile, numberOfEvents);
64
65 timer.stop();
66
67 timer.print(cout, milli_t);
68
69 while (ps->hasNext()) {
70
71 JDAQTimeslice* p = ps->next();
72
73 cout << *p << endl;
74 }
75}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Auxiliary class for CPU timing and usage.
Definition JTimer.hh:33
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
Definition JTimer.hh:172
void stop()
Stop timer.
Definition JTimer.hh:127
void start()
Start timer.
Definition JTimer.hh:106
Utility class to parse command line options.
Definition JParser.hh:1698
Auxiliary interface for direct access of elements in ROOT TChain.
Template definition for direct access of elements in ROOT TChain.
@ milli_t
milli
Definition JScale.hh:30
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::set< JROOTClassSelector > getROOTClassSelection(const bool option=false)
Get ROOT class selection.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Auxiliary class for a type holder.
Definition JType.hh:19
Auxiliary class to select ROOT class based on class name.
Auxiliary class to select JTreeScanner based on ROOT class name.
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45