Jpp
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
#include "
JAAnet/JHead.hh
"
7
#include "JAAnet/JAAnetDictionary.hh"
8
#include "
JSupport/JMultipleFileScanner.hh
"
9
#include "
JSupport/JMonteCarloFileSupportkit.hh
"
10
#include "
JSupport/JSupport.hh
"
11
#include "
JROOT/JRootPrinter.hh
"
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
* Auxiliary program to print sum of Monte Carlo run headers.
19
*
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
27
JMultipleFileScanner<JHeaderTypes_t>
inputFile;
28
string
key;
29
bool
print_only_mapped;
30
bool
print_as_head;
31
int
debug
;
32
33
try
{
34
35
JParser<>
zap(
"Auxiliary program to print sum of Monte Carlo run headers."
);
36
37
zap[
'f'
] =
make_field
(inputFile);
38
zap[
'k'
] =
make_field
(key) =
""
;
39
zap[
'O'
] =
make_field
(print_only_mapped);
40
zap[
'H'
] =
make_field
(print_as_head);
41
zap[
'd'
] =
make_field
(
debug
) = 1;
42
43
zap(argc, argv);
44
}
45
catch
(
const
exception &error) {
46
FATAL
(error.what() << endl);
47
}
48
49
const
JHead
header =
getHeader
(inputFile);
50
51
if
(key ==
""
) {
52
53
if
(print_only_mapped) {
54
55
header.write(cout);
56
57
}
else
if
(print_as_head) {
58
59
write
(header, cout);
60
61
}
else
{
62
63
header.print(cout);
64
}
65
66
}
else
{
67
68
JRootPrinter::print
(cout, header, key,
JAAnetDictionary::getInstance
());
69
}
70
}
71
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
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:471
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:1961
debug
int debug
debug level
Definition:
JSirene.cc:63
print
print
Definition:
JConvertDusj.sh:44
JMessage.hh
General purpose messaging.
JAANET::JHead
Monte Carlo run header.
Definition:
JHead.hh:1050
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:167
write
bool write(const Vec &v, std::ostream &os)
Write a Vec(tor) to a stream.
Definition:
io_ascii.hh:154
JParser.hh
Utility class to parse command line options.
Head.hh
JHead.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5