Jpp
19.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
JPhysics
JAddPDG.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <fstream>
5
#include <iomanip>
6
#include <vector>
7
8
#include "
JTools/JFunction1D_t.hh
"
9
#include "
JTools/JFunctionalMap_t.hh
"
10
#include "
JPhysics/JPDFTable.hh
"
11
12
#include "
Jeep/JParser.hh
"
13
#include "
Jeep/JMessage.hh
"
14
15
16
/**
17
* \file
18
*
19
* Auxiliary program to add PDF tables of the arrival time of the Cherenkov light from an EM-shower.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
26
vector<string>
inputFile;
27
string
outputFile
;
28
int
debug
;
29
30
try
{
31
32
JParser<>
zap(
"Auxiliary program to add PDF tables of the arrival time of the Cherenkov light from an EM-shower."
);
33
34
zap[
'f'
] =
make_field
(inputFile);
35
zap[
'o'
] =
make_field
(
outputFile
);
36
zap[
'd'
] =
make_field
(
debug
) = 2;
37
38
zap(argc, argv);
39
}
40
catch
(
const
exception &error) {
41
FATAL
(error.what() << endl);
42
}
43
44
45
if
(inputFile.empty()) {
46
FATAL
(
"No input file(s)."
<< endl);
47
}
48
49
using namespace
JPP;
50
51
typedef
JSplineFunction1D_t JFunction1D_t;
52
typedef
JMAPLIST<JPolint1FunctionalMap,
53
JPolint1FunctionalMap,
54
JPolint1FunctionalGridMap,
55
JPolint1FunctionalGridMap>::maplist JMapList_t;
56
typedef
JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
57
58
JPDF_t pdf;
59
60
const
JFunction1D_t::JSupervisor supervisor(
new
JFunction1D_t::JDefaultResult(0.0));
61
62
for
(
vector<string>::const_iterator
i
= inputFile.begin();
i
!= inputFile.end(); ++
i
) {
63
64
try
{
65
66
NOTICE
(
"loading input from file "
<< *
i
<<
"... "
<< flush);
67
68
JPDF_t buffer;
69
70
buffer.load(
i
->c_str());
71
buffer.compile();
72
buffer.setExceptionHandler(supervisor);
73
74
NOTICE
(
"OK"
<< endl);
75
76
if
(pdf.empty())
77
pdf = buffer;
78
else
79
pdf.add(buffer);
80
}
81
catch
(
const
JException& error) {
82
FATAL
(error.what() << endl);
83
}
84
}
85
86
try
{
87
88
NOTICE
(
"storing output to file "
<<
outputFile
<<
"... "
<< flush);
89
90
pdf.store(
outputFile
.c_str());
91
92
NOTICE
(
"OK"
<< endl);
93
}
94
catch
(
const
JException& error) {
95
FATAL
(error << endl);
96
}
97
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1711
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
std::vector
Definition:
JSTDTypes.hh:15
JFunctionalMap_t.hh
Various implementations of functional maps.
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JFunction1D_t.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:2158
JPDFTable.hh
NOTICE
#define NOTICE(A)
Definition:
JMessage.hh:64
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5