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.14 by nmohr, Mon Oct 8 15:11:44 2012 UTC vs.
Revision 1.25 by bortigno, Thu Feb 14 12:35:12 2013 UTC

# Line 8 | Line 8 | 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."
# Line 22 | Line 26 | fi
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 <
38 < #Path where the script write_regression_systematic.py and evaluateMVA.py are stored
34 < #execute=$PWD/UserCode/VHbb/python/
35 < #execute=/shome/peller/UserCode/VHbb/python/
36 < #cd $execute
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  
41 #Parsing the path form the config
42 pathAna=`python << EOF
43 import os
44 from BetterConfigParser import BetterConfigParser
45 config = BetterConfigParser()
46 config.read('./pathConfig$energy')
47 print config.get('Directories','samplepath')
48 EOF`
49 echo $pathAna
50 configFile=config$energy
51
43   MVAList=`python << EOF
44   import os
45 < from BetterConfigParser import BetterConfigParser
45 > from myutils import BetterConfigParser
46   config = BetterConfigParser()
47 < config.read('./config$energy')
47 > config.read('./${energy}config/training')
48   print config.get('MVALists','List_for_submitscript')
49   EOF`
59 configFile=config$energy
60
61
62 #Create subdirs where processed samples will be stored
63 if [ ! -d $pathAna/env ]
64    then
65    mkdir $pathAna/env
66 fi
67 if [ ! -d $pathAna/env/sys ]
68    then
69    mkdir $pathAna/env/sys
70 fi
71 if [ ! -d $pathAna/env/sys/MVAout ]
72    then
73    mkdir $pathAna/env/sys/MVAout
74 fi
75
76 #Create the link to th sample information in the new sudfolders.
77 #It always update the link.
78 ln -s -f $pathAna/env/samples.info  $pathAna/env/sys/samples.info
79 ln -s -f $pathAna/env/samples.info $pathAna/env/sys/MVAout/samples.info
50  
51   #Run the scripts
52  
53   if [ $task = "prep" ]; then
54 <    ./prepare_environment_with_config.py -I $pathAna -O $pathAna/env/ -C ${energy}samples_nosplit.cfg
54 >    ./prepare_environment_with_config.py -C ${energy}config/samples_nosplit.cfg -C ${energy}config/paths
55   fi
56   if [ $task = "sys" ]; then
57 <    ./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
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 -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
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 -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
64 <    ./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy
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 False
68   fi
69   if [ $task = "plot" ]; then
70 <    ./tree_stack.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -R $sample
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 -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -V $sample
73 >    ./workspace_datacard.py -V $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/datacards
74 > fi
75 > if [ $task = "split" ]; then
76 >    ./split_tree.py -M $additional -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training
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