File indexing completed on 2023-03-17 10:40:48
0001
0002 source /afs/cern.ch/cms/caf/setup.sh
0003
0004 echo ""
0005 echo "#############################################################################"
0006 echo "##### #####"
0007 echo "##### Starting the TK Alignment Skim&Prescale workflow!!! #####"
0008 echo "##### #####"
0009 echo "##### #####"
0010 echo "##### #####"
0011 echo "#############################################################################"
0012 echo
0013 echo
0014 echo "Program launched from $(hostname) at $(date) "
0015 echo
0016 echo
0017
0018
0019 CASTOR_OUT="/store/caf/user/bonato/Collisions2010/Run2010B/Sept2010/"
0020
0021 MYCMSSW_RELEASE="$CMSSW_BASE"
0022
0023
0024 sed -e "s|<CASTOROUT>|${CASTOR_OUT}|g" < SkimLooper.tpl > SkimLooper.sh
0025 sed -e "s|<CASTOROUT>|${CASTOR_OUT}|g" -e "s|<MYCMSSW>|$MYCMSSW_RELEASE|g" < PrescaleLooper.tpl > PrescaleLooper.sh
0026 sed -e "s|<MYCMSSW>|$MYCMSSW_RELEASE|g" < skim_exec.tpl > skim_exec.sh
0027 sed -e "s|<MYCMSSW>|$MYCMSSW_RELEASE|g" < presc_exec.tpl > presc_exec.sh
0028
0029
0030
0031 for ALCATAG in $( cat "taglist.txt" )
0032 do
0033 echo ""
0034 echo "Counting events for ${ALCATAG} ; Log in ./log_nevents_${ALCATAG}.out"
0035
0036 done
0037
0038
0039
0040 echo ""
0041 echo "~~~ Starting SkimLooper at $(date)"
0042 echo
0043 chmod 711 SkimLooper.sh
0044 chmod 711 skim_exec.sh
0045 ./SkimLooper.sh "taglist.txt" 3
0046 if [ $? != 0 ]
0047 then
0048 exit 2
0049 fi
0050
0051 sleep 1800
0052
0053
0054 SKIM_DONE=1
0055 echo ""
0056 echo "Checking the status of SkimLooper: "
0057 while [ $SKIM_DONE == 1 ]
0058 do
0059
0060 node=$(basename $(hostname) .cern.ch)
0061 bjobs -u $USER | grep $USER | grep $node > tmpskimjobs.tmp
0062 if [ $(wc -l tmpskimjobs.tmp | awk '{print $1}') == 0 ]
0063 then
0064 SKIM_DONE=0
0065 else
0066 sleep 600
0067 fi
0068
0069 rm -f tmpskimjobs
0070 echo "Status is ${SKIM_DONE}"
0071 done
0072
0073
0074
0075 echo ""
0076 echo "~~~ Starting PrescaleLooper at $(date)"
0077 echo
0078 chmod 711 PrescaleLooper.sh
0079 chmod 711 presc_exec.sh
0080 ./PrescaleLooper.sh "taglist.txt" 3
0081 if [ $? != 0 ]
0082 then
0083 exit 3
0084 fi
0085 echo
0086 echo
0087 echo "Finished operations at $(date)"