ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/runAll.sh
Revision: 1.15
Committed: Thu Oct 11 13:40:18 2012 UTC (12 years, 7 months ago) by peller
Content type: application/x-sh
Branch: MAIN
Changes since 1.14: +6 -2 lines
Log Message:
plotting cache

File Contents

# User Rev Content
1 bortigno 1.5 #!/bin/bash
2    
3     #Input argument:
4     #sample you want to run on. It has to match the naming in sample.info.
5 nmohr 1.1 sample=$1
6 bortigno 1.5 #sqrt(s) you want to run
7 nmohr 1.4 energy=$2
8 bortigno 1.5
9 peller 1.9 task=$3
10    
11     if [ $# -lt 3 ]
12 bortigno 1.7 then
13 peller 1.9 echo "ERROR: You passed " $# "arguments while the script needs at least 3 arguments."
14 bortigno 1.7 echo "Exiting..."
15     echo " ---------------------------------- "
16 peller 1.9 echo " Usage : ./runAll.sh sample energy task"
17 bortigno 1.7 echo " ---------------------------------- "
18     exit
19     fi
20    
21 bortigno 1.5 #Set the environment for the batch job execution
22 peller 1.8
23     #cd /shome/peller/CMSSW_5_2_4_patch4/src/
24     # this doesnt work for me..?
25 nmohr 1.4 cd $CMSSW_BASE/src/
26 nmohr 1.1 source /swshare/psit3/etc/profile.d/cms_ui_env.sh
27     export SCRAM_ARCH="slc5_amd64_gcc462"
28     source $VO_CMS_SW_DIR/cmsset_default.sh
29     eval `scramv1 runtime -sh`
30 peller 1.15 #unset TMP
31     #unset TMPDIR
32    
33     mkdir $TMPDIR
34 bortigno 1.5
35     #Path where the script write_regression_systematic.py and evaluateMVA.py are stored
36     #execute=$PWD/UserCode/VHbb/python/
37 peller 1.8 #execute=/shome/peller/UserCode/VHbb/python/
38 bortigno 1.7 #cd $execute
39 bortigno 1.5
40     #back to the working dir
41 bortigno 1.7 cd -
42 bortigno 1.5
43     #Parsing the path form the config
44 nmohr 1.4 pathAna=`python << EOF
45     import os
46     from BetterConfigParser import BetterConfigParser
47     config = BetterConfigParser()
48     config.read('./pathConfig$energy')
49     print config.get('Directories','samplepath')
50     EOF`
51     echo $pathAna
52     configFile=config$energy
53 bortigno 1.5
54 peller 1.9 MVAList=`python << EOF
55     import os
56     from BetterConfigParser import BetterConfigParser
57     config = BetterConfigParser()
58     config.read('./config$energy')
59     print config.get('MVALists','List_for_submitscript')
60     EOF`
61     configFile=config$energy
62    
63    
64 bortigno 1.5 #Create subdirs where processed samples will be stored
65 bortigno 1.10 if [ ! -d $pathAna/env ]
66     then
67     mkdir $pathAna/env
68     fi
69 bortigno 1.5 if [ ! -d $pathAna/env/sys ]
70     then
71     mkdir $pathAna/env/sys
72     fi
73 bortigno 1.7 if [ ! -d $pathAna/env/sys/MVAout ]
74 bortigno 1.5 then
75     mkdir $pathAna/env/sys/MVAout
76     fi
77    
78 bortigno 1.11 #Create the link to th sample information in the new sudfolders.
79     #It always update the link.
80     ln -s -f $pathAna/env/samples.info $pathAna/env/sys/samples.info
81     ln -s -f $pathAna/env/samples.info $pathAna/env/sys/MVAout/samples.info
82 bortigno 1.5
83     #Run the scripts
84 peller 1.9
85     if [ $task = "prep" ]; then
86 bortigno 1.10 ./prepare_environment_with_config.py -I $pathAna -O $pathAna/env/ -C ${energy}samples_nosplit.cfg
87 peller 1.9 fi
88     if [ $task = "sys" ]; then
89     ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
90     fi
91     if [ $task = "eval" ]; then
92     ./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
93     fi
94 nmohr 1.14 if [ $task = "syseval" ]; then
95     ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
96     ./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
97     fi
98 peller 1.9 if [ $task = "plot" ]; then
99 nmohr 1.14 ./tree_stack.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -R $sample
100 peller 1.9 fi
101     if [ $task = "dc" ]; then
102     ./workspace_datacard.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -V $sample
103     fi
104 peller 1.15
105     rm -rf $TMPDIR