Jpp
Functions
JConvert.cc File Reference
#include <string>
#include <iostream>
#include <iomanip>
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMonteCarloFileSupportkit.hh"
#include "JSupport/JTriggerParametersSupportkit.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JSupport.hh"
#include "JLang/JPipe.hh"
#include "JROOT/JROOTClassSelector.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to convert data formats. 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 49 of file JConvert.cc.

50 {
51  using namespace std;
52  using namespace JPP;
53 
54  typedef JAllTypes_t typelist;
55 
58  JLimit_t& numberOfEvents = inputFile.getLimit();
59  JROOTClassSelection selection = getROOTClassSelection<typelist>();
61  int debug;
62 
63  try {
64 
65  JParser<> zap("Auxiliary program to convert data formats.");
66 
67  zap['f'] = make_field(inputFile);
68  zap['o'] = make_field(outputFile);
69  zap['n'] = make_field(numberOfEvents) = JLimit::max();
70  zap['C'] = make_field(selection,
71  "Precede name of data structure by a '+' or '-' "
72  "to add or remove data types in the output, respectively."
73  "\nROOT wildcards are accepted.") = JPARSER::initialised();
74  zap['m'] = make_field(merge, "Allow merging of files w/o headers");
75  zap['d'] = make_field(debug) = 1;
76 
77  zap(argc, argv);
78  }
79  catch(const exception& error) {
80  FATAL(error.what() << endl);
81  }
82 
83 
84  outputFile.open();
85 
86  outputFile.put(JMeta(argc,argv));
87 
88  inputFile | JValve<typelist>(selection) | outputFile;
89 
90  outputFile.close();
91 }
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
JLANG::JValve
Auxiliary class for selection of data type.
Definition: JObjectIterator.hh:32
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
JROOT::JROOTClassSelection
Auxiliary class for ROOT class selection.
Definition: JROOTClassSelector.hh:91
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition: JMultipleFileScanner.hh:167
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:71
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
outputFile
string outputFile
Definition: JDAQTimesliceSelector.cc:37
JSUPPORT::JFileRecorder
Object writing to file.
Definition: JFileRecorder.hh:41