Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GaussChebyshevQ Class Reference

#include <G4GaussChebyshevQ.hh>

+ Inheritance diagram for G4GaussChebyshevQ:

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::G4GaussChebyshevQ ( function  pFunction,
G4int  nChebyshev 
)

Definition at line 36 of file G4GaussChebyshevQ.cc.

38 : G4VGaussianQuadrature(pFunction)
39{
40 fNumber = nChebyshev ; // Try to reduce fNumber twice ??
41 G4double cof = pi/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}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
const G4double pi

◆ ~G4GaussChebyshevQ()

G4GaussChebyshevQ::~G4GaussChebyshevQ ( )

Definition at line 54 of file G4GaussChebyshevQ.cc.

55{
56}

Member Function Documentation

◆ Integral()

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

Definition at line 64 of file G4GaussChebyshevQ.cc.

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}

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