Warning, /geant4/examples/advanced/purging_magnet/README is written in an unsupported language. File is not indexed.
0001 -------------------------------------------------------------------
0002
0003 =========================================================
0004 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005 =========================================================
0006
0007 purgin_magnet
0008 -------------
0009 s. Larsson, May 2004
0010
0011 -----------------------------------------------------------------
0012 Acknowledgments to the GEANT4 Collaboration, in particular to J. Apostolakis,
0013 J Generowicz, G. Folger, Vladimir Ivanchenko, M.G.Pia and
0014 S. Guatelli.
0015 -----------------------------------------------------------------
0016
0017 0. Introduction
0018 ----------------
0019
0020 This example simulates electrons traveling through a 3D magnetic field.
0021
0022 The Purging Magnet example is an application of Geant4 in a medical
0023 environment. It simulates a strong purging magnet in a treatment head.
0024 The geometry is very simplified. The major idea of this example is to
0025 implement an external magnetic field grid and test if the deviation of
0026 electrons are as expected in this particular field. The data (position,
0027 energy and momentum) are collected in a measurement volume. The data is
0028 stored in a CSV file (or, optionally in a ROOT, or a XML file, by changing
0029 the G4AnalysisManager default file type in PurgMagRunAction::Book().
0030
0031 <<<<<<< HEAD
0032
0033 =======
0034 >>>>>>> Migration to G4RunManagerFactory done.
0035 1. Setting up the environment variables
0036 ---------------------------------------
0037
0038 The following environment variables need to be set:
0039
0040 G4LEDATA: points to low energy data base
0041
0042 The required data-file for the detailed field map can be downloaded from:
0043 http://cern.ch/geant4-data/datasets/PurgMag3D.TABLE.gz
0044
0045
0046 2. How to run the example
0047 -------------------------
0048
0049 - Run the "PurgMag" executable.
0050 - File PurgMag.TABLE needs to be available in the current directory in order to run correctly.
0051 - For visualisation use vis.mac.
0052 - Interactive or batch modes possible.
0053 Default: Interactive mode.
0054
0055 To run a certain number of events in interactive mode,
0056 type the following at the "idle>" prompt:
0057
0058 idle> run/beamOn NumberOfEvents
0059 idle> exit
0060
0061 - Simulation histogram output is stored in purgmag_101.cvs (e-),
0062 purgmag_102.cvs (gammas), purgman_103.cvs (e+)
0063
0064 1)Ntuple with position, energy and momentum for electrons
0065 2)Ntuple with position, energy and momentum for photons
0066 (not needed in this example, will be used in further development)
0067 3)Ntuple with position, energy and momentum for positrons
0068 (not needed in this example, will be used in further development)
0069
0070 A default visualisation macro (vis.mac) is pre-loaded before interactive runs.
0071 Executing it from the build directory:
0072 $ ./PurgMag
0073 runs vis.mac before giving you an interactive prompt.
0074
0075
0076 3. Detector description
0077 -----------------------
0078
0079 Simply a measurement volume. All particles entering the volume are scored.
0080
0081
0082 4. Physics processes
0083 --------------------
0084
0085 This example uses the standard Electromagnetic processes.
0086
0087
0088 5. Particle Generator
0089 ----------------------
0090
0091 The PurgMagPrimaryGeneratorAction sets the initial state of tracks to
0092
0093 -electrons 50MeV
0094 -Start position (0, 0, 15cm)
0095 -Momentum direction (0, 0, -1)
0096
0097
0098 6. Geometry and materials
0099 --------------------------
0100
0101 The world consists of Vacuum to minimize interactions of the electrons
0102 with the medium. The purging magnet is implemented as a 3D field grid
0103 of field values and geometerically as a pole gap made of iron. The
0104 measurement volume also contains vacuum.
0105
0106 The field is interpolated using a simple linear interpolation in two
0107 dimensions (z and rho).
0108
0109 7. Comparison
0110 --------------
0111
0112 The design of the magnetic field was made with the OPERA 3D package
0113 which is an electromagnetic finite element and finite difference
0114 analysis software. The deviation in the y-direction (ey in Ntuple 1)
0115 has also been calculated in the OPERA 3D module TOSCA for comparison.
0116
0117 TOSCA: deviation y-direction: 35.112 cm
0118 GEANT4: deviation y-direction: 35.170 cm (updated after PurgMag.pdf)
0119
0120 ****************************************************************
0121 * *
0122 * More information about the setup and geometry in PurgMag.pdf *
0123 * *
0124 ****************************************************************