Recipes for Singularity images to be built on Singularity Hub.
The optical simulation software container can be pulled directly via the Singularity command:
(size ~ 1.4G)
singularity pull shub://PPKoller/SHub:root6.geant4.optsim.ubuntu-18.04
Performing the Singularity default checks should return PASS: (retval=0)
.
mv PPKoller-SHub-master-root6.geant4.optsim.ubuntu-18.04.simg OptSim.simg
singularity check --tag default OptSim.simg
Using the environment variable $SINGULARITY_BINDPATH
there won't be any need to bind I/O paths manually later.
mkdir input output
export SINGULARITY_BINDPATH="input/:/input,output/:/output"
Running the container without any arguments will return a list of the available apps including a short description on what it does and what parameters you might need to provide.
singularity run OptSim.simg
There are five apps available within the container: four simulaion related apps that run the optical simulation with different levels of user defined input and one app that allows you to build the photon look-up-table using the output created by running the simulation.
The selected voxels will be processed sequentially. Separate container calls are needed for parallel processing.
-
sim
Run the simulation on voxels no. 0 to 9 using the default statistics, voxel geometry and optical properties.singularity run --app sim OptSim.simg 0 10
Statistics: 1'000 events per voxel / 10'000 photons per event
Voxel geometry: 32 x 128 x 32 voxels / 9.460 x 9.858 x 9.692 mm3 (drift x vertical x beam)
Opt. properties: PPKoller/ArCubeOptSim/tree/LUT/resources/datafiles
-
sim_usr_geo
Run the simulation on voxels no. 0 to 9 with user defined statistics and voxel geometry. Herefore, the fileOptSim_LUT_voxel_table.txt
has to be placed in the folderinput/
before executing the simulation.singularity run --app sim_usr_geo OptSim.simg 0 10
The file
OptSim_LUT_voxel_table.txt
can be created by the Jupyter Notebook provided here. -
sim_usr_opt
Run the simulation on voxels no. 0 to 9 with user defined optical properties. Herefore, a folderdatafiles/
containing all optical properties files has to be placed in the folderinput/
before executing the simulation.singularity run --app sim_usr_opt OptSim.simg 0 10
The folder
datafiles/
containing the default optical properties files can be found here. -
sim_usr
Run the simulation on voxels no. 0 to 9 with user defined statistics, voxel geometry and optical properties. (see instructions above)singularity run --app sim_usr OptSim.simg 0 10
-
lut / lut_usr
Build the photon look-up-table using the output created by running the simulation. Herefore, voxel number '0' needs to have been processed and the respective root fileOptSim_00000000.root
has to be present inoutput/root_files/
.singularity run --app lut OptSim.simg
And in case the simulation was run with user defined statistics and voxel geometry:
singularity run --app lut_usr OptSim.simg
After running the optical simulation, log and error files will appear in output/log_files/
and root files will appear in output/root_files/
.
After running the LUT builder, the photon look-up-table will apper in output/
as OptSim_LUT_ArgonCube2x2.root
.
Place the file preinit.mac
with custom TPB thickness in the folder input/
before executing the simulation. The default preinit.mac
can be found here.
sudo singularity build --sandbox OptSim OptSim.simg
sudo singularity shell --writable OptSim
sudo singularity build OptSim_edited.simg OptSim