ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/scripts/configureDQMPlotter.sh
Revision: 1.1
Committed: Wed Dec 15 11:50:34 2010 UTC (14 years, 4 months ago) by battilan
Content type: application/x-sh
Branch: MAIN
CVS Tags: V00-01-00, V00-00-15
Log Message:
first version of scripts from Mary-Cruz

File Contents

# User Rev Content
1 battilan 1.1 #!/bin/sh
2     ###
3     # This script is meant to:
4     # A) get the list of DQM root files produced in parellel with CRAB
5     # running the runDQMOfflineDPGSources_cfg.py
6     # B) configure the runDQMOfflineDPGClients_cfg_template.py with the correct Run number
7     # and the correct DQM root files to read
8     ###
9     if [ $# -lt 2 ];then
10     echo "Run Number or CASTOR dir not provided!"
11     echo "Usage :"
12     echo " $0 <Run Number> <CASTOR dir with DQM root files for that Run>"
13     echo ""
14     echo " <Run Number> is the Run number you what to produce plots for "
15     echo " <CASTOR dir> is the CASTOR dir where the DQM root files have been copied "
16     echo " as configured with storage_path + lfn in crab_runDQM*.cfg "
17     echo " For example: "
18     echo " /castor/cern.ch/user/a/afanfani/DQMCRAFT/DQMDTRun<Run Number>"
19     echo ""
20     exit 1
21     fi
22    
23     run=$1
24     OutputDir=$2
25    
26    
27     CONFIG_FILE="runDTDPGOfflineSummary_template_cfg.py"
28     if ! [ -e $CONFIG_FILE ]; then
29     echo "ERROR: File $CONFIG_FILE do not exist in this directory"
30     echo "Exiting..."
31     exit 1
32     fi
33    
34     ## A)
35     echo "- Looking for DQM root files in ${OutputDir} "
36     InputFiles=`rfdir ${OutputDir} | awk '{print $9}' | grep root`
37     #echo $InputFiles
38     first=0
39     for file in $InputFiles; do
40     remotefile="rfio:$OutputDir/$file"
41     if [ $first -le 0 ];then
42     INPUT="'$remotefile'"
43     else
44     INPUT="$INPUT , '$remotefile'"
45     fi
46     first=1
47     done
48     echo $INPUT
49     ## B)
50     ## replace in configuration template the Run number and input file list
51     if [ -e tmp.pycfg ];then
52     rm tmp.pycfg
53     fi
54     less $CONFIG_FILE | sed -e "s?INPUT?$INPUT?g" > tmp.pycfg
55     less tmp.pycfg | sed -e "s?INSERTRUN?${run}?g" > runDTDPGOfflineSummary_cfg_${run}.py
56     rm tmp.pycfg
57     echo "- Created the configuration file: runDTDPGOfflineSummary_cfg_${run}.py "
58     echo "==> In order to produce DQM plots for run ${run} you should run it:"
59     echo " cmsRun runDTDPGOfflineSummary_cfg_${run}.py"
60