Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JBlurPDF.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <fstream>
4#include <iomanip>
5
6#include "Jeep/JParser.hh"
7#include "Jeep/JMessage.hh"
10#include "JPhysics/JPDFTable.hh"
11
12
13/**
14 * \file
15 * Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs.
16 * \author mdejong
17 */
18int main(int argc, char **argv)
19{
20 using namespace std;
21
22 string inputFile;
23 string outputFile;
25 double epsilon;
26 double TTS;
27 int debug;
28
29 try {
30
31 JParser<> zap("Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs.");
32
33 zap['f'] = make_field(inputFile);
34 zap['o'] = make_field(outputFile);
35 zap['n'] = make_field(numberOfPoints) = 25;
36 zap['e'] = make_field(epsilon) = 1.0e-10;
37 zap['T'] = make_field(TTS) = 0.0; // [ns]
38 zap['d'] = make_field(debug) = 0;
39
40 zap(argc, argv);
41 }
42 catch(const exception &error) {
43 FATAL(error.what() << endl);
44 }
45
46
47 using namespace JPP;
48
49 typedef JSplineFunction1D_t JFunction1D_t;
52 JPolint1FunctionalGridMap>::maplist JMapList_t;
54
55 JPDF_t pdf;
56
57
58 try {
59
60 NOTICE("loading input from file " << inputFile << "... " << flush);
61
62 pdf.load(inputFile.c_str());
63
64 NOTICE("OK" << endl);
65 }
66 catch(const JException& error) {
67 FATAL(error.what() << endl);
68 }
69
70
71 pdf.setExceptionHandler(new JFunction1D_t::JDefaultResult(0.0));
72
73 NOTICE("Gauss-Hermite integration... " << flush);
74
75 pdf.blur(TTS, numberOfPoints, epsilon);
76
77 NOTICE("OK" << endl);
78
79
80 NOTICE("storing output to file " << outputFile << "... " << flush);
81
82 pdf.store(outputFile.c_str());
83
84 NOTICE("OK" << endl);
85}
int main(int argc, char **argv)
Definition JBlurPDF.cc:18
string outputFile
Various implementations of functional maps.
General purpose messaging.
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
int numberOfPoints
Definition JResultPDF.cc:22
General exception.
Definition JException.hh:24
Utility class to parse command line options.
Definition JParser.hh:1698
Multi-dimensional PDF table for arrival time of Cherenkov light.
Definition JPDFTable.hh:44
void setExceptionHandler(const typename function_type::supervisor_type &supervisor)
Set the supervisor for handling of exceptions.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for recursive map list generation.
Definition JMapList.hh:109
Type definition of a 1st degree polynomial interpolation based on a JGridMap implementation.
Type definition of a 1st degree polynomial interpolation based on a JMap implementation.
Type definition of a spline interpolation method based on a JCollection with double result type.