You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/tutorials/geant4_ssd_lit.jl
+19-22Lines changed: 19 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
# # Geant4 Support
2
2
3
3
# SolidStateDetectors.jl provides an extension for Geant4.jl.
4
-
#This extension allows to simulate realistic event distributions resulting from particles emitted by a given source, which can be used as input to the waveform simulation.
4
+
#The extension allows users to generate realistic event distributions resulting from particles emitted by a specified source, which could then in turn also be used as input for a waveform simulation.
5
5
#
6
6
# To use the extension, both `SolidStateDetectors` and `Geant4` have to be loaded.
7
7
8
8
using SolidStateDetectors
9
9
using Geant4
10
10
11
-
# In order to run `Geant4` simulations, a `Geant4.G4JLApplication` needs to be defined based on the detector geometry and the particle source.
12
-
# The extension features a function that creates a `Geant4.G4JLApplcation` from an SSD `Simulation` object and a particle source.
11
+
# In order to run Geant4 simulations, a `Geant4.G4JLApplication` needs to be defined, which needs to include both the detector geometry and the particle source.
12
+
# The extension features a function that creates a `Geant4.G4JLApplcation` object from a SSD `Simulation` object and a particle source.
13
13
14
14
using Plots
15
15
using Unitful
@@ -18,7 +18,7 @@ using Unitful
18
18
#
19
19
# #### 1. `MonoenergeticSource`
20
20
#
21
-
# This source emits particles of the same type and same energy.
21
+
# This source emits particles with a fixed type and energy.
# - The particle type is given as a string (e.g. `"e-"` or `"gamma"`) and directly passed to `Geant4`. See the `Geant4` documentation on how to name the desired particle type.
32
-
# - The energy of the emitted particles is passed as a number with unit.
32
+
# - The energy of the emitted particles is passed as a number with the required unit.
33
33
# - The `position` of the particle source relative to the origin is defined by a `CartesianPoint` (in units of `m`).
34
-
# - The source can emit particles in a given `direction` if a `CartesianVector` is provided.
35
-
# If not, the emission is isotropic.
36
-
# - If an `opening_angle` is provided, the source emits via a directed cone with the defined opening angle.
34
+
# - The source emits particles in a given `direction`, specified by a `CartesianVector` object. If the user provides no direction, the emission will be isotropic.
35
+
# - If an `opening_angle` is provided, the particles are emitted in a directed cone with the specified opening angle.
37
36
38
37
# #### 2. `IsotopeSource`
39
38
#
@@ -50,7 +49,7 @@ source_2 = IsotopeSource(
50
49
)
51
50
52
51
# The source is defined using
53
-
# - The number of protons `Z` and the number of nucleons `A` in the isotope. <br/>
52
+
# - The number of protons `Z` and the number of nucleons `A` in the isotope.
54
53
# - The excitation energy
55
54
# - The charge of the isotope
56
55
# - The position, direction and opening angle from the source can be defined in the same way as for a `MonoenergeticSource`
@@ -69,13 +68,12 @@ plot!(source_1)
69
68
70
69
# A `Geant4.G4JLApplication` is built from a SSD `Simulation` `sim` and one of the previously defined particle sources, e.g. `source_1`.
71
70
#
72
-
# Internally, a GDML file is created that is subsequently read in by `Geant4.jl`. <br/>
73
-
# If needed, the resulting GDML file can also be saved by using the `Geant4.G4JLDetector(sim, "output_filename.gdml")` command.
71
+
# Internally, the translated geometry description is written to a temporary GDML file. This file will in turn be read in by `Geant4.jl` and deleted afterwards. However, if needed, the resulting GDML file can also be saved by using the `Geant4.G4JLDetector(sim, "output_filename.gdml", save_gdml = true)` function.
#The method `run_geant4_simulation` is used to generate a given number of events.
76
+
#Having defined a `G4JLApplication`, it is now possible to generate events using the `run_geant4_simulation` function. The function will continue running until the desired number of energy depositions have been recorded.
0 commit comments