This project is based on the prototype 3DGAN model developed at CERN and is developed on PyTorch Lightning framework. Can also be found in the following repositories in different ML framework versions:
- Keras on TF1: https://github.com/svalleco/3Dgan/tree/Anglegan/keras
- Keras on TF2 (Accelerated3DGAN): https://github.com/CERN-IT-INNOVATION/3DGAN
The data used for the training and validation processes of the model are 3D images representing calorimeter energy depositions and are publicly available in different formats:
- compressed format: https://zenodo.org/records/3603086#.ZEJOTs5Byqi
- HDF5: https://cernbox.cern.ch/s/3rK5UeRzRR3Kbnu
- tfrecords (used for the Accelerated3DGAN version)
In the analysis folder there are scripts plotting physics-based performance analytics. These scripts are based on the prototype developments here.
The analysis compares the GAN generated images to G4 data events. All of the scripts in this section, take a sample of G4 events and then generate GAN events with similar input conditions (primary particle energy / primary particleincident angle). Where events are selected in bins: the primary energy bins have a +/- 5 GeV tolerance and the incident angle bins have a tolerance of +/- 0.1 rad (5.73 degree). The utils directory contains a set of files with frequently used utility functions. Most of the scripts except the LossPlotsPython.py require ROOT software to be installed. Following is a brief description and a set of instructions for all scripts in this folder: A common feature for all the scripts is the ang (1: variable angle version 0: fixed angle version). The default is variable angle. The instructions will include only most useful parameters. Other options can be explored from parser help.
This scripts compares 2D projections for all the three planes for events from the G4 data with corressponding GAN generated events with same input values. The script can be submitted as:
python3 2dprojUpdated.py --gweight generator_weights --outdir results/your_result_dir
This scripts compares the two most crucial features of the generated events: the sampling fraction and the shower shapes. The script can be submitted as:
python3 SimpleAnalysis.py --gweights weight1 weight2 --labels label1 label2 --outdir results/your_result_dir
The scripts compares in detail different features of G4 and GAN events. The script can be submitted as:
python3 RootAnalysisAngle.py --gweights generator_weight1 generator_weight2 --dweights discriminator_weight1 discriminator_weight2 --labels label1 label2 --outdir results/your_result_dir
This script takes the loss history generated from each training, saved as a pickle file. The plots are generated using matplotlib. The script can be submitted as:
python3 LossPlotsPython.py --historyfile path_to_loss_history --outdir path_to_save_results
This script select the best epoch among a predefined number of epochs. The plots also provides the epoch to epoch progress based on the sampling fraction. The script can be submitted as:
python SelectEpoch.py --gweightsdir path_to_weights_directory --outdir path_to_save_results
- Khattak, G.R., Vallecorsa, S., Carminati, F. et al. Fast simulation of a high granularity calorimeter by generative adversarial networks. Eur. Phys. J. C 82, 386 (2022). DOI: https://doi.org/10.1140/epjc/s10052-022-10258-4
- Physics Validation of Novel Convolutional 2D Architectures for Speeding Up High Energy Physics Simulations, Florian Rehm, Sofia Vallecorsa, Kerstin Borras, Dirk Krücker. Paper published at vCHEP2021 conference. DOI: https://doi.org/10.48550/arXiv.2105.08960