Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JConvert.cc File Reference

Auxiliary program to convert data formats and/or to select data. More...

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to convert data formats and/or to select data.

Possible file name extensions include ".evt" (ASCII), ".root" (ROOT) and ".dat" (binary).
The following data structures and file name extensions are supported:

type evt root dat
KM3NETDAQ::JDAQEvent I/O I/O
KM3NETDAQ::JDAQTimeslice I/O I/O
KM3NETDAQ::JDAQSummaryslice I/O I/O
Head I I/O
Evt I I/O

The name of the data structure following option -C should be preceded by a '+' or '-' to add or remove data types in the output, respectively.
In this, ROOT wildcards are accepted (e.g. -C -\.\* will remove all data types).

Author
mdejong

Definition in file JConvert.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 126 of file JConvert.cc.

127{
128 using namespace std;
129 using namespace JPP;
130
131 typedef JAllTypes_t typelist;
132
134 JFileRecorder <typelist> outputFile;
135 JLimit_t& numberOfEvents = inputFile.getLimit();
138 JSelector<typelist> selector;
139 int debug;
140
141 try {
142
143 JParser<> zap("Auxiliary program to convert data formats and/or to select data.");
144
145 zap['f'] = make_field(inputFile);
146 zap['o'] = make_field(outputFile);
147 zap['n'] = make_field(numberOfEvents) = JLimit::max();
148 zap['C'] = make_field(selection,
149 "Precede name of data structure by a '+' or '-' "
150 "to add or remove data types in the output, respectively."
151 "\nROOT wildcards are accepted.") = JPARSER::initialised();
152 zap['m'] = make_field(merge, "Allow merging of files w/o Monte Carlo headers");
153 zap['r'] = make_field(selector) = JPARSER::initialised();
154 zap['d'] = make_field(debug) = 1;
155
156 zap(argc, argv);
157 }
158 catch(const exception& error) {
159 FATAL(error.what() << endl);
160 }
161
162
163 outputFile.open();
164
165 outputFile.put(JMeta(argc,argv));
166
167 inputFile | JValve<typelist>(selection) | selector | outputFile;
168
169 outputFile.close();
170}
string outputFile
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Auxiliary class for specifying selection of database data.
Auxiliary class for selection of data type.
Definition JValve.hh:23
Utility class to parse command line options.
Definition JParser.hh:1698
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.
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
static counter_type max()
Get maximum counter value.
Definition JLimit.hh:128
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72