1 |
#!/bin/bash
|
2 |
|
3 |
#checkout the head of UserCode/VHbb and the Btagging reshaping in VHbb/data/Btag/
|
4 |
cvs co -d VHbbSF UserCode/VHbb
|
5 |
cd data
|
6 |
cvs co -d Btag UserCode/VHbbAnalysis/VHbbDataFormats/interface/BTagReshaping.h
|
7 |
cvs co -d Btag UserCode/VHbbAnalysis/VHbbDataFormats/interface/btag_payload_b.h
|
8 |
cvs co -d Btag UserCode/VHbbAnalysis/VHbbDataFormats/interface/btag_payload_light.h
|
9 |
#go to test
|
10 |
cd ../test
|
11 |
cp prepare_histo_environment.sh SideBandAnalysis-Pt50To100/
|
12 |
cd SideBandAnalysis-Pt50To100/
|
13 |
|
14 |
#./prepare_histo_environment.sh <dir where you have the trees> # this thing creates histo dir and put there all the links to the trees. An example would be
|
15 |
echo "Insert the dir where you stored the trees"
|
16 |
read TREEDIR
|
17 |
./prepare_histos_environment.sh ${TREEDIR}/
|
18 |
ls -l histos # check the links
|
19 |
#if you still have the samples splitted by flavours then you need to do the following.
|
20 |
#hadd ZllH.Jun18.DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball.root ZllH.Jun18.b_DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball.root ZllH.Jun18.c_DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball.root ZllH.Jun18.udsg_DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball.root > hadd_M50.log 2>&1 &
|
21 |
#BETTER TO PARALLELIZE HERE...
|
22 |
cd histos
|
23 |
for file in ZllH.Jun18.b_*;
|
24 |
do
|
25 |
FILE=${file/b_/} ;
|
26 |
hadd -f ${FILE} ${FILE/Jun18./Jun18.b_} ${FILE/Jun18./Jun18.c_} ${FILE/Jun18./Jun18.udsg_} > hadd_${FILE}.log 2>&1 &
|
27 |
done
|
28 |
|
29 |
#hadd also the data!
|
30 |
hadd Zll.Jun18.DataZ.root ZllH.Jun18.DataZee.root ZllH.Jun18.DataZmm.root
|
31 |
|
32 |
#Wait that this is done
|
33 |
#then take the histos from b_ and the tree from the hadd"ed" file using this stupid script:
|
34 |
cvs co -p UserCode/bortigno/Utils/addHistos.py > addHistos.py
|
35 |
chmod u+x addHistos.py
|
36 |
# usage : ./addHistos.py -i <input histos file name> -t <input tree file name>
|
37 |
# looping does not work. You need to do it by hand...
|
38 |
for file in ZllH.Jun18.b_*;
|
39 |
do
|
40 |
FILE=${file/b_/};
|
41 |
./addHistos.py -t ${FILE} -i ${FILE/Jun18./Jun18.b_} > addHistos_${FILE}.log 2>&1 &
|
42 |
done
|
43 |
|
44 |
#before running you need to update the name of files and dir in sampleSideBand.h and the lumi!
|
45 |
vi sampleSideBand.h
|
46 |
|
47 |
#go to test dir
|
48 |
cd ../
|
49 |
./compile
|
50 |
#run make_histos_pt50To100 and wait ~5 min
|
51 |
./make_histos_Pt50To100
|
52 |
# if you want to look to some plots do:
|
53 |
cd SideBandAnalysis-Pt50To100/
|
54 |
mkdir PlotsJune18
|
55 |
root -b plottingmacro.C+
|
56 |
#in the dir will show up the plots of the sideband
|
57 |
|
58 |
#then run the fit and syst
|
59 |
./do_fit_and_syst.sh
|
60 |
|
61 |
#the output is a file with SF, one with the correlation matrix, one with the piece for the DC
|
62 |
#The implementation does not consider the extrapolation systematics due to JER and JES yet.
|
63 |
#It has to be done by hand...
|