Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:18

0001 #!/bin/sh
0002 RELEASE=CMSSW_3_2_0
0003 DQMfilesDir=/dqmdata/dqm/done
0004 
0005 # rootFilesList=(`ls $DQMfilesDir | grep .root`)
0006 
0007 # The playback_full is what is used now. It is supposed to change in the future
0008 # when the DQM gui will be able to handle to complete file.
0009 # The list is sorted.
0010 rootFilesList=(`find $DQMfilesDir -name "*.root" | grep SiStrip | sort`)
0011 
0012 if [ -e tempList.txt ]; then
0013     rm tempList.txt
0014 fi
0015 if [ -e newList.txt ]; then
0016     rm newList.txt
0017 fi
0018 
0019 for file in ${rootFilesList[@]}
0020 do
0021     echo $file >> tempList.txt
0022 done
0023 cat fullList.txt >> tempList.txt
0024 # Take only unique lines
0025 cat tempList.txt | sort | uniq -u > newList.txt
0026 rm tempList.txt
0027 # Take the difference between the full list and the list of already analyzed files
0028 
0029 echo "Setting up the environment"
0030 source /nfshome0/cmssw2/scripts/setup.sh
0031 cd /nfshome0/popcondev/SiStripDQMJob/${RELEASE}/src/
0032 echo pwd is `pwd`
0033 cmsenv
0034 echo "Release base is $CMSSW_RELEASE_BASE"
0035 cd $LOCALRT/src/DQMOffline/CalibTracker/scripts
0036 echo pwd is `pwd`
0037 
0038 i=0
0039 for file in `cat newList.txt`
0040 do
0041 
0042     echo
0043     echo "file[$i] = $file"
0044     runNumber=`echo $file | awk -F/ '{print $NF}' | awk -F_ '{print $NF}' | awk -F. '{print $1}'`
0045     # Strip the R at the start of the string
0046     runNumber=`echo ${runNumber#R}`
0047     # Strip all the 0s at the start of the runNumber
0048     # DQM_full_V0001_SiStrip_R000105765_T00000341.root
0049     runNumber=`echo $runNumber | sed 's/0*//'`
0050     echo "runNumber = $runNumber"
0051 
0052     # Create the cfg file
0053     if [ -e temp_cfg.py ]; then
0054         rm temp_cfg.py
0055     fi
0056 
0057     cat SiStripBadComponentsDQMServiceTemplate_cfg.py | sed "s/RUNNUMBER/$runNumber/g" | sed "s@FILENAME@$file@" > temp_cfg.py
0058     cmsRun temp_cfg.py > output_$runNumber.txt
0059     echo "Job finished with exit code = $?"
0060 
0061     # File processed. Update the list
0062     echo $file >> fullList.txt
0063 
0064     let i+=1
0065 
0066 done
0067 
0068 #Cleanup
0069 if [ -e newList.txt ]; then
0070     rm newList.txt
0071 fi
0072 
0073 # Do it every half a hour.
0074 # sleep 1800