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 contains 6 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 histo2D 1: vertex position in the X-Y plane.
0049 histo2D 2: vertex position in the X-Z plane.
0050 histo2D 3: vertex position in the Y-Z plane.
0051 histo2D 4: angular distribution: phi-cos(theta).
0052 histo2D 5: angular distribution: of phi-theta.
0053
0054 In the ntuple the following data are recorded for each incident particle:
0055
0056 Particle ID
0057 Incident Position (x,y,z);
0058 Incident Angle (theta,phi);
0059 Particle weight;
0060
0061 The histograms are managed by G4AnalysisManager class and its Messenger.
0062 The histos can be individually activated with the command :
0063 /analysis/h1/set id nbBins valMin valMax unit
0064 where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
0065
0066 One can control the name of the histograms file with the command:
0067 /analysis/setFileName name (default exgps)
0068
0069 It is possible to choose the format of the histogram file : root (default),
0070 xml, csv, by using namespace in HistoManager.hh
0071
0072
0073 6 - GETTING STARTED
0074
0075 - execute exgps in 'batch' mode from macro files
0076 % exgps exgps.in
0077
0078 - execute exgps in 'interactive mode' with visualization
0079 % exgps
0080 ....
0081 Idle> type your commands
0082 ....
0083 Idle> exit
0084
0085 7 - FURTHER EXAMPLES of MACRO FILES
0086
0087 There are a number of mac files in the ./macros subdirectory, to show the
0088 various features of GPS.
0089 Please see README file there for further informations.
0090
0091
0092