The geometry consists of a single block of a homogenous material, placed in a world.
Three parameters define the geometry :
The default is 20 cm of water.
In addition a transverse uniform magnetic field can be applied.
The default geometry is constructed in DetectorConstruction class, but all of the above parameters can be changed interactively via the commands defined in the DetectorMessenger class.
The size, matter, positions of several test-volumes (tallies) can be defined via UI commands : /testem/det/tally...
Physics lists can be local (eg. in this example) or from G4 kernel physics_lists subdirectory.
Local physics lists:
From geant4/source/physics_lists/builders:
Decay and StepMax processes are added to each list.
Optional components can be added:
Physics lists and options can be (re)set with UI commands
Please, notice that options set through G4EmProcessOptions are global, eg for all particle types. In G4 builders, it is shown how to set options per particle type.
The primary kinematic consists of a single particle which hits the block perpendicular to the input face. The type of the particle and its energy are set in the PrimaryGeneratorAction class, and can changed via the G4 build-in commands of G4ParticleGun class (see the macros provided with this example). The default is a 160 MeV proton.
In addition one can define randomly the impact point of the incident particle. The corresponding interactive command is built in PrimaryGeneratorMessenger class.
A RUN is a set of events.
The energy deposited in the test-volumes (tallies) defined in DetectorConstruction are printed at RunAction::EndOfRunAction(), both in MeV and gray.
The Visualization Manager is set in the main () (see TestEm7.cc). The initialisation of the drawing is done via the command
> /control/execute vis.mac
The detector has a default view which is a longitudinal view of the box.
The tracks are drawn at the end of event, and erased at the end of run. Optionally one can choose to draw all particles, only the charged one, or none. This command is defined in EventActionMessenger class.
% TestEm7 proton.mac
% TestEm7 .... Idle> type your commands .... Idle> exit
Testem7 computes the total energy deposited along the trajectory of the incident particle : the so-called Bragg peak.
In order to control the accuracy of the deposition, the user can limit the maximum allowed for the step size of charged particles. (command /testem/stepMax )
The result is a 1D histogram, which is the total energy deposited along the trajectory of the incident particle.
The bin size is equal to stepMax. The number of bins is determined by the thickness of the absorber (with a minimum of 100 bins). The total energy deposited is plotted in MeV/mm per incident particle.
The next histogram allows to have a zoom around the Bragg peak. Its binning should be defined via UI command:
/analysis/h1/set 2 nbins xmin xmax unit
The last histogram shows the projectile range. Its bining should be defined similary by the UI command:
/analysis/h1/set 3 nbins xmin xmax unit
One can control the name of the histograms file with the command:
/analysis/setFileName name (default testem7)
It is possible to choose the format of the histogram file : root (default), xml, csv, by using namespace in HistoManager.hh
It is also possible to print selected histograms on an ascii file:
/analysis/h1/setAscii id
All selected histos will be written on a file name.ascii (default testem7)