ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/DTDPGAnalysis/scripts/configureDQMPlotter.sh
Revision: 1.2
Committed: Thu Jul 4 16:41:23 2013 UTC (11 years, 9 months ago) by marycruz
Content type: application/x-sh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +9 -6 lines
Error occurred while calculating annotation data.
Log Message:
Update last version of PromptOffline

File Contents

# Content
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 eos dir not provided!"
11 echo "Usage :"
12 echo " $0 <Run Number> <eos 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 " <eos dir> is the eos caf 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 " /eos/cms/store/caf/marycruz/PromptOffline/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 ###InputFiles=`/afs/cern.ch/project/eos/installation/0.1.0-22d/bin/eos.select ls ${OutputDir} | awk '{print $1}' | grep root`
38 InputFiles=`/afs/cern.ch/project/eos/installation/pro/bin/eos.select ls ${OutputDir} | awk '{print $1}' | grep root`
39 #echo $InputFiles
40 first=0
41 for file in $InputFiles; do
42 ##remotefile="rfio:$OutputDir/$file"
43 remotefile="root://eoscms/$OutputDir/$file"
44 if [ $first -le 0 ];then
45 INPUT="'$remotefile'"
46 else
47 INPUT="$INPUT , '$remotefile'"
48 fi
49 first=1
50 done
51 echo $INPUT
52 ## B)
53 ## replace in configuration template the Run number and input file list
54 if [ -e tmp.pycfg ];then
55 rm tmp.pycfg
56 fi
57 less $CONFIG_FILE | sed -e "s?INPUT?$INPUT?g" > tmp.pycfg
58 less tmp.pycfg | sed -e "s?INSERTRUN?${run}?g" > runDTDPGOfflineSummary_cfg_${run}.py
59 rm tmp.pycfg
60 echo "- Created the configuration file: runDTDPGOfflineSummary_cfg_${run}.py "
61 echo "==> In order to produce DQM plots for run ${run} you should run it:"
62 echo " cmsRun runDTDPGOfflineSummary_cfg_${run}.py"
63