Several times the question came up on how RAINIER can be linked with GEANT4. Of course, there is many ways, but I will describe one possible solution here.
Idea
- Simulate all cascades with RAINIER
- Make sure to save the cascades to a root tree:
|
// #define bSaveTree // to save cascades to a ROOT tree in the RunXXXX.root file |
- Extract cascades from the root tree to some format readable by your GEANT4 simulations
- Run the geant4 simulation
- (Extract the information you care for from there)
Example
- Run RAINIER e.g. with the
FullRxn population method (or just the standard example as you like, but then you'll have the events from one level only). Make sure bSaveTree is defined.
- A small script
root_to_geant.py converts the cascades from the root tree to one file per multiplicity, and the file contents simply give the gamma-ray energies of each cascade. I use pyroot here, which can sometimes be challenging to install. In any case, one could write a pure root version. But for me speed was not an issue
- One could create gps macro commands, but with SUN it was easiest to adopt the source code slightly. Following private repo https://github.com/fzeiser/SUNresponse/tree/many_runs (on the
many_runs branch) has an example of this. Due to some small changes in sunShare-e14505e.cc, it simply reads the files that the script above produces.
- For the Oslo Method analysis with SuN, you may then want to add the simulated spectra for all cascades (and multiplicities), see e.g.
root2spe.c in the repo above. (TChains the files for each multiplicity)
Notes:
Several times the question came up on how RAINIER can be linked with GEANT4. Of course, there is many ways, but I will describe one possible solution here.
Idea
RAINIER/sample_folder/settings.h
Line 14 in 94ca2ff
Example
FullRxnpopulation method (or just the standard example as you like, but then you'll have the events from one level only). Make surebSaveTreeis defined.root_to_geant.pyconverts the cascades from the root tree to one file per multiplicity, and the file contents simply give the gamma-ray energies of each cascade. I usepyroothere, which can sometimes be challenging to install. In any case, one could write a pure root version. But for me speed was not an issuemany_runsbranch) has an example of this. Due to some small changes insunShare-e14505e.cc, it simply reads the files that the script above produces.root2spe.cin the repo above. (TChains the files for each multiplicity)Notes:
https://github.com/fzeiser/SUNresponse/blob/6e765c121b030d26c6304665d5d1593e669c2540/include/SuNBetaDecay.hh#L14-L20
root_to_geant.py) put's the output filename as a header for each file and creates a list of commands/files that should be run with SuN (run_inputs.txt).