Warning, /geant4/examples/extended/medical/dna/molcounters/sdcounters/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 *** molcounters/sdcounters example ***
0008
0009 Author: C. Velten \
0010 Date: 7 April 2025 \
0011 Email: cv2415@columbia.edu
0012
0013 (c) The Geant4-DNA collaboration.
0014
0015 This example shows how to use the new molecule counter manager
0016 system and how to write custom molecule counters.
0017
0018 This example is provided by the Geant4-DNA collaboration.
0019
0020 The custom (spatially-aware) molecule counter used here
0021 is further described in:
0022 - Radiat. Phys. Chem. 212 (2023) 111194 \
0023 doi:10.1016/j.radphyschem.2023.111194
0024
0025 Any report or published results obtained using the Geant4-DNA software shall
0026 cite the following Geant4-DNA collaboration publications:
0027 - Med. Phys. 51 (2024) 5873–5889
0028 - Med. Phys. 45 (2018) e722-e739
0029 - Phys. Med. 31 (2015) 861-874
0030 - Med. Phys. 37 (2010) 4692-4708
0031 - Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0032
0033 ### Description:
0034
0035 1. __Geometry__:
0036 A box of liquid water with a 8 µm (radius) spherical cell placed at its center.
0037 The cell contains a 4 µm (radius) nucleus and 100 mitochondria.
0038
0039 2. __Incident particles__:
0040 Electrons with 1 keV energy, which can be changed in
0041 the simple_sbs.ini macro file.
0042 They are shot from the center of the box (inside the nucleus).
0043
0044 3. __Physics__:
0045 The default Geant4-DNA physics constructor 2 is used in
0046 the PhysicsList class with chemistry constructor 3.
0047
0048 4. __Molecule Counters__:
0049 Counters are defined and registered in the ActionInitialization
0050 class for master & workers using the BuildMoleculeCounters(), and
0051 BuildMultipleAndCustomMoleculeCounters() methods.
0052 To switch between either of these methods, change the
0053 boolean value of fBuildMultipleAndCustomMoleculeCounters in
0054 ActionInitialization.hh. \
0055 By default, the molecule counter manager will accumulate counts from
0056 worker instances into the master instance. To facilitate this the user
0057 __must__ create a `UserEventAction` and `UserRunAction` and override
0058 the `(Begin|End)Of(Event|Run)Action` methods and call the corresponding
0059 method on the `G4DNAChemistryManager::Instance()`. See the example's
0060 `EventAction.hh` and `RunAction.(hh|cc)` on how to do this. \
0061
0062 __`BuildMoleculeCounters()`:__
0063 * __[important]__ Reset counters before each event but not keep counter values between events. \
0064 This is required since our scorers will read out the molecule counters using
0065 their `EndOfEvent()` method and save the recorded molecules.
0066 * Register a `G4MoleculeCounter` instance called "BasicCounter":
0067 * set its time precision to 10 ps
0068 * Register a `G4MoleculeCounter` instance called "BasicCounter_VariablePrecision":
0069 * set its time precision to vary with global time:
0070 ```
0071 <= 10 ps: 5 ps
0072 <= 100 ps: 50 ps
0073 <= 1 ns: 0.5 ns
0074 <= 1 µs: 50 ns
0075 ```
0076 * Register a `G4MoleculeReactionCounter` instance called "Reactions":
0077 * set its time precision to 10 ps
0078
0079 5. __Multifunctional Detector & Primitive Scorers__:
0080 Two scorers are defined for molecule (`ScoreBasicMoleculeCounts`) and
0081 reaction (`ScoreBasicReactionCounts`) counts. The basic molecule scorers
0082 are instantiated once for each molecule counter.
0083 The results are saved as ROOT trees to a single file.
0084
0085 6. __Execute__ the code by running:
0086 `./sdcounters [simple_sbs.in,simple_irt_syn_react.in]` \
0087 The `simple_sbs.in` macro __only__ includes molecule transport (diffusion)!
0088
0089 7. __Output__: Visualize the molecule and reaction counts using the Python notebook `plotRoot.ipynb`. It does not require a ROOT installation but the following packages:
0090 `matplotlib pandas seaborn uproot`