A FLUKA simulation that records the energy deposited in a single layer of polysterene from an ion beam. HTCondor submission scripts are included.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 lines
3.0 KiB

#!/bin/bash
TYPE="4-HELIUM"
#energy=(0.04812 0.05982 0.07003 0.07917 0.08753 0.09530 0.10261 0.10956 0.11620 0.12257 0.12872 0.13465 0.14041 0.14601 0.15150 0.15689 0.16221 0.16746 0.17262 0.17770 0.18481 0.19187 0.19876 0.20548 0.21206 0.21851); #GeV/u, protons
#energy=(0.08883 0.11058 0.12979 0.14713 0.16309 0.17801 0.19213 0.20560 0.21852 0.23098 0.24303 0.25471 0.26608 0.27719 0.28810 0.29887 0.30952 0.32007 0.33048 0.34077 0.35522 0.36964 0.38378 0.39766 0.41132 0.42477); #GeV/u, carbon
energy=(0.05057 0.06186 0.07173 0.08064 0.08885 0.09652 0.10376 0.11064 0.11723 0.12355 0.12964 0.13555 0.14127 0.14684 0.15226 0.15756 0.16273 0.16780 0.17277 0.17764 0.18456 0.19154 0.19836 0.20503 0.21157 0.21798); #GeV/u, helium
#THICKNESS=(0.025 0.050 0.075 0.100 1.25 0.150 0.2500 0.500) #cm
THICKNESS=(0.025 0.050 0.100 0.150 0.500 1.000 0.125) #cm
HOME=/work/leverington/fluka_gfortran7/project/helium
ZED=2.
ATN=4.
for j in {0..6}
do
mkdir -p $HOME/jobs$j #make the directory if it doesn't exist
JOB_HOME=$HOME/jobs$j
rm -r $JOB_HOME/* #clean up the directory
cd $JOB_HOME
for i in {0..25} #26
do
# make a copy of the template
cp $HOME/runjobtemplate.inp $JOB_HOME/runjob$i.inp
touch $JOB_HOME/runjob$i.inp
#replace template placeholders with values
sed -i 's/ENERGYIN/'"-${energy[i]}"'/g' $JOB_HOME/runjob$i.inp #the negative sign indicates energy, not momentum
sed -i 's/TYPE/'"$TYPE"'/g' $JOB_HOME/runjob$i.inp #beam particle type
sed -i 's/THICK/'"${THICKNESS[j]}"'/g' $JOB_HOME/runjob$i.inp #thickness of polystyrene layer
sed -i 's/ZED/'"$ZED"'/g' $JOB_HOME/runjob$i.inp #atomic charge
sed -i 's/ATN/'"$ATN"'/g' $JOB_HOME/runjob$i.inp #atomic number
echo "Job: $j-$i Ion type: $TYPE Energy: ${energy[i]} GeV/u Plane thickness: ${THICKNESS[j]} cm"
echo ""
touch $JOB_HOME/fluka$j-$i.sh #script to submit to the queue
echo "#!/bin/bash" >> $JOB_HOME/fluka$j-$i.sh
echo ". /local/env.sh" >> $JOB_HOME/fluka$j-$i.sh
# echo ". /cvmfs/lhcb.cern.ch/lib/lhcb/LBSCRIPTS/LBSCRIPTS_v9r2p2/InstallArea/scripts/LbLogin.sh -c x86_64-slc6-gcc7-opt" >> $JOB_HOME/fluka$j-$i.sh
echo "source /home/lhcb/leverington/setup.sh" >> $JOB_HOME/fluka$j-$i.sh
#execute this command(s)
echo "cd "$JOB_HOME >> $JOB_HOME/fluka$j-$i.sh
echo "$FLUPRO/flutil/rfluka -e $FLUPRO/flutil/flukadpm3 -N0 -M1 runjob"$i >> $JOB_HOME/fluka$j-$i.sh
echo "sleep 2" >> $JOB_HOME/fluka$j-$i.sh
echo "/work/leverington/readfluka/tools/eventdat2root runjob"$i"001_eventdata" >> $JOB_HOME/fluka$j-$i.sh
echo "sleep 2" >> $JOB_HOME/fluka$j-$i.sh
echo "$HOME/eventdatroot runjob"$i"001_eventdata "$j >> $JOB_HOME/fluka$j-$i.sh
# qsub -l os=slc6 -l ujl=20 -cwd -j yes $JOB_HOME/fluka$j-$i.sh
qsub -l os=slc6 -l hio=10 -l ujl=40 -cwd -j yes $JOB_HOME/fluka$j-$i.sh
# $FLUPRO/flutil/rfluka -e /home/leverington/software/fluka/flutil/flukadpm3 -N0 -M1 $JOB_HOME/runjob$i #run
# sleep 2
# eventdat2root runjob$i\001_eventdata #convert to root file
# sleep 2
# $HOME/eventdatroot runjob$i\001_eventdata $j #run analysis code
sleep 1
done
done