39int main(
int argc, 
char **argv)
 
   51    JParser<> zap(
"Auxiliary program to compare PDF tables of the arrival time of the Cherenkov light from a shower.");
 
   60  catch(
const exception &error) {
 
   61    FATAL(error.what() << endl);
 
   71  typedef JFunction1D_t::argument_type                            argument_type;
 
   77  const JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(0.0));
 
   80    const string file_name;
 
   91      NOTICE(
"loading input from file " << i.file_name << 
"... " << flush);
 
   93      i.pdf.load(i.file_name.c_str());
 
   95      i.pdf.setExceptionHandler(supervisor);
 
  106  JPDF_t::super_const_iterator i = pdfA.super_begin();
 
  107  JPDF_t::super_const_iterator j = pdfB.super_begin();
 
  109  for ( ; i != pdfA.super_end() && 
 
  110          j != pdfB.super_end(); ++i, ++j) {
 
  112    const double Wa = pdfA.transformer->getWeight(JArray_t((*i).getKey()));
 
  113    const double Wb = pdfB.transformer->getWeight(JArray_t((*j).getKey()));
 
  115    if (fabs(i->first                 - j->first)                                  >  precision ||
 
  116        fabs(i->second->first         - j->second->first)                          >  precision ||
 
  117        fabs(i->second->second->first - j->second->second->first)                  >  precision ||
 
  118        fabs(i->second->second->second->first - j->second->second->second->first)  >  precision ||
 
  119        fabs(Wa                       - Wb)                                        >  precision) {
 
  123            << i->second->first                 << 
' ' 
  124            << i->second->second->first         << 
' ' 
  125            << i->second->second->second->first << 
' ' 
  130            << j->second->first                 << 
' ' 
  131            << j->second->second->first         << 
' ' 
  132            << j->second->second->second->first << 
' ' 
  138    const JFunction1D_t& fa = (*i).getValue();
 
  139    const JFunction1D_t& fb = (*j).getValue();
 
  141    JFunction1D_t::const_iterator p = fa.begin();
 
  142    JFunction1D_t::const_iterator q = fb.begin();
 
  144    while (p != fa.end() && 
 
  147      if (fabs(p->getX() - q->getX()) > precision) {
 
  149        DEBUG(
"a.x " << p->getX() << endl);
 
  150        DEBUG(
"b.x " << q->getX() << endl);
 
  155      if (!compare(p->getY(), q->getY(), precision)) {
 
  157        DEBUG(
"a.y " << p->getX() << 
' ' << p->getY() << endl);
 
  158        DEBUG(
"b.y " << q->getX() << 
' ' << q->getY() << endl);
 
  163      if      (p->getX() < q->getX())
 
  165      else if (q->getX() < p->getX())
 
  173    for ( ; p != fa.end(); ++p) {
 
  175      DEBUG(
"a.x " << p->getX() << endl);
 
  180    for ( ; q != fb.end(); ++q) {
 
  182      DEBUG(
"b.x " << q->getX() << endl);
 
  188  for ( ; i != pdfA.super_end(); ++i) {
 
  192          << i->second->first                 << 
' ' 
  193          << i->second->second->first         << 
' ' 
  194          << i->second->second->second->first << endl); 
 
  199  for ( ; j != pdfB.super_end(); ++j) {
 
  203          << j->second->first                 << 
' ' 
  204          << j->second->second->first         << 
' ' 
  205          << j->second->second->second->first << endl);
 
  211    ERROR(inputFileA << 
" and " << inputFileB << 
" differ." << endl);