#include <TriangleProcessor.h>
Inheritance diagram for FastShower::TriangleProcessor:
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 |
UML: IDistributionClass.unm
Definition at line 21 of file TriangleProcessor.h.
|
Definition at line 37 of file TriangleProcessor.h. Referenced by TriangleProcessor(). |
|
Definition at line 38 of file TriangleProcessor.h. Referenced by TriangleProcessor(). |
|
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(){} |
|
Definition at line 43 of file TriangleProcessor.h.
00043 {} |
|
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 } |
|
Definition at line 48 of file TriangleProcessor.h. Referenced by process(), and TriangleProcessor(). |
|
Definition at line 49 of file TriangleProcessor.h. Referenced by process(), and TriangleProcessor(). |