Jpp  18.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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;
50  typedef JMAPLIST<JPolint1FunctionalMap,
51  JPolint1FunctionalGridMap,
52  JPolint1FunctionalGridMap>::maplist JMapList_t;
53  typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_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 }
Utility class to parse command line options.
Definition: JParser.hh:1514
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
int numberOfPoints
Definition: JResultPDF.cc:22
const double epsilon
Definition: JQuadrature.cc:21
int debug
debug level