Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #!/bin/csh
0002 
0003 set runnumber=${1}
0004 set refnumber=${3}
0005 set runNevents=${4}
0006 set CALIB=${5}
0007 
0008 set RELEASE=CMSSW_10_4_0
0009 
0010 set fullSrc0='/store/group/dpg_hcal/comm_hcal/USC'
0011 set fullSrc1='/store/group/dpg_hcal/comm_hcal/LS1'
0012 set fullSrc='NO'
0013 set WebDir='/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb'
0014 ###set WebDir='/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/AZweb'
0015 set WebSite='https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT'
0016 set HistoDir='/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos'
0017 ####set HistoDir='/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/AZweb/histos'
0018 set WD="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/RecoHcal/HcalPromptAnalysis/test/RDM"
0019 
0020 ### We are at working node
0021 mkdir ${runnumber}
0022 setenv WORK `pwd`/${runnumber}
0023 
0024 echo ${WORK} >> ${WD}/LOG/batchlog
0025 
0026 cd /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/RecoHcal/HcalPromptAnalysis/test
0027 cmsenv
0028 ###cp ${WD}/remoteMonitoring_${CALIB}_cfg.py ${WORK}/remoteMonitoring_cfg.py
0029 
0030 ls ${WD}/RemoteMonitoring2017.cc.exe  >> ${WD}/LOG/batchlog
0031 
0032 cp ${WD}/RemoteMonitoring2017.cc ${WORK}
0033 cp ${WD}/compile.csh ${WORK}
0034 cp ${WD}/LogEleMapdb.h ${WORK}
0035 cp ${WD}/${CALIB}_LIST/runlist.tmp.${2} ${WORK}/runlist.tmp
0036 
0037 cd ${WORK}
0038 
0039 ./compile.csh RemoteMonitoring2017.cc
0040 
0041 #### cmsRun Start
0042 ### Temporarily
0043 #rm LOG/log_${runnumber}
0044 #rm ${HistoDir}/${CALIB}_${runnumber}.root
0045 
0046 echo " Start CMS run ">${WD}/LOG/logn_${runnumber}
0047 echo ${LD_LIBRARY_PATH} >>${WD}/LOG/logn_${runnumber}
0048 
0049 #cmsRun remoteMonitoring_cfg.py ${runnumber} ${fullSrc} ${HistoDir} >> & ${WD}/LOG/log_${runnumber}
0050 #mv ${HistoDir}/LED_${runnumber}.root ${HistoDir}/${CALIB}_${runnumber}.root
0051 
0052 rm -rf ${WebDir}/${CALIB}_${runnumber} 
0053 mkdir ${WebDir}/${CALIB}_${runnumber} >> & ${WD}/LOG/logn_${runnumber}
0054 #####./compile.csh RemoteMonitoringMAP.cc  >> & ${WD}/LOG/logn_${runnumber}
0055 ./RemoteMonitoring2017.cc.exe "${HistoDir}/${CALIB}_${runnumber}.root" "${HistoDir}/${CALIB}_${refnumber}.root" "${CALIB}" >> ${WD}/LOG/logn_${runnumber}
0056 
0057 ##root -b -q -l 'RemoteMonitoringMAP.C+("'${HistoDir}'/${CALIB}_'${runnumber}'.root","'${HistoDir}'/${CALIB}_'${refnumber}'.root")'
0058 ls -l >> ${WD}/LOG/log_${runnumber}
0059 #echo " Start copy png " >> & ${WD}/LOG/log_${runnumber}
0060 #ls $WebDir/${CALIB}_$runnumber  >> & ${WD}/LOG/log_${runnumber}
0061 #cp *.html $WebDir/${CALIB}_$runnumber  >> & ${WD}/LOG/log_${runnumber}
0062 #cp *.png $WebDir/${CALIB}_$runnumber  >> & ${WD}/LOG/log_${runnumber}
0063 
0064 #### CmsRun end
0065 ### extract the date of file
0066 ### set rundate=`cmsLs $fullSrc | grep ${1} | awk '{print $3}'`
0067 
0068 set j=`cat runlist.tmp | grep ${runnumber}`
0069 echo ${j} >> ${WD}/LOG/batchlog    
0070 setenv runtype ${CALIB}
0071 setenv runHTML NO
0072 setenv runtime `echo $j | awk -F _ '{print $4}'`
0073 setenv rundate `echo $j | awk -F _ '{print $3}'`
0074 #wget ${runHTML} >> ${WD}/LOG/batchlog
0075 #setenv runNevents `cat index.html | tail -n +14 | head -n 1 | awk -F '>' '{print $2}' | awk -F '<' '{print $1}'`
0076 #rm index.html
0077 
0078 echo 'RUN Date = '${rundate} ${runtime} >> ${WD}/LOG/batchlog    
0079 echo 'RUN Type = '${runtype} >> ${WD}/LOG/batchlog    
0080 echo 'Reference RUN number ='${refnumber} >> ${WD}/LOG/batchlog    
0081 
0082 touch index_draft.html
0083 
0084 #adding entry to list of file index_draft.html
0085 
0086 ####sed '$d' < /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/index.html > index.html.tmp
0087 
0088 set raw=3
0089 echo '<tr>'>> index_draft.html
0090 echo '<td class="s1" align="center">'ktemp'</td>'>> index_draft.html
0091 echo '<td class="s'$raw'" align="center">'$runnumber'</td>'>> index_draft.html
0092 echo '<td class="s'$raw'" align="center">'$runtype'</td>'>> index_draft.html
0093 echo '<td class="s'$raw'" align="center">'$runNevents'</td>'>> index_draft.html
0094 echo '<td class="s'$raw'" align="center">'$rundate'</td>'>> index_draft.html
0095 echo '<td class="s'$raw'" align="center">'$runtime'</td>'>> index_draft.html
0096 echo '<td class="s'$raw'" align="center">'$refnumber'</td>'>> index_draft.html
0097 echo '<td class="s'$raw'" align="center"><a href="'$WebSite'/'${CALIB}'_'$runnumber'/MAP.html">'${CALIB}'_'$runnumber'</a></td>'>> index_draft.html
0098 echo '<td class="s'$raw'" align="center">NO</td>'>> index_draft.html
0099 echo '<td class="s'$raw'" align="center">OK</td>'>> index_draft.html
0100 echo '</tr>'>> index_draft.html
0101 
0102 #### PUT Corresponding calib type to html
0103 
0104 ls *.html >> ${WD}/LOG/log_${runnumber}
0105 
0106 foreach i (`ls *.html`)
0107 cat ${i} | sed s/LED/${CALIB}/g > ${i}_t
0108 mv ${i}_t ${i} 
0109 end
0110 
0111 #######touch $WebDir/${CALIB}_$runnumber/new
0112 ####### Copy to the new site in parallel
0113 ls *.png
0114 if(${status} == "0") then
0115 #### Copy to the old site
0116 echo " Start copy png " >> & ${WD}/LOG/log_${runnumber}
0117 cp *.html $WebDir/${CALIB}_$runnumber  >> & ${WD}/LOG/log_${runnumber}
0118 cp *.png $WebDir/${CALIB}_$runnumber  >> & ${WD}/LOG/log_${runnumber}
0119 
0120 mv $WebDir/${CALIB}_$runnumber/index_draft.html $WebDir/${CALIB}_$runnumber/index_draft.html.orig
0121 cp index_draft.html $WebDir/${CALIB}_$runnumber
0122 #### Copy to the new site
0123 eos mkdir /eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT/${CALIB}_$runnumber
0124 foreach i (`ls *.html`)
0125 cat ${i} | sed 's#cms-cpt-software.web.cern.ch\/cms-cpt-software\/General\/Validation\/SVSuite#cms-conddb-dev.cern.ch\/eosweb\/hcal#g'> ${i}.n
0126 xrdcp ${i} /eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT/${CALIB}_$runnumber
0127 ###cmsStage -f ${i}.n /store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT/${CALIB}_$runnumber
0128 end
0129 foreach k (`ls *.png`)
0130 xrdcp ${k} /eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT/${CALIB}_$runnumber
0131 end
0132 endif
0133 
0134