#### /ElectroWeakAnalysis/ZEE/test/StabilityPlots.cpp

https://github.com/aivanov-cern/cmssw
C++ | 478 lines | 340 code | 31 blank | 107 comment | 3 complexity | 8018d224b613a722f33dd9c8dda14286 MD5 | raw file
```  1#include "TFile.h"
2#include "TGraphErrors.h"
3#include "TVectorT.h"
4#include "TH1.h"
5#include "TLegend.h"
6#include "TCanvas.h"
7#include <iostream>
8#include <iomanip>
9#include <fstream>
10#include <cmath>
11
12using namespace std;
13
14void StabilityPlots()
15{
16	ofstream CaloMET("CaloMET.txt");
17	ofstream TcMET("TcMET.txt");
18	//ofstream T1MET("T1MET.txt");
19	ofstream PfMET("PfMET.txt");
20	CaloMET << "MET cut\tftrue\tf\tdf\teff\tdeff\ta\tb\tnpass\tf'true\tf'\tdf'\teff'\tdeff'\td\tc\tnfail" << endl;
21	TcMET << "MET cut\tftrue\tf\tdf\teff\tdeff\ta\tb\tnpass\tf'true\tf'\tdf'\teff'\tdeff'\td\tc\tnfail" << endl;
22	//T1MET << "MET cut\tftrue\tf\tdf\teff\tdeff\ta\tb\tnpass\tf'true\tf'\tdf'\teff'\tdeff'\td\tc\tnfail" << endl;
23	PfMET << "MET cut\tftrue\tf\tdf\teff\tdeff\ta\tb\tnpass\tf'true\tf'\tdf'\teff'\tdeff'\td\tc\tnfail" << endl;
24	cout << setprecision(3);
25	CaloMET << setprecision(3);
26	TcMET << setprecision(3);
27	//T1MET << setprecision(3);
28	PfMET << setprecision(3);
29
30	TVectorT<double> metcut(11), metcuterror(11);
31	TVectorT<double> f_calo_ersatz(11), df_calo_ersatz(11), eff_calo_ersatz(11), deff_calo_ersatz(11), deltaf_calo_ersatz(11);
32	TVectorT<double> fprime_calo_ersatz(11), dfprime_calo_ersatz(11), effprime_calo_ersatz(11), deffprime_calo_ersatz(11), deltafprime_calo_ersatz(11);
33	TVectorT<double> f_tc_ersatz(11), df_tc_ersatz(11), eff_tc_ersatz(11), deff_tc_ersatz(11), deltaf_tc_ersatz(11);
34	TVectorT<double> fprime_tc_ersatz(11), dfprime_tc_ersatz(11), effprime_tc_ersatz(11), deffprime_tc_ersatz(11), deltafprime_tc_ersatz(11);
35	//TVectorT<double> f_t1_ersatz(11), df_t1_ersatz(11), eff_t1_ersatz(11), deff_t1_ersatz(11), deltaf_t1_ersatz(11);
36	//TVectorT<double> fprime_t1_ersatz(11), dfprime_t1_ersatz(11), effprime_t1_ersatz(11), deffprime_t1_ersatz(11), deltafprime_t1_ersatz(11);
37	TVectorT<double> f_pf_ersatz(11), df_pf_ersatz(11), eff_pf_ersatz(11), deff_pf_ersatz(11), deltaf_pf_ersatz(11);
38	TVectorT<double> fprime_pf_ersatz(11), dfprime_pf_ersatz(11), effprime_pf_ersatz(11), deffprime_pf_ersatz(11), deltafprime_pf_ersatz(11);
39
40	TFile* file = TFile::Open("ZeePlots.root");
41
42	TH1F* h_ErsatzCaloMEt_pass = (TH1F*) file->Get("ErsatzMEt_pass");
43	TH1F* h_ErsatzCaloMEt_fail = (TH1F*) file->Get("ErsatzMEt_fail");
44	TH1F* h_WCaloMEt_pass = (TH1F*) file->Get("WCaloMEt_pass");
45	TH1F* h_WCaloMEt_fail = (TH1F*) file->Get("WCaloMEt_fail");
46	TH1F* h_ErsatzTcMEt_pass = (TH1F*) file->Get("ErsatzTcMEt_pass");
47	TH1F* h_ErsatzTcMEt_fail = (TH1F*) file->Get("ErsatzTcMEt_fail");
48	TH1F* h_WTcMEt_pass = (TH1F*) file->Get("WTcMEt_pass");
49	TH1F* h_WTcMEt_fail = (TH1F*) file->Get("WTcMEt_fail");
50	//TH1F* h_ErsatzT1MEt_pass = (TH1F*) file->Get("ErsatzT1MEt_pass");
51	//TH1F* h_ErsatzT1MEt_fail = (TH1F*) file->Get("ErsatzT1MEt_fail");
52	//TH1F* h_WT1MEt_pass = (TH1F*) file->Get("WT1MEt_pass");
53	//TH1F* h_WT1MEt_fail = (TH1F*) file->Get("WT1MEt_fail");
54	TH1F* h_ErsatzPfMEt_pass = (TH1F*) file->Get("ErsatzPfMEt_pass");
55	TH1F* h_ErsatzPfMEt_fail = (TH1F*) file->Get("ErsatzPfMEt_fail");
56	TH1F* h_WPfMEt_pass = (TH1F*) file->Get("WPfMEt_pass");
57	TH1F* h_WPfMEt_fail = (TH1F*) file->Get("WPfMEt_fail");
58
59	for(int i=0; i<102; i++)
60	{
61		cout << h_WCaloMEt_pass->GetBinContent(i) << endl;
62	}
63	cout << "sum = " << h_WCaloMEt_pass->Integral(21,100) << endl;
64	for(int i=0; i<102; i++)
65	{
66		cout << h_WCaloMEt_fail->GetBinContent(i) << endl;
67	}
68	cout << "sum = " << h_WCaloMEt_fail->Integral(21,100) << endl;
69
70	int i = 0;
71	double a_calo_ersatz, a_calo_true;
72	double a_tc_ersatz, a_tc_true;
73	//double a_t1_ersatz, a_t1_true;
74	double a_pf_ersatz, a_pf_true;
75	double b_calo_ersatz, b_calo_true;
76	double b_tc_ersatz, b_tc_true;
77	//double b_t1_ersatz, b_t1_true;
78	double b_pf_ersatz, b_pf_true;
79	double c_calo_ersatz, c_calo_true;
80	double c_tc_ersatz, c_tc_true;
81	//double c_t1_ersatz, c_t1_true;
82	double c_pf_ersatz, c_pf_true;
83	double d_calo_ersatz, d_calo_true;
84	double d_tc_ersatz, d_tc_true;
85	//double d_t1_ersatz, d_t1_true;
86	double d_pf_ersatz, d_pf_true;
87	cout << "mooooooooo" << endl;
88	for(int cMET=20; cMET<41; cMET+=2)
89	{
90		a_calo_ersatz = h_ErsatzCaloMEt_pass->Integral(cMET+1, 100); // Problem Here
91		a_tc_ersatz = h_ErsatzTcMEt_pass->Integral(cMET+1, 100);
92		//a_t1_ersatz = h_ErsatzT1MEt_pass->Integral(cMET+1, 100);
93		a_pf_ersatz = h_ErsatzPfMEt_pass->Integral(cMET+1, 100);
94	cout << "mooooooooo" << endl;
95		a_calo_true = h_WCaloMEt_pass->Integral(cMET+1, 100);
96		a_tc_true = h_WTcMEt_pass->Integral(cMET+1, 100);
97		//a_t1_true = h_WT1MEt_pass->Integral(cMET+1, 100);
98		a_pf_true = h_WPfMEt_pass->Integral(cMET+1, 100);
99	cout << "mooooooooo" << endl;
100		b_calo_ersatz = h_ErsatzCaloMEt_pass->Integral(1, cMET);
101		b_tc_ersatz = h_ErsatzTcMEt_pass->Integral(1, cMET);
102		//b_t1_ersatz = h_ErsatzT1MEt_pass->Integral(1, cMET);
103		b_pf_ersatz = h_ErsatzPfMEt_pass->Integral(1, cMET);
104	cout << "mooooooooo" << endl;
105		b_calo_true = h_WCaloMEt_pass->Integral(1, cMET);
106		b_tc_true = h_WTcMEt_pass->Integral(1, cMET);
107		//b_t1_true = h_WT1MEt_pass->Integral(1, cMET);
108		b_pf_true = h_WPfMEt_pass->Integral(1, cMET);
109	cout << "mooooooooo" << endl;
110		c_calo_ersatz = h_ErsatzCaloMEt_fail->Integral(1, cMET);
111		c_tc_ersatz = h_ErsatzTcMEt_fail->Integral(1, cMET);
112		//c_t1_ersatz = h_ErsatzT1MEt_fail->Integral(1, cMET);
113		c_pf_ersatz = h_ErsatzPfMEt_fail->Integral(1, cMET);
114	cout << "mooooooooo" << endl;
115		c_calo_true = h_WCaloMEt_fail->Integral(1, cMET);
116		c_tc_true = h_WTcMEt_fail->Integral(1, cMET);
117		//c_t1_true = h_WT1MEt_fail->Integral(1, cMET);
118		c_pf_true = h_WPfMEt_fail->Integral(1, cMET);
119	cout << "mooooooooo" << endl;
120		d_calo_ersatz = h_ErsatzCaloMEt_fail->Integral(cMET+1, 100);
121		d_tc_ersatz = h_ErsatzTcMEt_fail->Integral(cMET+1, 100);
122		//d_t1_ersatz = h_ErsatzT1MEt_fail->Integral(cMET+1, 100);
123		d_pf_ersatz = h_ErsatzPfMEt_fail->Integral(cMET+1, 100);
124	cout << "mooooooooo" << endl;
125		d_calo_true = h_WCaloMEt_fail->Integral(cMET+1, 100);
126		d_tc_true = h_WTcMEt_fail->Integral(cMET+1, 100);
127		//d_t1_true = h_WT1MEt_fail->Integral(cMET+1, 100);
128		d_pf_true = h_WPfMEt_fail->Integral(cMET+1, 100);
129	cout << "mooooooooo" << endl;
130
131		metcut[i] = 1.0*cMET;
132		metcuterror[i] = 0.0;
133
134		eff_calo_ersatz[i] = a_calo_ersatz/(a_calo_ersatz + b_calo_ersatz);
135		deff_calo_ersatz[i] = sqrt(eff_calo_ersatz[i]*(1. - eff_calo_ersatz[i])/(a_calo_ersatz + b_calo_ersatz));
136		f_calo_ersatz[i] = a_calo_ersatz/b_calo_ersatz;
137		df_calo_ersatz[i] = deff_calo_ersatz[i]/((1. - eff_calo_ersatz[i])*(1. - eff_calo_ersatz[i]));
138		deltaf_calo_ersatz[i] = a_calo_ersatz/b_calo_ersatz - a_calo_true/b_calo_true;
139		effprime_calo_ersatz[i] = d_calo_ersatz/(d_calo_ersatz + c_calo_ersatz);
140		deffprime_calo_ersatz[i] = sqrt(effprime_calo_ersatz[i]*(1. - effprime_calo_ersatz[i])/(d_calo_ersatz + c_calo_ersatz));
141		fprime_calo_ersatz[i] = d_calo_ersatz/c_calo_ersatz;
142		dfprime_calo_ersatz[i] = deffprime_calo_ersatz[i]/((1. - effprime_calo_ersatz[i])*(1. - effprime_calo_ersatz[i]));
143		deltafprime_calo_ersatz[i] = d_calo_ersatz/c_calo_ersatz - d_calo_true/c_calo_true;
144
145		eff_tc_ersatz[i] = a_tc_ersatz/(a_tc_ersatz + b_tc_ersatz);
146		deff_tc_ersatz[i] = sqrt(eff_tc_ersatz[i]*(1. - eff_tc_ersatz[i])/(a_tc_ersatz + b_tc_ersatz));
147		f_tc_ersatz[i] = a_tc_ersatz/b_tc_ersatz;
148		df_tc_ersatz[i] = deff_tc_ersatz[i]/((1. - eff_tc_ersatz[i])*(1. - eff_tc_ersatz[i]));
149		deltaf_tc_ersatz[i] = a_tc_ersatz/b_tc_ersatz - a_tc_true/b_tc_true;
150		effprime_tc_ersatz[i] = d_tc_ersatz/(d_tc_ersatz + c_tc_ersatz);
151		deffprime_tc_ersatz[i] = sqrt(effprime_tc_ersatz[i]*(1. - effprime_tc_ersatz[i])/(d_tc_ersatz + c_tc_ersatz));
152		fprime_tc_ersatz[i] = d_tc_ersatz/c_tc_ersatz;
153		dfprime_tc_ersatz[i] = deffprime_tc_ersatz[i]/((1. - effprime_tc_ersatz[i])*(1. - effprime_tc_ersatz[i]));
154		deltafprime_tc_ersatz[i] = d_tc_ersatz/c_tc_ersatz - d_tc_true/c_tc_true;
155/*
156		eff_t1_ersatz[i] = a_t1_ersatz/(a_t1_ersatz + b_t1_ersatz);
157		deff_t1_ersatz[i] = sqrt(eff_t1_ersatz[i]*(1. - eff_t1_ersatz[i])/(a_t1_ersatz + b_t1_ersatz));
158		f_t1_ersatz[i] = a_t1_ersatz/b_t1_ersatz;
159		df_t1_ersatz[i] = deff_t1_ersatz[i]/((1. - eff_t1_ersatz[i])*(1. - eff_t1_ersatz[i]));
160		deltaf_t1_ersatz[i] = a_t1_ersatz/b_t1_ersatz - a_t1_true/b_t1_true;
161		effprime_t1_ersatz[i] = d_t1_ersatz/(d_t1_ersatz + c_t1_ersatz);
162		deffprime_t1_ersatz[i] = sqrt(effprime_t1_ersatz[i]*(1. - effprime_t1_ersatz[i])/(d_t1_ersatz + c_t1_ersatz));
163		fprime_t1_ersatz[i] = d_t1_ersatz/c_t1_ersatz;
164		dfprime_t1_ersatz[i] = deffprime_t1_ersatz[i]/((1. - effprime_t1_ersatz[i])*(1. - effprime_t1_ersatz[i]));
165		deltafprime_t1_ersatz[i] = d_t1_ersatz/c_t1_ersatz - d_t1_true/c_t1_true;
166*/
167		eff_pf_ersatz[i] = a_pf_ersatz/(a_pf_ersatz + b_pf_ersatz);
168		deff_pf_ersatz[i] = sqrt(eff_pf_ersatz[i]*(1. - eff_pf_ersatz[i])/(a_pf_ersatz + b_pf_ersatz));
169		f_pf_ersatz[i] = a_pf_ersatz/b_pf_ersatz;
170		df_pf_ersatz[i] = deff_pf_ersatz[i]/((1. - eff_pf_ersatz[i])*(1. - eff_pf_ersatz[i]));
171		deltaf_pf_ersatz[i] = a_pf_ersatz/b_pf_ersatz - a_pf_true/b_pf_true;
172		effprime_pf_ersatz[i] = d_pf_ersatz/(d_pf_ersatz + c_pf_ersatz);
173		deffprime_pf_ersatz[i] = sqrt(effprime_pf_ersatz[i]*(1. - effprime_pf_ersatz[i])/(d_pf_ersatz + c_pf_ersatz));
174		fprime_pf_ersatz[i] = d_pf_ersatz/c_pf_ersatz;
175		dfprime_pf_ersatz[i] = deffprime_pf_ersatz[i]/((1. - effprime_pf_ersatz[i])*(1. - effprime_pf_ersatz[i]));
176		deltafprime_pf_ersatz[i] = d_pf_ersatz/c_pf_ersatz - d_pf_true/c_pf_true;
177
178		cout << "CaloMEt " << cMET << endl;
179		cout << "MET cut\tftrue\tf\tdf\teff\tdeff\ta\tb\tnpass\tf'true\tf'\tdf'\teff'\tdeff'\td\tc\tnfail" << endl;
180		cout << cMET << "\t"
181		<< a_calo_true/b_calo_true << "\t"
182		<< f_calo_ersatz[i] << "\t" << df_calo_ersatz[i] << "\t"
183		<< eff_calo_ersatz[i] << "\t" << deff_calo_ersatz[i] << "\t"
184		<< a_calo_ersatz << "\t" << b_calo_ersatz << "\t" << a_calo_ersatz + b_calo_ersatz << "\t"
185		<< d_calo_true/c_calo_true << "\t"
186		<< fprime_calo_ersatz[i] << "\t" << dfprime_calo_ersatz[i] << "\t"
187		<< effprime_calo_ersatz[i] << "\t" << deffprime_calo_ersatz[i] << "\t"
188		<< d_calo_ersatz << "\t" << c_calo_ersatz << "\t" << d_calo_ersatz + c_calo_ersatz << endl;
189		cout << cMET << "\t"
190		<< a_tc_true/b_tc_true << "\t"
191		<< f_tc_ersatz[i] << "\t" << df_tc_ersatz[i] << "\t"
192		<< eff_tc_ersatz[i] << "\t" << deff_tc_ersatz[i] << "\t"
193		<< a_tc_ersatz << "\t" << b_tc_ersatz << "\t" << a_tc_ersatz + b_tc_ersatz << "\t"
194		<< d_tc_true/c_tc_true << "\t"
195		<< fprime_tc_ersatz[i] << "\t" << dfprime_tc_ersatz[i] << "\t"
196		<< effprime_tc_ersatz[i] << "\t" << deffprime_tc_ersatz[i] << "\t"
197		<< d_tc_ersatz << "\t" << c_tc_ersatz << "\t" << d_tc_ersatz + c_tc_ersatz << endl;
198/*		cout << cMET << "\t"
199		<< a_t1_true/b_t1_true << "\t"
200		<< f_t1_ersatz[i] << "\t" << df_t1_ersatz[i] << "\t"
201		<< eff_t1_ersatz[i] << "\t" << deff_t1_ersatz[i] << "\t"
202		<< a_t1_ersatz << "\t" << b_t1_ersatz << "\t" << a_t1_ersatz + b_t1_ersatz << "\t"
203		<< d_t1_true/c_t1_true << "\t"
204		<< fprime_t1_ersatz[i] << "\t" << dfprime_t1_ersatz[i] << "\t"
205		<< effprime_t1_ersatz[i] << "\t" << deffprime_t1_ersatz[i] << "\t"
206		<< d_t1_ersatz << "\t" << c_t1_ersatz << "\t" << d_t1_ersatz + c_t1_ersatz << endl; */
207		cout << cMET << "\t"
208		<< a_pf_true/b_pf_true << "\t"
209		<< f_pf_ersatz[i] << "\t" << df_pf_ersatz[i] << "\t"
210		<< eff_pf_ersatz[i] << "\t" << deff_pf_ersatz[i] << "\t"
211		<< a_pf_ersatz << "\t" << b_pf_ersatz << "\t" << a_pf_ersatz + b_pf_ersatz << "\t"
212		<< d_pf_true/c_pf_true << "\t"
213		<< fprime_pf_ersatz[i] << "\t" << dfprime_pf_ersatz[i] << "\t"
214		<< effprime_pf_ersatz[i] << "\t" << deffprime_pf_ersatz[i] << "\t"
215		<< d_pf_ersatz << "\t" << c_pf_ersatz << "\t" << d_pf_ersatz + c_pf_ersatz << endl;
216
217		CaloMET << cMET << "\t"
218		<< a_calo_true/b_calo_true << "\t"
219		<< f_calo_ersatz[i] << "\t" << df_calo_ersatz[i] << "\t"
220		<< eff_calo_ersatz[i] << "\t" << deff_calo_ersatz[i] << "\t"
221		<< a_calo_ersatz << "\t" << b_calo_ersatz << "\t" << a_calo_ersatz + b_calo_ersatz << "\t"
222		<< d_calo_true/c_calo_true << "\t"
223		<< fprime_calo_ersatz[i] << "\t" << dfprime_calo_ersatz[i] << "\t"
224		<< effprime_calo_ersatz[i] << "\t" << deffprime_calo_ersatz[i] << "\t"
225		<< d_calo_ersatz << "\t" << c_calo_ersatz << "\t" << d_calo_ersatz + c_calo_ersatz << endl;
226		TcMET << cMET << "\t"
227		<< a_tc_true/b_tc_true << "\t"
228		<< f_tc_ersatz[i] << "\t" << df_tc_ersatz[i] << "\t"
229		<< eff_tc_ersatz[i] << "\t" << deff_tc_ersatz[i] << "\t"
230		<< a_tc_ersatz << "\t" << b_tc_ersatz << "\t" << a_tc_ersatz + b_tc_ersatz << "\t"
231		<< d_tc_true/c_tc_true << "\t"
232		<< fprime_tc_ersatz[i] << "\t" << dfprime_tc_ersatz[i] << "\t"
233		<< effprime_tc_ersatz[i] << "\t" << deffprime_tc_ersatz[i] << "\t"
234		<< d_tc_ersatz << "\t" << c_tc_ersatz << "\t" << d_tc_ersatz + c_tc_ersatz << endl;
235/*		T1MET << cMET << "\t"
236		<< a_t1_true/b_t1_true << "\t"
237		<< f_t1_ersatz[i] << "\t" << df_t1_ersatz[i] << "\t"
238		<< eff_t1_ersatz[i] << "\t" << deff_t1_ersatz[i] << "\t"
239		<< a_t1_ersatz << "\t" << b_t1_ersatz << "\t" << a_t1_ersatz + b_t1_ersatz << "\t"
240		<< d_t1_true/c_t1_true << "\t"
241		<< fprime_t1_ersatz[i] << "\t" << dfprime_t1_ersatz[i] << "\t"
242		<< effprime_t1_ersatz[i] << "\t" << deffprime_t1_ersatz[i] << "\t"
243		<< d_t1_ersatz << "\t" << c_t1_ersatz << "\t" << d_t1_ersatz + c_t1_ersatz << endl;*/
244		PfMET << cMET << "\t"
245		<< a_pf_true/b_pf_true << "\t"
246		<< f_pf_ersatz[i] << "\t" << df_pf_ersatz[i] << "\t"
247		<< eff_pf_ersatz[i] << "\t" << deff_pf_ersatz[i] << "\t"
248		<< a_pf_ersatz << "\t" << b_pf_ersatz << "\t" << a_pf_ersatz + b_pf_ersatz << "\t"
249		<< d_pf_true/c_pf_true << "\t"
250		<< fprime_pf_ersatz[i] << "\t" << dfprime_pf_ersatz[i] << "\t"
251		<< effprime_pf_ersatz[i] << "\t" << deffprime_pf_ersatz[i] << "\t"
252		<< d_pf_ersatz << "\t" << c_pf_ersatz << "\t" << d_pf_ersatz + c_pf_ersatz << endl;
253
254		i++;
255	}
256
257	TCanvas* c_calo_f = new TCanvas("calo_f", "", 800, 600);
258	TGraphErrors* g_calo_f = new TGraphErrors(metcut, f_calo_ersatz, metcuterror, df_calo_ersatz);
259	g_calo_f->GetXaxis()->SetTitle("#slash{E}_{T} cut");
260	g_calo_f->GetYaxis()->SetTitle("f_{ersatz}");
261	g_calo_f->Draw("ap");
262	c_calo_f->SaveAs("calo_f.png");
263	delete g_calo_f;
264	delete c_calo_f;
265
266	TCanvas* c_calo_eff = new TCanvas("calo_eff", "", 800, 600);
267	TGraphErrors* g_calo_eff = new TGraphErrors(metcut, eff_calo_ersatz, metcuterror, deff_calo_ersatz);
268	g_calo_eff->GetXaxis()->SetTitle("#slash{E}_{T} cut");
269	g_calo_eff->GetYaxis()->SetTitle("#epsilon_{ersatz}");
270	g_calo_eff->Draw("ap");
271	c_calo_eff->SaveAs("calo_eff.png");
272	delete g_calo_eff;
273	delete c_calo_eff;
274
275	TCanvas* c_calo_deltaf = new TCanvas("calo_deltaf", "", 800, 600);
276	TGraphErrors* g_calo_deltaf = new TGraphErrors(metcut, deltaf_calo_ersatz, metcuterror, df_calo_ersatz);
277	g_calo_deltaf->GetXaxis()->SetTitle("#slash{E}_{T} cut");
278	g_calo_deltaf->GetYaxis()->SetTitle("f_{ersatz} - f_{W#rightarrowe#nu}");
279	g_calo_deltaf->Draw("ap");
280	c_calo_deltaf->SaveAs("calo_deltaf.png");
281	delete g_calo_deltaf;
282	delete c_calo_deltaf;
283
284	TCanvas* c_calo_fprime = new TCanvas("calo_fprime", "", 800, 600);
285	TGraphErrors* g_calo_fprime = new TGraphErrors(metcut, fprime_calo_ersatz, metcuterror, dfprime_calo_ersatz);
286	g_calo_fprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
287	g_calo_fprime->GetYaxis()->SetTitle("f'_{ersatz}");
288	g_calo_fprime->Draw("ap");
289	c_calo_fprime->SaveAs("calo_fprime.png");
290	delete g_calo_fprime;
291	delete c_calo_fprime;
292
293	TCanvas* c_calo_effprime = new TCanvas("calo_effprime", "", 800, 600);
294	TGraphErrors* g_calo_effprime = new TGraphErrors(metcut, effprime_calo_ersatz, metcuterror, deffprime_calo_ersatz);
295	g_calo_effprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
296	g_calo_effprime->GetYaxis()->SetTitle("#epsilon'_{ersatz}");
297	g_calo_effprime->Draw("ap");
298	c_calo_effprime->SaveAs("calo_effprime.png");
299	delete g_calo_effprime;
300	delete c_calo_effprime;
301
302	TCanvas* c_calo_deltafprime = new TCanvas("calo_deltafprime", "", 800, 600);
303	TGraphErrors* g_calo_deltafprime = new TGraphErrors(metcut, deltafprime_calo_ersatz, metcuterror, dfprime_calo_ersatz);
304	g_calo_deltafprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
305	g_calo_deltafprime->GetYaxis()->SetTitle("f'_{ersatz} - f'_{W#rightarrowe#nu}");
306	g_calo_deltafprime->Draw("ap");
307	c_calo_deltafprime->SaveAs("calo_deltafprime.png");
308	delete g_calo_deltafprime;
309	delete c_calo_deltafprime;
310
311	TCanvas* c_tc_f = new TCanvas("tc_f", "", 800, 600);
312	TGraphErrors* g_tc_f = new TGraphErrors(metcut, f_tc_ersatz, metcuterror, df_tc_ersatz);
313	g_tc_f->GetXaxis()->SetTitle("#slash{E}_{T} cut");
314	g_tc_f->GetYaxis()->SetTitle("f_{ersatz}");
315	g_tc_f->Draw("ap");
316	c_tc_f->SaveAs("tc_f.png");
317	delete g_tc_f;
318	delete c_tc_f;
319
320	TCanvas* c_tc_eff = new TCanvas("tc_eff", "", 800, 600);
321	TGraphErrors* g_tc_eff = new TGraphErrors(metcut, eff_tc_ersatz, metcuterror, deff_tc_ersatz);
322	g_tc_eff->GetXaxis()->SetTitle("#slash{E}_{T} cut");
323	g_tc_eff->GetYaxis()->SetTitle("#epsilon_{ersatz}");
324	g_tc_eff->Draw("ap");
325	c_tc_eff->SaveAs("tc_eff.png");
326	delete g_tc_eff;
327	delete c_tc_eff;
328
329	TCanvas* c_tc_deltaf = new TCanvas("tc_deltaf", "", 800, 600);
330	TGraphErrors* g_tc_deltaf = new TGraphErrors(metcut, deltaf_tc_ersatz, metcuterror, df_tc_ersatz);
331	g_tc_deltaf->GetXaxis()->SetTitle("#slash{E}_{T} cut");
332	g_tc_deltaf->GetYaxis()->SetTitle("f_{ersatz} - f_{W#rightarrowe#nu}");
333	g_tc_deltaf->Draw("ap");
334	c_tc_deltaf->SaveAs("tc_deltaf.png");
335	delete g_tc_deltaf;
336	delete c_tc_deltaf;
337
338	TCanvas* c_tc_fprime = new TCanvas("tc_fprime", "", 800, 600);
339	TGraphErrors* g_tc_fprime = new TGraphErrors(metcut, fprime_tc_ersatz, metcuterror, dfprime_tc_ersatz);
340	g_tc_fprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
341	g_tc_fprime->GetYaxis()->SetTitle("f'_{ersatz}");
342	g_tc_fprime->Draw("ap");
343	c_tc_fprime->SaveAs("tc_fprime.png");
344	delete g_tc_fprime;
345	delete c_tc_fprime;
346
347	TCanvas* c_tc_effprime = new TCanvas("tc_effprime", "", 800, 600);
348	TGraphErrors* g_tc_effprime = new TGraphErrors(metcut, effprime_tc_ersatz, metcuterror, deffprime_tc_ersatz);
349	g_tc_effprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
350	g_tc_effprime->GetYaxis()->SetTitle("#epsilon'_{ersatz}");
351	g_tc_effprime->Draw("ap");
352	c_tc_effprime->SaveAs("tc_effprime.png");
353	delete g_tc_effprime;
354	delete c_tc_effprime;
355
356	TCanvas* c_tc_deltafprime = new TCanvas("tc_deltafprime", "", 800, 600);
357	TGraphErrors* g_tc_deltafprime = new TGraphErrors(metcut, deltafprime_tc_ersatz, metcuterror, dfprime_tc_ersatz);
358	g_tc_deltafprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
359	g_tc_deltafprime->GetYaxis()->SetTitle("f'_{ersatz} - f'_{W#rightarrowe#nu}");
360	g_tc_deltafprime->Draw("ap");
361	c_tc_deltafprime->SaveAs("tc_deltafprime.png");
362	delete g_tc_deltafprime;
363	delete c_tc_deltafprime;
364/*
365	TCanvas* c_t1_f = new TCanvas("t1_f", "", 800, 600);
366	TGraphErrors* g_t1_f = new TGraphErrors(metcut, f_t1_ersatz, metcuterror, df_t1_ersatz);
367	g_t1_f->GetXaxis()->SetTitle("#slash{E}_{T} cut");
368	g_t1_f->GetYaxis()->SetTitle("f_{ersatz}");
369	g_t1_f->Draw("ap");
370	c_t1_f->SaveAs("t1_f.png");
371	delete g_t1_f;
372	delete c_t1_f;
373
374	TCanvas* c_t1_eff = new TCanvas("t1_eff", "", 800, 600);
375	TGraphErrors* g_t1_eff = new TGraphErrors(metcut, eff_t1_ersatz, metcuterror, deff_t1_ersatz);
376	g_t1_eff->GetXaxis()->SetTitle("#slash{E}_{T} cut");
377	g_t1_eff->GetYaxis()->SetTitle("#epsilon_{ersatz}");
378	g_t1_eff->Draw("ap");
379	c_t1_eff->SaveAs("t1_eff.png");
380	delete g_t1_eff;
381	delete c_t1_eff;
382
383	TCanvas* c_t1_deltaf = new TCanvas("t1_deltaf", "", 800, 600);
384	TGraphErrors* g_t1_deltaf = new TGraphErrors(metcut, deltaf_t1_ersatz, metcuterror, df_t1_ersatz);
385	g_t1_deltaf->GetXaxis()->SetTitle("#slash{E}_{T} cut");
386	g_t1_deltaf->GetYaxis()->SetTitle("f_{ersatz} - f_{W#rightarrowe#nu}");
387	g_t1_deltaf->Draw("ap");
388	c_t1_deltaf->SaveAs("t1_deltaf.png");
389	delete g_t1_deltaf;
390	delete c_t1_deltaf;
391
392	TCanvas* c_t1_fprime = new TCanvas("t1_fprime", "", 800, 600);
393	TGraphErrors* g_t1_fprime = new TGraphErrors(metcut, fprime_t1_ersatz, metcuterror, dfprime_t1_ersatz);
394	g_t1_fprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
395	g_t1_fprime->GetYaxis()->SetTitle("f'_{ersatz}");
396	g_t1_fprime->Draw("ap");
397	c_t1_fprime->SaveAs("t1_fprime.png");
398	delete g_t1_fprime;
399	delete c_t1_fprime;
400
401	TCanvas* c_t1_effprime = new TCanvas("t1_effprime", "", 800, 600);
402	TGraphErrors* g_t1_effprime = new TGraphErrors(metcut, effprime_t1_ersatz, metcuterror, deffprime_t1_ersatz);
403	g_t1_effprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
404	g_t1_effprime->GetYaxis()->SetTitle("#epsilon'_{ersatz}");
405	g_t1_effprime->Draw("ap");
406	c_t1_effprime->SaveAs("t1_effprime.png");
407	delete g_t1_effprime;
408	delete c_t1_effprime;
409
410	TCanvas* c_t1_deltafprime = new TCanvas("t1_deltafprime", "", 800, 600);
411	TGraphErrors* g_t1_deltafprime = new TGraphErrors(metcut, deltafprime_t1_ersatz, metcuterror, dfprime_t1_ersatz);
412	g_t1_deltafprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
413	g_t1_deltafprime->GetYaxis()->SetTitle("f'_{ersatz} - f'_{W#rightarrowe#nu}");
414	g_t1_deltafprime->Draw("ap");
415	c_t1_deltafprime->SaveAs("t1_deltafprime.png");
416	delete g_t1_deltafprime;
417	delete c_t1_deltafprime;
418*/
419	TCanvas* c_pf_f = new TCanvas("pf_f", "", 800, 600);
420	TGraphErrors* g_pf_f = new TGraphErrors(metcut, f_pf_ersatz, metcuterror, df_pf_ersatz);
421	g_pf_f->GetXaxis()->SetTitle("#slash{E}_{T} cut");
422	g_pf_f->GetYaxis()->SetTitle("f_{ersatz}");
423	g_pf_f->Draw("ap");
424	c_pf_f->SaveAs("pf_f.png");
425	delete g_pf_f;
426	delete c_pf_f;
427
428	TCanvas* c_pf_eff = new TCanvas("pf_eff", "", 800, 600);
429	TGraphErrors* g_pf_eff = new TGraphErrors(metcut, eff_pf_ersatz, metcuterror, deff_pf_ersatz);
430	g_pf_eff->GetXaxis()->SetTitle("#slash{E}_{T} cut");
431	g_pf_eff->GetYaxis()->SetTitle("#epsilon_{ersatz}");
432	g_pf_eff->Draw("ap");
433	c_pf_eff->SaveAs("pf_eff.png");
434	delete g_pf_eff;
435	delete c_pf_eff;
436
437	TCanvas* c_pf_deltaf = new TCanvas("pf_deltaf", "", 800, 600);
438	TGraphErrors* g_pf_deltaf = new TGraphErrors(metcut, deltaf_pf_ersatz, metcuterror, df_pf_ersatz);
439	g_pf_deltaf->GetXaxis()->SetTitle("#slash{E}_{T} cut");
440	g_pf_deltaf->GetYaxis()->SetTitle("f_{ersatz} - f_{W#rightarrowe#nu}");
441	g_pf_deltaf->Draw("ap");
442	c_pf_deltaf->SaveAs("pf_deltaf.png");
443	delete g_pf_deltaf;
444	delete c_pf_deltaf;
445
446	TCanvas* c_pf_fprime = new TCanvas("pf_fprime", "", 800, 600);
447	TGraphErrors* g_pf_fprime = new TGraphErrors(metcut, fprime_pf_ersatz, metcuterror, dfprime_pf_ersatz);
448	g_pf_fprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
449	g_pf_fprime->GetYaxis()->SetTitle("f'_{ersatz}");
450	g_pf_fprime->Draw("ap");
451	c_pf_fprime->SaveAs("pf_fprime.png");
452	delete g_pf_fprime;
453	delete c_pf_fprime;
454
455	TCanvas* c_pf_effprime = new TCanvas("pf_effprime", "", 800, 600);
456	TGraphErrors* g_pf_effprime = new TGraphErrors(metcut, effprime_pf_ersatz, metcuterror, deffprime_pf_ersatz);
457	g_pf_effprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
458	g_pf_effprime->GetYaxis()->SetTitle("#epsilon'_{ersatz}");
459	g_pf_effprime->Draw("ap");
460	c_pf_effprime->SaveAs("pf_effprime.png");
461	delete g_pf_effprime;
462	delete c_pf_effprime;
463
464	TCanvas* c_pf_deltafprime = new TCanvas("pf_deltafprime", "", 800, 600);
465	TGraphErrors* g_pf_deltafprime = new TGraphErrors(metcut, deltafprime_pf_ersatz, metcuterror, dfprime_pf_ersatz);
466	g_pf_deltafprime->GetXaxis()->SetTitle("#slash{E}_{T} cut");
467	g_pf_deltafprime->GetYaxis()->SetTitle("f'_{ersatz} - f'_{W#rightarrowe#nu}");
468	g_pf_deltafprime->Draw("ap");
469	c_pf_deltafprime->SaveAs("pf_deltafprime.png");
470	delete g_pf_deltafprime;
471	delete c_pf_deltafprime;
472
473	file->Close();
474	CaloMET.close();
475	TcMET.close();
476	//T1MET.close();
477	PfMET.close();
478}
```