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 |
– |
|
35 |
|
#back to the working dir |
36 |
|
cd - |
37 |
|
|
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 |
– |
|
38 |
|
MVAList=`python << EOF |
39 |
|
import os |
40 |
< |
from BetterConfigParser import BetterConfigParser |
40 |
> |
from myutils import BetterConfigParser |
41 |
|
config = BetterConfigParser() |
42 |
< |
config.read('./config$energy') |
42 |
> |
config.read('./${energy}config/training') |
43 |
|
print config.get('MVALists','List_for_submitscript') |
44 |
|
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 |
45 |
|
|
46 |
|
#Run the scripts |
47 |
|
|
48 |
|
if [ $task = "prep" ]; then |
49 |
< |
./prepare_environment_with_config.py -I $storagesamples -O $pathAna/env/ -C ${energy}samples_nosplit.cfg |
49 |
> |
./prepare_environment_with_config.py -C ${energy}config/samples_nosplit.cfg -C ${energy}config/paths |
50 |
|
fi |
51 |
|
if [ $task = "sys" ]; then |
52 |
< |
./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy |
52 |
> |
./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths |
53 |
|
fi |
54 |
|
if [ $task = "eval" ]; then |
55 |
< |
./evaluateMVA.py -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy |
55 |
> |
./evaluateMVA.py -D $MVAList -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training |
56 |
|
fi |
57 |
|
if [ $task = "syseval" ]; then |
58 |
< |
./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy |
59 |
< |
./evaluateMVA.py -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy |
58 |
> |
./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths |
59 |
> |
./evaluateMVA.py -D $MVAList -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training |
60 |
|
fi |
61 |
|
if [ $task = "plot" ]; then |
62 |
< |
./tree_stack.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -R $sample |
62 |
> |
./tree_stack.py -R $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/plots |
63 |
|
fi |
64 |
|
if [ $task = "dc" ]; then |
65 |
< |
./workspace_datacard.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -V $sample |
65 |
> |
./workspace_datacard.py -V $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/datacards |
66 |
|
fi |
67 |
|
|
68 |
|
rm -rf $TMPDIR |