Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JMakeCDF.cc
Go to the documentation of this file.
1 #include <string>
2 #include <iostream>
3 #include <fstream>
4 #include <iomanip>
5 
8 #include "JPhysics/JPDFTable.hh"
9 #include "JPhysics/JCDFTable.hh"
10 
11 #include "Jeep/JParser.hh"
12 #include "Jeep/JMessage.hh"
13 
14 
15 /**
16  * \file
17  *
18  * Main program to create table of CDFs from table of PDFs for Cherenkov light from muon.
19  * \author mdejong
20  */
21 int main(int argc, char **argv)
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 muon.");
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 
50  JPolint1FunctionalGridMap>::maplist JMapList_t;
53 
54  JPDF_t pdf;
55 
56  try {
57 
58  NOTICE("loading input from file " << inputFile << "... " << flush);
59 
60  pdf.load(inputFile.c_str());
61 
62  NOTICE("OK" << endl);
63  }
64  catch(const JException& error) {
65  FATAL(error.what() << endl);
66  }
67 
68  NOTICE("converting... " << flush);
69 
70  JCDF_t cdf(pdf, epsilon);
71 
72  NOTICE("OK" << endl);
73 
74  try {
75 
76  NOTICE("storing output to file " << outputFile << "... " << flush);
77 
78  cdf.store(outputFile.c_str());
79 
80  NOTICE("OK" << endl);
81  }
82  catch(const JException& error) {
83  FATAL(error.what() << endl);
84  }
85 }
string outputFile
Various implementations of functional maps.
int main(int argc, char **argv)
Definition: JMakeCDF.cc:21
General purpose messaging.
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
General exception.
Definition: JException.hh:24
Utility class to parse command line options.
Definition: JParser.hh:1698
Multi-dimensional CDF table for arrival time of Cherenkov light.
Definition: JCDFTable.hh:57
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.