Skip to content

Commit

Permalink
feat: Material Mapping Auto-tuning script with Orion (#1464)
Browse files Browse the repository at this point in the history
This PR add the auto tuning algorithm I developed using Orion for the material mapping. This PR depends on #1458 so it shouldn't be merged before it. Some documentation has been added next to the material mapping howto.
  • Loading branch information
Corentin-Allaire committed Sep 26, 2022
1 parent 1cc1340 commit 5a419bb
Show file tree
Hide file tree
Showing 5 changed files with 760 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# We first run a single batch of jobs using the geant4 material track as an input.
# This will allow us to obtain a new material track file with the material associated with their respective surfaces.
# This file is then move to the input directory using it will allow us to speed up the following mapping by 50%
python3 ../Examples/Scripts/Python/material_mapping_optimisation.py --numberOfJobs 40 --topNumberOfEvents 10000 --inputPath "MaterialMappingInputDir" --outputPath "MaterialMappingOutputDir" --doPloting 2>&1 | tee log/opti_log_init.txt
mv MaterialMappingOutputDir/optimised-material-map_tracks.root MaterialMappingInputDir/optimised-material-map_tracks.root

# In case of crash the databases might get corrupted. To prevent this we create a backup every 10 itteration of the optimisation script (rougly every 3 hours)
# In case of crash, it is then preferable to replace Mapping/Database by the last backup.
for j in {0..4}
do
# Create a back up of the database
if [ -d "Mapping/Database-backup-$j" ]; then
rm -rf Mapping/Database-backup-$j
fi
mkdir Mapping/Database-backup-$j
cp Mapping/Database/* Mapping/Database-backup-$j/
for i in {0..9}
do
# Run a batch of optimisation jobs
python3 ../Examples/Scripts/Python/material_mapping_optimisation.py --numberOfJobs 40 --topNumberOfEvents 10000 --inputPath "/data/atlas/callaire/Acts/Material-Mapping-ODD" --outputPath "." --readCachedSurfaceInformation 2>&1 | tee log/opti_log_${j}_${i}.txt
rm Mapping/Database/*.lock
rm Mapping/Database/*.tmp
done
done

# Now that the optimisation is over, the script is run one last time to create the optimised material map and the result plots
python3 ../Examples/Scripts/Python/material_mapping_optimisation.py --numberOfJobs 00 --topNumberOfEvents 10000 --inputPath "/data/atlas/callaire/Acts/Material-Mapping-ODD" --outputPath "." --doPloting 2>&1 | tee log/opti_log.txt

0 comments on commit 5a419bb

Please sign in to comment.