File indexing completed on 2024-04-12 23:01:31
0001
0002
0003
0004
0005
0006 set runnumber=${1}
0007 set mydate=${2}
0008 set refnumber=${3}
0009 set runNevents=${4}
0010 set CALIB=${5}
0011 set CALIB1=${5}
0012
0013
0014
0015 set ERA=${6}
0016 set RELEASE=${7}
0017 set SCRAM_ARCH=${8}
0018 set SCRIPT=${9}
0019 set rundate=${10}
0020 set runtime=${11}
0021 set compiler ${12}
0022
0023
0024 set fullSrc0='/eos/cms/store/group/dpg_hcal/comm_hcal/USC'
0025 set fullSrc='NO'
0026 set HistoDir='/eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT/histos'
0027 set WD="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript"
0028
0029 set WebDir='http://cms-hcal-dpg.web.cern.ch/cms-hcal-dpg/HcalRemoteMonitoring/RMT'
0030 set WDS="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/DPGAnalysis/HcalTools/scripts/rmt"
0031 set WDM="/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/DPGAnalysis/HcalTools/macros/rmt"
0032 set PlotsDir='/eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/RMT'
0033
0034 echo ${runnumber} >> ${WD}/LOG/batchlog
0035 grep -q ${runnumber} ${WD}/${CALIB}_LIST/fullSrc0_list_${mydate}
0036 if( ${status} == "0" ) then
0037 set namef0=`grep ${runnumber} ${WD}/${CALIB}_LIST/fullSrc0_list_${mydate}`
0038 set namef=`echo ${namef0} | awk '{print $1}'`
0039 echo ${namef}
0040 if( ${namef} == "run${runnumber}" ) then
0041 set fullSrc=${fullSrc0}/run${runnumber}
0042 else
0043 set fullSrc=${fullSrc0}
0044 endif
0045
0046 echo "here"
0047 endif
0048
0049 echo ${fullSrc} >> ${WD}/LOG/batchlog
0050
0051 if( ${fullSrc} == "NO" ) then
0052 echo "No Batch submission" ${runnumber} >> ${WD}/LOG/batchlog
0053 exit
0054 endif
0055
0056 echo "Batch submission" ${fullSrc} " " ${runnumber} >> ${WD}/LOG/batchlog
0057
0058
0059
0060
0061 mkdir ${runnumber}
0062 setenv WORK `pwd`/${runnumber}
0063 source /cvmfs/cms.cern.ch/cmsset_default.csh
0064 setenv SCRAM_ARCH ${compiler}
0065 cd ${WORK}
0066 cmsrel ${RELEASE}
0067 cd ${RELEASE}/src
0068 cmsenv
0069
0070 pwd
0071
0072 ls -l
0073 echo /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/DPGAnalysis
0074
0075 cp -r /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/DPGAnalysis `pwd`/
0076 cp -r /afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMScript/${RELEASE}/src/Calibration `pwd`/
0077 scramv1 build
0078
0079 cd ${WORK}
0080 set HistoDirTMP="./"
0081 pwd > ${WD}/LOG/log_${CALIB}_${runnumber}
0082 echo ${CALIB} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0083 echo ${CALIB1} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0084 echo ${compiler} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0085 cp ${SCRIPT}/remoteMonitoring_${CALIB}_${ERA}_cfg.py ${WORK}
0086 cp ${WD}/${CALIB}_LIST/runlist.tmp.${2} ${WORK}/runlist.tmp
0087 ls >> ${WD}/LOG/log_${CALIB}_${runnumber}
0088
0089 echo "WORKDIR " ${WD} ${WORK} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0090
0091 echo " Start CMS run " >> ${WD}/LOG/log_${CALIB}_${runnumber}
0092 echo ${LD_LIBRARY_PATH} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0093 echo ${HistoDir} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0094 echo ${CMSSW_BASE} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0095 pwd >> ${WD}/LOG/log_${CALIB}_${runnumber}
0096 ls ${WORK} >> ${WD}/LOG/log_${CALIB}_${runnumber}
0097
0098 mkdir run${runnumber}
0099
0100 xrdcp ${fullSrc}/USC_${runnumber}.root run${runnumber}/USC_${runnumber}.root
0101
0102 echo "File was copied to workdir" >> & ${WD}/LOG/log_${CALIB}_${runnumber}
0103
0104 set runpath="file:."
0105
0106 cmsRun remoteMonitoring_${CALIB}_${ERA}_cfg.py ${runnumber} ${runpath} ${HistoDirTMP} >> & ${WD}/LOG/log_${CALIB}_${runnumber}
0107
0108 ls >> ${WD}/LOG/log_${CALIB}_${runnumber}
0109
0110 xrdcp -f ${HistoDirTMP}${CALIB}_${runnumber}.root ${HistoDir}/${CALIB}_${runnumber}.root
0111
0112 echo "Output was copied to ${HistoDir}" >> & ${WD}/LOG/log_${CALIB}_${runnumber}
0113
0114
0115
0116 echo " After CMS run ">>${WD}/LOG/log_${CALIB}_${runnumber}
0117
0118
0119
0120 ls >> & ${WD}/LOG/logn_${CALIB}_${runnumber}
0121
0122 cp ${WDM}/RemoteMonitoringMAP.cc .
0123 cp ${WDM}/compile.csh .
0124 cp ${WDS}/LogEleMapdb.h .
0125 cp ${WDS}/tmp.list.${CALIB} runlist.tmp
0126
0127 ./compile.csh RemoteMonitoringMAP.cc
0128
0129 echo " Start CMS run ">${WD}/LOG/logn_${CALIB}_${runnumber}
0130 echo ${LD_LIBRARY_PATH} >>${WD}/LOG/logn_${CALIB}_${runnumber}
0131
0132 ./RemoteMonitoringMAP.cc.exe "${HistoDir}/${CALIB}_${runnumber}.root" "${HistoDir}/${CALIB}_${refnumber}.root" "${CALIB1}" >> ${WD}/LOG/logn_${CALIB}_${runnumber}
0133
0134 ls -l >> ${WD}/LOG/logn_${CALIB}_${runnumber}
0135
0136
0137
0138 setenv runtype ${CALIB1}
0139 setenv runHTML NO
0140
0141
0142
0143 echo 'RUN Date = '${rundate} ${runtime} >> ${WD}/LOG/batchlog
0144 echo 'RUN Type = '${runtype} >> ${WD}/LOG/batchlog
0145 echo 'Reference RUN number ='${refnumber} >> ${WD}/LOG/batchlog
0146
0147 touch index_draft.html
0148
0149
0150 set raw=3
0151 echo '<tr>'>> index_draft.html
0152 echo '<td class="s1" align="center">'ktemp'</td>'>> index_draft.html
0153 echo '<td class="s'$raw'" align="center">'$runnumber'</td>'>> index_draft.html
0154 echo '<td class="s'$raw'" align="center">'$runtype'</td>'>> index_draft.html
0155 echo '<td class="s'$raw'" align="center">'$runNevents'</td>'>> index_draft.html
0156 echo '<td class="s'$raw'" align="center">'$rundate'</td>'>> index_draft.html
0157 echo '<td class="s'$raw'" align="center">'$runtime'</td>'>> index_draft.html
0158 echo '<td class="s'$raw'" align="center">'$refnumber'</td>'>> index_draft.html
0159 echo '<td class="s'$raw'" align="center"><a href="'$WebDir'/'${CALIB}'_'$runnumber'/MAP.html">'${CALIB}'_'$runnumber'</a></td>'>> index_draft.html
0160 echo '<td class="s'$raw'" align="center">NO</td>'>> index_draft.html
0161 echo '<td class="s'$raw'" align="center">OK</td>'>> index_draft.html
0162 echo '</tr>'>> index_draft.html
0163
0164
0165
0166 ls *.html >> ${WD}/LOG/logn_${CALIB}_${runnumber}
0167
0168 foreach i (`ls *.html`)
0169 cat ${i} | sed s/LED/${CALIB1}/g > ${i}_t
0170 mv ${i}_t ${i}
0171 end
0172
0173
0174 ls *.png
0175 eos rm -rf ${PlotsDir}/${CALIB1}_${runnumber}
0176 eos mkdir ${PlotsDir}/${CALIB1}_${runnumber} >> & ${WD}/LOG/logn_${CALIB}_${runnumber}
0177
0178 if(${status} == "0") then
0179
0180 foreach i (`ls *.html`)
0181 xrdcp ${i} ${PlotsDir}/${CALIB1}_${runnumber}
0182 end
0183 foreach k (`ls *.png`)
0184 xrdcp ${k} ${PlotsDir}/${CALIB1}_${runnumber}
0185 end
0186 endif
0187
0188
0189