251     JParser<> zap(
"Program to compare acoustics event data.");
 
  253     zap[
'f'] = 
make_field(inputFile,  
"two outputs of JAcousticsEventBuilder[.sh]");
 
  254     zap[
'n'] = 
make_field(numberOfEvents)                                    = JLimit::max();    
 
  255     zap[
'O'] = 
make_field(option,     Null_t << 
" -> nothing " << Sort_t << 
" -> sort")  = Null_t, Sort_t;
 
  256     zap[
'C'] = 
make_field(cta,        ToA_t  << 
" -> ToA "     << ToE_t  << 
" -> ToE")   = ToA_t,  ToE_t;
 
  261   catch(
const exception &error) {
 
  262     FATAL(error.what() << endl);
 
  265   if (inputFile.size() != 2
u) {
 
  266     FATAL(
"Wrong number of input files " << inputFile.size() << endl); 
 
  269   const size_t  width = max(inputFile[0].size(), inputFile[1].size());
 
  274   for (
int i = 0; 
i != 2; ++
i) {
 
  277       buffer[
i].push_back(*
in.next());
 
  281   if (option == Sort_t) {
 
  283     for (
int i = 0; i != 2; ++
i) {
 
  285       for (
JEvent& evt : buffer[i]) {
 
  286         sort(evt.begin(), evt.end(), compare);
 
  289       if (cta == ToA_t) { sort(buffer[i].begin(), buffer[i].end(), toa); }
 
  290       if (cta == ToE_t) { sort(buffer[i].begin(), buffer[i].end(), toe); }
 
  293         sort(p->begin(), p->end(), compare);
 
  298   int count[] = { 0, 0 };
 
  301          p0 = buffer[0].begin(),
 
  302          p1 = buffer[1].begin(); p0 != buffer[0].end() && 
p1 != buffer[1].end(); ) {
 
  304     for ( ; p0 != buffer[0].end() && 
p1 != buffer[1].end() && ((cta == ToA_t && toa(*p0,*
p1)) || (cta == ToE_t && toe(*p0,*
p1))); ++p0, ++count[1]) {
 
  305       print(cout, inputFile[0], 
distance(buffer[0].cbegin(),p0), *p0, 
">>", 
"");
 
  308     for ( ; p0 != buffer[0].end() && 
p1 != buffer[1].end() && ((cta == ToA_t && toa(*
p1,*p0)) || (cta == ToE_t && toe(*
p1,*p0))); ++
p1, ++count[1]) {
 
  312     if (p0 != buffer[0].end() && 
p1 != buffer[1].end()) {
 
  314       if (!compare(*p0,*
p1) && !compare(*
p1,*p0)) {
 
  318         print(cout, inputFile[0], 
distance(buffer[0].cbegin(),p0), *p0, 
"", 
"\\");
 
  325         print(cout, inputFile[0], 
distance(buffer[0].cbegin(),p0), *p0, 
"", 
"*");
 
  328         if (p0->getOID()     == 
p1->getOID()     &&
 
  329             p0->getCounter() == 
p1->getCounter() &&
 
  330             p0->getID()      == 
p1->getID()) {
 
  332           JEvent::const_iterator i0 = p0->begin();
 
  333           JEvent::const_iterator i1 = 
p1->begin();
 
  335           while (i0 != p0->end() && i1 != 
p1->end()) {
 
  337             for ( ; i0 != p0->end() && i1 != 
p1->end() && compare(*i0,*i1); ++i0) {
 
  338               print(cout, *i0, 
">>", 
"");
 
  341             for ( ; i0 != p0->end() && i1 != 
p1->end() && compare(*i1,*i0); ++i1) {
 
  342               print(cout, *i1, 
"<<", 
"");
 
  345             if (i0 != p0->end() && i1 != 
p1->end()) {
 
  346               if (!compare(*i0, *i1) && !compare(*i1,*i0)) {
 
  353           for ( ; i0 != p0->end(); ++i0) {
 
  354             print(cout, *i0, 
">>", 
"");
 
  357           for ( ; i1 != 
p1->end(); ++i1) {
 
  358             print(cout, *i1, 
"<<", 
"");
 
  363           print(cout, inputFile[0], 
distance(buffer[0].cbegin(),p0), *p0, 
">>", 
"");
 
  368       if (toa(*p0,*
p1) || toa(*
p1,*p0)) {
 
  378   STATUS(
"Number of differences / events: " << count[1] << 
" / " << count[0] << endl);
 
  380   if (buffer[0].size() != buffer[1].size()) {
 
  381     FATAL(
"Different size " << buffer[0].size() << 
' ' << buffer[1].size() << endl);
 
  385     FATAL(
"Number of differences " << count[1] << endl);
 
Utility class to parse command line options. 
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance. 
 
Auxiliary class for defining the range of iterations of objects. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
Object reading from a list of files. 
 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in