Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:47

0001 #!/bin/csh
0002 ###
0003 ### Day/Time
0004 ### All files have the particular time
0005 ###
0006 #set DAT=`date '+%Y-%m-%d_%H_%M_%S'`
0007 set WD='/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/CMSSW_5_3_8/src/RecoHcal/HcalPromptAnalysis/test/RDM'
0008 set REF=213224
0009 set LAST=`cat ${WD}/LED_LIST/LASTRUN` 
0010 if( ${LAST} == "" ) then
0011 echo  " Network problem: no access to the LASTRUN"
0012 exit
0013 endif
0014 
0015 #### Uncomment after it is done
0016 wget -q http://test-dtlisov.web.cern.ch/test-dtlisov/ -O ${WD}/LED_LIST/done.html.${1}
0017 
0018 echo "I am here 0"
0019 
0020 touch ${WD}/LED_LIST/done.html.${1}
0021 touch ${WD}/LED_LIST/goodledruns.${1}
0022 
0023 wget -q http://cmshcalweb01.cern.ch/DetDiag/Local_HTML/runlist.html -O ${WD}/LED_LIST/runlist.html.${1}
0024 
0025 echo "I am here 1"
0026 
0027 
0028 #cat ${WD}/LED_LIST/runlist.html.${1} | sed s/\"//g | sed st\>\/t' 'tg | sed sk\<\/td\>kkg | sed sk\<\/a\>kkg | tr '\n' ' ' | awk -F '</tr>' '{for(i=1;i<=NF;i++) printf $i"\n"}' | awk -F '<tr> <td' '{print $2}' | tail -n +4 | sed s/' '/-/g | grep LED | awk -F - '{print $13","$25","$9}'| awk -F "href=" '{print $1 $2}' > ${WD}/LED_LIST/runlist.tmp0.${1}
0029 
0030 cat ${WD}/LED_LIST/runlist.html.${1} | sed s/\"//g | sed st\>\/t' 'tg | sed sk\<\/td\>kkg | sed sk\<\/a\>kkg | tr '\n' ' ' | awk -F '</tr>' '{for(i=1;i<=NF;i++) printf $i"\n"}' | awk -F '<tr> <td' '{print $2}' | tail -n +4 | sed s/' '/-/g | grep LED > ${WD}/LED_LIST/runlist.tmp0.${1}
0031 
0032 echo "I am here 2"
0033 
0034 touch ${WD}/LED_LIST/runlist.tmp.${1}
0035 
0036 set count=0
0037 
0038 echo "I am here 3"
0039 
0040 foreach i (`cat ${WD}/LED_LIST/runlist.tmp0.${1}`)
0041 
0042 set TYPE=`echo $i | awk -F - '{print $13}'`
0043 set HTML=`echo $i | awk -F - '{print $25}' | awk -F 'href=' '{print $2}'`
0044 set RUNNUMBER=`echo $i | awk -F - '{print $9}'`
0045 
0046 echo ${TYPE} ${RUNNUMBER} ${HTML}
0047 
0048 if ( ${TYPE} == "LED" ) then
0049 echo ${TYPE} ${HTML} ${RUNNUMBER}
0050 wget -q ${HTML} -O ${WD}/LED_LIST/index.html.${1}
0051 set NEVENTS=`cat ${WD}/LED_LIST/index.html.${1} | tail -n +14 | head -n 1 | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'`
0052 echo ${RUNNUMBER} "Number of events" ${NEVENTS}
0053 ### !!!!!change >= to == 
0054 if( ${NEVENTS} == "10000" && ${RUNNUMBER} > ${LAST} ) then
0055 #echo "Take " ${RUNNUMBER}
0056 echo ${RUNNUMBER} "Number of events" ${NEVENTS} >> ${WD}/LED_LIST/goodledruns.${1}
0057 #grep -q ${RUNNUMBER} ${WD}/LED_LIST/done.html.${1}
0058 #if( ${status} == "1") then
0059 echo "${RUNNUMBER}_${REF}" >> ${WD}/LED_LIST/runlist.tmp.${1} 
0060 if( ${count} == "0" ) then
0061 rm LED_LIST/LASTRUN
0062 echo ${RUNNUMBER} > LED_LIST/LASTRUN
0063 endif
0064 @ count = ${count} + "1"
0065 endif
0066 endif
0067 rm ${WD}/LED_LIST/index.html.${1}
0068 endif
0069 
0070 end
0071 
0072 rm ${WD}/LED_LIST/done.html.${1}
0073 rm ${WD}/LED_LIST/runlist.html.${1}
0074 
0075 cmsLs /store/group/comm_hcal/USC > ${WD}/LED_LIST/fullSrc0_list_${1}
0076 cmsLs /store/group/comm_hcal/LS1 > ${WD}/LED_LIST/fullSrc1_list_${1}
0077 
0078 
0079 
0080