Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:27

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