1 |
bortigno |
1.5 |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
#Input argument:
|
4 |
|
|
#sample you want to run on. It has to match the naming in sample.info.
|
5 |
nmohr |
1.1 |
sample=$1
|
6 |
bortigno |
1.5 |
#sqrt(s) you want to run
|
7 |
nmohr |
1.4 |
energy=$2
|
8 |
bortigno |
1.5 |
|
9 |
bortigno |
1.7 |
if [ $# -lt 2 ]
|
10 |
|
|
then
|
11 |
|
|
echo "ERROR: You passed " $# "arguments while the script needs at least 2 arguments."
|
12 |
|
|
echo "Exiting..."
|
13 |
|
|
echo " ---------------------------------- "
|
14 |
|
|
echo " Usage : ./runAll.sh sample energy"
|
15 |
|
|
echo " ---------------------------------- "
|
16 |
|
|
exit
|
17 |
|
|
fi
|
18 |
|
|
|
19 |
bortigno |
1.5 |
#Set the environment for the batch job execution
|
20 |
nmohr |
1.4 |
cd $CMSSW_BASE/src/
|
21 |
nmohr |
1.1 |
source /swshare/psit3/etc/profile.d/cms_ui_env.sh
|
22 |
|
|
export SCRAM_ARCH="slc5_amd64_gcc462"
|
23 |
|
|
source $VO_CMS_SW_DIR/cmsset_default.sh
|
24 |
|
|
eval `scramv1 runtime -sh`
|
25 |
|
|
unset TMP
|
26 |
|
|
unset TMPDIR
|
27 |
bortigno |
1.5 |
|
28 |
|
|
#Path where the script write_regression_systematic.py and evaluateMVA.py are stored
|
29 |
|
|
#execute=$PWD/UserCode/VHbb/python/
|
30 |
bortigno |
1.7 |
#execute=/shome/bortigno/VHbbAnalysis/VHbbTest/python
|
31 |
|
|
#cd $execute
|
32 |
bortigno |
1.5 |
|
33 |
|
|
#back to the working dir
|
34 |
bortigno |
1.7 |
cd -
|
35 |
bortigno |
1.5 |
|
36 |
|
|
#Parsing the path form the config
|
37 |
nmohr |
1.4 |
pathAna=`python << EOF
|
38 |
|
|
import os
|
39 |
|
|
from BetterConfigParser import BetterConfigParser
|
40 |
|
|
config = BetterConfigParser()
|
41 |
|
|
config.read('./pathConfig$energy')
|
42 |
|
|
print config.get('Directories','samplepath')
|
43 |
|
|
EOF`
|
44 |
|
|
echo $pathAna
|
45 |
|
|
configFile=config$energy
|
46 |
bortigno |
1.5 |
|
47 |
|
|
#Create subdirs where processed samples will be stored
|
48 |
|
|
if [ ! -d $pathAna/env/sys ]
|
49 |
|
|
then
|
50 |
|
|
mkdir $pathAna/env/sys
|
51 |
|
|
fi
|
52 |
bortigno |
1.7 |
if [ ! -d $pathAna/env/sys/MVAout ]
|
53 |
bortigno |
1.5 |
then
|
54 |
|
|
mkdir $pathAna/env/sys/MVAout
|
55 |
|
|
fi
|
56 |
|
|
|
57 |
|
|
#Create the link to th sample information in the new sudfolders
|
58 |
|
|
if [ ! -f $pathAna/env/sys/samples.info ]
|
59 |
|
|
then
|
60 |
|
|
ln -s $pathAna/env/samples.info $pathAna/env/sys/samples.info
|
61 |
|
|
fi
|
62 |
|
|
if [ ! -f $pathAna/sys/MVAout/samples.info ]
|
63 |
|
|
then
|
64 |
|
|
ln -s $pathAna/env/samples.info $pathAna/env/sys/MVAout/samples.info
|
65 |
|
|
fi
|
66 |
|
|
|
67 |
|
|
#Run the scripts
|
68 |
nmohr |
1.4 |
./write_regression_systematics.py -P $pathAna/env/ -S $sample -C $configFile -C pathConfig$energy
|
69 |
|
|
./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} -C pathConfig$energy
|