Functions
test_chirp.cxx File Reference
#include "WireCellSigProc/Diagnostics.h"
#include "WireCellUtil/Waveform.h"
#include "WireCellUtil/Testing.h"
#include <iostream>
#include <string>
#include <vector>
#include "example-chirp.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 19 of file test_chirp.cxx.

20 {
21  // vectors are in example-chirp.h
22 
23  int beg=-1, end=-1;
24  Diagnostics::Chirp chirp;
25  bool found = chirp(horig, beg, end);
26  Assert(found);
27 
28  // the function should find something starting at the beginning.
29  Assert(beg == 0);
30  // and the chirp does not extend to the end
31  Assert(end !=0 && end != (int)horig.size());
32 
33  Assert (beg >= 0);
34  Assert (end >= 0);
35  Assert (beg < end);
36 
37  // The algorithm works in chunks of 20
38  Assert ((end-beg)%20 == 0);
39 
40  for (int ind=beg; ind<end; ++ind) {
41  Assert(hfilt[ind] == 0);
42  }
43 
44  cerr << "chirp at " << beg << " --> " << end << endl;
45  Assert (end == 4240);
46 
47  return 0;
48 }
std::vector< float > horig
Definition: example-chirp.h:1
std::vector< float > hfilt
Definition: example-chirp.h:1
#define Assert
Definition: Testing.h:7
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:72
QTextStream & endl(QTextStream &s)