Jpp 21.0.0-rc.1
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 127 of file JConvert.cc.

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