Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JMakeCDG.cc File Reference

Main program to create table of CDFs from table of PDFs for Cherenkov light from EM-shower. More...

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program to create table of CDFs from table of PDFs for Cherenkov light from EM-shower.

Author
mdejong

Definition in file JMakeCDG.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 21 of file JMakeCDG.cc.

22{
23 using namespace std;
24
25 string inputFile;
26 string outputFile;
27 double epsilon;
28 int debug;
29
30 try {
31
32 JParser<> zap("Main program to create table of CDFs from table of PDFs for Cherenkov light from EM-shower.");
33
34 zap['f'] = make_field(inputFile);
35 zap['o'] = make_field(outputFile);
36 zap['e'] = make_field(epsilon) = 0.0;
37 zap['d'] = make_field(debug) = 0;
38
39 zap(argc, argv);
40 }
41 catch(const exception& error) {
42 FATAL(error.what() << endl);
43 }
44
45
46 using namespace JPP;
47
48
52 JPolint1FunctionalGridMap>::maplist JMapList_t;
55
56 JPDF_t pdf;
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 NOTICE("converting... " << flush);
71
72 JCDF_t cdf(pdf, epsilon);
73
74 NOTICE("OK" << endl);
75
76 try {
77
78 NOTICE("storing output to file " << outputFile << "... " << flush);
79
80 cdf.store(outputFile.c_str());
81
82 NOTICE("OK" << endl);
83 }
84 catch(const JException& error) {
85 NOTICE(error.what() << endl);
86 }
87}
string outputFile
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
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 CDF table for arrival time of Cherenkov light.
Definition JCDFTable.hh:58
Multi-dimensional PDF table for arrival time of Cherenkov light.
Definition JPDFTable.hh:44
const double epsilon
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.