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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Toolkit Fundamentals3.2.1. Signature of <strong>Geant4</strong> classesIn order to keep an homogeneous naming style, and according to the <strong>Geant4</strong> coding style conventions, eachclass part of the <strong>Geant4</strong> kernel has its name beginning with the prefix G4, e.g., G4VHit, G4GeometryManager,G4ProcessVector, etc. Instead of the raw C types, G4 types are used within the <strong>Geant4</strong> code. For the basic numerictypes (int, float, double, etc.), different compilers and different plat<strong>for</strong>ms provide different value ranges.In order to assure portability, the use of G4int, G4float, G4double, G4bool, globally defined, is preferable. G4types implement the right generic type <strong>for</strong> a given architecture.3.2.1.1. Basic typesThe basic types in <strong>Geant4</strong> are considered to be the following:• G4int,• G4long,• G4float,• G4double,• G4bool,• G4complex,• G4String.which currently consist of simple typedefs to respective types defined in the CLHEP, STL or system libraries.Most definitions of these basic types come with the inclusion of a single header file, globals.hh. This file alsoprovides inclusion of required system headers, as well as some global utility functions needed and used withinthe <strong>Geant4</strong> kernel.3.2.1.2. Typedefs to CLHEP classes and their usageThe following classes are typedefs to the corresponding classes of the CLHEP (Computing Library <strong>for</strong> HighEnergy Physics) distribution. For more detailed documentation please refer to the CLHEP reference guide andthe CLHEP user manual .• G4ThreeVector, G4RotationMatrix, G4LorentzVector and G4LorentzRotationVector classes: defining 3-component (x,y,z) vector entities, rotation of such objects as 3x3 matrices, 4-component(x,y,z,t) vector entities and their rotation as 4x4 matrices.• G4Plane3D, G4Trans<strong>for</strong>m3D, G4Normal3D, G4Point3D, and G4Vector3DGeometrical classes: defining geometrical entities and trans<strong>for</strong>mations in 3D space.3.2.2. The HEPRandom module in CLHEPThe HEPRandom module, originally part of the <strong>Geant4</strong> kernel, and now distributed as a module of CLHEP,has been designed and developed starting from the Random class of MC++, the original CLHEP's HepRandommodule and the Rogue Wave approach in the Math.h++ package. For detailed documentation on the HEPRandomclasses see the CLHEP reference guide and the CLHEP user manual .In<strong>for</strong>mation written in this manual is extracted from the original manifesto distributed with the HEPRandompackage.The HEPRandom module consists of classes implementing different random ``engines'' and different random``distributions''. A distribution associated to an engine constitutes a random ``generator''. A distribution class cancollect different algorithms and different calling sequences <strong>for</strong> each method to define distribution parameters orrange-intervals. An engine implements the basic algorithm <strong>for</strong> pseudo-random numbers generation.There are 3 different ways of shooting random values:35

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

Saved successfully!

Ooh no, something went wrong!