#include #include #include #include "km3net-dataformat/offline/Head.hh" #include "JAAnet/JHead.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to test matching of headers. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; int debug; try { JParser<> zap("Auxiliary program to test matching of headers."); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } cout.tie(&cerr); JHead header[2]; header[0].push(); header[1].push(); { JHead match = header[0].getMatch(header[1]); DEBUG("match " << match.size() << ' ' << JHead::getMaximumNumberOfMatches()); for (JHead::const_iterator p = match.begin(); p != match.end(); ++p) { DEBUG(" " << p->first); } DEBUG(endl); ASSERT(match.size() == JHead::getMaximumNumberOfMatches()); } for (unsigned int i : {1, 0}) { header[i].genvol.volume = 1.0; JHead match = header[0].getMatch(header[1]); DEBUG("match " << match.size()); for (JHead::const_iterator p = match.begin(); p != match.end(); ++p) { DEBUG(" " << p->first); } DEBUG(endl); ASSERT(match.size() == JHead::getMaximumNumberOfMatches() - i); } for (unsigned int i : {1, 0}) { header[i].livetime.numberOfSeconds = 1.0; JHead match = header[0].getMatch(header[1]); DEBUG("match " << match.size()); for (JHead::const_iterator p = match.begin(); p != match.end(); ++p) { DEBUG(" " << p->first); } DEBUG(endl); ASSERT(match.size() == JHead::getMaximumNumberOfMatches() - i); } return 0; }