12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Toolkit Fundamentals3.2.3. The HEPNumerics moduleA set of classes implementing numerical algorithms has been developed in <strong>Geant4</strong>. Most of the algorithms andmethods have been implemented mainly based on recommendations given in the books:• B.H. Flowers, ``An introduction to Numerical Methods In C++'', Claredon Press, Ox<strong>for</strong>d 1995.• M. Abramowitz, I. Stegun, ``Handbook of mathematical functions'', DOVER Publications INC, New York1965 ; chapters 9, 10, and 22.This set of classes includes:• G4ChebyshevApproximationClass creating the Chebyshev approximation <strong>for</strong> a function pointed by fFunction data member. The Chebyshevpolynomial approximation provides an efficient evaluation of the minimax polynomial, which (among all polynomialsof the same degree) has the smallest maximum deviation from the true function.• G4DataInterpolationClass providing methods <strong>for</strong> data interpolations and extrapolations: Polynomial, Cubic Spline, ...• G4GaussChebyshevQ• G4GaussHermiteQ• G4GaussJacobiQ• G4GaussLaguerreQClasses implementing the Gauss-Chebyshev, Gauss-Hermite, Gauss-Jacobi, Gauss-Laguerre and Gauss-Legendrequadrature methods. Roots of orthogonal polynomials and corresponding weights are calculated basedon iteration method (by bisection Newton algorithm).• G4IntegratorTemplate class collecting integrator methods <strong>for</strong> generic functions (Legendre, Simpson, Adaptive Gauss, Laguerre,Hermite, Jacobi).• G4SimpleIntegrationClass implementing simple numerical methods (Trapezoidal, MidPoint, Gauss, Simpson, Adaptive Gauss, <strong>for</strong>integration of functions with signature: double f(double).3.2.4. General management classesThe `global' category defines also a set of `utility' classes generally used within the kernel of <strong>Geant4</strong>. These classesinclude:• G4AllocatorA class <strong>for</strong> fast allocation of objects to the heap through paging mechanism. It's meant to be used by associatingit to the object to be allocated and defining <strong>for</strong> it new and delete operators via MallocSingle() andFreeSingle() methods of G4Allocator.Note: G4Allocator assumes that objects being allocated have all the same size <strong>for</strong> the type they represent.For this reason, classes which are handled by G4Allocator should avoid to be used as base-classes <strong>for</strong> others.Similarly, base-classes of sub-classes handled through G4Allocator should not define their (eventuallyempty) virtual destructors inlined; such measure is necessary in order also to prevent bad aliasing optimisationsby compilers which may potentially lead to crashes in the attempt to free allocated chunks of memory whenusing the base-class pointer or not.The list of allocators implicitely defined and used in <strong>Geant4</strong> is reported here:- events (G4Event): anEventAllocator39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!