Jpp  19.1.0-rc.1
the software that should make you happy
Functions
JPrintPDE.cc File Reference

Program to print PDF of Cherenkov light from elongated EM-shower. More...

#include <string>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "JTools/JFunction1D_t.hh"
#include "JTools/JFunctionalMap_t.hh"
#include "JPhysics/JPDFTransformer.hh"
#include "JPhysics/JPDFTable.hh"
#include "JPhysics/JPDFTypes.hh"
#include "Jeep/JPrint.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

Program to print PDF of Cherenkov light from elongated EM-shower.

Author
mdejong

Definition in file JPrintPDE.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 23 of file JPrintPDE.cc.

24 {
25  using namespace std;
26  using namespace JPP;
27 
28  string inputFile;
29  int debug;
30 
31  try {
32 
33  JParser<> zap("Program to print PDF of Cherenkov light from elongated EM-shower.");
34 
35  zap['f'] = make_field(inputFile);
36  zap['d'] = make_field(debug) = 2;
37 
38  zap(argc, argv);
39  }
40  catch(const exception &error) {
41  FATAL(error.what() << endl);
42  }
43 
44 
45  typedef JPolint0Function1D_t JFunction1D_t;
50  JPolint0FunctionalGridMap>::maplist JMapList_t;
52 
53  JPDF_t pdf;
54 
55  try {
56 
57  NOTICE("loading input from file " << inputFile << "... " << flush);
58 
59  pdf.load(inputFile.c_str());
60 
61  NOTICE("OK" << endl);
62  }
63  catch(const JException& error) {
64  FATAL(error.what() << endl);
65  }
66 
67  int number_of_counts = 0;
68  int number_of_errors = 0;
69 
70  for (JPDF_t::super_const_iterator i = pdf.super_begin(); i != pdf.super_end(); ++i) {
71 
72  const JFunction1D_t& f1 = i.getValue();
73 
74  for (JFunction1D_t::const_iterator p = f1.begin(); p != f1.end(); ++p) {
75 
76  number_of_counts += 1;
77 
78  if (p->getY() != p->getY()) {
79 
80  if (debug >= debug_t) {
81  cout << FIXED(15,5) << i->first << ' ';
82  cout << FIXED(15,5) << i->second->first << ' ';
83  cout << FIXED(15,5) << i->second->second->first << ' ';
84  cout << FIXED(15,5) << i->second->second->second->first << ' ';
85  cout << FIXED(15,5) << i->second->second->second->second->first << ' ';
86  cout << FIXED(15,5) << p->getX() << ' ';
87  cout << FIXED(15,5) << p->getY() << endl;
88  }
89 
90  number_of_errors += 1;
91  }
92  }
93  }
94 
95  cout << "Number of errors / counts: " << number_of_errors << " / " << number_of_counts << endl;
96 
97  if (number_of_errors != 0) {
98  FATAL("Number of errors " << number_of_errors << endl);
99  }
100 
101  return 0;
102 }
#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:2158
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:1714
Multi-dimensional PDF table for arrival time of Cherenkov light.
Definition: JPDFTable.hh:44
const JPolynome f1(1.0, 2.0, 3.0)
Function.
@ debug_t
debug
Definition: JMessage.hh:29
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Auxiliary data structure for floating point format specification.
Definition: JManip.hh:448
double getValue(const double x) const
Function value.
Definition: JMathlib.hh:1421
Auxiliary class for recursive map list generation.
Definition: JMapList.hh:109
Type definition of a zero degree polynomial interpolation with result type double.
Type definition of a zero degree polynomial interpolation based on a JGridMap implementation.
Type definition of a zero degree polynomial interpolation based on a JMap implementation.