diff --git a/macros/CCEScan/batch/missingSectors.dat b/macros/CCEScan/batch/missingSectors.dat new file mode 100644 index 0000000..52b7740 --- /dev/null +++ b/macros/CCEScan/batch/missingSectors.dat @@ -0,0 +1,16 @@ +7202 +7203 +7206 +7207 +7235 +7236 +7239 +7266 +7267 +7270 +7271 +7297 +7298 +7301 +7302 + diff --git a/macros/CCEScan/batch/submitLandau_missingSectors.sh b/macros/CCEScan/batch/submitLandau_missingSectors.sh new file mode 100644 index 0000000..f5b7bbd --- /dev/null +++ b/macros/CCEScan/batch/submitLandau_missingSectors.sh @@ -0,0 +1,148 @@ +# to remove erroneous jobs: +# for job in `qstat | grep ${USER} | awk '{print $1;}'`; do qdel ${job}@farm-ce; done + +swsource=$HOME/STAging/macros/CCEScan +scripts=$swsource/batch +logs=/disk/data1/hep/elena/logs/ST/CCEScan + +vals=(3 5 7) +rads=(75 45 40) + +echo "Backup file!" +echo "cp /disk/data1/hep/elena/data/ST/Aging/CCEScan.root /disk/data1/hep/elena/data/ST/Aging/CCEScan_backup_May3.root" +cp /disk/data1/hep/elena/data/ST/Aging/CCEScan.root /disk/data1/hep/elena/data/ST/Aging/CCEScan_backup_May3.root + +# fills to process +onefill=(5162 5448) +# array of missing sectors +missing=`cat missingSectors.dat` + +# http://stackoverflow.com/questions/14366390/bash-if-condition-check-if-element-is-present-in-array +array_contains2 () { + local name=$1[@] + local array=("${!name}") + local seeking=$2 + local in=1 + for element in $array; do + if [[ $element == $seeking ]]; then + echo $element + in=0 + break + fi + done + echo $in + return $in +} + + +echo "Submitting TT:" +for fill in $onefill +do + echo " Submitting fill "$fill + for sector in `cat $swsource/TTsectors.dat` + do + array_contains2 missing $sector + # Check the output of the function + # 0 is returned if the element is found + if [ "$?" -eq 0 ]; then + echo " Sector "$sector + scriptname="landauFit_TT_f${fill}_s${sector}_allSteps_allVal" + cp $scripts/base.sh $scripts/temp_scripts/${scriptname}.sh + for i in {0..65} + do + for val in "${vals[@]}" + do + echo "${swsource}/landauFit -d TT -l TTaU -s ${sector} -f ${fill} -c ${i} -v ${val} -b -ss" >> $scripts/temp_scripts/${scriptname}.sh + done + done + qsub -l cput=75000 $scripts/temp_scripts/${scriptname}.sh -o ${logs}/${scriptname}.log -e ${logs}/${scriptname}.log -j oe + #sleep 2 + fi + done +done + +echo "Submitting TT inner sectors:" +#for fill in `cat $swsource/Fills.dat` +for fill in $onefill +do + echo " Submitting fill "$fill + for sector in `cat $swsource/TTinner.dat` + do + array_contains2 missing $sector + # Check the output of the function + # 0 is returned if the element is found + if [ "$?" -eq 0 ]; then + echo " Sector "$sector + scriptname="landauFit_TTinner_f${fill}_s${sector}_allSteps_allVal_allRads" + cp $scripts/base.sh $scripts/temp_scripts/${scriptname}.sh + for i in {0..65} + do + for val in "${vals[@]}" + do + for rad in "${rads[@]}" + do + echo "${swsource}/landauFit -d TT -l TTaU -s ${sector} -f ${fill} -c ${i} -v ${val} -r ${rad} -b -ss" >> $scripts/temp_scripts/${scriptname}.sh + done + done + done + qsub -l cput=225000 $scripts/temp_scripts/${scriptname}.sh -o ${logs}/${scriptname}.log -e ${logs}/${scriptname}.log -j oe + #sleep 2 + fi + done +done + + + + +echo "Submitting IT:" +for sector in `cat $swsource/ITsectors.dat` +do + array_contains2 missing $sector + # Check the output of the function + # 0 is returned if the element is found + if [ "$?" -eq 0 ]; then + echo " Sector " $sector + for fill in $onefill + #for fill in `cat $swsource/Fills.dat` + do + echo " Fill "$fill + val=7 + scriptname="landauFit_IT_s${sector}_f${fill}_allSteps_v${val}" + echo "Creating file " $scripts/temp_scripts/${scriptname}.sh + cp $scripts/base.sh $scripts/temp_scripts/${scriptname}.sh + for i in {0..65} + do + echo "${swsource}/landauFit -d IT -l T3X2 -s ${sector} -f ${fill} -c ${i} -v ${val} -b -ss" >> $scripts/temp_scripts/${scriptname}.sh + done + qsub -l cput=24000 $scripts/temp_scripts/${scriptname}.sh -o ${logs}/${scriptname}.log -e ${logs}/${scriptname}.log -j oe + sleep 1 + done + fi +done + +echo "Submitting IT inner sectors:" +for sector in `cat $swsource/ITinner.dat` +do + array_contains2 missing $sector + # Check the output of the function + # 0 is returned if the element is found + if [ "$?" -eq 0 ]; then + echo " Sector " $sector + for fill in $onefill + #for fill in `cat $swsource/Fills.dat` + do + echo " Fill "$fill + val=7 + scriptname="landauFit_ITinner_s${sector}_f${fill}_allSteps_v${val}_r175" + cp $scripts/base.sh $scripts/temp_scripts/${scriptname}.sh + for i in {0..65} + do + echo "${swsource}/landauFit -d IT -l T3X2 -s ${sector} -f ${fill} -c ${i} -v ${val} -r 175 -b -ss" >> $scripts/temp_scripts/${scriptname}.sh + done + qsub -l cput=24000 $scripts/temp_scripts/${scriptname}.sh -o ${logs}/${scriptname}.log -e ${logs}/${scriptname}.log -j oe + sleep 1 + done + fi +done + +