10 #include <tst/Verify.h>
12 #include <revt/Channel.h>
13 #include <revt/Station.h>
14 #include <utl/HannWindow.h>
15 #include <utl/AugerException.h>
16 #include <utl/AugerUnits.h>
17 #include <utl/PhysicalConstants.h>
20 #include <cppunit/extensions/HelperMacros.h>
34 CPPUNIT_TEST(testHannWindow);
35 CPPUNIT_TEST_SUITE_END();
53 long traceLength = 1000;
54 double windowWidth = 0.1;
56 HannWindow ourWindow(windowWidth, traceLength);
59 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(
long(windowWidth*traceLength)+1),1.0));
60 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(traceLength-
long(windowWidth*traceLength+1)),1.0));
62 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(traceLength-1),0.0));
64 double testLocation = 0.3;
67 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(testLocation*
long(windowWidth*traceLength)),0.5*(1-std::cos(2*
kPi*testLocation*
long(windowWidth*traceLength)/(
long(2*windowWidth*traceLength)-1)))));
68 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(traceLength-1-(testLocation*
long(windowWidth*traceLength))),0.5*(1-std::cos(2*
kPi*testLocation*
long(windowWidth*traceLength)/(
long(2*windowWidth*traceLength)-1)))));
75 CPPUNIT_ASSERT(Verify<Equal>(ourWindow.
GetTraceLength(),traceLength));
80 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(testLocation*
long(windowWidth*traceLength)),0.5*(1-std::cos(2*
kPi*testLocation*
long(windowWidth*traceLength)/(
long(2*windowWidth*traceLength)-1)))));
81 CPPUNIT_ASSERT(Verify<CloseTo>(ourWindow.
GetWeightAtBin(traceLength-1-(testLocation*
long(windowWidth*traceLength))),0.5*(1-std::cos(2*
kPi*testLocation*
long(windowWidth*traceLength)/(
long(2*windowWidth*traceLength)-1)))));
virtual double GetWeightAtBin(long parBin) const
Abstract base class for analytic windows.
virtual long GetTraceLength() const
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
virtual void SetTraceLength(long parTraceLength)