Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes related to multithreading #58

Merged
merged 183 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from 166 commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
515caee
Merge remote-tracking branch 'origin/lobis-remove-process-hardcoding'…
lobis Jun 20, 2022
29e7e6b
Merge remote-tracking branch 'origin/lobis-remove-biasing' into lobis…
lobis Jun 20, 2022
5b0d51d
Adding constructor to TRestGeant4Event and adding to manager
lobis Jun 20, 2022
f8ecc76
Initialization of OutputManager
lobis Jun 20, 2022
a3c0846
Added StackingAction, updated event insertion logic
lobis Jun 20, 2022
71c9cdc
Compilation works
lobis Jun 20, 2022
4b88326
working compilation
lobis Jun 20, 2022
8b6fac0
Added stepping verbose
lobis Jun 20, 2022
7ddf769
Fixed problem with stepping verbose
lobis Jun 20, 2022
afbeca1
Added SensitiveDetector class
lobis Jun 21, 2022
1eca511
using `size_t` for numbers
lobis Jun 21, 2022
d7c20f8
Storing per process energy in TRestGeant4Event
lobis Jun 21, 2022
6e1ec9a
Simplified installation output
lobis Jun 21, 2022
c2483d3
Merge remote-tracking branch 'origin/master' into lobis-prepare-for-m…
lobis Jun 21, 2022
d383bf6
Added subevent tag for decays, avoid counting "" as decay in validation
lobis Jun 21, 2022
f9e1a69
reverted cmake change
lobis Jun 21, 2022
2780541
Added missing event origin
lobis Jun 21, 2022
a81a8fc
Updated reference values of example
lobis Jun 21, 2022
a3932ac
Updated example ref values
lobis Jun 21, 2022
c8aae98
Updated reference value for decay (was counting "" as decay)
lobis Jun 21, 2022
dbddf42
Inserted correctly volume ID and hit KE
lobis Jun 22, 2022
98e80f0
Added variable for decay logic, no changes
lobis Jun 22, 2022
317f3be
Ignoring hits not in active volume
lobis Jun 22, 2022
f75cb08
Updated validation with new change of active volumes
lobis Jun 22, 2022
b4583a1
Updated validation with new change of active volumes for reference G4
lobis Jun 22, 2022
46c1e3c
Added example 06 to examples
lobis Jun 22, 2022
e0a620a
fix merge conflicts
lobis Jul 4, 2022
aaab4a8
SimulationManager - inserted references in event and tracks
lobis Jul 4, 2022
b979cdd
fix merge conflicts
lobis Jul 6, 2022
2213529
TRestGeant4PhysicsInfo - more tests
lobis Jul 6, 2022
474edaa
TRestGeant4Event - added new members to better track subevent info, u…
lobis Jul 6, 2022
95292b3
removed metadata injection from constructors
lobis Jul 6, 2022
8f0269f
updating decay validation to include primary decaying particle too
lobis Jul 6, 2022
41b01cb
fixed decay validation
lobis Jul 6, 2022
b57b08e
Update validation.yml
lobis Jul 6, 2022
4ef91b6
using G4RunManagerFactory
lobis Jul 7, 2022
3c3c108
updated MT logic
lobis Jul 7, 2022
ded49ff
cleaned UI command logic
lobis Jul 7, 2022
f9de596
fix MT initialization
lobis Jul 7, 2022
2fce679
Compatibility with older versions
lobis Jul 7, 2022
1d8a5b2
Multithreading example
lobis Jul 7, 2022
746f3e6
storing momentum as TVector3
lobis Jul 7, 2022
3ede16a
Added track length on stepping action
lobis Jul 7, 2022
e7d10ed
TRestGeant4Track: added secondaries
lobis Jul 7, 2022
6d624c2
track secondaries: Adding protection for nullptr
lobis Jul 7, 2022
f974145
fix segfault
lobis Jul 7, 2022
7220198
TRestGeant4Track - removed redundant track length
lobis Jul 7, 2022
e04bd0c
general cleaning
lobis Jul 7, 2022
8609e61
Updated track secondary handling
lobis Jul 8, 2022
24a9d2c
TRestGeant4Track - renamed some members
lobis Jul 8, 2022
a218e6f
Simplified primary generator
lobis Jul 8, 2022
10c66d6
unified some variable names
lobis Jul 8, 2022
1c0bed1
Simplified user distribution initialization
lobis Jul 8, 2022
3423472
Application: removed unnecessary line
lobis Jul 8, 2022
b483ecc
Application: fixing MT
lobis Jul 8, 2022
e717100
Simplified geometry saving
lobis Jul 8, 2022
0e24544
Added 06 example to ref version
lobis Jul 8, 2022
f7bd4af
Added 06 example to ref version - updated name
lobis Jul 8, 2022
d6b7d7b
SimulationManager - made rest members private and create accessors
lobis Jul 11, 2022
8c11bb9
Application - updated geometry writing
lobis Jul 12, 2022
309c4f9
uncommented example
lobis Jul 12, 2022
f5d5a6b
Added check for correct TGeoManager in file
lobis Jul 12, 2022
e951097
Merge remote-tracking branch 'origin/master' into lobis-prepare-for-m…
lobis Jul 13, 2022
57f2fc6
DetectorConstruction.cxx - simplified paths
lobis Jul 13, 2022
3036730
Attempt to fix segfaults on MT
lobis Jul 13, 2022
1d9c887
updates locking
lobis Jul 13, 2022
ca499a0
TRestGeant4PrimaryGeneratorInfo - updated initialization
lobis Jul 18, 2022
6c9112b
Simplified generator and TRestGeant4Metadata
lobis Jul 18, 2022
d829348
PrimaryGeneratorAction - addressed TODO
lobis Jul 18, 2022
0826cca
DetectorConstruction - raised error when from vol not found
lobis Jul 19, 2022
104c933
Starting to add formula support for angular/energy dist
lobis Jul 19, 2022
5793f6e
TRestGeant4Metadata - updated some member names
lobis Jul 19, 2022
c72f4fb
Using random cos2 angle from formula instead of th1d
lobis Jul 19, 2022
b8a3859
PrimaryGeneratorAction - implemented generator energy from formula
lobis Jul 19, 2022
806dee6
Updated parameter names preserving backwards comp
lobis Jul 19, 2022
d174326
EventAction - print update
lobis Jul 19, 2022
32c4e53
Merge branch 'lobis-prepare-for-multithreading' of https://github.com…
lobis Jul 20, 2022
b539981
Fixed example 09 validation bug
lobis Jul 20, 2022
e7e7dda
Updated example 06 to use average instead of one event
lobis Jul 20, 2022
326ec12
Updated examples
lobis Jul 20, 2022
af203c8
Updated muon validation ref values
lobis Jul 20, 2022
0a8cf99
Updated reference value for old geant4
lobis Jul 20, 2022
7c090bf
Reverted angular dist to fix bug
lobis Jul 20, 2022
907ce01
Application - print geometry info before run info
lobis Jul 20, 2022
e7324b3
Added example to check generators
lobis Jul 20, 2022
d0de8a4
Set XML version to `xml version="1.0"`
lobis Jul 20, 2022
d25b84b
Using circle to example 12
lobis Jul 20, 2022
c3555ea
Working example 12 validation
lobis Jul 20, 2022
ad2aed8
Using "formula" instead of "TH1D" in angular generator
lobis Jul 20, 2022
8e87d06
Example 04 - updated validation ref values for new seed
lobis Jul 20, 2022
56916f2
Added new example to github action
lobis Jul 20, 2022
65f7bc5
DetectorConstruction - cleaned output a bit
lobis Jul 21, 2022
3bce9b0
Updated formula generator logic
lobis Jul 21, 2022
eac364a
Using formula energy generator in example 12
lobis Jul 21, 2022
1692782
increased tolerance on muon example
lobis Jul 21, 2022
964e4ad
Fixed bug on energy generator
lobis Jul 25, 2022
17b2e1c
Added additional check for example 12
lobis Jul 25, 2022
35f3cd8
Added comment to example
lobis Jul 25, 2022
bde868f
Updated validation logic for example 12
lobis Jul 25, 2022
7c9d3ad
Added -n option to restG4 to set nEvents from cli
lobis Jul 27, 2022
9a9bb2b
Added option for "desired events on file"
lobis Jul 27, 2022
22f58f6
fixed potential segfault
lobis Jul 27, 2022
449fbbd
Fixed bug in MT
lobis Jul 27, 2022
37ac714
now all threads can write events (may make some simulations slower bu…
lobis Jul 27, 2022
f10334f
Simplified serial/MT selection
lobis Jul 27, 2022
f58d821
Adding parse of time expression for new option -S
lobis Jul 27, 2022
f51a4fc
working time limit to stop simulation
lobis Jul 27, 2022
c199ebe
Now simulation will attempt to save into disk after stop signal (CTRL+C)
lobis Jul 27, 2022
55a00cd
Adding stuff to README
lobis Jul 27, 2022
f4726b7
Made invalid rml message more clear
lobis Jul 28, 2022
65e6ac8
DetectorConstruction - simplified
lobis Jul 28, 2022
7e97c60
Fixed bug in assembly geometry
lobis Jul 28, 2022
5687905
Simplified EventAction
lobis Jul 28, 2022
71f07a1
Fixed bug on assembly geometry
lobis Jul 28, 2022
050f35e
-n and -N options are no longer incompatible
lobis Jul 28, 2022
1e11d2b
Improved print statements
lobis Jul 28, 2022
cc6f62c
Removed problematic code when using geantino
lobis Jul 28, 2022
3f7f130
Fixed bug introduced for assembly geometry
lobis Jul 28, 2022
37a3a54
Fixed bug with nEvents setting from rml
lobis Jul 29, 2022
6337003
Simplified command line options
lobis Jul 29, 2022
a78047d
fixed small bug
lobis Jul 29, 2022
3646286
Added cli banner
lobis Jul 29, 2022
1f070e8
Fixed bug with G4UI_USE
lobis Jul 29, 2022
9390d6e
Fixed arg parsing
lobis Jul 29, 2022
1540be0
Fixed bug when calling with single parameter
lobis Jul 29, 2022
d3494b9
Updated some error messages
lobis Jul 29, 2022
b0b4a8e
Starting to support multiple sensitive volumes
lobis Jul 29, 2022
eefbc20
Updated print for DetectorConstruction
lobis Jul 29, 2022
ffb6b6f
Updated storage section tu support multiple sensitive volumes (work i…
lobis Jul 29, 2022
a2cfc3b
Fixed bug with strings in active volume check
lobis Jul 29, 2022
a642e3e
Added method to reduce number of tracks not needed for analysis
lobis Jul 29, 2022
c9bbb01
Fixed multiple sensitive detectors not working
lobis Jul 29, 2022
a920357
Fixed bad print when exiting simulation early
lobis Jul 30, 2022
15d423d
Fixed random seed to avoid occasional pipeline failure
lobis Jul 30, 2022
40b4e1a
Handled more errors for `restG4` CLI
lobis Jul 30, 2022
2336afc
Added extra option for RemoveUnwantedTracks, fixed possible issue in …
lobis Jul 30, 2022
bb0c2c8
Fixed bug with default energy range
lobis Jul 30, 2022
98aa339
Allow to pass `-t 0` to signal serial mode (previously it was an error)
lobis Jul 31, 2022
0dcbe5a
Working on periodic print thread
lobis Jul 31, 2022
ff69014
Updated print to periodic function
lobis Jul 31, 2022
38e968a
Attempt to fix segfault
lobis Jul 31, 2022
7c99e9e
Attempt to fix segfault
lobis Jul 31, 2022
22e5257
Handle null pointers
lobis Jul 31, 2022
3030586
Added error message for when output path is not accessible
lobis Jul 31, 2022
1be9958
merge with origin/master
lobis Aug 1, 2022
7febe62
Updated examples
lobis Aug 1, 2022
6532cd8
Added validation for output file
lobis Aug 1, 2022
5d3930f
Extended validation to check for metadata keys
lobis Aug 1, 2022
ab6f971
Reordered prints
lobis Aug 3, 2022
e057db3
work in progress on alternative shaping process
lobis Aug 30, 2022
503ec5c
Time is now correctly stored as us instead of s
lobis Sep 1, 2022
5b697ff
Attempt to fix pipeline
lobis Sep 1, 2022
4a66b5e
Merge remote-tracking branch 'origin/master' into lobis-prepare-for-m…
lobis Sep 4, 2022
f8fb120
fixed bug with total energy not computed
lobis Sep 5, 2022
00b1533
simplified RML
lobis Sep 5, 2022
ecb5761
added example for IAXO
lobis Sep 5, 2022
ef5cde7
added example 13 to github pipeline
lobis Sep 5, 2022
d6a0452
added validation macro for new example 13
lobis Sep 5, 2022
5b7cb78
added more checks to validation
lobis Sep 5, 2022
a01a0de
added example 13 to tests
lobis Sep 6, 2022
2375268
correctly insert process type
lobis Sep 6, 2022
fbf9871
working on remove unwanted tracks bug
lobis Sep 6, 2022
a7db119
fixed bad parenthesis
lobis Sep 8, 2022
54421db
added check for number of tracks and hits
lobis Sep 8, 2022
73b708d
Correctly update fTrackIDToTrackIndex when removing tracks
lobis Sep 9, 2022
48d42f0
added comment
lobis Sep 9, 2022
393929c
SimulationManager - added back activation volumes with random chance
lobis Sep 12, 2022
0a0c8c5
moved code relative to Geant4Lib into separate file
lobis Sep 12, 2022
ed9b0b4
renamed "Desired" to "Requested"
lobis Sep 12, 2022
19223f3
made periodic print thread unique_ptr
lobis Sep 12, 2022
d6e7c81
attempt to fix pipeline
lobis Sep 12, 2022
483cb20
Revert "attempt to fix pipeline"
lobis Sep 13, 2022
ecd748f
removed problematic code
lobis Sep 13, 2022
1dfa1ee
fix small mistake in print
lobis Sep 13, 2022
0d36aa3
cleanup code for saving objects to file
lobis Sep 13, 2022
03c12d9
.gitlab-ci.yml - update decay value
lobis Sep 13, 2022
1d0bf69
saving geometry earlier in run
lobis Sep 13, 2022
3a83f72
writing geometry with TObject::kWriteDelete flag instead of kOverwrite
lobis Sep 13, 2022
824e949
updated example 13 (IAXO) - using good geometry
lobis Sep 13, 2022
299b6c3
Better formatting of print
lobis Sep 14, 2022
23c1674
Better formatting of print
lobis Sep 14, 2022
6486d1b
added method for better time printing
lobis Sep 14, 2022
5c5a8bd
avoid hardcoding max int value
lobis Sep 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
source ${{ env.REST_PATH }}/thisREST.sh
cd ${{ env.REST_PATH }}/examples/restG4/07.FullChainDecay/
restG4 fullChain.rml -o Run00001_U238_FullChainDecay.root
restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 16)'
restRoot -b -q Validate.C'("Run00001_U238_FullChainDecay.root", 17)'
restG4 singleDecay.rml -o Run00002_U238_SingleChainDecay.root
restRoot -b -q Validate.C'("Run00002_U238_SingleChainDecay.root", 1)'
export REST_ISOTOPE=Be7
Expand Down Expand Up @@ -374,6 +374,48 @@ jobs:
restManager --c analysis.rml --f xrays_simulation.root --o xrays_simulation_analysis.root
restRoot -b -q GetQE.C'("xrays_simulation_analysis.root")'

restG4-examples-12:
name: "Example 12: Generators"
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
needs: [ check-installation, restG4-examples-01 ]
steps:
- uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
id: framework-install-restG4-cache
with:
path: ${{ env.REST_PATH }}
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
- name: Run example
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd ${{ env.REST_PATH }}/examples/restG4/12.Generators/
restG4 CosineSquaredCircle.rml -o CosineSquaredCircle.root
restRoot -b -q Validate.C'("CosineSquaredCircle.root")'

restG4-examples-13:
name: "Example 13: IAXO"
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics
needs: [ check-installation, restG4-examples-10 ]
steps:
- uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
id: framework-install-restG4-cache
with:
path: ${{ env.REST_PATH }}
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
- name: Run example
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd ${{ env.REST_PATH }}/examples/restG4/13.IAXO/
restG4 Neutrons.rml -o Neutrons.root -e 1
restRoot -b -q Validate.C'("Neutrons.root")'

# Reference version of Geant4

framework-install-reference:
Expand Down Expand Up @@ -459,6 +501,28 @@ jobs:
restG4 NLDBD.rml -o Run00001_NLDBD_Test.root
restRoot -b -q Validate.C'("Run00001_NLDBD_Test.root")'


restG4-examples-06-reference:
name: "Reference Example 06: Ion recoils"
runs-on: ubuntu-latest
container:
image: ghcr.io/lobis/root-geant4-garfield:rest-for-physics-reference-jun2022
needs: [ framework-install-reference, check-installation-reference ]
steps:
- uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
id: framework-install-restG4-cache-reference
with:
path: ${{ env.REST_PATH }}
key: ${{ env.BRANCH_NAME }}-${{ github.sha }}
- name: Run example
run: |
source ${{ env.REST_PATH }}/thisREST.sh
cd ${{ env.REST_PATH }}/examples/restG4/06.IonRecoils/
restG4 recoils.rml -o Run00001_F20_Recoils.root
restRoot -b -q Validate.C'("Run00001_F20_Recoils.root")'

restG4-examples-07-reference:
name: "Reference Example 07: Decay"
runs-on: ubuntu-latest
Expand Down
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
[![pipeline status](https://gitlab.cern.ch/rest-for-physics/restg4/badges/master/pipeline.svg)](https://gitlab.cern.ch/rest-for-physics/restg4/-/commits/master)
[![Validation](https://github.com/rest-for-physics/restG4/actions/workflows/validation.yml/badge.svg)](https://github.com/rest-for-physics/restG4/actions/workflows/validation.yml)

This README must be written yet! :(
## Table of Contents

- Usage
- Structure of the output file

## Usage

Typing `restG4 -h` will show all available options.

### Basic Usage

`restG4 simulation.rml` will launch a simulation using `simulation.rml` as the configuration file. The output file will
be saved to the specified path in the configuration.

### Multithreading

`restG4` makes use of the multithreading capabilities of Geant4 and can be used in multithreading mode to significantly
increase simulation speed.

- `restG4 simulation.rml -t 8` will launch a simulation using 8 worker threads.

By default `restG4` is executed in serial mode (one single thread) and is equivalent to the `-t 0` option.

Simulation results are determined by the random seed and the number of threads, so using different number of threads
with the same seed will produce different results. Using the same seed and same number of threads produces the same
results.

The multithreading implementation of `restG4` is new and although it looks to work properly it may have some bugs. If
you find one of such bugs, please post an issue [here](https://github.com/rest-for-physics/restG4/issues) with
the `multithreading` label.

We encourage our users to use the multithreading feature especially when performing exploratory simulations.

### Overriding values from the RML

The CLI interface allows to set a few different parameters without having to modify the RML.

- `restG4 simulation.rml -o output.root` to specify the output file.
- `restG4 simulation.rml -n 1000` to set the number of processed events
(`n` in Geant4's `/run/beamOn n` or `nEvents` in the rml configuration).
- `restG4 simulation.rml -g geometry.gdml` to specify the geometry file.

### Ending the simulation early

The simulation run will naturally end when the selected number of events have been processed. They can either be
specified in the RML file or via the `-n` flag on the CLI. However, the user can also specify additional conditions to
end the simulation early.

- `restG4 simulation.rml -N 1000` will signal the simulation to stop once 1000 events have been marked as valid (saved
on the output file). The final simulation will probably have a slightly higher number of entries than the value
specified in the case of multithreading as the worker threads may still be working on valid events, or they may not
have been saved yet. The number of processed events (the equivalent of `nEvents`) will be adjusted to the real number
of processed events, overriding the selected value of the user, so the resulting simulation would be equivalent to a
plain simulation using this value as `nEvents`. This holds more accurately the large the `-N` parameter.
- `restG4 simulation.rml -S 1h20m30s` will signal the simulation to stop after 1 hour 20 minutes and 30 seconds have
elapsed since the start. You can specify any value using this format such as `1h15m`, `30s`, etc.
- Sending the interrupt signal (typically via `CTRL+C`) will signal the simulation to stop, and it will attempt to save
the results into disk before closing the process.

## Structure of the output file

TODO
14 changes: 8 additions & 6 deletions examples/01.NLDBD/NLDBD.rml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="4.0" encoding="UTF-8" standalone="no" ?>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!-- Constructing XML-like REST metadata input file
File : config.rml
Expand Down Expand Up @@ -56,8 +56,8 @@ By default REST units are mm, keV and degrees

///3. geant4 internal
<!--<source use="geant4" particle="Na22" excitedLevel="0.0" fullChain="on">
<angularDist type="isotropic" />
<energyDist type="mono" energy="0.0" units="MeV" />
<angular type="isotropic" />
<energy type="mono" energy="0.0" units="MeV" />
</source>-->
</generator>

Expand All @@ -67,10 +67,12 @@ By default REST units are mm, keV and degrees
<biasingVolume size="2050mm" position="(0,0,0)mm" factor="2" energyRange="(0,5)MeV"/>
</biasing>

<storage sensitiveVolume="gas">
<detector>
<parameter name="energyRange" value="(0,5)" units="MeV"/>
<activeVolume name="gas" chance="1" maxStepSize="1mm"/>
</storage>
<parameter name="activateAllVolumes" value="false"/>
<volume name="gas" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation.">
Expand Down
7 changes: 4 additions & 3 deletions examples/01.NLDBD/Validate.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Int_t Validate(const char* filename) {
const bool isReferenceGeant4Version = geant4Metadata->GetGeant4Version() == "10.4.3";

if (geant4Metadata->GetNumberOfActiveVolumes() != 1) {
cout << "The number of registered does not match the reference value of 1" << endl;
cout << "The number of active volumes does not match the reference value of 1. Value: "
<< geant4Metadata->GetNumberOfActiveVolumes() << endl;
return 7;
}

Expand All @@ -62,10 +63,10 @@ Int_t Validate(const char* filename) {
const double averageSensitiveEnergyRef = (!isReferenceGeant4Version) ? 2280.96 : 2221.55;

double averageNumberOfHits = 0;
const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 3071.17 : 342.37;
const double averageNumberOfHitsRef = (!isReferenceGeant4Version) ? 5371.17 : 353.2;

double averageNumberOfTracks = 0;
const double averageNumberOfTracksRef = (!isReferenceGeant4Version) ? 2161.43 : 10.11;
const double averageNumberOfTracksRef = (!isReferenceGeant4Version) ? 2300 : 10.83;

TVector3 averagePosition = {};
const TVector3 averagePositionRef = (!isReferenceGeant4Version) ? TVector3(-38.8987, 27.5536, 91.3969)
Expand Down
12 changes: 6 additions & 6 deletions examples/02.TREXDM/FullChainFromReadout.rml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@

<generator type="virtualWall" position="(0,0,158-1.25+0.001)mm" rotation="(0,0,0)" lenX="20cm" lenY="20cm">
<source particle="${REST_ISOTOPE}" excitedLevel="0.0" fullChain="on">
<angularDist type="isotropic"/>
<energyDist type="mono" energy="0.0" units="keV"/>
<angular type="isotropic"/>
<energy type="mono" energy="0.0" units="keV"/>
</source>
</generator>


<storage sensitiveVolume="gas">
<detector>
<parameter name="energyRange" value="(0,1)" units="GeV"/>
<activeVolume name="gas" chance="1" maxStepSize="${STEP_SIZE}"/>
</storage>
<volume name="gas" sensitive="true" maxStepSize="${STEP_SIZE}"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" file="common/physics.xml"/>
Expand Down
13 changes: 7 additions & 6 deletions examples/03.Fluorescence/electron.rml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="4.0" encoding="UTF-8" standalone="no" ?>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!-- Constructing XML-like REST metadata input file
File : config.rml
Expand Down Expand Up @@ -42,15 +42,16 @@ By default REST units are mm, keV and degrees

<generator type="point" position="(0,0,-200)" units="mm">
<source particle="e-">
<angularDist type="flux" direction="(0,0,1)"/>
<energyDist type="mono" energy="30.0" units="keV"/>
<angular type="flux" direction="(0,0,1)"/>
<energy type="mono" energy="30.0" units="keV"/>
</source>
</generator>

<storage sensitiveVolume="detector">
<detector>
<parameter name="energyRange" value="(0,30)" units="keV"/>
<activeVolume name="detector" chance="1" maxStepSize="1mm"/>
</storage>
<volume name="detector" sensitive="true" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation.">
Expand Down
13 changes: 7 additions & 6 deletions examples/03.Fluorescence/gamma.rml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="4.0" encoding="UTF-8" standalone="no" ?>
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!-- Constructing XML-like REST metadata input file
File : config.rml
Expand Down Expand Up @@ -41,15 +41,16 @@ By default REST units are mm, keV and degrees

<generator type="point" position="(0,0,-200)" units="mm">
<source particle="gamma">
<angularDist type="flux" direction="(0,0,1)"/>
<energyDist type="mono" energy="30.0" units="keV"/>
<angular type="flux" direction="(0,0,1)"/>
<energy type="mono" energy="30.0" units="keV"/>
</source>
</generator>

<storage sensitiveVolume="detector">
<detector>
<parameter name="energyRange" value="(0,30)" units="keV"/>
<activeVolume name="detector" chance="1"/>
</storage>
<volume name="detector" sensitive="true"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation.">
Expand Down
17 changes: 9 additions & 8 deletions examples/04.MuonScan/CosmicMuonsFromCircle.rml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<parameter name="gdmlFile" value="setup.gdml"/>
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="nEvents" value="5000"/>
<parameter name="nEvents" value="10000"/>

<parameter name="seed" value="17021981"/>
<parameter name="seed" value="1702198"/>
<parameter name="saveAllEvents" value="false"/>
<parameter name="printProgress" value="true"/>

Expand All @@ -29,16 +29,17 @@
position="(0,100,0)mm" size="(400,0,0)mm"
rotationAngle="90deg" rotationAxis="(1,0,0)">
<source particle="mu-" excitedLevel="0.0" fullChain="on">
<energyDist type="TH1D" file="Muons.root" spctName="cosmicmuon"/>
<angularDist type="TH1D" file="CosmicAngles.root" spctName="Theta2" direction="(0,-1,0)"/>
<energy type="TH1D" file="Muons.root" name="cosmicmuon"/>
<angular type="formula" name="Cos2" direction="(0,-1,0)"/>
</source>
</generator>

<storage sensitiveVolume="det_dw_01">
<detector>
<parameter name="energyRange" value="(0,10)" units="GeV"/>
<activeVolume name="det_dw_01" chance="1" maxStepSize="1mm"/>
<activeVolume name="det_up_01" chance="1" maxStepSize="1mm"/>
</storage>
<volume name="det_dw_01" sensitive="true" maxStepSize="1mm"/>
<volume name="det_up_01" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation." verboseLevel="warning">
Expand Down
14 changes: 8 additions & 6 deletions examples/04.MuonScan/CosmicMuonsFromWall.rml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ First concept author G. Luzón (16-11-2020) -->
<parameter name="subEventTimeDelay" value="100us"/>

<parameter name="nEvents" value="1000"/>
<parameter name="seed" value="17021981"/>

<parameter name="saveAllEvents" value="false"/>
<parameter name="printProgress" value="true"/>

<generator type="surface" shape="wall" position="(0,0,50)cm" size="(30,30,0)cm" rotationAngle="0"
rotationAxis="(1,0,0)">
<source particle="mu-" excitedLevel="0.0" fullChain="on">
<energyDist type="TH1D" file="Muons.root" spctName="cosmicmuon"/>
<angularDist type="TH1D" file="CosmicAngles.root" spctName="Theta2" direction="(0,0,-1)"/>
<energy type="TH1D" file="Muons.root" name="cosmicmuon"/>
<angular type="formula" name="Cos2" direction="(0,0,-1)"/>
</source>
</generator>

<storage sensitiveVolume="det_dw_01">
<detector>
<parameter name="energyRange" value="(0,10)" units="GeV"/>
<activeVolume name="det_dw_01" chance="1" maxStepSize="1mm"/>
<activeVolume name="det_up_01" chance="1" maxStepSize="1mm"/>
</storage>
<volume name="det_dw_01" sensitive="true" maxStepSize="1mm"/>
<volume name="det_up_01" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

<TRestGeant4PhysicsLists name="default" title="First physics list implementation." verboseLevel="warning">
Expand Down
12 changes: 6 additions & 6 deletions examples/04.MuonScan/Muon.rml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@

<generator type="point" position="(0,0,-50)cm">
<source particle="mu-" excitedLevel="0.0">
<energyDist type="mono" energy="100GeV"/>
<angularDist type="flux" direction="(0,0,1)"/>
<energy type="mono" energy="100GeV"/>
<angular type="flux" direction="(0,0,1)"/>
</source>
</generator>

<storage sensitiveVolume="det_dw_01">
<detector>
<parameter name="energyRange" value="(0,10)" units="GeV"/>
<activeVolume name="det_dw_01" chance="1" maxStepSize="1mm"/>
<activeVolume name="det_up_01" chance="1" maxStepSize="1mm"/>
</storage>
<volume name="det_dw_01" sensitive="true" maxStepSize="1mm"/>
<volume name="det_up_01" maxStepSize="1mm"/>
</detector>

</TRestGeant4Metadata>

Expand Down
Loading