Author: J. K. Patel
Date: 04/09/2023

Title: Description of setup details and files contained in the Section 4 datset for Geant4 Monte-Carlo simulations and tomographic spectro-spatial reconstruction of modelled proton beams

This dataset contains the source code and configuration files used to perform Monte-Carlo simulations using Geant4-10.4.2, as well as the generated simulation data,
and Python scripts for analysing the data and generating the figures for the results presented in Section 4 of the article "A scintillating fiber imaging spectrometer for active 
characterisation of laser-driven proton beams".

The Geant4 simulation uses the FTFP_BERT physics package. The fiber array construction is implemented in the 'full_construction.cc' and 'full_construction.hh' files,
where 500um fibers are arranged in linear arrays at 1 mm intervals (i.e. 500um separation) to form 'panels', as described in the main article. Eight such panels are rotated 
in 12.5 deg increments to form a tomographic layer, and 10 of these layers are stacked, with 2mm thick PTFE filters between each layer. The 'JKP.mac' file defines the triple-
Gaussian proton beamlets, with radii (at one standard deviation) r = [4, 2, 1] mm and monoenergetic energy spectra at E0 = [30, 45, 60] MeV, respectively. The intensities 
in each beamlet are adjusted to ensure that all beamlets have the same peak intensity.

The source code can be set up and run as follows:
- run 'cmake' in the './source' directory from the command line
- run 'make' in the './source/build'  directory
- run 'full_sim' to run the simulation

This will output the particle data as a '.root' file in the './Data' directory.

The data can then be processed using the provided analysis scripts in the './Analyis/Code' directory.
The 'Geant4_reconstructions_and_figure_generation.py' script will perform the full processing of the Geant4 data from the '.root' file,
and then generate Figures 6 and 7, contained in the './Figures/' directory. The same analysis script is also provided as a Jupyter notebook, 'Geant4_reconstructions_and_figure_generation.ipynb',
for interactive analysis. Some other .py files are included which are used to generate the projection matrices for the tomographic reconstruction (fibre_readout.py), 
generate synthetic beam profiles (beam_profiles.py) and implement tomographic reconstruction algorithms, such as the MLEM algorithm used in this work (reconstruction_algorithms.py).
The 'util.py' file contains some additional helper functions for data processing, analysis and plotting. 

To run the full analysis in 'Geant4_reconstructions_and_figure_generation.[py, ipynb]' the following are required:
- Python 3.9.19
- numpy 1.24.3
- matplotlib 3.8.0
- uproot 4.3.7
- scikit-image 0.19.3
- scipy 1.9.3

In the processing stages of these scripts, some interim files are written to the './Analysis/Data/' directory. These are included in this repository for convenience,
and are used by the simplified './Analysis/Code/Geant4_figure_generation.py' script to simply generate Figures 6 and 7, without having to complete the full (time consuming) data analysis.
