Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
software/JGizmo/JPrint.cc
Go to the documentation of this file.
1 
2 #include <string>
3 #include <iostream>
4 #include <iomanip>
5 
9 
10 #include "JDAQ/JDAQTimesliceIO.hh"
11 #include "JDAQ/JDAQEventIO.hh"
13 
15 
18 
19 #include "JAcoustics/JEvent.hh"
20 #include "JAcoustics/JEvt.hh"
21 #include "JAcoustics/JSuperEvt.hh"
24 #include "JAcoustics/JSupport.hh"
25 
26 #include "JCompass/JEvt.hh"
27 #include "JCompass/JSupport.hh"
28 
29 #include "JSupport/JSupport.hh"
33 
35 #include "JLang/JPipe.hh"
36 #include "JLang/JManip.hh"
37 
39 
40 #include "Jeep/JParser.hh"
41 #include "Jeep/JMessage.hh"
42 
43 
44 /**
45  * \file
46  * Auxiliary program to print 'any' data.
47  *
48  * The name of the data structure following option -C should be preceded by a '+' or '-'
49  * to add or remove data types in the output, respectively.\n
50  * In this, ROOT wildcards are accepted (e.g. <tt>-C -\\\.\\*</tt> will remove all data types).
51  *
52  * Note that for printing TRandom information and meta data, JPrintRandom.cc and JPrintMeta.cc should be used, respectively.
53  * \author mdejong
54  */
55 int main(int argc, char **argv)
56 {
57  using namespace std;
58  using namespace JPP;
59  using namespace KM3NETDAQ;
60 
61  typedef JTYPELIST<JAllDataTypes_t,
64  JCompassTypes_t>::typelist typelist;
65 
67  JLimit_t& numberOfEvents = inputFile.getLimit();
68  JROOTClassSelection selection = getROOTClassSelection<typelist>(true);
69  int debug;
70 
71  try {
72 
73  JParser<> zap("Auxiliary program to print 'any' data.");
74 
75  zap['f'] = make_field(inputFile);
76  zap['n'] = make_field(numberOfEvents) = 1;
77  zap['C'] = make_field(selection,
78  "Precede name of data structure by a '+' or '-' "
79  "to add or remove data types in the output, respectively."
80  "\nROOT wildcards are accepted.") = JPARSER::initialised();
81  zap['d'] = make_field(debug) = 1;
82 
83  zap(argc, argv);
84  }
85  catch(const exception& error) {
86  FATAL(error.what() << endl);
87  }
88 
90 
91  if (debug >= JEEP::debug_t) {
92  setLongprint(cout);
93  }
94 
96 
97  inputFile | JValve<typelist>(selection) | out;
98 }
Utility class to parse command line options.
Definition: JParser.hh:1711
debug
Definition: JMessage.hh:29
int main(int argc, char *argv[])
Definition: Main.cc:15
ROOT TTree parameter settings of various packages.
ROOT TTree parameter settings.
Auxiliary class for ROOT class selection.
Acoustic event.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:84
Auxiliary class for selection of data type.
ROOT TTree parameter settings.
Acoustic fit parameters.
Type list.
Definition: JTypeList.hh:22
void setDAQLongprint(const bool option)
Set DAQ print option.
Definition: JDAQPrint.hh:28
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:351
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2158
void setLongprint(std::ostream &out)
Set long print option.
Definition: JManip.hh:132
Acoustic event fit.
Implementation of pipe operation for object iterators.
General purpose messaging.
I/O manipulators.
#define FATAL(A)
Definition: JMessage.hh:67
Scanning of objects from multiple files according a format that follows from the extension of each fi...
JTYPELIST< JAAnetTypes_t, JTriggerTypes_t >::typelist JAllDataTypes_t
Type list of Monte Carlo, trigger and DAQ data types for I/O.
Acoustic trigger parameters.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
Template implementation of stream output for single data type.
JTYPELIST< SPE_TimeSlice, ExtendedSummary_TimeSlice, PhysicsEvent >::typelist JAntaresTypes_t
Type list of Antares DAQ data types for I/O.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:84
Compass event data types.
Acoustic event fit.
JLANG::JTYPELIST< JACOUSTICS::JEvent, JACOUSTICS::JEvt, JACOUSTICS::JSuperEvt, JACOUSTICS::JTriggerParameters, JACOUSTICS::JFitParameters >::typelist JAcousticsTypes_t
Type list of acoustics data types for I/O.
int debug
debug level