Jpp  15.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JMakeCDF.cc File Reference

Main program to create table of CDFs from table of PDFs for Cherenkov light from muon. 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 muon.

Author
mdejong

Definition in file JMakeCDF.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 21 of file JMakeCDF.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 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 
48  typedef JMAPLIST<JPolint1FunctionalMap,
49  JPolint1FunctionalGridMap,
50  JPolint1FunctionalGridMap>::maplist JMapList_t;
51  typedef JPDFTable<JSplineFunction1S_t, JMapList_t> JPDF_t;
52  typedef JCDFTable<JSplineFunction1D_t, JMapList_t> JCDF_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 }
Utility class to parse command line options.
Definition: JParser.hh:1500
string outputFile
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
#define NOTICE(A)
Definition: JMessage.hh:64
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
then for FUNCTION in pdf npe cdf
Definition: JPlotNPE-PDG.sh:73