-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.C
321 lines (305 loc) · 12.4 KB
/
Example.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
void Example()
{
//=========Macro generated from canvas: cMtdNdy/dNdy Mt
//========= (Tue Feb 19 10:13:40 2019) by ROOT version 6.12/06
TCanvas *cMtdNdy = new TCanvas("cMtdNdy", "dNdy Mt",214,153,1200,840);
cMtdNdy->ToggleEventStatus();
cMtdNdy->Range(-1.251047,0.0008372092,1.109419,0.01246512);
cMtdNdy->SetFillColor(0);
cMtdNdy->SetBorderMode(0);
cMtdNdy->SetBorderSize(2);
cMtdNdy->SetRightMargin(0.04);
cMtdNdy->SetTopMargin(0.04);
cMtdNdy->SetFrameBorderMode(0);
cMtdNdy->SetFrameBorderMode(0);
TGraphMultiErrors* tgme = new TGraphMultiErrors(35, 3);
tgme->SetName("Graph_from_hdNdyStd");
tgme->SetTitle("");
tgme->SetFillStyle(0);
Int_t ci; // for color index setting
TColor *color; // for color definition with alpha
ci = TColor::GetColor("#ff0000");
tgme->SetLineColor(ci);
ci = TColor::GetColor("#ff0000");
tgme->SetMarkerColor(ci);
tgme->SetMarkerStyle(20);
tgme->SetMarkerSize(1.5);
tgme->GetAttFill(0)->SetFillStyle(0);
ci = TColor::GetColor("#ff0000");
tgme->GetAttLine(0)->SetLineColor(ci);
tgme->GetAttFill(1)->SetFillStyle(0);
ci = TColor::GetColor("#ff0000");
tgme->GetAttLine(1)->SetLineColor(ci);
tgme->GetAttFill(2)->SetFillStyle(3002);
tgme->GetAttFill(2)->SetFillColor(kBlue);
ci = TColor::GetColor("#ff0000");
tgme->GetAttLine(2)->SetLineColor(ci);
tgme->SetPoint(0, -1.7, -1e-10);
tgme->SetPointEX(0, 0.05, 0.05);
tgme->SetPointEY(0, 0, 0, 0);
tgme->SetPointEY(0, 1, 0, 0);
tgme->SetPointEY(0, 2, 0, 0);
tgme->SetPoint(1, -1.6, -1e-10);
tgme->SetPointEX(1, 0.05, 0.05);
tgme->SetPointEY(1, 0, 0, 0);
tgme->SetPointEY(1, 1, 0, 0);
tgme->SetPointEY(1, 2, 0, 0);
tgme->SetPoint(2, -1.5, -1e-10);
tgme->SetPointEX(2, 0.05, 0.05);
tgme->SetPointEY(2, 0, 0, 0);
tgme->SetPointEY(2, 1, 0, 0);
tgme->SetPointEY(2, 2, 0, 0);
tgme->SetPoint(3, -1.4, -1e-10);
tgme->SetPointEX(3, 0.05, 0.05);
tgme->SetPointEY(3, 0, 0, 0);
tgme->SetPointEY(3, 1, 0, 0);
tgme->SetPointEY(3, 2, 0, 0);
tgme->SetPoint(4, -1.3, -1e-10);
tgme->SetPointEX(4, 0.05, 0.05);
tgme->SetPointEY(4, 0, 0, 0);
tgme->SetPointEY(4, 1, 0, 0);
tgme->SetPointEY(4, 2, 0, 0);
tgme->SetPoint(5, -1.2, -1e-10);
tgme->SetPointEX(5, 0.05, 0.05);
tgme->SetPointEY(5, 0, 0, 0);
tgme->SetPointEY(5, 1, 0, 0);
tgme->SetPointEY(5, 2, 0, 0);
tgme->SetPoint(6, -1.1, -1e-10);
tgme->SetPointEX(6, 0.05, 0.05);
tgme->SetPointEY(6, 0, 0, 0);
tgme->SetPointEY(6, 1, 0, 0);
tgme->SetPointEY(6, 2, 0, 0);
tgme->SetPoint(7, -1, -1e-10);
tgme->SetPointEX(7, 0.05, 0.05);
tgme->SetPointEY(7, 0, 0, 0);
tgme->SetPointEY(7, 1, 0, 0);
tgme->SetPointEY(7, 2, 0, 0);
tgme->SetPoint(8, -0.9, -1e-10);
tgme->SetPointEX(8, 0.05, 0.05);
tgme->SetPointEY(8, 0, 0, 0);
tgme->SetPointEY(8, 1, 0, 0);
tgme->SetPointEY(8, 2, 0, 0);
tgme->SetPoint(9, -0.8, -1e-10);
tgme->SetPointEX(9, 0.05, 0.05);
tgme->SetPointEY(9, 0, 0, 0);
tgme->SetPointEY(9, 1, 0, 0);
tgme->SetPointEY(9, 2, 0, 0);
tgme->SetPoint(10, -0.7, -1e-10);
tgme->SetPointEX(10, 0.05, 0.05);
tgme->SetPointEY(10, 0, 0, 0);
tgme->SetPointEY(10, 1, 0, 0);
tgme->SetPointEY(10, 2, 0, 0);
tgme->SetPoint(11, -0.6, 0.006653559);
tgme->SetPointEX(11, 0.05, 0.05);
tgme->SetPointEY(11, 0, 0.0007770135, 0.0007770135);
tgme->SetPointEY(11, 1, 0.0002661424, 0.0002661424);
tgme->SetPointEY(11, 2, 0.001114412, 0.001114412);
tgme->SetPoint(12, -0.5, 0.007612885);
tgme->SetPointEX(12, 0.05, 0.05);
tgme->SetPointEY(12, 0, 0.0003058048, 0.0003058048);
tgme->SetPointEY(12, 1, 0.0003045154, 0.0003045154);
tgme->SetPointEY(12, 2, 0.001114412, 0.001114412);
tgme->SetPoint(13, -0.4, 0.007998861);
tgme->SetPointEX(13, 0.05, 0.05);
tgme->SetPointEY(13, 0, 0.000169729, 0.000169729);
tgme->SetPointEY(13, 1, 0.0003199544, 0.0003199544);
tgme->SetPointEY(13, 2, 0.001114412, 0.001114412);
tgme->SetPoint(14, -0.3, 0.008373467);
tgme->SetPointEX(14, 0.05, 0.05);
tgme->SetPointEY(14, 0, 0.0001226339, 0.0001226339);
tgme->SetPointEY(14, 1, 0.0003349387, 0.0003349387);
tgme->SetPointEY(14, 2, 0.001114412, 0.001114412);
tgme->SetPoint(15, -0.2, 0.0090014);
tgme->SetPointEX(15, 0.05, 0.05);
tgme->SetPointEY(15, 0, 0.0001099641, 0.0001099641);
tgme->SetPointEY(15, 1, 0.000360056, 0.000360056);
tgme->SetPointEY(15, 2, 0.001114412, 0.001114412);
tgme->SetPoint(16, -0.1, 0.00918717);
tgme->SetPointEX(16, 0.05, 0.05);
tgme->SetPointEY(16, 0, 0.0001012269, 0.0001012269);
tgme->SetPointEY(16, 1, 0.0003674868, 0.0003674868);
tgme->SetPointEY(16, 2, 0.001114412, 0.001114412);
tgme->SetPoint(17, 1.804112e-16, 0.009157779);
tgme->SetPointEX(17, 0.05, 0.05);
tgme->SetPointEY(17, 0, 9.974575e-05, 9.974575e-05);
tgme->SetPointEY(17, 1, 0.0003663111, 0.0003663111);
tgme->SetPointEY(17, 2, 0.001114412, 0.001114412);
tgme->SetPoint(18, 0.1, 0.009052232);
tgme->SetPointEX(18, 0.05, 0.05);
tgme->SetPointEY(18, 0, 0.0001012727, 0.0001012727);
tgme->SetPointEY(18, 1, 0.0003620893, 0.0003620893);
tgme->SetPointEY(18, 2, 0.001114412, 0.001114412);
tgme->SetPoint(19, 0.2, 0.008822018);
tgme->SetPointEX(19, 0.05, 0.05);
tgme->SetPointEY(19, 0, 0.0001061224, 0.0001061224);
tgme->SetPointEY(19, 1, 0.0003528807, 0.0003528807);
tgme->SetPointEY(19, 2, 0.001114412, 0.001114412);
tgme->SetPoint(20, 0.3, 0.008393364);
tgme->SetPointEX(20, 0.05, 0.05);
tgme->SetPointEY(20, 0, 0.0001146153, 0.0001146153);
tgme->SetPointEY(20, 1, 0.0003357346, 0.0003357346);
tgme->SetPointEY(20, 2, 0.001114412, 0.001114412);
tgme->SetPoint(21, 0.4, 0.007694294);
tgme->SetPointEX(21, 0.05, 0.05);
tgme->SetPointEY(21, 0, 0.0001231055, 0.0001231055);
tgme->SetPointEY(21, 1, 0.0003077718, 0.0003077718);
tgme->SetPointEY(21, 2, 0.001114412, 0.001114412);
tgme->SetPoint(22, 0.5, 0.006927766);
tgme->SetPointEX(22, 0.05, 0.05);
tgme->SetPointEY(22, 0, 0.0001419568, 0.0001419568);
tgme->SetPointEY(22, 1, 0.0002771106, 0.0002771106);
tgme->SetPointEY(22, 2, 0.001114412, 0.001114412);
tgme->SetPoint(23, 0.6, 0.005943415);
tgme->SetPointEX(23, 0.05, 0.05);
tgme->SetPointEY(23, 0, 0.0001604474, 0.0001604474);
tgme->SetPointEY(23, 1, 0.000248211, 0.000248211);
tgme->SetPointEY(23, 2, 0.001114412, 0.001114412);
tgme->SetPoint(24, 0.7, 0.004971598);
tgme->SetPointEX(24, 0.05, 0.05);
tgme->SetPointEY(24, 0, 0.00019305, 0.00019305);
tgme->SetPointEY(24, 1, 0.0001988639, 0.0001988639);
tgme->SetPointEY(24, 2, 0.001114412, 0.001114412);
tgme->SetPoint(25, 0.8, 0.003335559);
tgme->SetPointEX(25, 0.05, 0.05);
tgme->SetPointEY(25, 0, 0.000226053, 0.000226053);
tgme->SetPointEY(25, 1, 0.0001334223, 0.0001334223);
tgme->SetPointEY(25, 2, 0.001114412, 0.001114412);
tgme->SetPoint(26, 0.9, -1e-10);
tgme->SetPointEX(26, 0.05, 0.05);
tgme->SetPointEY(26, 0, 0, 0);
tgme->SetPointEY(26, 1, 0, 0);
tgme->SetPointEY(26, 2, 0, 0);
tgme->SetPoint(27, 1, -1e-10);
tgme->SetPointEX(27, 0.05, 0.05);
tgme->SetPointEY(27, 0, 0, 0);
tgme->SetPointEY(27, 1, 0, 0);
tgme->SetPointEY(27, 2, 0, 0);
tgme->SetPoint(28, 1.1, -1e-10);
tgme->SetPointEX(28, 0.05, 0.05);
tgme->SetPointEY(28, 0, 0, 0);
tgme->SetPointEY(28, 1, 0, 0);
tgme->SetPointEY(28, 2, 0, 0);
tgme->SetPoint(29, 1.2, -1e-10);
tgme->SetPointEX(29, 0.05, 0.05);
tgme->SetPointEY(29, 0, 0, 0);
tgme->SetPointEY(29, 1, 0, 0);
tgme->SetPointEY(29, 2, 0, 0);
tgme->SetPoint(30, 1.3, -1e-10);
tgme->SetPointEX(30, 0.05, 0.05);
tgme->SetPointEY(30, 0, 0, 0);
tgme->SetPointEY(30, 1, 0, 0);
tgme->SetPointEY(30, 2, 0, 0);
tgme->SetPoint(31, 1.4, -1e-10);
tgme->SetPointEX(31, 0.05, 0.05);
tgme->SetPointEY(31, 0, 0, 0);
tgme->SetPointEY(31, 1, 0, 0);
tgme->SetPointEY(31, 2, 0, 0);
tgme->SetPoint(32, 1.5, -1e-10);
tgme->SetPointEX(32, 0.05, 0.05);
tgme->SetPointEY(32, 0, 0, 0);
tgme->SetPointEY(32, 1, 0, 0);
tgme->SetPointEY(32, 2, 0, 0);
tgme->SetPoint(33, 1.6, -1e-10);
tgme->SetPointEX(33, 0.05, 0.05);
tgme->SetPointEY(33, 0, 0, 0);
tgme->SetPointEY(33, 1, 0, 0);
tgme->SetPointEY(33, 2, 0, 0);
tgme->SetPoint(34, 1.7, -1e-10);
tgme->SetPointEX(34, 0.05, 0.05);
tgme->SetPointEY(34, 0, 0, 0);
tgme->SetPointEY(34, 1, 0, 0);
tgme->SetPointEY(34, 2, 0, 0);
TH1F *Graph_Graph_from_hdNdyStd1 = new TH1F("Graph_Graph_from_hdNdyStd1","",100,-1.75,1.75);
Graph_Graph_from_hdNdyStd1->SetMinimum(0.002);
Graph_Graph_from_hdNdyStd1->SetMaximum(0.012);
Graph_Graph_from_hdNdyStd1->SetDirectory(0);
Graph_Graph_from_hdNdyStd1->SetStats(0);
ci = TColor::GetColor("#000099");
Graph_Graph_from_hdNdyStd1->SetLineColor(ci);
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitle("Rapidity y_{cm}");
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetRange(22,79);
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetLabelFont(42);
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetLabelSize(0.035);
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitleSize(0.035);
Graph_Graph_from_hdNdyStd1->GetXaxis()->SetTitleFont(42);
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitle("#frac{dN}{dy} / N_{Events}");
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetLabelFont(42);
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetLabelSize(0.035);
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleSize(0.035);
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleOffset(1.4);
Graph_Graph_from_hdNdyStd1->GetYaxis()->SetTitleFont(42);
Graph_Graph_from_hdNdyStd1->GetZaxis()->SetLabelFont(42);
Graph_Graph_from_hdNdyStd1->GetZaxis()->SetLabelSize(0.035);
Graph_Graph_from_hdNdyStd1->GetZaxis()->SetTitleSize(0.035);
Graph_Graph_from_hdNdyStd1->GetZaxis()->SetTitleFont(42);
tgme->SetHistogram(Graph_Graph_from_hdNdyStd1);
tgme->Draw("a p x y0 s ; z ; 5 s=0.5 ; 3");
TF1 *fdNdyStdGaus1 = new TF1("fdNdyStdGaus","gaus",-1.75,1.75, TF1::EAddToList::kDefault);
fdNdyStdGaus1->SetFillColor(19);
fdNdyStdGaus1->SetFillStyle(0);
ci = TColor::GetColor("#ff0000");
fdNdyStdGaus1->SetLineColor(ci);
fdNdyStdGaus1->SetLineWidth(2);
fdNdyStdGaus1->SetChisquare(34.55391);
fdNdyStdGaus1->SetNDF(13);
fdNdyStdGaus1->GetXaxis()->SetLabelFont(42);
fdNdyStdGaus1->GetXaxis()->SetLabelSize(0.035);
fdNdyStdGaus1->GetXaxis()->SetTitleSize(0.035);
fdNdyStdGaus1->GetXaxis()->SetTitleFont(42);
fdNdyStdGaus1->GetYaxis()->SetLabelFont(42);
fdNdyStdGaus1->GetYaxis()->SetLabelSize(0.035);
fdNdyStdGaus1->GetYaxis()->SetTitleSize(0.035);
fdNdyStdGaus1->GetYaxis()->SetTitleOffset(0);
fdNdyStdGaus1->GetYaxis()->SetTitleFont(42);
fdNdyStdGaus1->SetParameter(0,0.009320421);
fdNdyStdGaus1->SetParError(0,4.67545e-05);
fdNdyStdGaus1->SetParLimits(0,0,0);
fdNdyStdGaus1->SetParameter(1,0);
fdNdyStdGaus1->SetParError(1,0);
fdNdyStdGaus1->SetParLimits(1,1,1);
fdNdyStdGaus1->SetParameter(2,0.6340543);
fdNdyStdGaus1->SetParError(2,0.01016669);
fdNdyStdGaus1->SetParLimits(2,0,0);
fdNdyStdGaus1->Draw("SAME");
TLegend *leg = new TLegend(0.73,0.75,0.95,0.95,NULL,"brNDC");
leg->SetBorderSize(1);
leg->SetLineColor(0);
leg->SetLineStyle(1);
leg->SetLineWidth(1);
leg->SetFillColor(0);
leg->SetFillStyle(1001);
TLegendEntry *entry=leg->AddEntry("Graph_from_hdNdyStd","Data","L P");
ci = TColor::GetColor("#ff0000");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
ci = TColor::GetColor("#ff0000");
entry->SetMarkerColor(ci);
entry->SetMarkerStyle(20);
entry->SetMarkerSize(1.5);
entry->SetTextFont(42);
entry=leg->AddEntry("","Point to Point Systematics","F");
ci = TColor::GetColor("#ff0000");
entry->SetLineColor(ci);
entry->SetLineStyle(1);
entry->SetLineWidth(1);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
entry=leg->AddEntry("","Common Systematics","F");
ci = TColor::GetColor("#0000ff");
entry->SetLineColor(ci);
entry->SetLineStyle(0);
entry->SetLineWidth(0);
entry->SetFillColor(ci);
entry->SetFillStyle(3002);
entry->SetMarkerColor(1);
entry->SetMarkerStyle(21);
entry->SetMarkerSize(1);
entry->SetTextFont(42);
leg->Draw();
cMtdNdy->Modified();
cMtdNdy->cd();
cMtdNdy->SetSelected(cMtdNdy);
}