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

FastShower::TriangleProcessor Class Reference

Processor to convert from a flat to a triangle dsitribution. More...

#include <TriangleProcessor.h>

Inheritance diagram for FastShower::TriangleProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef double EndPoint1
typedef double EndPoint2

Public Methods

 TriangleProcessor (EndPoint1 endPoint1, EndPoint2 endPoint2)
 Constructor parameters - no set methods to do on the fly!

 ~TriangleProcessor ()
virtual double process (double) const
 IDistProcessor interface.


Private Attributes

EndPoint1 m_endPoint1
EndPoint2 m_endPoint2

Detailed Description

Processor to convert from a flat to a triangle dsitribution.

UML: IDistributionClass.unm

Definition at line 21 of file TriangleProcessor.h.


Member Typedef Documentation

typedef double FastShower::TriangleProcessor::EndPoint1
 

Definition at line 37 of file TriangleProcessor.h.

Referenced by TriangleProcessor().

typedef double FastShower::TriangleProcessor::EndPoint2
 

Definition at line 38 of file TriangleProcessor.h.

Referenced by TriangleProcessor().


Constructor & Destructor Documentation

FastShower::TriangleProcessor::TriangleProcessor EndPoint1    endPoint1,
EndPoint2    endPoint2
[inline]
 

Constructor parameters - no set methods to do on the fly!

Definition at line 41 of file TriangleProcessor.h.

References EndPoint1, EndPoint2, m_endPoint1, and m_endPoint2.

00041                                                                :
00042       m_endPoint1(endPoint1),m_endPoint2(endPoint2){assert( fabs(m_endPoint1 - m_endPoint2)>0 );}
    ~TriangleProcessor(){}

FastShower::TriangleProcessor::~TriangleProcessor   [inline]
 

Definition at line 43 of file TriangleProcessor.h.

00043 {}

Member Function Documentation

double FastShower::TriangleProcessor::process double    const [virtual]
 

IDistProcessor interface.

Implements FastShower::IDistProcessor.

Definition at line 7 of file TriangleProcessor.cxx.

References m_endPoint1, and m_endPoint2.

00007                                                   {
00008     // example of a left triangle (endPoint1 < endPoint2)
00009     // Area       : A = m_area
00010     // lowerLimit : a = m_endPoint1
00011     // upperLimit : b = m_endPoint2
00012     // height     : h = 2 * A/(b - a)
00013     // 
00014     // distribution function: 
00015     //     Y' = f(x) = h * (x - a)/(b - a)
00016     // integral of the above (accumulated distribution):
00017     //     Y  = F(x) = A * (x - b)**2/(b - a)**2
00018     // 
00019     // normalized  :   y = Y/A
00020     // and inversed:   x = a + (b - a) * y**0.5
00021     // 
00022     // NOTE: this is independent of the area!!!
00023     //
00024 
00025     return m_endPoint1 + (m_endPoint2 - m_endPoint1) * std::sqrt(y);
00026   }

Member Data Documentation

EndPoint1 FastShower::TriangleProcessor::m_endPoint1 [private]
 

Definition at line 48 of file TriangleProcessor.h.

Referenced by process(), and TriangleProcessor().

EndPoint2 FastShower::TriangleProcessor::m_endPoint2 [private]
 

Definition at line 49 of file TriangleProcessor.h.

Referenced by process(), and TriangleProcessor().


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