-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcoupling_measurement.C
153 lines (142 loc) · 7.39 KB
/
coupling_measurement.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include "TROOT.h"
#include "TFile.h"
#include "TTree.h"
#include "TBrowser.h"
#include "TH2.h"
#include "TRandom.h"
#include "TCanvas.h"
#include "TStyle.h"
#include "THStack.h"
#include "TLegend.h"
#include "TLatex.h"
#include <iostream>
void coupling_measurement(TString sel="prova", bool sideband=true, float min=0, float max=2)
{
if(sel=="prova") return;
gROOT->Reset();
gStyle->SetCanvasColor(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetMarkerStyle(22);
gStyle->SetOptStat(0);
TCanvas *c1 = new TCanvas("coupling","coupling",30,30,800,600);
c1->SetGrid();
// draw a frame to define the range
TH1F *hr = c1->DrawFrame(-5,0,7,65);
//hr->SetXTitle("p_t");
hr->GetYaxis()->SetTitleOffset(1.0);
hr->SetYTitle("MET cut");
hr->SetXTitle("#sigma on rV measurement");
hr->GetYaxis()->SetTitleSize(0.045);
hr->GetXaxis()->SetTitleSize(0.045);
hr->GetYaxis()->SetLabelSize(0.045);
hr->GetXaxis()->SetLabelSize(0.040);
hr->GetYaxis()->SetNdivisions(015);
const Int_t n = 20;
//LOW MET CUT
Double_t y_centr[n] = {-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9};
Double_t y_erlow[n] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
Double_t y_erhig[n] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
Double_t x_centr[n] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
// -1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
if(!sideband){
//MC BKG
//VHlep1
if(sel=="VHlep1") {
Double_t x_erlow[n] = {0.865345,0.844741,0.826624,0.814634,0.804645,0.802949,0.804242,0.809796,201,201,201,201,201,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {1.57891,1.56241,1.54981,1.54917,1.54998,1.57084,1.59965,1.64251,1.19334,1.22874,1.26373,1.3193,1.39003,1.47625,1.59185,1.75099,1.98393,2.33453,2.90948,4.68023};
}
//VHlep2
if(sel=="VHlep2") {
Double_t x_erlow[n] = {2.56557,2.38531,2.22304,2.09321,2.00704,1.98628,1.981,1.98794,2.01623,2.05354,2.08783,201,201,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {3.43476,3.29173,3.16909,3.08308,3.05138,3.11495,3.20622,3.32696,3.50211,3.72148,3.97364,2.97657,3.2132,3.55633,4.08556,4.90006,6.3567,8.29943,30.5657,128.278};
}
//VHmetT
if(sel=="VHmetT") {
Double_t x_erlow[n] = {2.8874,2.56138,2.26013,2.01522,1.85125,1.71143,1.59633,1.4957,1.41358,1.35894,1.30951,1.2762,1.23767,1.21275,1.19742,1.20805,1.23355,201,201,201};
Double_t x_erhig[n] = {3.18255,2.91988,2.67321,2.47263,2.34945,2.24189,2.15582,2.08163,2.02718,2.00829,1.99598,2.00913,2.0161,2.05034,2.11062,2.24004,2.43898,1.94345,2.26239,3.36364};
}
//ttHhad
if(sel=="ttHhad") {
Double_t x_erlow[n] = {3.84643,3.23125,2.96495,2.82116,2.70509,2.596,2.49624,2.40113,2.31831,2.28309,2.19436,2.09837,2.00986,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {4.58439,4.0736,3.86196,3.75742,3.68325,3.62087,3.57653,3.54561,3.54225,3.62824,3.651,3.68787,3.77815,2.76994,2.82907,2.93495,3.24079,3.61888,4.50953,7.14343};
}
//VHhadB
if(sel=="VHhadB") {
Double_t x_erlow[n] = {5.35001,5.09173,4.84396,4.64062,4.43147,4.20828,3.9993,3.79365,3.625,3.48895,3.39049,3.24834,3.17256,3.11595,2.99101,2.80766,2.85888,3.11851,201,201};
Double_t x_erhig[n] = {5.66319,5.45352,5.25341,5.09811,4.93559,4.75593,4.5908,4.42958,4.31223,4.23727,4.21498,4.15067,4.18357,4.26287,4.27935,4.24169,4.62244,5.53665,5.1091,22.3609};
}
//VHhad0
if(sel=="VHhad0") {
Double_t x_erlow[n] = {2.67097,2.58138,2.49218,2.4054,2.31249,2.21792,2.12431,2.07219,1.98572,1.8808,1.78948,1.70381,1.66196,1.58922,1.55664,1.53952,1.58572,201,201,201};
Double_t x_erhig[n] = {3.29995,3.22518,3.1511,3.08043,3.00298,2.92372,2.84768,2.82851,2.7679,2.68509,2.62409,2.57511,2.59963,2.58517,2.65137,2.77153,3.07152,2.4114,3.14665,8.34286};
}
}
if(sideband){
//SIDEBAND
//VHlep1
if(sel=="VHlep1") {
Double_t x_erlow[n] = {1.21869,1.15681,1.10054,1.05793,1.02142,1.00191,0.988866,0.983631,0.979968,0.983412,201,201,201,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {1.91116,1.85891,1.81291,1.78525,1.76234,1.7673,1.78322,1.81641,1.85603,1.91849,1.40949,1.46047,1.52805,1.61182,1.72804,1.89225,2.13811,2.51264,3.12966,5.10852};
}
//VHlep2
if(sel=="VHlep2") {
Double_t x_erlow[n] = {3.11548,2.87988,2.66834,2.49813,2.38352,2.35112,2.33867,2.34185,2.37193,2.41362,2.45208,2.4729,201,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {3.90609,3.71908,3.55668,3.43838,3.38426,3.43987,3.52696,3.64649,3.82548,4.05123,4.30982,4.58501,3.57694,3.9542,4.54303,5.45666,7.10646,9.3052,32.0946,133.269};
}
//VHmetT
if(sel=="VHmetT") {
Double_t x_erlow[n] = {3.03829,2.69084,2.36918,2.10777,1.93241,1.78255,1.65984,1.55225,1.4643,1.40533,1.35191,1.31545,1.27356,1.24594,1.22833,1.23785,1.26274,201,201,201};
Double_t x_erhig[n] = {3.30609,3.02607,2.76347,2.54997,2.4179,2.30279,2.21046,2.13076,2.07169,2.0494,2.03395,2.04464,2.04893,2.08101,2.13949,2.26815,2.46687,1.97301,2.29484,3.4136};
}
//ttHhad
if(sel=="ttHhad") {
Double_t x_erlow[n] = {3.32048,2.81115,2.59078,2.47157,2.376,2.2863,2.20459,2.12683,2.0596,2.03317,1.96088,1.8825,201,201,201,201,201,201,201,201};
Double_t x_erhig[n] = {4.14027,3.71348,3.53826,3.45367,3.39573,3.3487,3.31856,3.3013,3.31007,3.40212,3.43787,3.48884,2.54189,2.59388,2.66517,2.78245,3.08706,3.46504,4.32835,6.84114};
}
//VHhadB
if(sel=="VHhadB") {
Double_t x_erlow[n] = {3.89188,3.71798,3.55106,3.41527,3.27502,3.12374,2.9822,2.84268,2.72989,2.64161,2.58054,2.48755,2.44351,2.41267,2.33155,2.20676,2.25397,201,201,201};
Double_t x_erhig[n] = {4.46581,4.3219,4.18483,4.08197,3.9728,3.84949,3.73721,3.62792,3.55392,3.5148,3.5197,3.49253,3.54717,3.64371,3.69268,3.7009,4.07076,3.44509,4.33376,20.209};
}
//VHhad0
if(sel=="VHhad0") {
Double_t x_erlow[n] = {2.09522,2.0317,1.96848,1.90712,1.84121,1.77369,1.70736,1.67273,1.61226,1.53798,1.47428,1.41515,1.38975,1.34111,1.32351,1.31815,201,201,201,201};
Double_t x_erhig[n] = {2.80897,2.75498,2.70162,2.6512,2.59535,2.53825,2.48422,2.47853,2.43882,2.38101,2.34246,2.31508,2.35232,2.35753,2.43535,2.56426,1.98796,2.19105,2.85189,7.29571};
}
}
TGraphAsymmErrors *h1 = new TGraphAsymmErrors(n,x_centr,y_centr,x_erlow,x_erhig,y_erlow,y_erhig);
h1->SetMarkerColor(2);
h1->SetMarkerStyle(20);
h1->SetMarkerSize(1.0);
h1->SetFillColor(2);
h1->SetLineColor(1);
h1->SetLineWidth(2);
h1->Draw("P");
hr->GetXaxis()->SetTitleOffset(0.5);
hr->GetXaxis()->SetNdivisions(000);
TH1D *DEN = new TH1D("","",20,-1-0.05,1-0.05);
for(int i=0; i<18; i++){
S=(x_erlow[i]+x_erhig[i])/2;
DEN->SetBinContent(i+1,S);
DEN->SetBinError(i+1,0.001);
}
DEN->SetMarkerColor(2);
DEN->SetMarkerStyle(20);
DEN->SetMarkerSize(1.0);
DEN->SetFillColor(2);
DEN->SetLineColor(1);
DEN->SetLineWidth(2);
DEN->GetYaxis()->SetRangeUser(min,max);
DEN->GetXaxis()->SetRangeUser(-1,1);
DEN->SetXTitle("diphoton MVA cut");
DEN->SetYTitle("#sigma on rV measurement");
DEN->GetYaxis()->SetTitleOffset(1.1);
DEN->GetYaxis()->SetTitleSize(0.045);
DEN->GetXaxis()->SetTitleSize(0.045);
DEN->GetYaxis()->SetLabelSize(0.045);
DEN->GetXaxis()->SetLabelSize(0.025);
DEN->GetXaxis()->SetNdivisions(0030);
DEN->GetYaxis()->SetNdivisions(515);
DEN->Draw("E");
c1->SaveAs("coupling_"+sel+".png");
}