Jpp 20.0.0-195-g190c9e876
the software that should make you happy
Loading...
Searching...
No Matches
JPrintRootClass.cc
Go to the documentation of this file.
1
2#include <string>
3#include <iostream>
4#include <iomanip>
5
9
10#include "JAAnet/JHead.hh"
11
13#include "JDAQ/JDAQEventIO.hh"
15
17
18#include "antares-dataformat/TimeSlice.hh"
19#include "antares-dataformat/PhysicsEvent.hh"
20
21#include "JAcoustics/JToA.hh"
22#include "JAcoustics/JEvent.hh"
23#include "JAcoustics/JEvt.hh"
29
30#include "JCompass/JEvt.hh"
31#include "JCompass/JSupport.hh"
32
33#include "JSupport/JSupport.hh"
34
35#include "JROOT/JRootClass.hh"
37
38#include "Jeep/JParser.hh"
39#include "Jeep/JMessage.hh"
40
41namespace {
42
43 using namespace JPP;
44
45 /**
46 * Auxiliary class for printing class information.
47 */
48 struct JPrinter_t :
50 {
51 /**
52 * Constructor.
53 *
54 * \param out output stream
55 * \param selection selection
56 */
57 JPrinter_t(std::ostream& out, const JROOTClassSelection& selection) :
58 JROOTClassSelection(selection),
59 out(out)
60 {}
61
62
63 /**
64 * Print class infomration.
65 *
66 * \param type data type
67 * \return this printer
68 */
69 template<class T>
70 void operator()(const JType<T>& type) const
71 {
72 using namespace std;
73 using namespace JPP;
74
75 if (static_cast<const JROOTClassSelection&>(*this)(type)) {
76 JRootClass(type).print(out);
77 }
78 }
79
80 protected:
81 std::ostream& out;
82 };
83}
84
85
86/**
87 * \file
88 * Auxiliary program to print ROOT class information.
89 *
90 * The name of the data structure following option -C should be preceded by a '+' or '-'
91 * to add or remove data types in the output, respectively.\n
92 * In this, ROOT wildcards are accepted (e.g. <tt>-C -\\\.\\*</tt> will remove all data types).
93 * \author mdejong
94 */
95int main(int argc, char **argv)
96{
97 using namespace std;
98 using namespace JPP;
99
109 JCOMPASS::JQuaternion>::typelist typelist;
110
111 JPrinter_t printer(cout, getROOTClassSelection<typelist>(true));
112 int debug;
113
114 try {
115
116 JParser<> zap("Auxiliary program to print ROOT class information.");
117
118 zap['C'] = make_field(printer,
119 "Precede name of data structure by a '+' or '-' "
120 "to add or remove data types in the output, respectively."
121 "\nROOT wildcards are accepted.") = JPARSER::initialised();
122 zap['d'] = make_field(debug) = 1;
123
124 zap(argc, argv);
125 }
126 catch(const exception& error) {
127 FATAL(error.what() << endl);
128 }
129
130 for_each(printer, JType<typelist>());
131}
Acoustic event.
Acoustic event fit.
ROOT TTree parameter settings.
JLANG::JTYPELIST< JACOUSTICS::JToA, JACOUSTICS::JEvent, JACOUSTICS::JEvt, JACOUSTICS::JSuperEvt, JACOUSTICS::JTriggerParameters, JACOUSTICS::JFitParameters, JACOUSTICS::JDetectorMechanics_t >::typelist JAcousticsTypes_t
Type list of acoustics data types for I/O.
Acoustic trigger parameters.
Compass event data types.
ROOT TTree parameter settings.
JLANG::JTYPELIST< JCOMPASS::JOrientation, JCOMPASS::JEvt >::typelist JCompassTypes_t
Type list of compass data types for I/O.
Acoustic fit parameters.
Mechanical modelling of string.
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:74
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int main(int argc, char **argv)
Acoustic event fit.
ROOT TTree parameter settings of various packages.
JTYPELIST< SPE_TimeSlice, ExtendedSummary_TimeSlice, PhysicsEvent >::typelist JAntaresTypes_t
Type list of Antares DAQ data types for I/O.
JTYPELIST< Head, MultiHead, Evt >::typelist JAAnetTypes_t
Type list of Monte Carlo data types for I/O.
JTYPELIST< JAAnetTypes_t, JTriggerTypes_t >::typelist JAllDataTypes_t
Type list of Monte Carlo, trigger and DAQ data types for I/O.
Acoustic event.
Monte Carlo run header.
Definition JHead.hh:1236
Utility class to parse command line options.
Definition JParser.hh:1698
void for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition JTypeList.hh:414
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.
Acoustic single fit.
Auxiliary class for recursive type list generation.
Definition JTypeList.hh:351
Auxiliary class for a type holder.
Definition JType.hh:19
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 to manage access to base classes and data members of ROOT class.
Definition JRootClass.hh:44
void print(std::ostream &out) const
Print ROOT class information.