Fork me on GitHub

source: svn/trunk/paper/sourceCode/resolutionJet.C@ 504

Last change on this file since 504 was 130, checked in by severine ovyn, 16 years ago

code for graphs publi

File size: 6.8 KB
Line 
1{
2//=========Macro generated from canvas: c2/JET resol
3//========= (Sat Jan 3 15:06:31 2009) by ROOT version5.20/00
4 TCanvas *c2 = new TCanvas("c2", "JET resol",103,123,600,450);
5 gStyle->SetOptFit(1);
6 gStyle->SetOptStat(0);
7 c2->Range(-110.302,-4.83611,865.0212,32.52035);
8 c2->SetFillColor(0);
9 c2->SetBorderMode(0);
10 c2->SetBorderSize(2);
11 c2->SetTickx(1);
12 c2->SetTicky(1);
13 c2->SetLeftMargin(0.13);
14 c2->SetRightMargin(0.05);
15 c2->SetTopMargin(0.05);
16 c2->SetBottomMargin(0.13);
17 c2->SetFrameFillStyle(0);
18 c2->SetFrameBorderMode(0);
19 c2->SetFrameFillStyle(0);
20 c2->SetFrameBorderMode(0);
21
22 TGraph *graph = new TGraph(15);
23 graph->SetName("Graph");
24 graph->SetTitle("");
25 graph->SetFillColor(1);
26 graph->SetMarkerStyle(20);
27 graph->SetPoint(0,5,22.5596);
28 graph->SetPoint(1,15,25.04835);
29 graph->SetPoint(2,25,19.30046);
30 graph->SetPoint(3,35,16.76912);
31 graph->SetPoint(4,45,15.23036);
32 graph->SetPoint(5,55,14.07184);
33 graph->SetPoint(6,65,13.29615);
34 graph->SetPoint(7,75,12.51001);
35 graph->SetPoint(8,90,11.98179);
36 graph->SetPoint(9,110,11.4267);
37 graph->SetPoint(10,130,10.63493);
38 graph->SetPoint(11,160,9.663273);
39 graph->SetPoint(12,200,8.609053);
40 graph->SetPoint(13,260,7.867697);
41 graph->SetPoint(14,750,6.408123);
42
43 TH1 *Graph1 = new TH1F("Graph1","",100,0,824.5);
44 Graph1->SetMinimum(0.02022917);
45 Graph1->SetMaximum(30.65253);
46 Graph1->SetDirectory(0);
47 Graph1->SetStats(0);
48 Graph1->SetLineStyle(0);
49 Graph1->SetMarkerStyle(20);
50 Graph1->GetXaxis()->SetTitle("E_{T}^{MC} [GeV]");
51 Graph1->GetXaxis()->SetRange(3,99);
52 Graph1->GetXaxis()->SetLabelFont(42);
53 Graph1->GetXaxis()->SetLabelOffset(0.007);
54 Graph1->GetXaxis()->SetTitleSize(0.05);
55 Graph1->GetXaxis()->SetTitleOffset(0.9);
56 Graph1->GetXaxis()->SetTitleFont(42);
57 Graph1->GetYaxis()->SetTitle("#sigma(E_{T}^{rec}/E_{T}^{MC})_{fit}/<E_{T}^{rec}/E_{T}^{MC}>_{fit}");
58 Graph1->GetYaxis()->SetLabelFont(42);
59 Graph1->GetYaxis()->SetLabelOffset(0.007);
60 Graph1->GetYaxis()->SetTitleSize(0.05);
61 Graph1->GetYaxis()->SetTitleOffset(1.05);
62 Graph1->GetYaxis()->SetTitleFont(42);
63 Graph1->GetZaxis()->SetLabelFont(42);
64 Graph1->GetZaxis()->SetLabelOffset(0.007);
65 Graph1->GetZaxis()->SetTitleSize(0.05);
66 Graph1->GetZaxis()->SetTitleFont(42);
67 graph->SetHistogram(Graph1);
68
69
70 TF1 *user = new TF1("user","sqrt(pow([0]/x,2)+pow([1]/sqrt(x),2)+pow([2],2))",10,800);
71 user->SetFillColor(19);
72 user->SetFillStyle(0);
73 user->SetMarkerStyle(20);
74 user->SetLineColor(6);
75 user->SetLineWidth(1);
76 user->SetChisquare(1.661577);
77 user->GetXaxis()->SetLabelFont(42);
78 user->GetXaxis()->SetLabelOffset(0.007);
79 user->GetXaxis()->SetTitleSize(0.05);
80 user->GetXaxis()->SetTitleOffset(0.9);
81 user->GetXaxis()->SetTitleFont(42);
82 user->GetYaxis()->SetLabelFont(42);
83 user->GetYaxis()->SetLabelOffset(0.007);
84 user->GetYaxis()->SetTitleSize(0.05);
85 user->GetYaxis()->SetTitleOffset(1.05);
86 user->GetYaxis()->SetTitleFont(42);
87 user->SetParameter(0,-3.740005e-06);
88 user->SetParError(0,70.25748);
89 user->SetParLimits(0,0,0);
90 user->SetParameter(1,94.31575);
91 user->SetParError(1,1.231109);
92 user->SetParLimits(1,0,0);
93 user->SetParameter(2,5.905654);
94 user->SetParError(2,0.2829689);
95 user->SetParLimits(2,0,0);
96 graph->GetListOfFunctions()->Add(user);
97
98 TPaveStats *ptstats = new TPaveStats(0.6090604,0.7464455,0.8791946,0.8696682,"brNDC");
99 ptstats->SetName("stats");
100 ptstats->SetBorderSize(1);
101 ptstats->SetTextAlign(12);
102 ptstats->SetTextFont(42);
103 TText *text = ptstats->AddText("#chi^{2} / ndf = 1.662 / 11");
104 text = ptstats->AddText("p0 = -3.74e-06 #pm 70.26 ");
105 text = ptstats->AddText("p1 = 94.32 #pm 1.231 ");
106 text = ptstats->AddText("p2 = 5.906 #pm 0.283 ");
107 ptstats->SetOptStat(0);
108 ptstats->SetOptFit(111);
109 ptstats->Draw();
110 graph->GetListOfFunctions()->Add(ptstats);
111 ptstats->SetParent(graph->GetListOfFunctions());
112 graph->Draw("ap");
113
114 TF1 *userDelphes = new TF1("userDelphes","sqrt(pow(94.3/sqrt(x),2)+pow(5.9,2))",7,1000);
115 userDelphes->SetFillColor(19);
116 userDelphes->SetFillStyle(0);
117 userDelphes->SetMarkerStyle(20);
118 userDelphes->SetLineColor(6);
119 userDelphes->SetLineWidth(1);
120 userDelphes->GetXaxis()->SetLabelFont(42);
121 userDelphes->GetXaxis()->SetLabelOffset(0.007);
122 userDelphes->GetXaxis()->SetTitleSize(0.05);
123 userDelphes->GetXaxis()->SetTitleOffset(0.9);
124 userDelphes->GetXaxis()->SetTitleFont(42);
125 userDelphes->GetYaxis()->SetLabelFont(42);
126 userDelphes->GetYaxis()->SetLabelOffset(0.007);
127 userDelphes->GetYaxis()->SetTitleSize(0.05);
128 userDelphes->GetYaxis()->SetTitleOffset(1.05);
129 userDelphes->GetYaxis()->SetTitleFont(42);
130 userDelphes->Draw("same");
131
132 TF1 *userCMS = new TF1("userCMS","sqrt(pow(1.17*100/sqrt(x),2)+pow(0.039*100,2))",10,800);
133 userCMS->SetFillColor(19);
134 userCMS->SetFillStyle(0);
135 userCMS->SetMarkerStyle(20);
136 userCMS->SetLineColor(9);
137 userCMS->SetLineWidth(1);
138 userCMS->GetXaxis()->SetLabelFont(42);
139 userCMS->GetXaxis()->SetLabelOffset(0.007);
140 userCMS->GetXaxis()->SetTitleSize(0.05);
141 userCMS->GetXaxis()->SetTitleOffset(0.9);
142 userCMS->GetXaxis()->SetTitleFont(42);
143 userCMS->GetYaxis()->SetLabelFont(42);
144 userCMS->GetYaxis()->SetLabelOffset(0.007);
145 userCMS->GetYaxis()->SetTitleSize(0.05);
146 userCMS->GetYaxis()->SetTitleOffset(1.05);
147 userCMS->GetYaxis()->SetTitleFont(42);
148 userCMS->Draw("same");
149
150 TPaveText *pt = new TPaveText(0.6493289,0.4905213,0.7986577,0.5402844,"brNDC");
151 pt->SetBorderSize(0);
152 pt->SetFillColor(10);
153 pt->SetTextFont(42);
154 pt->SetTextSize(0.03791469);
155 text = pt->AddText("Events: pp #rightarrow gg ");
156 pt->Draw();
157
158 pt = new TPaveText(0.2,0.15,0.35,0.2,"brNDC");
159 pt->SetBorderSize(0);
160 pt->SetFillColor(10);
161 pt->SetTextFont(42);
162 pt->SetTextSize(0.03791469);
163 text = pt->AddText("MG/ME + Delphes");
164 pt->Draw();
165
166 TLegend *leg = new TLegend(0.1963087,0.6421801,0.8959732,0.8909953,NULL,"brNDC");
167 leg->SetBorderSize(0);
168 leg->SetTextFont(62);
169 leg->SetLineColor(1);
170 leg->SetLineStyle(1);
171 leg->SetLineWidth(1);
172 leg->SetFillColor(10);
173 leg->SetFillStyle(1001);
174 TLegendEntry *entry=leg->AddEntry("userCMS","CMS resolution","l");
175 entry->SetLineColor(9);
176 entry->SetLineStyle(1);
177 entry->SetLineWidth(1);
178 entry->SetMarkerColor(1);
179 entry->SetMarkerStyle(21);
180 entry->SetMarkerSize(1);
181 entry=leg->AddEntry("userDelphes","Delphes resolution: #frac{#sigma(E_{T}^{rec}/E_{T}^{MC})}{<E_{T}^{rec}/E_{T}^{MC}>} = #frac{94.3}{#sqrt{E_{T}^{MC}}} #oplus 5.9","l");
182 entry->SetLineColor(6);
183 entry->SetLineStyle(1);
184 entry->SetLineWidth(1);
185 entry->SetMarkerColor(1);
186 entry->SetMarkerStyle(21);
187 entry->SetMarkerSize(1);
188 leg->Draw();
189 c2->Modified();
190 c2->cd();
191 c2->SetSelected(c2);
192}
Note: See TracBrowser for help on using the repository browser.