PAASS
Software suite to Acquire and Analyze Data from Pixie16
unittest-GslFitter.cpp
Go to the documentation of this file.
1 #include <iostream>
6 #include <stdexcept>
7 
8 #include <UnitTest++.h>
9 
10 #include "GslFitter.hpp"
11 #include "UnitTestSampleData.hpp"
12 
13 using namespace std;
14 using namespace unittest_trace_variables;
15 using namespace unittest_fit_variables;
16 
17 TEST_FIXTURE(GslFitter, TestGslFitter) {
18  //We need to set the QDC before the fit
19  SetQdc(21329.85714285);
20 
21  //Actually perform the fitting
22  double phase = CalculatePhase(waveform, fitting_parameters,
24 
25  CHECK_CLOSE(0.8565802, GetAmplitude(), 0.1);
26  CHECK_CLOSE(-0.0826487, phase, 1.);
27 }
28 
29 int main(int argv, char *argc[]) {
30  return (UnitTest::RunAllTests());
31 }
Implementation of the GSL fitting routine for GSL v2+.
STL namespace.
static const std::vector< double > waveform(trace_sans_baseline.begin()+71, trace_sans_baseline.begin()+86)
static const std::pair< double, double > fitting_parameters(0.2659404170, 0.2080547991796)
static const std::pair< unsigned int, double > max_pair(max_position, maximum_value)
This is the pair made from the expected maximum information.
static const std::pair< double, double > baseline_pair(baseline, standard_deviation)
This header provides sample data that can be used by Unit Tests to ensure proper functionality.
TEST_FIXTURE(GslFitter, TestGslFitter)
int main(int argv, char *argc[])