ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/runAll.sh
(Generate patch)

Comparing UserCode/VHbb/python/runAll.sh (file contents):
Revision 1.3 by nmohr, Thu Aug 9 13:52:04 2012 UTC vs.
Revision 1.18 by nmohr, Mon Dec 3 13:28:40 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines