Collection of examples to exercise the available functionality of the Julia bindings to Geant4. The idea was to separate this repository from the Julia package Geant4.jl since the examples carry additional dependencies to packages that provide visualization and data analysis functionality.
The examples are organised in 3 sections following more or less to the organisation of the Geant4 repository: basic, extended and advanced. As soon new functionality will be added to Geant4.jl, new examples will be added in this repository.
All examples are provided as Julia scripts and Jupyter notebooks at the same time. This is achieved by using the package Literate.jl
that uses a single input file to produce the different output formats. The script in src/literate.jl
does the conversion.
Finally, the examples in this repository as also used to generate the documentation of Geant4.jl
This is most basic example using a more Geant4 native interface. It is creating a geometry with two volumes and standard physcis.
Basic example of a calorimeter detector using a sensitive detector to collect 'hits'.
The example simulates schematically a Positron Emitted Tomography system. It uses a custom primary particle generator, a custom physics list and makes use of two sensitive detectors.
Notebook and script to exercise and visualize all implemented solid types.
This example comes from extended/electromagnetic/TestEm3 example. It is fully based on user actions. It comes with additional packages such as FHist.jl and Plots.jl to provide some data analysis and visualization ogf results.
Example using the Geant4 built-in scoring mechanism. A more complete example using scoring is the WaterPhantom
example in the advanced section.
Example using the General Particle Source primary particle generator class G4GeneralParticleSource
Example in a notebook format similar to RE03 but with different primary particle generator (MedicalBeam) and using the scoring mechanism. Plots are produced after each run.
Example of a bubble chamber in which we display the particle tracks for an event that passes the trigger. This example introduces a magnetic field.
Example from the original at https://github.com/settwi/g4-basic-scintillation and adapted to the Geant4.jl interface. Introduces optical photons and a custom physics list. It produces histograms as a result.
Example that shows how easy is to integrate several packages in Julia. The example uses the package PYTHIA8
to generate LEP collisions of e+ e- which are then input as primary particles to a Geant4
simulation. Only the event display is exercised of the simulation.
Example on how to build and call a user custom library providing additional Geant4 functionally that is not provided by the set of wrapped classes.