#include <ProcessedNormalTester.h>
Inheritance diagram for FastShower::ProcessedNormalTester:
Public Methods | |
ProcessedNormalTester (bool verbose) | |
~ProcessedNormalTester () | |
virtual TestStat | test () |
virtual void | results () const |
Private Methods | |
TestStat | test1 () |
Private Attributes | |
TestStat | m_ts |
bool | m_verbose |
|
Definition at line 26 of file ProcessedNormalTester.h. References m_verbose.
00026 :m_verbose(verbose){} |
|
Definition at line 27 of file ProcessedNormalTester.h.
00027 {} |
|
Implements FastShower::ITester. Definition at line 16 of file ProcessedNormalTester.cxx.
|
|
Implements FastShower::ITester. Definition at line 64 of file ProcessedNormalTester.cxx. References m_ts.
|
|
Definition at line 21 of file ProcessedNormalTester.cxx. References FastShower::TestStat::incFail(), FastShower::TestStat::incPass(), and FastShower::ProcessedNormal::sample(). Referenced by test().
00021 { 00022 TestStat ts; 00023 std::vector<pair<double, double> > pars; 00024 pars.push_back( pair<double, double>(1., 0.) ); 00025 pars.push_back( pair<double, double>(2., 0.) ); 00026 pars.push_back( pair<double, double>(1., 1.) ); 00027 00028 std::vector<pair<double, double> >::const_iterator pptr = pars.begin(); 00029 std::vector<pair<double, double> >::const_iterator pend = pars.end(); 00030 00031 const int maxtry = 100000; 00032 const double dmaxtry = static_cast<double>(maxtry); 00033 00034 for(; pptr!=pend; ++pptr){ 00035 double a = (*pptr).first; 00036 double b = (*pptr).second; 00037 00038 const IDistProcessor* lp = new LinearProcessor(a, b); 00039 ProcessedNormal pn; 00040 00041 int i = 0; 00042 double sum = 0.; 00043 double sumsq = 0.; 00044 double samp; 00045 00046 for(; i!=maxtry; ++i){ 00047 samp=pn.sample(lp); 00048 // cout<< "a, b, samp "<<a<<" "<<b<<" "<<samp<<endl; 00049 sum+=samp; 00050 sumsq+=samp*samp; 00051 } 00052 00053 double mean = sum/dmaxtry; 00054 double var= (sumsq/dmaxtry)-( mean*mean ); 00055 00056 // cout<<"a,b "<<a<<" "<<b<<endl; 00057 // cout<<"mean, var: "<<mean<<" "<<var<<endl; 00058 00059 (abs(mean-b)<0.01 && abs(var-(a*a))<0.1) ? ts.incPass():ts.incFail(); 00060 } 00061 return ts; 00062 } |
|
Definition at line 34 of file ProcessedNormalTester.h. |
|
Definition at line 35 of file ProcessedNormalTester.h. Referenced by ProcessedNormalTester(). |