51 JParser<> zap(
"Auxiliary program to compare PDF tables of the arrival time of the Cherenkov light from a bright point.");
60 catch(
const exception &error) {
61 FATAL(error.what() << endl);
64 typedef JSplineFunction1D_t JFunction1D_t;
65 typedef JMAPLIST<JPolint1FunctionalMap,
66 JPolint1FunctionalGridMap>::maplist JMapList_t;
67 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
69 typedef JFunction1D_t::argument_type argument_type;
70 typedef JArray<2, argument_type> JArray_t;
75 const JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(0.0));
78 const string file_name;
89 NOTICE(
"loading input from file " <<
i.file_name <<
"... " << flush);
91 i.pdf.load(
i.file_name.c_str());
93 i.pdf.setExceptionHandler(supervisor);
97 catch(
const JException& error) {
98 FATAL(error.what() << endl);
104 JPDF_t::super_const_iterator
i = pdfA.super_begin();
105 JPDF_t::super_const_iterator
j = pdfB.super_begin();
107 for ( ;
i != pdfA.super_end() &&
108 j != pdfB.super_end(); ++
i, ++
j) {
110 const double Wa = pdfA.transformer->getWeight(JArray_t((*i).getKey()));
111 const double Wb = pdfB.transformer->getWeight(JArray_t((*j).getKey()));
113 if (fabs(
i->first -
j->first) > precision ||
114 fabs(
i->second->first -
j->second->first) > precision ||
115 fabs(Wa - Wb) > precision) {
119 <<
i->second->first <<
' '
124 <<
j->second->first <<
' '
130 const JFunction1D_t& fa = (*i).getValue();
131 const JFunction1D_t& fb = (*j).getValue();
133 JFunction1D_t::const_iterator p = fa.begin();
134 JFunction1D_t::const_iterator q = fb.begin();
136 while (p != fa.end() &&
139 if (fabs(p->getX() - q->getX()) > precision) {
141 DEBUG(
"a.x " << p->getX() << endl);
142 DEBUG(
"b.x " << q->getX() << endl);
147 if (!compare(p->getY(), q->getY(), precision)) {
149 DEBUG(
"a.y " << p->getX() <<
' ' << p->getY() << endl);
150 DEBUG(
"b.y " << q->getX() <<
' ' << q->getY() << endl);
155 if (p->getX() < q->getX())
157 else if (q->getX() < p->getX())
165 for ( ; p != fa.end(); ++p) {
167 DEBUG(
"a.x " << p->getX() << endl);
172 for ( ; q != fb.end(); ++q) {
174 DEBUG(
"b.x " << q->getX() << endl);
180 for ( ;
i != pdfA.super_end(); ++
i) {
184 <<
i->second->first << endl);
189 for ( ;
j != pdfB.super_end(); ++
j) {
193 <<
j->second->first << endl);
199 ERROR(inputFileA <<
" and " << inputFileB <<
" differ." << endl);
Utility class to parse command line options.
JCombinatorics::pair_type pair_type
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define DEBUG(A)
Message macros.