Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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
 
- Public Member Functions inherited from G4VGaussianQuadrature
 G4VGaussianQuadrature (function pFunction)
 
virtual ~G4VGaussianQuadrature ()
 
G4double GetAbscissa (G4int index) const
 
G4double GetWeight (G4int index) const
 
G4int GetNumber () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VGaussianQuadrature
G4double GammaLogarithm (G4double xx)
 
- Protected Attributes inherited from G4VGaussianQuadrature
function fFunction
 
G4doublefAbscissa
 
G4doublefWeight
 
G4int fNumber
 

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 python.hepunit::pi.

38  : G4VGaussianQuadrature(pFunction)
39 {
40  fNumber = nChebyshev ; // Try to reduce fNumber twice ??
41  G4double cof = pi/fNumber ;
42  fAbscissa = new G4double[fNumber] ;
43  fWeight = new G4double[fNumber] ;
44  for(G4int i=0;i<fNumber;i++)
45  {
46  fAbscissa[i] = std::cos(cof*(i + 0.5)) ;
47  fWeight[i] = cof*std::sqrt(1 - fAbscissa[i]*fAbscissa[i]) ;
48  }
49 }
G4VGaussianQuadrature(function pFunction)
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
G4GaussChebyshevQ::~G4GaussChebyshevQ ( )

Definition at line 54 of file G4GaussChebyshevQ.cc.

55 {
56 }

Member Function Documentation

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

Definition at line 64 of file G4GaussChebyshevQ.cc.

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

65 {
66  G4double xDiff=0.5*(b - a),
67  xMean=0.5*(a + b),
68  dx=0.0, integral=0.0 ;
69 
70  for(G4int i=0;i<fNumber;i++)
71  {
72  dx = xDiff*fAbscissa[i] ;
73  integral += fWeight[i]*fFunction(xMean + dx) ;
74  }
75  return integral *= xDiff ;
76 }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76

The documentation for this class was generated from the following files: