Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JSon.cc
Go to the documentation of this file.
1
2#include <string>
3#include <iostream>
4#include <iomanip>
5
8
10#include "JDAQ/JDAQEventIO.hh"
12
14
17
21#include "JSupport/JSupport.hh"
22
25
26#include "JLang/JPipe.hh"
27
28#include "Jeep/JParser.hh"
29#include "Jeep/JMessage.hh"
30
31
32/**
33 * \file
34 * Auxiliary program to print 'any' data in JSON format.
35 *
36 * The name of the data structure following option -C should be preceded by a '+' or '-'
37 * to add or remove data types in the output, respectively.\n
38 * In this, ROOT wildcards are accepted (e.g. <tt>-C -\\\.\\*</tt> will remove all data types).
39 *
40 * Note that for printing TRandom information and meta data, JPrintRandom.cc and JPrintMeta.cc should be used, respectively.
41 * \author mdejong
42 */
43int main(int argc, char **argv)
44{
45 using namespace std;
46 using namespace JPP;
47 using namespace KM3NETDAQ;
48
50
52 JLimit_t& numberOfEvents = inputFile.getLimit();
54 int debug;
55
56 try {
57
58 JParser<> zap("Auxiliary program to print 'any' data.");
59
60 zap['f'] = make_field(inputFile);
61 zap['n'] = make_field(numberOfEvents) = 1;
62 zap['C'] = make_field(selection,
63 "Precede name of data structure by a '+' or '-' "
64 "to add or remove data types in the output, respectively."
65 "\nROOT wildcards are accepted.") = JPARSER::initialised();
66 zap['d'] = make_field(debug) = 1;
67
68 zap(argc, argv);
69 }
70 catch(const exception& error) {
71 FATAL(error.what() << endl);
72 }
73
75
76 inputFile | JValve<typelist>(selection) | out;
77}
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
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.
int main(int argc, char **argv)
Definition JSon.cc:43
ROOT TTree parameter settings of various packages.
Auxiliary class for selection of data type.
Definition JValve.hh:23
Utility class to parse command line options.
Definition JParser.hh:1698
Template implementation of stream output for single data type.
General purpose class for object reading from a list of file names.
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
Type list.
Definition JTypeList.hh:23
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