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.19 by bortigno, Fri Jan 11 13:29:45 2013 UTC vs.
Revision 1.27 by nmohr, Thu Feb 28 16:38:49 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 28 | Line 32 | source /swshare/psit3/etc/profile.d/cms_
32   export SCRAM_ARCH="slc5_amd64_gcc462"
33   source $VO_CMS_SW_DIR/cmsset_default.sh
34   eval `scramv1 runtime -sh`
35 < export LD_PRELOAD="libglobus_gssapi_gsi_gcc64pthr.so.0":${LD_PRELOAD}
36 <
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  
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
40   #back to the working dir
41   cd -
42  
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
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`
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
50  
51   #Run the scripts
52  
53   if [ $task = "prep" ]; then
54 <    ./prepare_environment_with_config.py -I $storagesamples -O $pathAna/env/ -C ${energy}samples_nosplit.cfg
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 -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 -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 -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 True
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 -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