Jpp  19.1.0
the software that should make you happy
Functions
JBlurPDF.cc File Reference

Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs. More...

#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JTools/JFunction1D_t.hh"
#include "JTools/JFunctionalMap_t.hh"
#include "JPhysics/JPDFTable.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Auxiliary program to apply the transition time spread (TTS) of the PMTs to interpolation tables of PDFs.

Author
mdejong

Definition in file JBlurPDF.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 18 of file JBlurPDF.cc.

19 {
20  using namespace std;
21 
22  string inputFile;
23  string outputFile;
24  int numberOfPoints;
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 }
string outputFile
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#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
virtual const char * what() const override
Get error message.
Definition: JException.hh:64
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
const double epsilon
Definition: JQuadrature.cc:21
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
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.