ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/certifyRuns.sh
Revision: 1.3
Committed: Mon May 7 18:38:40 2012 UTC (12 years, 11 months ago) by fantasia
Content type: application/x-sh
Branch: MAIN
CVS Tags: V00-01-10, V-00-01-10, V00-01-09, V00-01-08, V00-01-07, V00-01-06, V00-01-05, V00-01-04, V00-01-03, V00-01-02, V00-01-01, V00-00-34, V00-00-33, MenuAnalyzer_V00-00-02, MenuAnalyzer_V00-00-01, MenuAnalyzer_V1
Changes since 1.2: +19 -6 lines
Log Message:
safeguards

File Contents

# User Rev Content
1 fantasia 1.2 #!/bin/bash
2     #Usage ./certifyRuns.sh runList TriggerList firstFitRun lastFitRun fitFile fitRootFile JSONFile
3 fantasia 1.1
4 fantasia 1.2 runList=runList.txt
5     TriggerList=monitorlist_Apr_Core_2012.list
6     firstFitRun=190782
7 fantasia 1.3 lastFitRun=191859 #191276 #191859
8 fantasia 1.2 fitFile=Fits/2012/Fit_HLT_NoV_10LS_Run${firstFitRun}to${lastFitRun}.pkl
9     fitRootFile=HLT_10LS_delivered_vs_rate_Run${firstFitRun}-${lastFitRun}.root
10 fantasia 1.3 JSONFile=Cert_190456-191859_8TeV_PromptReco_Collisions12_JSON.txt
11 fantasia 1.2
12     if [ $# -ge 1 ]; then
13     runList=${1}
14     fi
15     if [ $# -ge 2 ]; then
16     TriggerList=${2}
17     fi
18     if [ $# -ge 3 ]; then
19     firstFitRun=${3}
20     fi
21     if [ $# -ge 4 ]; then
22     lastFitRun=${4}
23     fi
24     if [ $# -ge 5 ]; then
25     fitFile=${5}
26     fi
27     if [ $# -ge 6 ]; then
28     fitRootFile=${6}
29     fi
30     if [ $# -ge 7 ]; then
31     JSONFile=${7}
32     fi
33    
34     echo Certifying runs from file $runList
35     echo Using Trigger List $TriggerList from run $firstFitRun to $lastFitRun
36     echo Fit files are $fitFile $fitRootFile
37     echo JSON file is $JSONFile
38    
39     #if fit file doesn't exist, make it!!!
40 fantasia 1.3 if [[ ( ! -f $fitFile ) || ( ! -f $fitRootFile ) ]]; then
41 fantasia 1.2 echo Fit file do not exist, creating
42 fantasia 1.3 ./DatabaseRatePredictor.py --makeFits --TriggerList=$TriggerList --Beam --NoVersion --json=$JSONFile ${firstFitRun}-${lastFitRun}
43 fantasia 1.2 echo Done making fit file.
44     fi
45    
46     for run in `cat $runList`
47 fantasia 1.1 do
48 fantasia 1.3 if [ -f HLT_1LS_ls_vs_rawrate_Run${run}-${run}.pdf ]; then
49     echo Skipping because .pdf exists for run $run
50     continue
51     fi
52    
53 fantasia 1.1 echo Producing Plots for run $run
54 fantasia 1.3 ./DatabaseRatePredictor.py --Beam --secondary --TriggerList=${TriggerList} --fitFile=${fitFile} ${run}
55     if [ ! -f HLT_1LS_ls_vs_rawrate_Run${run}-${run}.root ]; then
56     echo -e "\n\tNo output root fit file for run $run, was the collisions key used?\n"
57     continue
58     fi
59    
60 fantasia 1.2 root -b -l -q 'dumpToPDF.C("HLT_1LS_ls_vs_rawrate_Run'${run}'-'${run}'.root", "'${fitRootFile}'")'
61 fantasia 1.3 if [ $? -ne 0 ]; then
62     echo Return value not 0!!!! Quitting...
63     exit 1
64     fi
65 fantasia 1.1 done
66 fantasia 1.2
67     echo Done.