Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-08 02:27:14

0001 #!/bin/bash
0002 
0003 rm index_selection.html
0004 
0005 echo "11111111111111"
0006 runList=`cat ${1}`
0007 #echo "${runList}"
0008 
0009 echo "22222222222"
0010 
0011 # Check the runList and correct the correctables
0012 # Replace ',' and ';' by empty spaces
0013 runList=`echo "${runList}" | sed 'sk,k\ kg' | sed 'sk;k\ kg'`
0014 ok=1
0015 for r in ${runList} ; do
0016     if [ ! ${#r} -eq 6 ] ; then
0017         echo "run numbers are expected to be of length 6. Check <$r>"
0018         ok=0
0019     fi
0020     debug_loc=0
0021     if [ "$r" -eq "$r" ] 2>/dev/null ; then
0022         if [ ${debug_loc} -eq 1 ] ; then echo "run variable <$r> is a number (ok)"; fi
0023     else
0024         echo "error: run variable <$r> is not an integer number"
0025         ok=0
0026     fi
0027 done
0028 echo "333"
0029 
0030 #echo "Tested `wc -w <<< "${runList}"` runs from file ${fileName}"
0031 if [ ${ok} -eq 0 ] ; then
0032     echo "errors in the file ${fileName} with run numbers"
0033     exit 3
0034 else
0035     if [ ${#fileName} -gt 0 ] ; then
0036         echo "run numbers in ${fileName} verified ok"
0037     fi
0038 fi
0039 echo "444"
0040 echo "555"
0041 
0042 #echo 'Numbers of NEW runs for processing'
0043 #echo "${runList}"
0044 #echo -e "runList complete\n"
0045 
0046 #processing skipped
0047 echo "6"
0048 
0049 
0050 # #  #  # # # # # # # # # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # ### # # #####
0051 
0052 #echo -e '\n\nRun numbers:'
0053 runListEOS=`echo $runList | tee _runlist_`
0054 
0055 echo "7"
0056 
0057 
0058 #echo "${runListEOS}"
0059 #echo -e "Full runList for EOS complete\n"
0060 
0061 
0062 
0063 echo "8"
0064 
0065 
0066 
0067 
0068 #########################################################################################################
0069 for i in ${runListEOS} ; do
0070  
0071 runnumber=${i}
0072 #if [[ "$runnumber" > 243400 ]] ; then
0073 #dasgoclient --query="file dataset=/HcalNZS/Run2018A-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0074 #dasgoclient --query="file dataset=/HcalNZS/Run2018B-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0075 #dasgoclient --query="file dataset=/HcalNZS/Run2018C-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0076 #
0077 #dasgoclient --query="file dataset=/HcalNZS/Run2018D-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0078 #
0079 echo "runnumber:"
0080 dasgoclient --query="file dataset=/HcalNZS/Commissioning2021-HcalCalMinBias-PromptReco-v1/ALCARECO  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0081 
0082 echo "${runnumber}"
0083 
0084 
0085 #
0086 #dasgoclient --query="file dataset=/HcalNZS/Run2018E-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0087 #dasgoclient --query="run dataset=/HIHcalNZS/HIRun2018A-v1/RAW  run=${i} | grep file.size, file.nevents, file.modification_time "  > tmp
0088 timetmp=`cat tmp | awk '{print $3}'`
0089 ############################################################################################################
0090 type='NZS'
0091 timetmp2=`date -d @${timetmp} +%Y-%m-%d:%H-%M-%S`
0092 sizetmp=`cat tmp | awk '{print $1}'`
0093 neventstmp=`cat tmp | awk '{print $2}'`
0094 commentariy='Com21-ALCARECO'
0095 ##cat runs_info
0096 #echo 'RUN Type = '$type
0097 #echo ${sizetmp} ${neventstmp} ${timetmp2}
0098 #echo 'RUN Comment = '$commentariy
0099 #
0100 #
0101 #
0102 #adding entry to list of file index_selection.html
0103 let "raw = (k % 2) + 2"
0104 echo '<tr>'>> index_selection.html
0105 echo '<td class="s1" align="center">'$k'</td>'>> index_selection.html
0106 echo '<td class="s'$raw'" align="center">'$runnumber'</td>'>> index_selection.html
0107 echo '<td class="s'$raw'" align="center">'$type'</td>'>> index_selection.html
0108 echo '<td class="s'$raw'" align="center">'$timetmp2'</td>'>> index_selection.html
0109 echo '<td class="s'$raw'" align="center">'$sizetmp'</td>'>> index_selection.html
0110 echo '<td class="s'$raw'" align="center">'$neventstmp'</td>'>> index_selection.html
0111 echo '<td class="s'$raw'" align="center">'$commentariy'</td>'>> index_selection.html
0112 
0113 done
0114 
0115 echo "9"
0116 
0117 mv index_selection.html index_selectionNZS_ALCARECO.html
0118 #mv index_selection.html index_selectionA.html
0119 #mv index_selection.html index_selectionB.html
0120 #mv index_selection.html index_selectionC.html
0121 #mv index_selection.html index_selectionD.html
0122 #mv index_selection.html index_selectionE.html
0123 #mv index_selection.html index_selectionHI.html
0124 ############################################################################################################
0125 rm tmp
0126 rm \_runlist\_
0127 
0128 
0129 echo " done"