Jpp
examples
JSupport
JPrintTreeScanner.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <limits>
6
7
#include "
JDAQ/JDAQTimeslice.hh
"
8
#include "
JDAQ/JDAQEvaluator.hh
"
9
10
#include "
JROOT/JROOTClassSelector.hh
"
11
#include "
JSupport/JTreeScanner.hh
"
12
#include "
JSupport/JSupport.hh
"
13
#include "
JSupport/JAutoTreeScanner.hh
"
14
15
#include "
Jeep/JParser.hh
"
16
#include "
Jeep/JMessage.hh
"
17
18
19
/**
20
* \file
21
*
22
* Program to test ordered reading using JSUPPORT::JTreeScanner.
23
* \author mdejong
24
*/
25
int
main
(
int
argc,
char
**argv)
26
{
27
using namespace
std
;
28
using namespace
JPP
;
29
using namespace
KM3NETDAQ
;
30
31
JMultipleFileScanner<>
inputFile;
32
JROOTClassSelector selector;
33
int
debug
;
34
35
try
{
36
37
JParser<>
zap(
"Program to test ordered reading from a ROOT TTree."
);
38
39
zap[
'f'
] =
make_field
(inputFile);
40
zap[
'C'
] =
make_field
(selector) = getROOTClassSelection<JDAQTimesliceTypes_t>();
41
zap[
'd'
] =
make_field
(
debug
) = 2;
42
43
zap(argc, argv);
44
}
45
catch
(
const
exception& error) {
46
FATAL
(error.what() << endl);
47
}
48
49
50
JTreeScanner<>::debug
=
debug
;
51
52
JAutoTreeScanner<JDAQTimeslice, JDAQEvaluator> zmap =
JType<JDAQTimesliceTypes_t>
();
53
54
JTreeScannerInterface<JDAQTimeslice>* ps = zmap[selector];
55
56
ps->configure(inputFile);
57
58
while
(ps->hasNext()) {
59
60
JDAQTimeslice
* p = ps->next();
61
62
cout << *p << endl;
63
}
64
}
JLANG::JType
Auxiliary class for a type holder.
Definition:
JType.hh:19
JMessage.hh
JROOTClassSelector.hh
KM3NETDAQ::JDAQTimeslice
Data time slice.
Definition:
JDAQTimeslice.hh:36
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JDAQTimeslice.hh
JTreeScanner.hh
JSupport.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
debug
int debug
debug level
Definition:
JSirene.cc:59
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
JSUPPORT::JMultipleFileScanner<>
std
Definition:
jaanetDictionary.h:36
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition:
DataQueue.cc:39
main
int main(int argc, char **argv)
Definition:
JPrintTreeScanner.cc:25
JAutoTreeScanner.hh
JDAQEvaluator.hh
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
Generated by
1.8.16