Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

FastShower::ProcessedFlatTester Class Reference

#include <ProcessedFlatTester.h>

Inheritance diagram for FastShower::ProcessedFlatTester:

Inheritance graph
[legend]
Collaboration diagram for FastShower::ProcessedFlatTester:

Collaboration graph
[legend]
List of all members.

Public Methods

 ProcessedFlatTester (bool verbose)
 ~ProcessedFlatTester ()
virtual TestStat test ()
virtual void results () const

Private Methods

TestStat test1 ()

Private Attributes

TestStat m_ts
bool m_verbose

Constructor & Destructor Documentation

FastShower::ProcessedFlatTester::ProcessedFlatTester bool    verbose [inline]
 

Definition at line 26 of file ProcessedFlatTester.h.

References m_verbose.

00026 :m_verbose(verbose){}

FastShower::ProcessedFlatTester::~ProcessedFlatTester   [inline]
 

Definition at line 27 of file ProcessedFlatTester.h.

00027 {}

Member Function Documentation

TestStat FastShower::ProcessedFlatTester::test   [virtual]
 

Implements FastShower::ITester.

Definition at line 13 of file ProcessedFlatTester.cxx.

References m_ts, and test1().

00013                                     {
00014     m_ts+=this->test1();
00015     return m_ts;
00016   }

void FastShower::ProcessedFlatTester::results   const [virtual]
 

Implements FastShower::ITester.

Definition at line 65 of file ProcessedFlatTester.cxx.

References m_ts.

00065                                          {
00066     cout<<"ProcessedFlatTester: "<<m_ts;
00067     if(!m_ts) cout<<" Failures! ";
00068     cout<<endl;
00069   }

TestStat FastShower::ProcessedFlatTester::test1   [private]
 

Definition at line 18 of file ProcessedFlatTester.cxx.

References FastShower::TestStat::incFail(), FastShower::TestStat::incPass(), and FastShower::ProcessedFlat::sample().

Referenced by test().

00018                                      {
00019     TestStat ts;
00020     const IDistProcessor* lp1 = new LinearProcessor(1., 0.);
00021     const IDistProcessor* lp2 = new LinearProcessor(2., 0.);
00022     const IDistProcessor* lp3 = new LinearProcessor(1., 1.);
00023     ProcessedFlat pf;
00024 
00025     bool pass = true;
00026     const int maxtry = 1000;
00027 
00028     int i = maxtry;
00029     while(i!=0 && pass){
00030       --i;
00031       double samp=pf.sample(lp1);
00032       //      cout<<"[0,1) "<<samp<<endl;
00033       if (samp <0. || samp>=1.) pass = false;
00034     }
00035     pass ? ts.incPass():ts.incFail();
00036 
00037 
00038     pass = true;
00039     i = maxtry;
00040 
00041     while(i!=0 && pass){
00042       --i;
00043       double samp=pf.sample(lp2);
00044       //      cout<<"[0,2) "<<samp<<endl;
00045       if (samp <0. || samp>=2.) pass = false;
00046     }
00047     pass ? ts.incPass():ts.incFail();
00048 
00049 
00050     pass = true;
00051     i = maxtry;
00052 
00053     while(i!=0 && pass){
00054       --i;
00055       double samp=pf.sample(lp3);
00056       //      cout<<"[1,2) "<<samp<<endl;
00057       if (samp <1. || samp>=2.) pass = false;
00058     }
00059 
00060     pass ? ts.incPass():ts.incFail();
00061 
00062     return ts;
00063   }

Member Data Documentation

TestStat FastShower::ProcessedFlatTester::m_ts [private]
 

Definition at line 34 of file ProcessedFlatTester.h.

Referenced by results(), and test().

bool FastShower::ProcessedFlatTester::m_verbose [private]
 

Definition at line 35 of file ProcessedFlatTester.h.

Referenced by ProcessedFlatTester().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:56:50 2003 for FastShowerUtils by doxygen1.3-rc1