Warning, /geant4/examples/extended/medical/dna/microtrack/README.md is written in an unsupported language. File is not indexed.
0001 \page Examplemicrotrack Example microtrack
0002
0003 # Geant4-DNA microtrack example
0004
0005 Author: M. Galocha-Oliva, A. Baratto-Roldan, M.A. Cortés-Giraldo
0006 Date: 04 November 2025
0007 Email: miancortes@us.es
0008
0009 (c) The Geant4-DNA collaboration.
0010
0011
0012 ## 1. Introduction
0013
0014 The microtrack example presents a geometry to calculate microdosimetry
0015 quantities for ion tracks in liquid water at a given energy, ensuring secondary
0016 electron equilibrium when needed.
0017 At each event, a random track hit defines a spherical scoring site; weighted
0018 sampling is then used to estimate energy imparted and related quantities.
0019
0020 **Reference paper of this example:**
0021 - Front. Phys. 9 (2021) 726787
0022
0023 This example is provided by the Geant4-DNA collaboration.
0024
0025 Geant4-DNA processes and models are documented at:
0026 http://geant4-dna.org
0027
0028 Any report or published results obtained using the Geant4-DNA software shall
0029 cite the following Geant4-DNA collaboration publications:
0030 - Med. Phys. 51 (2024) 5873–5889
0031 - Med. Phys. 45 (2018) e722-e739
0032 - Phys. Med. 31 (2015) 861-874
0033 - Med. Phys. 37 (2010) 4692-4708
0034 - Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0035
0036
0037 ## 2. Geometry
0038
0039 - A box-shaped World of liquid water (`G4_WATER`) centered at the origin.
0040 - A box-shaped sensitive detector volume (`SDbox`) is created inside the world,
0041 centered at the origin. Its X/Y dimensions match those of the world.
0042
0043 The size of both volumes is determined by the parameters listed below:
0044
0045 Configurable geometry parameters:
0046 - `/mygeom/material <name>`: material of world/SD (default `G4_WATER`).
0047 - `/mygeom/maxRange <value> [um|mm|cm]`: maximum electron range.
0048 - `/mygeom/hitSelRegZ <value> [um|mm|cm]`: half-thickness of the central zone,
0049 within the SDbox, where energy transfer points (hits) are eligible for the
0050 random placement of the site.
0051 - `/mygeom/hitSelRegXY <value> [um|mm|cm]`: XY size of the central zone, within
0052 the SDbox, where energy transfer points (hits) are eligible for the random
0053 placement of the site.
0054 - `/mygeom/siteRadius <value> [um|mm|cm]`: radius of the site.
0055
0056
0057 ## 3. Particle source
0058
0059 - Primary generator: `G4ParticleGun` with one particle per event.
0060 The source Z0 position is typically set at the world edge, pointing towards the
0061 SDbox. To achieve the desired energy at the SDbox center, the user may want to
0062 set the energy considering the expected energy loss from Z0 to the center.
0063 - Example: protons at 20.13 MeV from z_0 = -50.99 um, to achieve 20 MeV at z=0.
0064
0065 Configurable beam parameters (via UI):
0066 - `/gun/particle <name>`: e.g., `proton`, `e-`, ions available via
0067 `G4DNAGenericIonsManager`.
0068 - `/gun/energy <value> [Energy]`: kinetic energy compensated with (dE/dz)*Z0.
0069 - `/beam/position/Z0 <value> [Length]`: source position along Z coordinate.
0070
0071 The example macro `run.mac` sets `proton` at 20.13 MeV and Z0 = -50.99 um.
0072
0073
0074 ## 4. Physics
0075
0076 - Default physics: `G4EmDNAPhysics_option2`.
0077 - Alternative lists can be selected at pre-init using:
0078 - `/physics/addPhysics dna_opt1|dna_opt2|dna_opt3|dna_opt4|dna_opt5|
0079 dna_opt6|dna_opt7|dna_opt8`
0080 - `/physics/addPhysics liv` (Livermore)
0081 - `/physics/addPhysics penelope`
0082 - `/physics/addPhysics em_standard_opt4`
0083
0084 Production cuts can be set:
0085 - `/run/setCutForAGivenParticle gamma <L>`
0086 - `/run/setCutForAGivenParticle e- <L>`
0087 - `/run/setCutForAGivenParticle e+ <L>`
0088 - `/run/setCutForAGivenParticle proton <L>`
0089
0090
0091 ## 5. Scoring
0092
0093 All energy depositions (Hits) are recorded in the sensitive detector. At end of
0094 each event:
0095 - One valid hit is randomly selected within the Hit Selection Region.
0096 - A spherical site (radius `siteRadius`) centered around a random offset within
0097 the sphere around this hit is defined. This procedure ensures that the
0098 spherical site sampled from a hit at the Hit Selection Region edge remains
0099 fully contained within `SDbox`.
0100 - For each event, we compute:
0101 - Edep: total energy imparted inside the site.
0102 - Nsel: number of hits in the Hit Selection Region.
0103 - Nsite: number of hits in the site.
0104 - Weighted and squared-weighted quantities are also histogrammed.
0105 - KinE_in / KinE_out at the SD boundary for primary particles.
0106
0107 Output produced via Geant4 analysis (ROOT by default, multi-thread merge enabled):
0108 - File: `microtrack.root` in the run directory.
0109 - Histograms:
0110 - H1[0]: f(E_{dep}) (single event energy imparted)
0111 - H1[1]: E_{dep} f(E_{dep}) (weighted single event energy imparted)
0112 - H1[2]: E_{dep}^2 f(E_{dep}) (squared-weighted single event energy imparted)
0113 - H1[3]: f(y) (lineal energy)
0114 - H1[4]: y f(y) (weighted lineal energy)
0115 - H1[5]: y^2 f(y) (squared-weighted lineal energy)
0116 - H1[6]: f(z) (specific energy)
0117 - H1[7]: z f(z) (weighted specific energy)
0118 - H1[8]: z^2 f(z) (squared-weighted specific energy)
0119 - H1[9]: N_{sel} (number of hits within the central selection region)
0120 - H1[10]: N_{site} (number of hits within the site)
0121 - H1[11]: N_{int} (number of hits within the site _and_ the central selection region)
0122 - H1[12]: KinE_in (kinetic energy of primaries at SDbox upstream plane)
0123 - H1[13]: KinE_out (kinetic energy of primaries at SBbox downstream plane)
0124 - H2[0]: N_{site} vs E_{dep}.
0125
0126
0127 ## 6. Build and run
0128
0129 Prerequisites:
0130 - Geant4 built with analysis, UI and visualization if desired.
0131
0132 Configure and build (out-of-source recommended):
0133
0134 ```bash
0135 mkdir build && cd build
0136 cmake ..
0137 make -j
0138 ```
0139
0140 Run in batch mode with provided macro:
0141
0142 ```bash
0143 ./microtrack run.mac
0144 ```
0145
0146 Interactive with visualization:
0147
0148 ```bash
0149 ./microtrack
0150 ```
0151
0152 In the UI session, the visualization is configured by `init_vis.mac` and
0153 `vis.mac`.
0154
0155 Multi-threading: Set threads before initialization, e.g. in macro:
0156 `/run/numberOfThreads 10`.
0157
0158
0159 ## 7. Example macro (run.mac)
0160
0161 The provided `run.mac` configures a water world/SD, considering
0162 G4EmDNAPhysics_option2, proton beam at 20.13 MeV from z = -50.99 um, sites radius
0163 of 0.5 um, and 20 events. See the file for details and as a template.
0164
0165
0166 ## 8. Notes and limitations
0167
0168 - Site selection uses a random hit within the Hit Selection Region; events
0169 with no eligible hits are skipped from analysis.
0170
0171
0172 ## 9. Acknowledgments and citations
0173
0174 This example is provided by the Geant4-DNA collaboration.
0175 Please cite the publications listed above.