Recipes for Singularity images to be built on Singularity Hub.
First pull verification key:
singularity key pull A74587B3F8E5E651C40B0D6D01454D9DB5CA14F2The optical simulation software container can be pulled directly via the Singularity command:
(size ~ 1.4G)
For 2x2 Module-0:
singularity pull library://liviocali/ndlar_optsim/optsim_mod0:v1_0For 2x2 Module-1, 2 or 3
singularity pull library://liviocali/ndlar_optsim/optsim_mod123:v1_0Performing the Singularity default checks should return PASS: (retval=0).
mv optsim_mod0_v1_0.sif OptSim.sif
singularity verify OptSim.sifor
mv optsim_mod123_v1_0.sif OptSim.sif
singularity verify OptSim.sifUsing 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.sifThere 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.sif 0 10Statistics: 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.txthas to be placed in the folderinput/before executing the simulation.singularity run --app sim_usr_geo OptSim.sif 0 10The file
OptSim_LUT_voxel_table.txtcan 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.sif 0 10The 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.sif 0 10 -
lut / lut_usr
Build the photon look-up-table using the output created by running the simulation with a SiPM efficiency of 39% (Mod-0 25%, Mod-1 39%). Herefore, voxel number '0' needs to have been processed and the respective root fileOptSim_00000000.roothas to be present inoutput/root_files/.singularity run --app lut OptSim.sif 0.39And in case the simulation was run with user defined statistics and voxel geometry:
singularity run --app lut_usr OptSim.sif 0.39
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.sif
sudo singularity shell --writable OptSimsudo singularity build OptSim_edited.sif OptSim