-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Material Mapping Auto-tuning script with Orion (#1464)
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
1 parent
1cc1340
commit 5a419bb
Showing
5 changed files
with
760 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
Examples/Scripts/Python/Auto-tuning/Orion/launchMaterialAutoTuning.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.