ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dhidas/OSUAnalysis/Tools/scripts/makeNotePlots.C
Revision: 1.1.1.1 (vendor branch)
Committed: Thu Dec 1 16:28:48 2011 UTC (13 years, 5 months ago) by dhidas
Content type: text/plain
Branch: dhidas, MAIN
CVS Tags: START, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
osu copy modified

File Contents

# User Rev Content
1 dhidas 1.1 #include "TStyle.h"
2     #include "THStack.h"
3     #include <vector>
4     #include "TFile.h"
5     #include "TLegend.h"
6     #include "TH1F.h"
7     #include "TCanvas.h"
8     #include "TString.h"
9     #include "TLatex.h"
10     #include "TGraphAsymmErrors.h"
11    
12     using namespace std;
13     void setTDRStyle();
14     TH1F* getCumulativePlot(TH1F* initial, TString type);
15    
16     void makeNotePlots() {
17     setTDRStyle();
18     gStyle->SetHatchesSpacing(1.0);
19     double lumi = 19.;//3.06 + 1.37 + 2.53 + 0.26;
20     double oldLumi = 19.;
21     double scale = lumi / oldLumi;
22     double qcdScale = 1;
23     // TFile* data = TFile::Open("data2.9pb_fullSetOfVars.root");
24     TFile* data = TFile::Open("data_19pb_allPF.root");
25     // TFile* data2 = TFile::Open("data_4.4pb_withoutHLT.root");
26     TFile* ttbar = TFile::Open("ttjet_19pb.root");
27     TFile* wjets = TFile::Open("wj_19pb.root");
28     TFile* zjets = TFile::Open("zj_19pb.root");
29     // TFile* bce1 = TFile::Open("bce1_19pb.root");
30     TFile* bce2 = TFile::Open("bce2_19pb.root");
31     TFile* bce3 = TFile::Open("bce3_19pb.root");
32     TFile* enri1 = TFile::Open("enri1_19pb.root");
33     TFile* enri2 = TFile::Open("enri2_19pb.root");
34     TFile* enri3 = TFile::Open("enri3_19pb.root");
35     TFile* pj1 = TFile::Open("pj1_19pb.root");
36     TFile* pj2 = TFile::Open("pj2_19pb.root");
37     TFile* pj3 = TFile::Open("pj3_19pb.root");
38     // TFile* vqq = TFile::Open("vqq_7.22pb_V4PFCalo.root__fullSetOfVars.root");
39     // TFile* Zprime500 = TFile::Open("Zprime_M500GeV_W5GeV_19pb.root");
40     // TFile* Zprime750 = TFile::Open("Zprime_M750GeV_W7500MeV_19pb.root");
41     // TFile* Zprime1000 = TFile::Open("Zprime_M1TeV_W10GeV_19pb.root");
42     // TFile* Zprime1250 = TFile::Open("Zprime_M1250GeV_W12500MeV_19pb.root");
43     // TFile* Zprime1500 = TFile::Open("Zprime_M1500GeV_W15GeV_19pb.root");
44    
45     vector<TString> hists;
46     hists.push_back("DRmin_QCDenriched");
47     hists.push_back("ptRel_QCDenriched");
48     hists.push_back("ptRel_WZenriched");
49     hists.push_back("DRmin_WZenriched");
50     // hists.push_back("HT");
51     // hists.push_back("numberOfJets");
52     // hists.push_back("numberOfBJets");
53     // hists.push_back("MET");
54     // hists.push_back("leadingJetMass");
55     // hists.push_back("mtW");
56     // hists.push_back("electronD0");
57     // hists.push_back("neutrino_pz");
58     // TString folder("");
59    
60     for (unsigned int hist = 0; hist < hists.size(); ++hist) {
61     TString histname(hists.at(hist));
62     TString histpath(histname);
63     TH1F* hist_data = (TH1F*) data->Get(histpath);
64    
65     // TH1F* hist_data2;
66     // if (histname == "mttbar_rebinned")
67     // hist_data2 = (TH1F*) data2->Get(histpath);
68     // else
69     // hist_data2 = new TH1F(*hist_data);
70     hist_data->Sumw2();
71     // hist_data2->Sumw2();
72     TH1F* hist_ttbar = (TH1F*) ttbar->Get(histpath);
73     TH1F* hist_wjets = (TH1F*) wjets->Get(histpath);
74     TH1F* hist_zjets = (TH1F*) zjets->Get(histpath);
75    
76     // TH1F* hist_bce1 = (TH1F*) bce1->Get(histpath);
77     TH1F* hist_bce2 = (TH1F*) bce2->Get(histpath);
78     TH1F* hist_bce3 = (TH1F*) bce3->Get(histpath);
79     TH1F* hist_enri1 = (TH1F*) enri1->Get(histpath);
80     TH1F* hist_enri2 = (TH1F*) enri2->Get(histpath);
81     TH1F* hist_enri3 = (TH1F*) enri3->Get(histpath);
82     TH1F* hist_pj1 = (TH1F*) pj1->Get(histpath);
83     TH1F* hist_pj2 = (TH1F*) pj2->Get(histpath);
84     TH1F* hist_pj3 = (TH1F*) pj3->Get(histpath);
85    
86     // TH1F* hist_Zprime500 = (TH1F*) Zprime500->Get(histpath);
87     // TH1F* hist_Zprime750 = (TH1F*) Zprime750->Get(histpath);
88     // TH1F* hist_Zprime1000 = (TH1F*) Zprime1000->Get(histpath);
89     // TH1F* hist_Zprime1250 = (TH1F*) Zprime1250->Get(histpath);
90     // TH1F* hist_Zprime1500 = (TH1F*) Zprime1500->Get(histpath);
91    
92     // hist_ttbar->Scale(157.5 * lumi / 1468404.);
93     // hist_wjets->Scale(31314 * lumi / 5143895.);
94     // hist_zjets->Scale(3048 * lumi / 1084921.);
95    
96     // cout << hist_ttbar->Integral() << endl;
97     hist_ttbar->Scale(scale);
98     // cout << hist_ttbar->Integral() << endl;
99     hist_wjets->Scale(scale/2);
100     hist_zjets->Scale(scale);
101    
102     // hist_bce1->Scale(0.2355e9 * 0.00046 * lumi / 2606023.);
103     // hist_bce2->Scale(0.0593e9 * 0.00234 * lumi / 2470597.);
104     // hist_bce3->Scale(0.906e6 * 0.0104 * lumi / 998674.);
105     //
106     // hist_enri1->Scale(0.2355e9 * 0.0073 * lumi / 14607326.);
107     // hist_enri2->Scale(0.0593e9 * 0.059 * lumi / 27403259.);
108     // hist_enri3->Scale(0.906e6 * 0.148 * lumi / 4686413.);
109    
110     // hist_bce1->Scale(scale);
111     hist_bce2->Scale(scale);
112     hist_bce3->Scale(scale);
113    
114     hist_enri1->Scale(scale);
115     hist_enri2->Scale(scale);
116     hist_enri3->Scale(scale);
117    
118     hist_pj1->Scale(scale);
119     hist_pj2->Scale(scale);
120     hist_pj3->Scale(scale);
121    
122     // hist_pj1->Scale(23620. * lumi / 2255228.);
123     // hist_pj2->Scale(3476. * lumi / 1071393.);
124     // hist_pj3->Scale(485. * lumi / 960198.);
125    
126     // hist_Zprime500->Scale(50 * lumi / 227266);
127     // hist_Zprime750->Scale(50 * lumi / 182024);
128     // hist_Zprime1000->Scale(50 * lumi / 200759);
129     // hist_Zprime1250->Scale(50 * lumi / 298428);
130     // hist_Zprime1500->Scale(50 * lumi / 299024);
131    
132     // hist_Zprime500->Scale(scale);
133     // hist_Zprime750->Scale(scale);
134     // hist_Zprime1000->Scale(scale);
135     // hist_Zprime1250->Scale(scale);
136     // hist_Zprime1500->Scale(scale);
137    
138     TH1F* hist_qcd = new TH1F(*hist_bce2);
139     // hist_qcd->Add(hist_bce2);
140     hist_qcd->Add(hist_bce3);
141     hist_qcd->Add(hist_enri1);
142     hist_qcd->Add(hist_enri2);
143     hist_qcd->Add(hist_enri3);
144     hist_qcd->Add(hist_pj1);
145     hist_qcd->Add(hist_pj2);
146     hist_qcd->Add(hist_pj3);
147     hist_qcd->Scale(qcdScale);
148     // double ndata = hist_data->Integral();
149     // double ntop = hist_ttbar->Integral();
150     // double nwj = hist_wjets->Integral();
151     // double nzj = hist_zjets->Integral();
152     // double nqcd = hist_qcd->Integral();
153     // double sumMC = ntop + nwj + nzj + nqcd;
154     // cout << ndata << " " << sumMC << endl;
155     // hist_wjets->Scale(ndata / sumMC);
156     // hist_ttbar->Scale(ndata / sumMC);
157     // hist_zjets->Scale(ndata / sumMC);
158     // hist_qcd->Scale(ndata / sumMC);
159     TH1F* hist_mc = new TH1F(*hist_qcd);
160     hist_mc->Add(hist_ttbar);
161     hist_mc->Add(hist_zjets);
162     hist_mc->Add(hist_wjets);
163    
164     unsigned int rebin = 1;
165     if (histname == "mttbar") {
166     hist_data->SetXTitle("M_{t#bar{t}}/GeV");
167     hist_data->SetYTitle("Events/(50 GeV)");
168     rebin = 50;
169     } else if (histname == "m3") {
170     hist_data->SetXTitle("M3/GeV");
171     hist_data->SetYTitle("Events/(100 GeV)");
172     rebin = 100;
173     } else if (histname == "electron_et") {
174     hist_data->SetXTitle("electron p_{T}/GeV");
175     hist_data->SetYTitle("Events/(5 GeV)");
176     rebin = 5;
177     } else if (histname == "ttbar_pt") {
178     hist_data->SetXTitle("p_{T} of t#bar{t} system/GeV");
179     hist_data->SetYTitle("Events/(5 GeV)");
180     rebin = 5;
181     } else if (histname == "HT") {
182     hist_data->SetXTitle("#Sigma p_{T}/GeV");
183     hist_data->SetYTitle("Events/(50 GeV)");
184     rebin = 50;
185     } else if (histname == "numberOfJets") {
186     hist_data->SetXTitle("number of jets");
187     hist_data->SetYTitle("Events");
188     } else if (histname == "numberOfBJets") {
189     hist_data->SetXTitle("number of b-tagged jets (SSVHE medium)");
190     hist_data->SetYTitle("Events");
191     } else if (histname == "MET") {
192     hist_data->SetXTitle("MET/GeV");
193     hist_data->SetYTitle("Events/(10 GeV)");
194     rebin = 10;
195     } else if (histname == "leadingJetMass") {
196     hist_data->SetXTitle("leading jet mass/GeV");
197     hist_data->SetYTitle("Events/(4 GeV)");
198     rebin = 4;
199     } else if (histname == "mtW") {
200     hist_data->SetXTitle("transverse W-boson mass/GeV");
201     hist_data->SetYTitle("Events/(10 GeV)");
202     rebin = 10;
203     } else if (histname == "electronD0") {
204     hist_data->SetXTitle("electron d_{0} / cm");
205     hist_data->SetYTitle("Events/(0.001 cm)");
206     rebin = 10;
207    
208     } else if (histname == "neutrino_pz") {
209     hist_data->SetXTitle("neutrino p_{Z} /GeV");
210     hist_data->SetYTitle("Events/(10 GeV)");
211     rebin = 10;
212     }
213     else if(histname == "ptRel_QCDenriched" || histname == "ptRel_WZenriched"){
214     hist_data->SetXTitle("relative p_{T} (electron, closest jet) /GeV");
215     hist_data->SetYTitle("Events/(1 GeV)");
216     rebin = 1;
217     }
218    
219     else if (histname == "DRmin_QCDenriched" || histname == "DRmin_WZenriched") {
220     hist_data->SetXTitle("#DeltaR (electron, closest jet)");
221     hist_data->SetYTitle("Events");
222     rebin = 1;
223     }
224    
225     hist_data->Rebin(rebin);
226     hist_ttbar->Rebin(rebin);
227     hist_wjets->Rebin(rebin);
228     hist_zjets->Rebin(rebin);
229     hist_qcd->Rebin(rebin);
230     // hist_Zprime500->Rebin(rebin);
231     // hist_Zprime750->Rebin(rebin);
232     // hist_Zprime1000->Rebin(rebin);
233     // hist_Zprime1250->Rebin(rebin);
234     // hist_Zprime1500->Rebin(rebin);
235    
236     hist_data->SetMarkerStyle(8);
237     // hist_data2->SetMarkerStyle(8);
238     // hist_data2->SetMarkerSize(1.5);
239     // hist_data2->SetMarkerColor(kAzure + 1);
240     // hist_data2->SetLineColor(kAzure + 1);
241     hist_ttbar->SetFillStyle(1001);
242     hist_ttbar->SetFillColor(kRed + 1);
243     hist_wjets->SetFillStyle(1001);
244     hist_wjets->SetFillColor(kGreen - 3);
245     hist_zjets->SetFillStyle(1001);
246     hist_zjets->SetFillColor(kAzure - 2);
247     hist_qcd->SetFillStyle(1001);
248     hist_qcd->SetFillColor(kYellow);
249    
250     const int nbins = hist_qcd->GetXaxis()->GetNbins();
251     float binwidth = (hist_qcd->GetXaxis()->GetXmax() - hist_qcd->GetXaxis()->GetXmin()) / nbins;
252     for (int i = 1; i <= nbins; i++) {
253     float yvalue = hist_qcd->GetBinContent(i);
254     // float xvalue = hist_qcd->GetBinCenter(i);
255     // float ymin = yvalue - yvalue*0.5;
256     // float ymax = yvalue + yvalue*0.5;
257     // float xmin = xvalue - 0.5*binwidth;
258     // float xmax = xvalue + 0.5*binwidth;
259     float error = yvalue * 0.5;
260     hist_mc->SetBinError(i, error);
261     // qcdUncert->SetPointError(i, xmin, xmax, ymin, ymax);
262     }
263     TGraphAsymmErrors* qcdUncert = new TGraphAsymmErrors(hist_mc);
264    
265     // hist_Zprime500->SetLineColor(kTeal - 9);
266     // hist_Zprime500->SetLineWidth(3);
267     // hist_Zprime500->SetFillStyle(0);
268     // hist_Zprime500->SetFillColor(kWhite);
269     //
270     // hist_Zprime750->SetLineColor(kBlue - 6);
271     // hist_Zprime750->SetLineWidth(3);
272     // hist_Zprime750->SetFillStyle(0);
273     // hist_Zprime750->SetFillColor(kWhite);
274     //
275     // hist_Zprime1000->SetLineColor(28);
276     // hist_Zprime1000->SetLineWidth(3);
277     // hist_Zprime1000->SetFillStyle(0);
278     // hist_Zprime1000->SetFillColor(kWhite);
279     //
280     // hist_Zprime1250->SetLineColor(kCyan - 5);
281     // hist_Zprime1250->SetLineWidth(3);
282     // hist_Zprime1250->SetFillStyle(0);
283     // hist_Zprime1250->SetFillColor(kWhite);
284     //
285     // hist_Zprime1500->SetLineColor(kOrange + 1);
286     // hist_Zprime1500->SetLineWidth(3);
287     // hist_Zprime1500->SetFillStyle(0);
288     // hist_Zprime1500->SetFillColor(kWhite);
289    
290     qcdUncert->SetFillColor(kGray + 3);
291     qcdUncert->SetFillStyle(3003);
292    
293     TLegend* leg = new TLegend(0.696, 0.35, 0.94, 0.92);
294     leg->SetBorderSize(0);
295     leg->SetLineStyle(0);
296     leg->SetTextFont(42);
297     leg->SetFillStyle(0);
298    
299     leg->AddEntry(hist_data, "data", "P");
300     // leg->AddEntry(hist_data2, "data(no HLT)", "P");
301     // leg->AddEntry(hist_ttbar, "t#bar{t}", "f");
302     // leg->AddEntry(hist_wjets, "W#rightarrowl#nu", "f");
303     // leg->AddEntry(hist_zjets, "Z/#gamma*#rightarrowl^{+}l^{-}", "f");
304     // leg->AddEntry(hist_qcd, "QCD/#gamma + jets");
305     // leg->AddEntry(hist_Zprime500, "Z' 0.5TeV (50pb)");
306     // leg->AddEntry(hist_Zprime750, "Z' 0.75TeV (50pb)");
307     // leg->AddEntry(hist_Zprime1000, "Z' 1TeV (50pb)");
308     // leg->AddEntry(hist_Zprime1250, "Z' 1.25TeV (50pb)");
309     // leg->AddEntry(hist_Zprime1500, "Z' 1.5TeV (50pb)");
310    
311     THStack* hs = new THStack("MC", "MC");
312     hs->Add(hist_qcd);
313     hs->Add(hist_zjets);
314     hs->Add(hist_wjets);
315     hs->Add(hist_ttbar);
316    
317     TCanvas* c = new TCanvas(TString("cname" + histname), histname, 800, 600);
318     c->cd()->SetRightMargin(0.04);
319     // hist_data2->Draw("error");
320     hist_data->Draw("error");
321     // hs->Draw("hist same");
322     // hist_Zprime500->Draw("same");
323     // hist_Zprime750->Draw("same");
324     // hist_Zprime1000->Draw("same");
325     // hist_Zprime1250->Draw("same");
326     // hist_Zprime1500->Draw("same");
327     // qcdUncert->Draw("1 same");
328     // hist_data2->Draw("error same");
329     hist_data->Draw("error same");
330     leg->Draw();
331    
332     // text1 = new TLatex(3.570061, 23.08044, "CMS Preliminary");
333     // text1->SetNDC();
334     // text1->SetTextAlign(13);
335     // text1->SetX(0.184);
336     // text1->SetY(0.928);
337     // //text1->SetLineWidth(2);
338     // text1->SetTextFont(42);
339     // text1->SetTextSizePixels(24);// dflt=28
340     // text1->Draw();
341    
342     TLatex * text2 = new TLatex(3.570061, 23.08044, "~19 pb^{-1} at #sqrt{s} = 7 TeV");
343     text2->SetNDC();
344     text2->SetTextAlign(13);
345     text2->SetX(0.184);
346     text2->SetY(0.88);
347     //text2->SetLineWidth(2);
348     text2->SetTextFont(42);
349     text2->SetTextSizePixels(24);// dflt=28
350     text2->Draw();
351    
352     // TH1F* cu_hist_data = getCumulativePlot(hist_data, "data");
353     //// TH1F* cu_hist_data2 = getCumulativePlot(hist_data2, "data2");
354     // TH1F* cu_hist_ttbar = getCumulativePlot(hist_ttbar, "ttbar");
355     // TH1F* cu_hist_wjets = getCumulativePlot(hist_wjets, "wjets");
356     // TH1F* cu_hist_zjets = getCumulativePlot(hist_zjets, "zjets");
357     // TH1F* cu_hist_qcd = getCumulativePlot(hist_qcd, "qcd");
358     // TH1F* cu_hist_Zprime500 = getCumulativePlot(hist_Zprime500, "Zprime500");
359     // TH1F* cu_hist_Zprime750 = getCumulativePlot(hist_Zprime750, "Zprime750");
360     // TH1F* cu_hist_Zprime1000 = getCumulativePlot(hist_Zprime1000, "Zprime1000");
361     // TH1F* cu_hist_Zprime1250 = getCumulativePlot(hist_Zprime1250, "Zprime1250");
362     // TH1F* cu_hist_Zprime1500 = getCumulativePlot(hist_Zprime1500, "Zprime1500");
363     //// if (histname == "mttbar_rebinned") {
364     //// cu_hist_data2->SetXTitle("M_{t#bar{t}}/GeV");
365     //// cu_hist_data2->SetYTitle("Integrated Events/(50 GeV)");
366     //// }
367     //
368     // THStack* cu_hs = new THStack("cu_MC", "cu_MC");
369     // cu_hs->Add(cu_hist_qcd);
370     // cu_hs->Add(cu_hist_zjets);
371     // cu_hs->Add(cu_hist_wjets);
372     // cu_hs->Add(cu_hist_ttbar);
373     //
374     // TCanvas* cu_c = new TCanvas(TString("cu_cname" + histname), TString(histname + "(cu)"), 800, 600);
375     // cu_c->cd()->SetRightMargin(0.04);
376     // // cu_hist_data2->Draw("error");
377     // cu_hist_data->Draw("error");
378     // cu_hs->Draw("hist same");
379     // cu_hist_Zprime500->Draw("same");
380     // cu_hist_Zprime750->Draw("same");
381     // cu_hist_Zprime1000->Draw("same");
382     // cu_hist_Zprime1250->Draw("same");
383     // cu_hist_Zprime1500->Draw("same");
384     // // cu_hist_data2->Draw("error same");
385     // cu_hist_data->Draw("error same");
386     // leg->Draw();
387     //
388     // // text1->Draw();
389     //
390     // text2->Draw();
391     }
392     }
393    
394     // tdrGrid: Turns the grid lines on (true) or off (false)
395    
396     //void tdrGrid(bool gridOn) {
397     // tdrStyle->SetPadGridX(gridOn);
398     // tdrStyle->SetPadGridY(gridOn);
399     //}
400    
401     // fixOverlay: Redraws the axis
402    
403     void fixOverlay() {
404     gPad->RedrawAxis();
405     }
406    
407     void setTDRStyle() {
408     TStyle *tdrStyle = new TStyle("tdrStyle", "Style for P-TDR");
409    
410     // For the canvas:
411     tdrStyle->SetCanvasBorderMode(0);
412     tdrStyle->SetCanvasColor(kWhite);
413     tdrStyle->SetCanvasDefH(600); //Height of canvas
414     tdrStyle->SetCanvasDefW(600); //Width of canvas
415     tdrStyle->SetCanvasDefX(0); //POsition on screen
416     tdrStyle->SetCanvasDefY(0);
417    
418     // For the Pad:
419     tdrStyle->SetPadBorderMode(0);
420     // tdrStyle->SetPadBorderSize(Width_t size = 1);
421     tdrStyle->SetPadColor(kWhite);
422     tdrStyle->SetPadGridX(false);
423     tdrStyle->SetPadGridY(false);
424     tdrStyle->SetGridColor(0);
425     tdrStyle->SetGridStyle(3);
426     tdrStyle->SetGridWidth(1);
427    
428     // For the frame:
429     tdrStyle->SetFrameBorderMode(0);
430     tdrStyle->SetFrameBorderSize(1);
431     tdrStyle->SetFrameFillColor(0);
432     tdrStyle->SetFrameFillStyle(0);
433     tdrStyle->SetFrameLineColor(1);
434     tdrStyle->SetFrameLineStyle(1);
435     tdrStyle->SetFrameLineWidth(1);
436    
437     // For the histo:
438     // tdrStyle->SetHistFillColor(1);
439     // tdrStyle->SetHistFillStyle(0);
440     tdrStyle->SetHistLineColor(1);
441     tdrStyle->SetHistLineStyle(0);
442     tdrStyle->SetHistLineWidth(1);
443     // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
444     // tdrStyle->SetNumberContours(Int_t number = 20);
445    
446     tdrStyle->SetEndErrorSize(2);
447     // tdrStyle->SetErrorMarker(20);
448     tdrStyle->SetErrorX(0.);
449    
450     tdrStyle->SetMarkerStyle(20);
451    
452     //For the fit/function:
453     tdrStyle->SetOptFit(1);
454     tdrStyle->SetFitFormat("5.4g");
455     tdrStyle->SetFuncColor(2);
456     tdrStyle->SetFuncStyle(1);
457     tdrStyle->SetFuncWidth(1);
458    
459     //For the date:
460     tdrStyle->SetOptDate(0);
461     // tdrStyle->SetDateX(Float_t x = 0.01);
462     // tdrStyle->SetDateY(Float_t y = 0.01);
463    
464     // For the statistics box:
465     tdrStyle->SetOptFile(0);
466     tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
467     tdrStyle->SetStatColor(kWhite);
468     tdrStyle->SetStatFont(42);
469     tdrStyle->SetStatFontSize(0.025);
470     tdrStyle->SetStatTextColor(1);
471     tdrStyle->SetStatFormat("6.4g");
472     tdrStyle->SetStatBorderSize(1);
473     tdrStyle->SetStatH(0.1);
474     tdrStyle->SetStatW(0.15);
475     // tdrStyle->SetStatStyle(Style_t style = 1001);
476     // tdrStyle->SetStatX(Float_t x = 0);
477     // tdrStyle->SetStatY(Float_t y = 0);
478    
479     // Margins:
480     tdrStyle->SetPadTopMargin(0.05);
481     tdrStyle->SetPadBottomMargin(0.13);
482     tdrStyle->SetPadLeftMargin(0.16);
483     tdrStyle->SetPadRightMargin(0.02);
484    
485     // For the Global title:
486    
487     tdrStyle->SetOptTitle(0);
488     tdrStyle->SetTitleFont(42);
489     tdrStyle->SetTitleColor(1);
490     tdrStyle->SetTitleTextColor(1);
491     tdrStyle->SetTitleFillColor(10);
492     tdrStyle->SetTitleFontSize(0.05);
493     // tdrStyle->SetTitleH(0); // Set the height of the title box
494     // tdrStyle->SetTitleW(0); // Set the width of the title box
495     // tdrStyle->SetTitleX(0); // Set the position of the title box
496     // tdrStyle->SetTitleY(0.985); // Set the position of the title box
497     // tdrStyle->SetTitleStyle(Style_t style = 1001);
498     // tdrStyle->SetTitleBorderSize(2);
499    
500     // For the axis titles:
501    
502     tdrStyle->SetTitleColor(1, "XYZ");
503     tdrStyle->SetTitleFont(42, "XYZ");
504     tdrStyle->SetTitleSize(0.06, "XYZ");
505     // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
506     // tdrStyle->SetTitleYSize(Float_t size = 0.02);
507     tdrStyle->SetTitleXOffset(0.9);
508     tdrStyle->SetTitleYOffset(1.25);
509     // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
510    
511     // For the axis labels:
512    
513     tdrStyle->SetLabelColor(1, "XYZ");
514     tdrStyle->SetLabelFont(42, "XYZ");
515     tdrStyle->SetLabelOffset(0.007, "XYZ");
516     tdrStyle->SetLabelSize(0.05, "XYZ");
517    
518     // For the axis:
519    
520     tdrStyle->SetAxisColor(1, "XYZ");
521     tdrStyle->SetStripDecimals(kTRUE);
522     tdrStyle->SetTickLength(0.03, "XYZ");
523     tdrStyle->SetNdivisions(510, "XYZ");
524     tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
525     tdrStyle->SetPadTickY(1);
526    
527     // Change for log plots:
528     tdrStyle->SetOptLogx(0);
529     tdrStyle->SetOptLogy(0);
530     tdrStyle->SetOptLogz(0);
531    
532     // Postscript options:
533     tdrStyle->SetPaperSize(20., 20.);
534     // tdrStyle->SetLineScalePS(Float_t scale = 3);
535     // tdrStyle->SetLineStyleString(Int_t i, const char* text);
536     // tdrStyle->SetHeaderPS(const char* header);
537     // tdrStyle->SetTitlePS(const char* pstitle);
538    
539     // tdrStyle->SetBarOffset(Float_t baroff = 0.5);
540     // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
541     // tdrStyle->SetPaintTextFormat(const char* format = "g");
542     // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
543     // tdrStyle->SetTimeOffset(Double_t toffset);
544     // tdrStyle->SetHistMinimumZero(kTRUE);
545    
546     tdrStyle->cd();
547    
548     }
549    
550     TH1F* getCumulativePlot(TH1F* initial, TString type) {
551     TString name(initial->GetName());
552     name = "cu_" + name + "_" + type;
553     TString title(initial->GetTitle());
554     title = "cu_" + title + "_" + type;
555     TString xaxis = initial->GetXaxis()->GetTitle();
556     TString yaxis = initial->GetYaxis()->GetTitle();
557     unsigned int nBins = initial->GetNbinsX();
558     TH1F* cu = new TH1F(name, title, nBins, initial->GetXaxis()->GetXmin(), initial->GetXaxis()->GetXmax());
559     for (unsigned int bin = 1; bin <= nBins; ++bin) {
560     cu->SetBinContent(bin, initial->Integral(bin, nBins));
561     }
562     cu->SetFillStyle(initial->GetFillStyle());
563     cu->SetFillColor(initial->GetFillColor());
564     cu->SetLineColor(initial->GetLineColor());
565     cu->SetMarkerSize(initial->GetMarkerSize());
566     cu->SetMarkerStyle(initial->GetMarkerStyle());
567     cu->SetMarkerColor(initial->GetMarkerColor());
568     cu->SetLineWidth(initial->GetLineWidth());
569     cu->GetXaxis()->SetTitle(xaxis);
570     cu->GetYaxis()->SetTitle(yaxis);
571     return cu;
572     }
573