22 |
|
|
23 |
|
#cd /shome/peller/CMSSW_5_2_4_patch4/src/ |
24 |
|
# this doesnt work for me..? |
25 |
+ |
|
26 |
|
cd $CMSSW_BASE/src/ |
27 |
|
source /swshare/psit3/etc/profile.d/cms_ui_env.sh |
28 |
|
export SCRAM_ARCH="slc5_amd64_gcc462" |
29 |
|
source $VO_CMS_SW_DIR/cmsset_default.sh |
30 |
|
eval `scramv1 runtime -sh` |
31 |
< |
unset TMP |
31 |
< |
unset TMPDIR |
31 |
> |
export LD_PRELOAD="libglobus_gssapi_gsi_gcc64pthr.so.0":${LD_PRELOAD} |
32 |
|
|
33 |
< |
#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 |
33 |
> |
mkdir $TMPDIR |
34 |
|
|
35 |
|
#back to the working dir |
36 |
|
cd - |
37 |
|
|
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 |
– |
|
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` |
59 |
– |
configFile=config$energy |
45 |
|
|
46 |
< |
|
47 |
< |
#Create subdirs where processed samples will be stored |
48 |
< |
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 |
46 |
> |
pathAnaEnv=$pathAna/env |
47 |
> |
pathAnaSys=$pathAnaEnv/sys |
48 |
> |
pathAnaMVAout=$pathAnaSys/MVAout |
49 |
|
|
50 |
|
#Run the scripts |
51 |
|
|
52 |
|
if [ $task = "prep" ]; then |
53 |
< |
./prepare_environment_with_config.py -I $pathAna -O $pathAna/env/ -C ${energy}samples_nosplit.cfg |
53 |
> |
./prepare_environment_with_config.py -C ${energy}config/samples_nosplit.cfg -C ${energy}config/paths |
54 |
|
fi |
55 |
|
if [ $task = "sys" ]; then |
56 |
< |
./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy |
56 |
> |
./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths |
57 |
|
fi |
58 |
|
if [ $task = "eval" ]; then |
59 |
< |
./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy |
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 = "syseval" ]; then |
62 |
< |
./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy |
63 |
< |
./evaluateMVA.py -P $pathAna/env/sys/ -D $MVAList -S $sample -U 0 -C ${configFile} -C pathConfig$energy |
62 |
> |
./write_regression_systematics.py -S $sample -C ${energy}config/general -C ${energy}config/paths |
63 |
> |
./evaluateMVA.py -D $MVAList -S $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/training |
64 |
|
fi |
65 |
|
if [ $task = "plot" ]; then |
66 |
< |
./tree_stack.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -R $sample |
66 |
> |
./tree_stack.py -R $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/plots |
67 |
|
fi |
68 |
|
if [ $task = "dc" ]; then |
69 |
< |
./workspace_datacard.py -P $pathAna/env/sys/MVAout/ -C ${configFile} -C pathConfig$energy -V $sample |
69 |
> |
./workspace_datacard.py -V $sample -C ${energy}config/general -C ${energy}config/paths -C ${energy}config/cuts -C ${energy}config/datacards |
70 |
|
fi |
71 |
+ |
|
72 |
+ |
rm -rf $TMPDIR |