Skip to content

Commit

Permalink
Refactor all the notebooks and added placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
peremato committed Apr 11, 2024
1 parent ba92c1d commit a04df94
Show file tree
Hide file tree
Showing 28 changed files with 3,205 additions and 3,285 deletions.
6 changes: 6 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
FHist = "68837c9b-b678-4cd5-9925-8a54edc8f695"
Geant4 = "559df036-b7a0-42fd-85df-7d5dd9d70f44"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
IGLWrap_jll = "283677c1-8365-580c-84e5-ef4b5d190868"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"

[compat]
FHist = "0.10"
82 changes: 82 additions & 0 deletions tutorial/docs/01-introduction.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"# Introduction to Geant4.jl\n",
"\n",
"Geant4.jl provides the Julia bindings for the [Geant4](https://geant4.web.cern.ch) particle transportation toolkit. It is using [CxxWrap.jl](https://github.com/JuliaInterop/CxxWrap.jl) package to wrap C++ types and functions to Julia. Since the Geant4 toolkit is rather large and complex, writing the wrapper code by hand is not really an option. For this we use the package [WrapIt](https://github.com/grasph/wrapit) that automates the generation of the wrapper code making use of the clang library.\n",
"\n",
"Documentation of the concepts and how to write applications with the Geant4 toolkit can be found with the [Application Developer Guide](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/index.html) or the [Classes and Members reference guide](https://geant4.kek.jp/Reference/11.2.0/index.html) for a detailed description of each C++ class. In this tutorial we will only highlight the differences between the Julia and the C++ API. Therefore it is assumed some prior knowledge of the Geant4 C++ interfaces.\n",
"\n",
"## Installation\n",
"The Geant4.jl package does no require any special installation. Stable releases are registered to the Julia general registry, and therefore, it can be deployed with the standard `Pkg` Julia package manager.\n",
"\n",
"**Please note that the first time the `Geant4` package is added it may take some time since it downloads all the binary libraries and data files of Geant4** \n",
"\n",
"```julia\n",
"using Pkg\n",
"Pkg.add(\"Geant4\")\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Wrapped classes\n",
"The notebook [02-wrapped-classes.ipynb](02-wrapped-classes.ipynb) introduces some basics for the interaction with the Geant4 wrapped classes. it is important to follow it in order to get familiar with some basic concepts and the mapping between the Julia and C++ constructs. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Geant4 Julia interface\n",
"The main goal for defining a Geant4 application in the Julia interface is to create an instance of the `G4JLApplication` type. The instance is constructed specifying all the needed elements for running a Geant4 application as shown in the figure. In particular we need to define the detector geometry, the physics list, the primary particle generator, the type of run manager, the user actions, the sensitive detectors, etc.\n",
"\n",
"The type `G4JLApplication` is not a wrapped type from the underlying Geant4 toolkit, it has been added to facilitate development of applications. To distinguish these added types, we have prefixed them by `G4JL`. \n",
"\n",
"![Figure](assets/interfaces.png)\n",
"\n",
"In the following notebooks will describe and exercise each of these elements needed to build a complete application:\n",
"- [03-geometry.ipynb](03-geometry.ipynb) - to learn how to define detector geometries and materials\n",
"- [04-physics-list.ipynb](04-physics-list.ipynb) - to learn how to use predefined physics lists or compose new ones\n",
"- [05-primary-particles.ipynb](05-primary-particles.ipynb) - to learn how to define primary particles\n",
"- [06-field.ipynb](06-field.ipynb) - to learn how to define magnetic field\n",
"- [07-applications.ipynb](07-applications.ipynb) - building compete applications and using the UI interface to control them\n",
"- [08-sensitive-detectors.ipynb](08-sensitive-detectors.ipynb) - building applications with sensitive detectors\n",
"- [09-scoring-meshes.ipynb](09-scoring-meshes.ipynb) - building applications with scoring meshes\n",
"- [10-histograms.ipynb](10-histograms.ipynb) - to learn how to use the histogram extension to provide analysis functionality\n",
"- [11-event-display.ipynb](11-event-display.ipynb) - use the event display capability and learn how to customize it\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.10.0",
"language": "julia",
"name": "julia-1.10"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.10.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading

0 comments on commit a04df94

Please sign in to comment.