Jpp
18.0.0-rc.1
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
examples
JAAnet
JMultiHead.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <cmath>
6
7
#include "TROOT.h"
8
#include "TFile.h"
9
10
#include "
km3net-dataformat/offline/Head.hh
"
11
#include "
km3net-dataformat/offline/MultiHead.hh
"
12
#include "
km3net-dataformat/offline/Evt.hh
"
13
14
#include "
JSupport/JMultipleFileScanner.hh
"
15
#include "
JSupport/JFileRecorder.hh
"
16
#include "
JSupport/JMonteCarloFileSupportkit.hh
"
17
#include "
JSupport/JSupport.hh
"
18
#include "
JSupport/JMeta.hh
"
19
20
#include "
Jeep/JParser.hh
"
21
#include "
Jeep/JMessage.hh
"
22
23
24
/**
25
* \file
26
*
27
* Example program to add MultiHead.
28
* \author mdejong
29
*/
30
int
main
(
int
argc,
char
**argv)
31
{
32
using namespace
std;
33
using namespace
JPP;
34
35
JMultipleFileScanner<Evt>
inputFile;
36
JFileRecorder<JTYPELIST<JAAnetTypes_t, JMetaTypes_t>::typelist
>
outputFile
;
37
JLimit_t
& numberOfEvents = inputFile.
getLimit
();
38
int
debug
;
39
40
try
{
41
42
JParser<>
zap(
"Example program to add MultiHead."
);
43
44
zap[
'f'
] =
make_field
(inputFile);
45
zap[
'n'
] =
make_field
(numberOfEvents) = JLimit::max();
46
zap[
'o'
] =
make_field
(
outputFile
);
47
zap[
'd'
] =
make_field
(
debug
) = 2;
48
49
zap(argc, argv);
50
}
51
catch
(
const
exception& error) {
52
FATAL
(error.what() << endl);
53
}
54
55
56
outputFile
.open();
57
58
outputFile
.put(
JMeta
(argc, argv));
59
60
Head
header;
61
62
try
{
63
64
header =
getHeader
(inputFile);
65
66
MultiHead
buffer;
67
68
buffer.push_back(header);
69
70
outputFile
.put(header);
71
outputFile
.put(buffer);
72
73
}
catch
(
const
exception& error) {
74
FATAL
(
"Missing header."
<< endl);
75
}
76
77
while
(inputFile.hasNext()) {
78
79
STATUS
(
"event: "
<< setw(10) << inputFile.getCounter() <<
'\r'
);
DEBUG
(endl);
80
81
const
Evt
* evt = inputFile.next();
82
83
outputFile
.put(*evt);
84
}
85
STATUS
(endl);
86
87
outputFile
.close();
88
}
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:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
JFileRecorder.hh
Recording of objects on file according a format that follows from the file name extension.
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
JSUPPORT::getHeader
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Definition:
JMonteCarloFileSupportkit.hh:534
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition:
JLimit.hh:41
MultiHead
Definition:
MultiHead.hh:17
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
MultiHead.hh
JMeta.hh
ROOT I/O of application specific meta data.
JMessage.hh
General purpose messaging.
Head
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition:
Head.hh:65
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:199
JParser.hh
Utility class to parse command line options.
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition:
JLimit.hh:84
Head.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Evt
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition:
Evt.hh:20
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5