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.27 by nmohr, Thu Feb 28 16:38:49 2013 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 > job_id=$4
12 >
13 > additional_arg=$5
14 >
15 > if [ $# -lt 3 ]
16 >    then
17 >    echo "ERROR: You passed " $# "arguments while the script needs at least 3 arguments."
18 >    echo "Exiting..."
19 >    echo " ---------------------------------- "
20 >    echo " Usage : ./runAll.sh sample energy task"
21 >    echo " ---------------------------------- "
22 >    exit
23 > fi
24 >
25 > #Set the environment for the batch job execution
26 >
27 > #cd /shome/peller/CMSSW_5_2_4_patch4/src/
28 > # this doesnt work for me..?
29 >
30 > cd $CMSSW_BASE/src/
31   source /swshare/psit3/etc/profile.d/cms_ui_env.sh
32   export SCRAM_ARCH="slc5_amd64_gcc462"
33   source $VO_CMS_SW_DIR/cmsset_default.sh
34   eval `scramv1 runtime -sh`
35 < unset TMP
36 < unset TMPDIR
37 < pathAna=/shome/nmohr/VHbbAnalysis/EDMNtuple_step2/May5/
38 < execute=/shome/nmohr/CMSSW_5_3_2/src/UserCode/VHbb/python/
39 < configFile=config7TeV
40 < mkdir $pathAna/env/sys
41 < cd $execute
42 < ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile
43 < mkdir $pathAna/env/sys/MVAout
44 < ./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}
45 < ./showinfo.py $pathAna/env/sys
35 > #export LD_PRELOAD="libglobus_gssapi_gsi_gcc64pthr.so.0":${LD_PRELOAD}
36 > export LD_LIBRARY_PATH=/swshare/glite/globus/lib/:/swshare/glite/d-cache/dcap/lib64/:$LD_LIBRARY_PATH
37 > export LD_PRELOAD="libglobus_gssapi_gsi_gcc64pthr.so.0:${LD_PRELOAD}"
38 > mkdir $TMPDIR
39 >
40 > #back to the working dir
41 > cd -
42 >
43 > MVAList=`python << EOF
44 > import os
45 > from myutils import BetterConfigParser
46 > config = BetterConfigParser()
47 > config.read('./${energy}config/training')
48 > print config.get('MVALists','List_for_submitscript')
49 > EOF`
50 >
51 > #Run the scripts
52 >
53 > if [ $task = "prep" ]; then
54 >    ./prepare_environment_with_config.py -S $sample -C ${energy}config/samples_nosplit.cfg -C ${energy}config/paths
55 > fi
56 > if [ $task = "sys" ]; then
57 >    ./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths
58 > fi
59 > if [ $task = "eval" ]; then
60 >    ./evaluateMVA.py -D $MVAList -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training
61 > fi
62 > if [ $task = "syseval" ]; then
63 >    ./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths
64 >    ./evaluateMVA.py -D $MVAList -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training
65 > fi
66 > if [ $task = "train" ]; then
67 >    ./train.py -T $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training -L True
68 > fi
69 > if [ $task = "plot" ]; then
70 >    ./tree_stack.py -R $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/plots
71 > fi
72 > if [ $task = "dc" ]; then
73 >    ./workspace_datacard.py -V $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/datacards -C ${energy}config/plots
74 > fi
75 > if [ $task = "split" ]; then
76 >    ./split_tree.py -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training -M $job_id
77 > fi
78 >
79 > if [ $task = "mva_opt" ]; then
80 >    if [ $# -lt 5 ]
81 >        then
82 >        echo "@ERROR: You passed " $# "arguments while BDT optimisation needs at least 5 arguments."
83 >        echo "Exiting..."
84 >        echo " ---------------------------------- "
85 >        echo " Usage : ./runAll.sh sample energy task jo_id bdt_factory_settings"
86 >        echo " ---------------------------------- "
87 >        exit
88 >    fi
89 >    echo "BDT factory settings"
90 >    echo $additional_arg
91 >    echo "Runnning"
92 >    ./train.py -N ${sample} -T ${job_id} -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/training -C ${energy}config/cuts -S ${additional_arg} -L False
93 > fi
94 >
95 > rm -rf $TMPDIR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines