33 JParser<> zap(
"Auxiliary program to compare PDF tables of the arrival time of the Cherenkov light from a shower.");
42 catch(
const exception &error) {
43 FATAL(error.what() << endl);
49 typedef JSplineFunction1D_t JFunction1D_t;
50 typedef JMAPLIST<JPolint1FunctionalMap,
51 JPolint1FunctionalMap,
52 JPolint1FunctionalGridMap,
53 JPolint1FunctionalGridMap>::maplist JMapList_t;
54 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
56 typedef JFunction1D_t::argument_type argument_type;
57 typedef JArray<4, argument_type> JArray_t;
64 const JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(0.0));
69 const char* file_name;
78 { inputFileA.c_str(), pdfA },
79 { inputFileB.c_str(), pdfB }
83 for (JEntry_t* p = buffer; p != buffer +
sizeof(buffer)/
sizeof(buffer[0]); ++p) {
87 NOTICE(
"loading input from file " << p->file_name <<
"... " << flush);
93 catch(
const JException& error) {
94 FATAL(error.what() << endl);
98 p->pdf.setExceptionHandler(supervisor);
103 JPDF_t::super_const_iterator i = pdfA.super_begin();
104 JPDF_t::super_const_iterator j = pdfB.super_begin();
106 for ( ; i != pdfA.super_end() &&
107 j != pdfB.super_end(); ++i, ++j) {
109 const double Wa = pdfA.transformer->getWeight(JArray_t((*i).getKey()));
110 const double Wb = pdfB.transformer->getWeight(JArray_t((*j).getKey()));
112 if (fabs(i->first - j->first) > precision ||
113 fabs(i->second->first - j->second->first) > precision ||
114 fabs(i->second->second->first - j->second->second->first) > precision ||
115 fabs(i->second->second->second->first - j->second->second->second->first) > precision ||
116 fabs(Wa - Wb) > precision) {
120 << i->second->first <<
' '
121 << i->second->second->first <<
' '
122 << i->second->second->second->first <<
' '
127 << j->second->first <<
' '
128 << j->second->second->first <<
' '
129 << j->second->second->second->first <<
' '
136 const JFunction1D_t& fa = (*i).getValue();
137 const JFunction1D_t& fb = (*j).getValue();
139 JFunction1D_t::const_iterator p = fa.begin();
140 JFunction1D_t::const_iterator q = fb.begin();
142 while (p != fa.end() &&
145 if (fabs(p->getX() - q->getX()) > precision) {
147 DEBUG(
"a.f[] " << p->getX() << endl);
148 DEBUG(
"b.f[] " << q->getX() << endl);
153 if (fabs(p->getY() - q->getY()) > precision) {
155 DEBUG(
"a.f() " << p->getX() <<
' ' << p->getY() << endl);
156 DEBUG(
"b.f() " << q->getX() <<
' ' << q->getY() << endl);
161 if (p->getX() < q->getX())
163 else if (q->getX() < p->getX())
171 for ( ; p != fa.end(); ++p) {
173 DEBUG(
"a.f() " << p->getX() << endl);
178 for ( ; q != fb.end(); ++q) {
180 DEBUG(
"b.f() " << q->getX() << endl);
186 for ( ; i != pdfA.super_end(); ++i) {
190 << i->second->first <<
' '
191 << i->second->second->first <<
' '
192 << i->second->second->second->first << endl);
197 for ( ; j != pdfB.super_end(); ++j) {
201 << j->second->first <<
' '
202 << j->second->second->first <<
' '
203 << j->second->second->second->first << endl);
209 ERROR(inputFileA <<
" and " << inputFileB <<
" differ." << endl);
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
#define DEBUG(A)
Message macros.