Jpp
18.2.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
software
JGizmo
JPrintMultiHeader.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
km3net-dataformat/offline/MultiHead.hh
"
6
7
#include "
JAAnet/JHead.hh
"
8
#include "JAAnet/JAAnetDictionary.hh"
9
10
#include "
JSupport/JSingleFileScanner.hh
"
11
#include "
JSupport/JSupport.hh
"
12
13
#include "
JROOT/JRootPrinter.hh
"
14
#include "
JROOT/JSonObjectOutput.hh
"
15
16
#include "
JLang/JStreamObjectOutput.hh
"
17
18
#include "
Jeep/JParser.hh
"
19
#include "
Jeep/JMessage.hh
"
20
21
22
/**
23
* \file
24
* Auxiliary program to print Monte Carlo run headers.
25
*
26
* \author mdejong
27
*/
28
int
main
(
int
argc,
char
**argv)
29
{
30
using namespace
std;
31
using namespace
JPP;
32
33
JSingleFileScanner<MultiHead>
inputFile;
34
bool
print_as_head;
35
bool
print_as_json;
36
int
debug
;
37
38
try
{
39
40
JParser<>
zap(
"Auxiliary program to print Monte Carlo run headers."
);
41
42
zap[
'f'
] =
make_field
(inputFile);
43
zap[
'H'
] =
make_field
(print_as_head);
44
zap[
'J'
] =
make_field
(print_as_json);
45
zap[
'd'
] =
make_field
(
debug
) = 1;
46
47
zap(argc, argv);
48
}
49
catch
(
const
exception &error) {
50
FATAL
(error.what() << endl);
51
}
52
53
typedef
JTYPELIST<Head, JHead>::typelist
typelist;
54
typedef
JObjectOutput<typelist>
* output_type;
55
56
output_type out = (print_as_json ?
57
(output_type)
new
JSonObjectOutput <typelist>
(cout) :
58
(output_type)
new
JStreamObjectOutput<typelist>
(cout));
59
60
while
(inputFile.hasNext()) {
61
62
const
MultiHead
* head = inputFile.next();
63
64
for
(MultiHead::const_iterator
i
= head->begin();
i
!= head->end(); ++
i
) {
65
66
if
(print_as_head)
67
out->put(*
i
);
68
else
69
out->put(
JHead
(*
i
));
70
}
71
}
72
73
delete
out;
74
}
75
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.
JRootPrinter.hh
Print objects in ASCII format using ROOT dictionary.
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
JSingleFileScanner.hh
Scanning of objects from a single file according a format that follows from the extension of each fil...
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
MultiHead
Definition:
MultiHead.hh:17
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1234
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
MultiHead.hh
JROOT::JSonObjectOutput
Template implementation of stream output for single data type.
Definition:
JSonObjectOutput.hh:32
JMessage.hh
General purpose messaging.
JSonObjectOutput.hh
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JLANG::JStreamObjectOutput
Template implementation of stream output for single data type.
Definition:
JStreamObjectOutput.hh:28
JLANG::JObjectOutput
Template interface of object output for single data type.
Definition:
JObjectIterator.hh:33
JSUPPORT::JSingleFileScanner
Object reading from a list of files.
Definition:
JSingleFileScanner.hh:75
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
JHead.hh
JStreamObjectOutput.hh
Generated by
1.8.5