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.5 by bortigno, Wed Sep 19 15:19:00 2012 UTC vs.
Revision 1.16 by nmohr, Thu Oct 11 16:53:25 2012 UTC

# Line 6 | Line 6 | sample=$1
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   cd $CMSSW_BASE/src/
26   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 < unset TMP
31 < unset TMPDIR
30 > export LD_LIBRARY_PATH=/swshare/glite/d-cache/dcap/lib/:$LD_LIBRARY_PATH
31 > #unset TMP
32 > #unset TMPDIR
33 >
34 > mkdir $TMPDIR
35  
36   #Path where the script write_regression_systematic.py and evaluateMVA.py are stored
37   #execute=$PWD/UserCode/VHbb/python/
38 < #execute=/shome/bortigno/VHbbAnalysis/VHbbTest/python
38 > #execute=/shome/peller/UserCode/VHbb/python/
39   #cd $execute
40  
41   #back to the working dir
# Line 34 | Line 52 | EOF`
52   echo $pathAna
53   configFile=config$energy
54  
55 + MVAList=`python << EOF
56 + import os
57 + from BetterConfigParser import BetterConfigParser
58 + config = BetterConfigParser()
59 + config.read('./config$energy')
60 + print config.get('MVALists','List_for_submitscript')
61 + EOF`
62 + configFile=config$energy
63  
64  
65   #Create subdirs where processed samples will be stored
66 + if [ ! -d $pathAna/env ]
67 +    then
68 +    mkdir $pathAna/env
69 + fi
70   if [ ! -d $pathAna/env/sys ]
71      then
72      mkdir $pathAna/env/sys
73   fi
74 < if [ ! -d $pathAna/env/sys ]
74 > if [ ! -d $pathAna/env/sys/MVAout ]
75      then
76      mkdir $pathAna/env/sys/MVAout
77   fi
78  
79 < #Create the link to th sample information in the new sudfolders
80 < if [ ! -f $pathAna/env/sys/samples.info ]
81 <    then
82 <    ln -s $pathAna/env/samples.info  $pathAna/env/sys/samples.info
79 > #Run the scripts
80 >
81 > if [ $task = "prep" ]; then
82 >    ./prepare_environment_with_config.py -I $pathAna -O $pathAna/env/ -C ${energy}samples_nosplit.cfg
83   fi
84 < if [ ! -f $pathAna/sys/MVAout/samples.info ]
85 <    then
86 <    ln -s $pathAna/env/samples.info $pathAna/env/sys/MVAout/samples.info
84 > if [ $task = "sys" ]; then
85 >    ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
86 > fi
87 > if [ $task = "eval" ]; then
88 >    ./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
89 > fi
90 > if [ $task = "syseval" ]; then
91 >    ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
92 >    ./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
93 > fi
94 > if [ $task = "plot" ]; then
95 >    ./tree_stack.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -R $sample
96 > fi
97 > if [ $task = "dc" ]; then
98 >    ./workspace_datacard.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -V $sample
99   fi
100  
101 < #Run the scripts
60 < ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
61 < ./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} -C pathConfig$energy
62 < #./showinfo.py $pathAna/env/sys
101 > rm -rf $TMPDIR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines