Jpp
18.0.0-rc.2
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
JPrintHeader.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
km3net-dataformat/offline/Head.hh
"
6
7
#include "
JAAnet/JHead.hh
"
8
#include "JAAnet/JAAnetDictionary.hh"
9
10
#include "
JSupport/JMultipleFileScanner.hh
"
11
#include "
JSupport/JMonteCarloFileSupportkit.hh
"
12
#include "
JSupport/JSupport.hh
"
13
14
#include "
JROOT/JRootPrinter.hh
"
15
#include "
JROOT/JSonObjectOutput.hh
"
16
17
#include "
JLang/JStreamObjectOutput.hh
"
18
19
#include "
Jeep/JParser.hh
"
20
#include "
Jeep/JMessage.hh
"
21
22
23
/**
24
* \file
25
* Auxiliary program to print sum of Monte Carlo run headers.
26
*
27
* \author mdejong
28
*/
29
int
main
(
int
argc,
char
**argv)
30
{
31
using namespace
std;
32
using namespace
JPP;
33
34
JMultipleFileScanner<JHeaderTypes_t>
inputFile;
35
string
key;
36
bool
print_as_head;
37
bool
print_as_json;
38
int
debug
;
39
40
try
{
41
42
JParser<>
zap(
"Auxiliary program to print sum of Monte Carlo run headers."
);
43
44
zap[
'f'
] =
make_field
(inputFile);
45
zap[
'k'
] =
make_field
(key) =
""
;
46
zap[
'H'
] =
make_field
(print_as_head);
47
zap[
'J'
] =
make_field
(print_as_json);
48
zap[
'd'
] =
make_field
(
debug
) = 1;
49
50
zap(argc, argv);
51
}
52
catch
(
const
exception &error) {
53
FATAL
(error.what() << endl);
54
}
55
56
const
JHead
header =
getHeader
(inputFile);
57
58
if
(key ==
""
) {
59
60
Head
buffer;
61
62
copy
(header, buffer);
63
64
typedef
JTYPELIST<Head, JHead>::typelist
typelist;
65
typedef
JObjectOutput<typelist>
* output_type;
66
67
output_type out = (print_as_json ?
68
(output_type)
new
JSonObjectOutput <typelist>
(cout) :
69
(output_type)
new
JStreamObjectOutput<typelist>
(cout));
70
71
if
(print_as_head)
72
out->
put
(buffer);
73
else
74
out->put(header);
75
76
delete
out;
77
78
}
else
{
79
80
JRootPrinter::print
(cout, header, key,
JAAnetDictionary::getInstance
());
81
}
82
}
83
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.
JSUPPORT::getHeader
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Definition:
JMonteCarloFileSupportkit.hh:534
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition:
JObject.hh:75
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
JROOT::JSonObjectOutput
Template implementation of stream output for single data type.
Definition:
JSonObjectOutput.hh:32
print
print
Definition:
JConvertDusj.sh:44
JMessage.hh
General purpose messaging.
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1221
JSonObjectOutput.hh
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
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.
JLANG::JStreamObjectOutput
Template implementation of stream output for single data type.
Definition:
JStreamObjectOutput.hh:28
JAANET::copy
void copy(const Head &from, JHead &to)
Copy header from from to to.
Definition:
JHead.cc:162
JLANG::JObjectOutput
Template interface of object output for single data type.
Definition:
JObjectIterator.hh:33
JLANG::JObjectOutput::put
virtual bool put(const T &object)=0
Object output.
Head.hh
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
JHead.hh
JStreamObjectOutput.hh
Generated by
1.8.5