Warning, /geant4/examples/extended/eventgenerator/exgps/README is written in an unsupported language. File is not indexed.
0001
0002 Extended Example for G4GeneralParticleSource (GPS)
0003 --------------------------------------------------
0004
0005 exgps is created to demonstrate the usage of G4GeneralParticleSource
0006 for generating primary particle according to user defined distributions.
0007 These range from simple monocromatic point source to complicated mutiple
0008 sources with various biasing schemes.
0009
0010 http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides
0011 /ForApplicationDeveloper/html/ch02s07.html
0012
0013
0014 1 - GEOMETRY
0015
0016 Simple geometry consists of a "Vacuum" world and, in it, two other components:
0017 - An alunimium box : 20 x 20 x 20 cm in size, cerntered at the origin.
0018 - A SiO2 sphere (radius 5 cm) is placed at the centre of the aluminium box.
0019
0020 2 - PHYSICS
0021
0022 Tranportation process only for all particles.
0023
0024 3 - EVENT
0025
0026 The event generator is the G4GeneralParticleSource (GPS). The instantiation of
0027 G4GeneralParticleSource is same as that for G4ParticleGun.
0028 See the exGPSPrimaryGeneratorAction.cc file for details.
0029
0030 4 - VISUALIZATION
0031
0032 Visualisation of the geometry and the tracks is possible with many of the
0033 G4 visualisation packages.
0034 An example of displaying the geometry and tracks using OGL is given in the
0035 macro vis.mac.
0036
0037 5 - HISTOGRAMS
0038
0039 This example implements an histo manager which creates histograms and
0040 ntuples using Geant4 analysis tools.
0041
0042 The output file can contain the following histograms and one ntuple:
0043
0044 histo1D 1: energy spectrum.
0045 histo1D 2: vertex: radial distribution dN/dv.
0046 histo1D 3: angular distribution: cos(theta).
0047 histo1D 4: angular distribution: phi.
0048
0049 histo2D 1: vertex position in the X-Y plane.
0050 histo2D 2: vertex position in the X-Z plane.
0051 histo2D 3: vertex position in the Y-Z plane.
0052 histo2D 4: angular distribution: phi-cos(theta).
0053 histo2D 5: angular distribution: of phi-theta.
0054
0055 In the ntuple the following data are recorded for each incident particle:
0056
0057 Particle ID
0058 Kinetic energy (Ekin);
0059 Incident Position (x,y,z);
0060 Incident Angle (theta,phi);
0061 Particle weight;
0062
0063 The histograms are managed by G4AnalysisManager class and its Messenger.
0064 The histos, not activated by default, can be individually activated with the command :
0065 /analysis/h1/set id nbBins valMin valMax unit
0066 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
0067
0068 One can control the name of the histograms file with the command:
0069 /analysis/setFileName name (default exgps)
0070
0071 It is possible to choose the format of the histogram file : root (default),
0072 xml, csv, by using namespace in HistoManager.hh
0073
0074
0075 6 - GETTING STARTED
0076
0077 - execute exgps in 'batch' mode from macro files
0078 % exgps exgps.in
0079 % exgps exgps_MT.in # larger number of events
0080
0081 - execute exgps in 'interactive mode' with visualization
0082 % exgps
0083 ....
0084 Idle> type your commands
0085 ....
0086 Idle> exit
0087
0088 7 - FURTHER EXAMPLES of MACRO FILES
0089
0090 There are a number of mac files in the ./macros subdirectory, to show the
0091 various features of GPS.
0092 Please see README file there for further informations.
0093
0094 All test macros can be run via the 'runall.csh' script and the resulting ROOT
0095 files can be then analysed with the 'plotall.py' macro, calling internally
0096 'plotfiles.py':
0097
0098 % ./macros/runall.csh
0099 % python3 macros/plotall.py
0100
0101 In addition, the examples of ROOT macros plotHisto.C and plottest35.C are also available.