It is a simple box which represents a 'semi infinite' homogeneous medium.
Two parameters define the geometry :
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.
Physics lists are based on modular design. Several modules are instantiated:
EM physics builders can be local (eg. in this example) or from G4 kernel physics_lists subdirectory.
Local physics builder:
From geant4/source/physics_lists/builders:
Physics lists and options can be (re)set with UI commands
A few commands have been added to PhysicsList, in order to set the production threshold for secondaries for gamma and e-/e+.
The primary kinematic consists of a single particle starting at the left face of the box. The type of the particle and its energy are set in the PrimaryGeneratorAction class, and can be changed via the G4 build-in commands of G4ParticleGun class (see the macros provided with this example).
In addition one can choose randomly the impact point of the incident particle. The corresponding interactive command is built in PrimaryGeneratorMessenger.
The Visualization Manager is set in the main () (see TestEm1.cc). The initialisation of the drawing is done via the commands /vis/... in the macro vis.mac. To get visualisation:
> /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.
The particle's type and the physics processes which will be available in this example are set in PhysicsList class.
A set of macros defining various run conditions are provided. The processes are actived/inactivated together with differents cuts, in order to survey the processes one by one.
The number of produced secondaries are counted, the number of steps, and the number of process calls responsible of the step.
% TestEm1 runs.mac
% TestEm1 .... Idle> type your commands .... Idle> exit
Macros provided in this example:
Macros to be run interactively:
In order to control the accuracy of the deposition, the user can limit 'by hand' the maximum step size of charged particles. As an example, this limitation is implemented as a 'full' process : see StepMax class and its Messenger. The 'StepMax process' is registered in the Physics List.
Testem1 produces several histo which are saved as testem1.root by default. Content of these histo:
The histograms are managed by G4AnalysisManager class and its Messenger. The histos can be individually activated with the command : /analysis/h1/set id nbBins valMin valMax unit where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
One can control the name of the histograms file with the command:
/analysis/setFileName name (default testem1)
It is possible to choose the format of the histogram file : root (default), hdf5, xml, csv, by changing the default file type in HistoManager.cc
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 testem1)