-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph_for3.c
414 lines (366 loc) · 19.2 KB
/
graph_for3.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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
void graph() {
TCanvas *c1 = new TCanvas("graph1","graph1",200,10,700,500);
TCanvas *c2 = new TCanvas("graph2","graph2",200,10,700,500);
TCanvas *c3 = new TCanvas("graph3","graph3",200,10,700,500);
TCanvas *c4 = new TCanvas("graph4","graph4",200,10,700,500);
//c1->SetFillColor(42);
//gStyle->SetPalette(52);
c1->SetGrid();
c2->SetGrid();
c3->SetGrid();
c4->SetGrid();
//c1->GetFrame()->SetFillColor(21);
//c1->GetFrame()->SetBorderSize(12);
const Int_t n = 16;
Float_t energy[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t energyerror[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_mean[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_mean[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_meanerror[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_meanerror[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigma[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigma[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigmaerror[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigmaerror[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_chi[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_chi[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t linearity_error[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t absolute_error[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_stat[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_sys[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_stat[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_sys[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t energy2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t energyerror2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_mean2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_mean2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_meanerror2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_meanerror2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigma2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigma2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigmaerror2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigmaerror2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_chi2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_chi2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t linearity_error2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t absolute_error2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_stat2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_sys2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_stat2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_sys2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error2[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t energy3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t energyerror3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_mean3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_mean3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_meanerror3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_meanerror3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigma3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigma3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_sigmaerror3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_sigmaerror3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t mean_chi3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t rms_chi3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t linearity_error3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t absolute_error3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_stat3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error_sys3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t ratio_error3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_stat3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error_sys3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Float_t resolution_error3[n] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/*
for (int i = 0; i < n; i++) {
printf( " %f ", energy[i] );
printf( " %f ", energyerror[i] );
printf( " %f ", mean[i] );
printf( " %f ", meanerror[i] );
printf( " %f ", sigma[i] );
printf( " %f ", sigmaerror[i] );
printf( " %f ", value[i] );
printf( " %f ", error[i] );
printf( "\n" );
}
*/
FILE *file1 = fopen("out0_5000.txt", "r");
if ( !(long)file1 ) return;
FILE *file2 = fopen("out0_10000.txt", "r");
if ( !(long)file2 ) return;
FILE *file3 = fopen("out1.txt", "r");
if ( !(long)file3 ) return;
for ( int i = 0; i < n; i++ ) {
fscanf( file1, "%f %E %E %E %E %E %E %E\n", &energy[i], &mean_mean[i], &rms_mean[i], &mean_meanerror[i], &mean_sigma[i], &rms_sigma[i], &mean_sigmaerror[i], &mean_chi[i] );
if ( feof( file1 ) ) break;
}
for ( int i = 0; i < n; i++ ) {
fscanf( file2, "%f %E %E %E %E %E %E %E\n", &energy2[i], &mean_mean2[i], &rms_mean2[i], &mean_meanerror2[i], &mean_sigma2[i], &rms_sigma2[i], &mean_sigmaerror2[i], &mean_chi2[i] );
if ( feof( file2 ) ) break;
}
for ( int i = 0; i < n; i++ ) {
fscanf( file3, "%f %E %E %E %E %E %E %E\n", &energy3[i], &mean_mean3[i], &rms_mean3[i], &mean_meanerror3[i], &mean_sigma3[i], &rms_sigma3[i], &mean_sigmaerror3[i], &mean_chi3[i] );
if ( feof( file3 ) ) break;
}
for ( int i = 0; i < n; i++ ) {
linearity_error[ i ] = sqrt( ( pow( mean_meanerror[ i ], 2 ) ) + ( pow( rms_mean[ i ], 2 ) ) );
absolute_error[ i ] = sqrt( ( pow( mean_sigmaerror[ i ], 2 ) ) + ( pow( rms_sigma[ i ], 2 ) ) );
ratio[ i ] = ( mean_mean[i] - energy[i] ) / energy[i];
ratio_error_stat[ i ] = sqrt( pow( (mean_meanerror[i])/(energy[i]), 2 ) + pow( (mean_mean[i] * energyerror[i])/(energy[i] * energy[i]), 2 ) );
ratio_error_sys[ i ] = sqrt( pow( (rms_mean[i])/(energy[i]), 2 ) + pow( (mean_mean[i] * energyerror[i])/(energy[i] * energy[i]), 2 ) );
ratio_error[ i ] = sqrt( ( pow( ratio_error_stat[ i ], 2 ) ) + ( pow( ratio_error_sys[ i ], 2 ) ) );
resolution[ i ] = mean_sigma[i] / mean_mean[i];
resolution_error_stat[ i ] = sqrt( pow( (mean_sigmaerror[i])/(mean_mean[i]), 2 ) + pow( (mean_sigma[i] * mean_meanerror[i])/(mean_mean[i] * mean_mean[i]), 2 ) );
resolution_error_sys[ i ] = sqrt( pow( (rms_sigma[i])/(mean_mean[i]), 2 ) + pow( (mean_sigma[i] * rms_mean[i])/(mean_mean[i] * mean_mean[i]), 2 ) );
resolution_error[ i ] = sqrt( ( pow( resolution_error_stat[ i ], 2 ) ) + ( pow( resolution_error_sys[ i ], 2 ) ) );
}
for ( int i = 0; i < n; i++ ) {
linearity_error2[ i ] = sqrt( ( pow( mean_meanerror2[ i ], 2 ) ) + ( pow( rms_mean2[ i ], 2 ) ) );
absolute_error2[ i ] = sqrt( ( pow( mean_sigmaerror2[ i ], 2 ) ) + ( pow( rms_sigma2[ i ], 2 ) ) );
ratio2[ i ] = ( mean_mean2[i] - energy2[i] ) / energy2[i];
ratio_error_stat2[ i ] = sqrt( pow( (mean_meanerror2[i])/(energy2[i]), 2 ) + pow( (mean_mean2[i] * energyerror2[i])/(energy2[i] * energy2[i]), 2 ) );
ratio_error_sys2[ i ] = sqrt( pow( (rms_mean2[i])/(energy2[i]), 2 ) + pow( (mean_mean2[i] * energyerror2[i])/(energy2[i] * energy2[i]), 2 ) );
ratio_error2[ i ] = sqrt( ( pow( ratio_error_stat2[ i ], 2 ) ) + ( pow( ratio_error_sys2[ i ], 2 ) ) );
resolution2[ i ] = mean_sigma2[i] / mean_mean2[i];
resolution_error_stat2[ i ] = sqrt( pow( (mean_sigmaerror2[i])/(mean_mean2[i]), 2 ) + pow( (mean_sigma2[i] * mean_meanerror2[i])/(mean_mean2[i] * mean_mean2[i]), 2 ) );
resolution_error_sys2[ i ] = sqrt( pow( (rms_sigma2[i])/(mean_mean2[i]), 2 ) + pow( (mean_sigma2[i] * rms_mean2[i])/(mean_mean2[i] * mean_mean2[i]), 2 ) );
resolution_error2[ i ] = sqrt( ( pow( resolution_error_stat2[ i ], 2 ) ) + ( pow( resolution_error_sys2[ i ], 2 ) ) );
}
for ( int i = 0; i < n; i++ ) {
linearity_error3[ i ] = sqrt( ( pow( mean_meanerror3[ i ], 2 ) ) + ( pow( rms_mean3[ i ], 2 ) ) );
absolute_error3[ i ] = sqrt( ( pow( mean_sigmaerror3[ i ], 2 ) ) + ( pow( rms_sigma3[ i ], 2 ) ) );
ratio3[ i ] = ( mean_mean3[i] - energy3[i] ) / energy3[i];
ratio_error_stat3[ i ] = sqrt( pow( (mean_meanerror3[i])/(energy3[i]), 2 ) + pow( (mean_mean3[i] * energyerror3[i])/(energy3[i] * energy3[i]), 2 ) );
ratio_error_sys3[ i ] = sqrt( pow( (rms_mean3[i])/(energy3[i]), 2 ) + pow( (mean_mean3[i] * energyerror3[i])/(energy3[i] * energy3[i]), 2 ) );
ratio_error3[ i ] = sqrt( ( pow( ratio_error_stat3[ i ], 2 ) ) + ( pow( ratio_error_sys3[ i ], 2 ) ) );
resolution3[ i ] = mean_sigma3[i] / mean_mean3[i];
resolution_error_stat3[ i ] = sqrt( pow( (mean_sigmaerror3[i])/(mean_mean3[i]), 2 ) + pow( (mean_sigma3[i] * mean_meanerror3[i])/(mean_mean3[i] * mean_mean3[i]), 2 ) );
resolution_error_sys3[ i ] = sqrt( pow( (rms_sigma3[i])/(mean_mean3[i]), 2 ) + pow( (mean_sigma3[i] * rms_mean3[i])/(mean_mean3[i] * mean_mean3[i]), 2 ) );
resolution_error3[ i ] = sqrt( ( pow( resolution_error_stat3[ i ], 2 ) ) + ( pow( resolution_error_sys3[ i ], 2 ) ) );
}
printf( "\n" );
for (int i = 0; i < n; i++) {
printf( " %f ", energy[i] );
printf( " %f ", energyerror[i] );
printf( " %f ", mean_mean[i] );
printf( " %f ", rms_mean[i] );
printf( " %f ", mean_meanerror[i] );
printf( " %f ", rms_meanerror[i] );
printf( " %f ", mean_sigma[i] );
printf( " %f ", rms_sigma[i] );
printf( " %f ", mean_sigmaerror[i] );
printf( " %f ", rms_sigmaerror[i] );
printf( " %f ", linearity_error[i] );
printf( " %f ", absolute_error[i] );
printf( " %f ", ratio[i] );
printf( " %f ", ratio_error[i] );
printf( " %f ", resolution[i] );
printf( " %f ", resolution_error[i] );
printf( "\n" );
}
printf( "\n" );
for (int i = 0; i < n; i++) {
printf( " %f ", energy2[i] );
printf( " %f ", energyerror2[i] );
printf( " %f ", mean_mean2[i] );
printf( " %f ", rms_mean2[i] );
printf( " %f ", mean_meanerror2[i] );
printf( " %f ", rms_meanerror2[i] );
printf( " %f ", mean_sigma2[i] );
printf( " %f ", rms_sigma2[i] );
printf( " %f ", mean_sigmaerror2[i] );
printf( " %f ", rms_sigmaerror2[i] );
printf( " %f ", linearity_error2[i] );
printf( " %f ", absolute_error2[i] );
printf( " %f ", ratio2[i] );
printf( " %f ", ratio_error2[i] );
printf( " %f ", resolution2[i] );
printf( " %f ", resolution_error2[i] );
printf( "\n" );
}
printf( "\n" );
for (int i = 0; i < n; i++) {
printf( " %f ", energy3[i] );
printf( " %f ", energyerror3[i] );
printf( " %f ", mean_mean3[i] );
printf( " %f ", rms_mean3[i] );
printf( " %f ", mean_meanerror3[i] );
printf( " %f ", rms_meanerror3[i] );
printf( " %f ", mean_sigma3[i] );
printf( " %f ", rms_sigma3[i] );
printf( " %f ", mean_sigmaerror3[i] );
printf( " %f ", rms_sigmaerror3[i] );
printf( " %f ", linearity_error3[i] );
printf( " %f ", absolute_error3[i] );
printf( " %f ", ratio3[i] );
printf( " %f ", ratio_error3[i] );
printf( " %f ", resolution3[i] );
printf( " %f ", resolution_error3[i] );
printf( "\n" );
}
/* printf( "Here is difference:\n" );
Float_t v1 = 0;
Float_t v2 = 0;
Float_t v3 = 0;
for ( int i = 0; i < n; i++ ) {
printf( " %f, %f, %f, %f \n", energy[i], value[i], value2[i], value3[i] );
printf( " Difference between nodigi and digi20: %f \n", value2[i] - value[i] );
v1 = v1 + ( value2[i] - value[i] );
printf( " Difference between digi20 and digi60: %f \n", value3[i] - value2[i] );
v2 = v2 + ( value3[i] - value2[i] );
printf( " Difference between nodigi and digi60: %f \n", value3[i] - value[i] );
v3 = v3 + ( value3[i] - value[i] );
}
printf( "Average values: %f, %f, %f \n", v1/n, v2/n, v3/n );
*/
TGraphErrors *agr;
TGraphErrors *bgr;
TGraphErrors *cgr;
char fname[ 100 ];
for ( int i = 0; i < 100; i++ ) fname[ i ] = 0;
c1->cd();
agr = new TGraphErrors( n, energy, mean_mean, energyerror, linearity_error );
agr->GetYaxis()->SetTitle("E_{reco}, GeV");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy2, mean_mean2, energyerror2, linearity_error2 );
bgr->GetYaxis()->SetTitle("E_{reco}, GeV");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy3, mean_mean3, energyerror3, linearity_error3 );
cgr->GetYaxis()->SetTitle("E_{reco}, GeV");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Linearity" ); // Linearity energy resolution // Absolute energy resolution // Relative energy resolution
agr->SetTitle(fname);
agr->SetMarkerColor(kBlue); // kBlue // 12
agr->SetLineColor(kBlue);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34); // 21
// agr->SetMarkerSize(2);
agr->Draw("ALP");
bgr->SetMarkerColor(kRed); // kRed // 15
bgr->SetLineColor(kRed);
bgr->SetLineWidth(3);
bgr->SetMarkerStyle(29); // 21
// bgr->SetMarkerSize(2);
bgr->Draw("LPSAME"); // LPSAME
cgr->SetMarkerColor(kGreen); // kGreen // 17
cgr->SetLineColor(kGreen);
cgr->SetLineWidth(3);
cgr->SetMarkerStyle(20); // 21
// cgr->SetMarkerSize(2);
cgr->Draw("LPSAME"); // LPSAME // ALP
c1->Update();
c2->cd();
agr = new TGraphErrors( n, energy, ratio, energyerror, ratio_error );
agr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy2, ratio2, energyerror2, ratio_error2 );
bgr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy3, ratio3, energyerror3, ratio_error3 );
cgr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Linearity" ); // Linearity energy resolution // Absolute energy resolution // Relative energy resolution
agr->GetYaxis()->SetRangeUser(-0.3,0.8);
agr->SetTitle(fname);
agr->SetMarkerColor(kBlue); // kBlue // 12
agr->SetLineColor(kBlue);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34); // 21
// agr->SetMarkerSize(2);
agr->Draw("ALP");
bgr->SetMarkerColor(kRed); // kRed // 15
bgr->SetLineColor(kRed);
bgr->SetLineWidth(3);
bgr->SetMarkerStyle(29); // 21
// bgr->SetMarkerSize(2);
bgr->Draw("LPSAME"); // LPSAME
cgr->SetMarkerColor(kGreen); // kGreen // 17
cgr->SetLineColor(kGreen);
cgr->SetLineWidth(3);
cgr->SetMarkerStyle(20); // 21
// cgr->SetMarkerSize(2);
cgr->Draw("LPSAME"); // LPSAME // ALP
c2->Update();
c3->cd();
agr = new TGraphErrors( n, energy, mean_sigma, energyerror, absolute_error );
agr->GetYaxis()->SetTitle("#sigma_{reco}, GeV");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy2, mean_sigma2, energyerror2, absolute_error2 );
bgr->GetYaxis()->SetTitle("#sigma_{reco}, GeV");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy3, mean_sigma3, energyerror3, absolute_error3 );
cgr->GetYaxis()->SetTitle("#sigma_{reco}, GeV");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Absolute energy resolution" ); // Linearity energy resolution // Absolute energy resolution // Relative energy resolution
agr->SetTitle(fname);
agr->SetMarkerColor(kBlue); // kBlue // 12
agr->SetLineColor(kBlue);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34); // 21
// agr->SetMarkerSize(2);
agr->Draw("ALP");
bgr->SetMarkerColor(kRed); // kRed // 15
bgr->SetLineColor(kRed);
bgr->SetLineWidth(3);
bgr->SetMarkerStyle(29); // 21
// bgr->SetMarkerSize(2);
bgr->Draw("LPSAME"); // LPSAME
cgr->SetMarkerColor(kGreen); // kGreen // 17
cgr->SetLineColor(kGreen);
cgr->SetLineWidth(3);
cgr->SetMarkerStyle(20); // 21
// cgr->SetMarkerSize(2);
cgr->Draw("LPSAME"); // LPSAME // ALP
c3->Update();
c4->cd();
agr = new TGraphErrors( n, energy, resolution, energyerror, resolution_error );
agr->GetYaxis()->SetTitle("#sigma_{reco} / E_{reco}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy2, resolution2, energyerror2, resolution_error2 );
bgr->GetYaxis()->SetTitle("#sigma_{reco} / E_{reco}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy3, resolution3, energyerror3, resolution_error3 );
cgr->GetYaxis()->SetTitle("#sigma_{reco} / E_{reco}");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Relative energy resolution" ); // Linearity energy resolution // Absolute energy resolution // Relative energy resolution
// agr->GetYaxis()->SetRangeUser(0.03,0.45);
agr->SetTitle(fname);
agr->SetMarkerColor(kBlue); // kBlue // 12
agr->SetLineColor(kBlue);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34); // 21
// agr->SetMarkerSize(2);
agr->Draw("ALP");
bgr->SetMarkerColor(kRed); // kRed // 15
bgr->SetLineColor(kRed);
bgr->SetLineWidth(3);
bgr->SetMarkerStyle(29); // 21
// bgr->SetMarkerSize(2);
bgr->Draw("LPSAME"); // LPSAME
cgr->SetMarkerColor(kGreen); // kGreen // 17
cgr->SetLineColor(kGreen);
cgr->SetLineWidth(3);
cgr->SetMarkerStyle(20); // 21
// cgr->SetMarkerSize(2);
cgr->Draw("LPSAME"); // LPSAME // ALP
c4->Update();
TLegend *lsc = new TLegend(0.55,0.62,0.90,0.92);
lsc->AddEntry(agr,"without ANN, 5000 events","pl");
lsc->AddEntry(bgr,"without ANN, 10000 events","pl");
lsc->AddEntry(cgr,"with ANN","pl");
c1->cd();
lsc->Draw();
c2->cd();
lsc->Draw();
c3->cd();
lsc->Draw();
c4->cd();
lsc->Draw();
}