Jpp
Functions
JPrintTreeScanner.cc File Reference
#include <string>
#include <iostream>
#include <iomanip>
#include <limits>
#include "JDAQ/JDAQTimeslice.hh"
#include "JDAQ/JDAQEvaluator.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "JSupport/JTreeScanner.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JAutoTreeScanner.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 25 of file JPrintTreeScanner.cc.

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 
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
KM3NETDAQ::JDAQTimeslice
Data time slice.
Definition: JDAQTimeslice.hh:36
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
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
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
FATAL
#define FATAL(A)
Definition: JMessage.hh:67