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 Fundamentals• G4UnitsTablePlaceholder <strong>for</strong> the system of units in <strong>Geant4</strong>.3.3. System of units3.3.1. Basic units<strong>Geant4</strong> offers the user the possibility to choose and use the preferred units <strong>for</strong> any quantity. In fact, <strong>Geant4</strong> takescare of the units. Internally a consistent set on units based on the HepSystemOfUnits is used:millimeter(mm)nanosecond(ns)Mega electron Volt (MeV)positron charge(eplus)degree Kelvin(kelvin)the amount of substance (mole)luminous intensity (candela)radian(radian)steradian(steradian)All other units are defined from the basic ones.For instance:millimeter = mm = 1;meter = m = 1000*mm;...m3 = m*m*m;...In the file $CLHEP_BASE_DIR/include/CLHEP/Units/SystemOfUnits.h from the CLHEP installation,one can find all untis definitions.One can also change the system of units to be used by the kernel.3.3.2. Input your data3.3.2.1. Avoid 'hard coded' dataThe user must give the units <strong>for</strong> the data to introduce:G4double Size = 15*km, KineticEnergy = 90.3*GeV, density = 11*mg/cm3;<strong>Geant4</strong> assumes that these specifications <strong>for</strong> the units are respected, in order to assure indeipendence from theunits chosen in the client application.If units are not specified in the client application, data are implicitly treated in internal <strong>Geant4</strong> system units; thispractice is however strongly discouraged.If the data set comes from an array or from an external file, it is strongly recommended to set the units as soonas the data are read, be<strong>for</strong>e any treatment. For instance:<strong>for</strong> (int j=0, j

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

Saved successfully!

Ooh no, something went wrong!