Electric Tiger DAQ  1.0.0
Data Acquisition Software for the Electric Tiger Experiment
algorithm_test.h
1 #ifndef ALGORITHM_TEST_H
2 #define ALGORITHM_TEST_H
3 
4 #include "algorithm.h"
5 
6 namespace etig {
7 
8 void test_Rebin() {
9  auto test_rebin = Rebin<float>();
10 
11  std::vector<float> time_series = { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5 };
12 
13  float f_res = 1.0f;
14  float t_int = 3.0f*2.0f/( f_res * 1e6 );
15 
16  test_rebin( time_series, f_res, t_int );
17  std::vector< float > rebinned_sig = test_rebin.RebinnedSignal();
18  uint rebin_size = test_rebin.RebinSize();
19 
20  std::cout << "Rebinned signal elements " << std::endl;
21 
22  for( const auto& elem : rebinned_sig ) {
23  std::cout << elem << std::endl;
24  }
25 
26  std::cout << "Rebinned signal size " << rebin_size << std::endl;
27 }
28 
29 }
30 
31 #endif // ALGORITHM_TEST_H
Definition: algorithm.cpp:16