Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
software/JGizmo/JPrint.cc
Go to the documentation of this file.
1
2#include <string>
3#include <iostream>
4#include <iomanip>
5
9
11#include "JDAQ/JDAQEventIO.hh"
13
15
16#include "antares-dataformat/TimeSlice.hh"
17#include "antares-dataformat/PhysicsEvent.hh"
18
19#include "JAcoustics/JToA.hh"
20#include "JAcoustics/JEvent.hh"
21#include "JAcoustics/JEvt.hh"
27
28#include "JCompass/JEvt.hh"
29#include "JCompass/JSupport.hh"
30
31#include "JSupport/JSupport.hh"
35
37#include "JLang/JPipe.hh"
38
40
41#include "Jeep/JParser.hh"
42#include "Jeep/JMessage.hh"
43
44namespace {
45
46 /**
47 * Print.
48 *
49 * \param inputFile input file
50 * \patam selection selection
51 */
52 template<class T>
53 inline void print(const JSUPPORT::JMultipleFileScanner<>& inputFile, const JROOT::JROOTClassSelection& selection)
54 {
55 using namespace std;
56 using namespace JPP;
57
58 JMultipleFileScanner<T> in(inputFile, inputFile.getLimit());
59 JStreamObjectOutput <T> out(cout);
60
61 in | JValve<T>(selection) | out;
62 }
63}
64
65/**
66 * \file
67 * Auxiliary program to print 'any' data.
68 *
69 * The name of the data structure following option -C should be preceded by a '+' or '-'
70 * to add or remove data types in the output, respectively.\n
71 * In this, ROOT wildcards are accepted (e.g. <tt>-C -\\\.\\*</tt> will remove all data types).
72 *
73 * Note that for printing TRandom information and meta data, JPrintRandom.cc and JPrintMeta.cc should be used, respectively.
74 * \author mdejong
75 */
76int main(int argc, char **argv)
77{
78 using namespace std;
79 using namespace JPP;
80 using namespace KM3NETDAQ;
81
82 JMultipleFileScanner<> inputFile;
83 JLimit_t& numberOfEvents = inputFile.getLimit();
84 JROOTClassSelection selection;
85 int debug;
86
91
92 try {
93
94 JParser<> zap("Auxiliary program to print 'any' data."\
95 "\n Note that for printing TRandom information and meta data, JPrintRandom and JPrintMeta should be used, respectively.");
96
97 zap['f'] = make_field(inputFile);
98 zap['n'] = make_field(numberOfEvents) = 1;
99 zap['C'] = make_field(selection,
100 "Precede name of data structure by a '+' or '-' "
101 "to add or remove data types in the output, respectively."
102 "\nROOT wildcards are accepted.") = JPARSER::initialised();
103 zap['d'] = make_field(debug) = 1;
104
105 zap(argc, argv);
106 }
107 catch(const exception& error) {
108 FATAL(error.what() << endl);
109 }
110
112
113 if (debug >= JEEP::debug_t) {
114 setLongprint(cout);
115 }
116
117 print<JAllDataTypes_t> (inputFile, selection);
118 print<JAntaresTypes_t> (inputFile, selection);
119 print<JAcousticsTypes_t>(inputFile, selection);
120 print<JCompassTypes_t> (inputFile, selection);
121}
Acoustic event.
Acoustic event fit.
ROOT TTree parameter settings.
Acoustic trigger parameters.
Compass event data types.
ROOT TTree parameter settings.
Acoustic fit parameters.
void setLongprint(std::ostream &out)
Set long print option.
Definition JManip.hh:132
Mechanical modelling of string.
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Implementation of pipe operation for object iterators.
Acoustic event fit.
ROOT TTree parameter settings of various packages.
Acoustic event.
Auxiliary class for selection of data type.
Definition JValve.hh:23
Utility class to parse command line options.
Definition JParser.hh:1698
std::ostream & print(std::ostream &out, const JTestSummary &summary, T __begin, T __end, const bool useColors=true, const JFormat_t &formatting=JFormat_t(18, 3, std::ios::fixed))
Print test summary.
@ debug_t
debug
Definition JMessage.hh:29
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
void setDAQLongprint(const bool option)
Set DAQ print option.
Definition JDAQPrint.hh:28
int main(int argc, char **argv)
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition JParser.hh:68
Auxiliary class for ROOT class selection.
Auxiliary class for defining the range of iterations of objects.
Definition JLimit.hh:45