Jpp
15.0.0
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JGizmo
JConvert.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
km3net-dataformat/offline/Head.hh
"
7
#include "
km3net-dataformat/offline/Evt.hh
"
8
9
#include "
JDAQ/JDAQTimesliceIO.hh
"
10
#include "
JDAQ/JDAQEventIO.hh
"
11
#include "
JDAQ/JDAQSummarysliceIO.hh
"
12
13
#include "
JTrigger/JTriggerParameters.hh
"
14
15
#include "
JSupport/JMultipleFileScanner.hh
"
16
#include "
JSupport/JFileRecorder.hh
"
17
#include "
JSupport/JMonteCarloFileSupportkit.hh
"
18
#include "
JSupport/JTriggerParametersSupportkit.hh
"
19
#include "
JSupport/JMeta.hh
"
20
#include "
JSupport/JSupport.hh
"
21
#include "
JLang/JPipe.hh
"
22
#include "
JROOT/JROOTClassSelector.hh
"
23
24
#include "
Jeep/JParser.hh
"
25
#include "
Jeep/JMessage.hh
"
26
27
28
/**
29
* \file
30
* Auxiliary program to convert data formats.
31
* Possible file name extensions include ".evt" (ASCII), ".root" (ROOT) and ".dat" (binary).\n
32
* The following data structures and file name extensions are supported:
33
*
34
* <table>
35
* <tr><th> type </th><th> evt </th><th> root </th><th> dat </th></tr>
36
* <tr><td> KM3NETDAQ::JDAQEvent </td><td> </td><td> I/O </td><td> I/O </td></tr>
37
* <tr><td> KM3NETDAQ::JDAQTimeslice </td><td> </td><td> I/O </td><td> I/O </td></tr>
38
* <tr><td> KM3NETDAQ::JDAQSummaryslice </td><td> </td><td> I/O </td><td> I/O </td></tr>
39
* <tr><td> Head </td><td> I </td><td> I/O </td><td> </td></tr>
40
* <tr><td> Evt </td><td> I </td><td> I/O </td><td> </td></tr>
41
* </table>
42
*
43
* The name of the data structure following option -C should be preceded by a '+' or '-'
44
* to add or remove data types in the output, respectively.\n
45
* In this, ROOT wildcards are accepted (e.g. <pre>-C -\\.\\*</pre> will remove all data types).
46
*
47
* \author mdejong
48
*/
49
int
main
(
int
argc,
char
**argv)
50
{
51
using namespace
std;
52
using namespace
JPP;
53
54
typedef
JAllTypes_t
typelist;
55
56
JMultipleFileScanner<typelist>
inputFile;
57
JFileRecorder <typelist>
outputFile
;
58
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
59
JROOTClassSelection
selection = getROOTClassSelection<typelist>();
60
bool
& merge =
JMultipleFileScanner<Head>::merge
;
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::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition:
JMeta.hh:70
JSUPPORT::JFileRecorder
Object writing to file.
Definition:
JFileRecorder.hh:41
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
JFileRecorder.hh
Recording of objects on file according a format that follows from the file name extension.
JROOT::JROOTClassSelection
Auxiliary class for ROOT class selection.
Definition:
JROOTClassSelector.hh:91
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:66
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JLANG::JValve
Auxiliary class for selection of data type.
Definition:
JObjectIterator.hh:34
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
JPipe.hh
Implementation of pipe operation for object iterators.
JMeta.hh
ROOT I/O of application specific meta data.
JDAQSummarysliceIO.hh
debug
int debug
debug level
Definition:
JSirene.cc:63
JTriggerParametersSupportkit.hh
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JMultipleFileScanner.hh
Scanning of objects from multiple files according a format that follows from the extension of each fi...
JMonteCarloFileSupportkit.hh
Evt.hh
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition:
JMultipleFileScanner.hh:183
JParser.hh
Utility class to parse command line options.
JROOTClassSelector.hh
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:73
JDAQEventIO.hh
Head.hh
JDAQTimesliceIO.hh
JTriggerParameters.hh
Generated by
1.8.5