Jpp  15.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JConvert.cc File Reference

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

#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 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

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 and/or to select data.");
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 Monte Carlo 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 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1500
Auxiliary class for ROOT class selection.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:66
string outputFile
Auxiliary class for selection of data type.
Type list.
Definition: JTypeList.hh:22
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73