G4GaussChebyshevQ Class Reference

#include <G4GaussChebyshevQ.hh>

Inheritance diagram for G4GaussChebyshevQ:

G4VGaussianQuadrature

Public Member Functions

 G4GaussChebyshevQ (function pFunction, G4int nChebyshev)
 ~G4GaussChebyshevQ ()
G4double Integral (G4double a, G4double b) const

Detailed Description

Definition at line 63 of file G4GaussChebyshevQ.hh.


Constructor & Destructor Documentation

G4GaussChebyshevQ::G4GaussChebyshevQ ( function  pFunction,
G4int  nChebyshev 
)

Definition at line 36 of file G4GaussChebyshevQ.cc.

References G4VGaussianQuadrature::fAbscissa, G4VGaussianQuadrature::fNumber, G4VGaussianQuadrature::fWeight, and G4INCL::Math::pi.

00038    : G4VGaussianQuadrature(pFunction)
00039 {
00040    fNumber = nChebyshev  ;   // Try to reduce fNumber twice ??
00041    G4double cof = pi/fNumber ;
00042    fAbscissa = new G4double[fNumber] ;
00043    fWeight = new G4double[fNumber] ;
00044    for(G4int i=0;i<fNumber;i++)
00045    {
00046       fAbscissa[i] = std::cos(cof*(i + 0.5)) ;
00047       fWeight[i] = cof*std::sqrt(1 - fAbscissa[i]*fAbscissa[i]) ;
00048    }
00049 }

G4GaussChebyshevQ::~G4GaussChebyshevQ (  ) 

Definition at line 54 of file G4GaussChebyshevQ.cc.

00055 {
00056 }


Member Function Documentation

G4double G4GaussChebyshevQ::Integral ( G4double  a,
G4double  b 
) const

Definition at line 64 of file G4GaussChebyshevQ.cc.

References G4VGaussianQuadrature::fAbscissa, G4VGaussianQuadrature::fFunction, G4VGaussianQuadrature::fNumber, and G4VGaussianQuadrature::fWeight.

00065 {
00066    G4double xDiff=0.5*(b - a),
00067             xMean=0.5*(a + b),
00068             dx=0.0, integral=0.0 ;
00069    
00070    for(G4int i=0;i<fNumber;i++)
00071    {
00072       dx = xDiff*fAbscissa[i] ;
00073       integral += fWeight[i]*fFunction(xMean + dx)  ;
00074    }
00075    return integral *= xDiff ;
00076 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:02 2013 for Geant4 by  doxygen 1.4.7