-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_hists.c
937 lines (804 loc) · 35.2 KB
/
plot_hists.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
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
void plot_hists() {
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);
// TCanvas *c5 = new TCanvas("graph5","graph5",200,10,700,500);
// TCanvas *c6 = new TCanvas("graph6","graph6",200,10,700,500);
// TCanvas *c7 = new TCanvas("graph7","graph7",200,10,700,500);
// TCanvas *c8 = new TCanvas("graph8","graph8",200,10,700,500);
// c1->SetGrid();
// c2->SetGrid();
// c3->SetGrid();
// c4->SetGrid();
// c5->SetGrid();
// c6->SetGrid();
// c7->SetGrid();
// c8->SetGrid();
const Int_t n = 29; // 9
const Int_t nfiles = 10;
Float_t energy[nfiles][ n ];
Float_t energyerror[nfiles][ n ];
// for ann
Float_t mean[nfiles][ n ];
Float_t meanerror[nfiles][ n ];
Float_t rms[nfiles][ n ];
Float_t rmserror[nfiles][ n ];
Float_t mean_hist90[nfiles][ n ];
Float_t meanerror_hist90[nfiles][ n ];
Float_t rms_hist90[nfiles][ n ];
Float_t rmserror_hist90[nfiles][ n ];
Float_t mean_mean[nfiles][ n ];
// Float_t rms_mean[nfiles][ n ];
Float_t mean_meanerror[nfiles][ n ];
// Float_t rms_meanerror[nfiles][ n ];
Float_t mean_sigma[nfiles][ n ];
// Float_t rms_sigma[nfiles][ n ];
Float_t mean_sigmaerror[nfiles][ n ];
// Float_t rms_sigmaerror[nfiles][ n ];
// Float_t mean_chi[nfiles][ n ];
// Float_t rms_chi[nfiles][ n ];
Float_t ratio_hist[nfiles][ n ];
Float_t ratio_error_stat_hist[nfiles][ n ];
Float_t ratio_error_sys_hist[nfiles][ n ];
Float_t ratio_error_hist[nfiles][ n ];
Float_t resolution_hist[nfiles][ n ];
Float_t resolution_error_stat_hist[nfiles][ n ];
Float_t resolution_error_sys_hist[nfiles][ n ];
Float_t resolution_error_hist[nfiles][ n ];
Float_t ratio_hist90[nfiles][ n ];
Float_t ratio_error_stat_hist90[nfiles][ n ];
Float_t ratio_error_sys_hist90[nfiles][ n ];
Float_t ratio_error_hist90[nfiles][ n ];
Float_t resolution_hist90[nfiles][ n ];
Float_t resolution_error_stat_hist90[nfiles][ n ];
Float_t resolution_error_sys_hist90[nfiles][ n ];
Float_t resolution_error_hist90[nfiles][ n ];
Float_t ratio[nfiles][ n ];
Float_t ratio_error_stat[nfiles][ n ];
Float_t ratio_error_sys[nfiles][ n ];
Float_t ratio_error[nfiles][ n ];
Float_t resolution[nfiles][ n ];
Float_t resolution_error_stat[nfiles][ n ];
Float_t resolution_error_sys[nfiles][ n ];
Float_t resolution_error[nfiles][ n ];
// for data
Float_t denergy[ n ];
Float_t denergyerror[ n ];
Float_t dmean[ n ];
Float_t dmeanerror[ n ];
Float_t drms[ n ];
Float_t drmserror[ n ];
Float_t dmean_hist90[ n ];
Float_t dmeanerror_hist90[ n ];
Float_t drms_hist90[ n ];
Float_t drmserror_hist90[ n ];
Float_t dmean_mean[ n ];
// Float_t drms_mean[ n ];
Float_t dmean_meanerror[ n ];
// Float_t drms_meanerror[ n ];
Float_t dmean_sigma[ n ];
// Float_t drms_sigma[ n ];
Float_t dmean_sigmaerror[ n ];
// Float_t drms_sigmaerror[ n ];
// Float_t dmean_chi[ n ];
// Float_t drms_chi[ n ];
Float_t dratio_hist[ n ];
Float_t dratio_error_stat_hist[ n ];
Float_t dratio_error_sys_hist[ n ];
Float_t dratio_error_hist[ n ];
Float_t dresolution_hist[ n ];
Float_t dresolution_error_stat_hist[ n ];
Float_t dresolution_error_sys_hist[ n ];
Float_t dresolution_error_hist[ n ];
Float_t dratio_hist90[ n ];
Float_t dratio_error_stat_hist90[ n ];
Float_t dratio_error_sys_hist90[ n ];
Float_t dratio_error_hist90[ n ];
Float_t dresolution_hist90[ n ];
Float_t dresolution_error_stat_hist90[ n ];
Float_t dresolution_error_sys_hist90[ n ];
Float_t dresolution_error_hist90[ n ];
Float_t dratio[ n ];
Float_t dratio_error_stat[ n ];
Float_t dratio_error_sys[ n ];
Float_t dratio_error[ n ];
Float_t dresolution[ n ];
Float_t dresolution_error_stat[ n ];
Float_t dresolution_error_sys[ n ];
Float_t dresolution_error[ n ];
for( int j = 0; j < nfiles; j++ ) {
for( int i = 0; i < n; i++ ) {
energy[ j ][ i ] = 0.0;
energyerror[ j ][ i ] = 0.0;
// for ann
mean[ j ][ i ] = 0.0;
meanerror[ j ][ i ] = 0.0;
rms[ j ][ i ] = 0.0;
rmserror[ j ][ i ] = 0.0;
mean_hist90[ j ][ i ] = 0.0;
meanerror_hist90[ j ][ i ] = 0.0;
rms_hist90[ j ][ i ] = 0.0;
rmserror_hist90[ j ][ i ] = 0.0;
mean_mean[ j ][ i ] = 0.0;
// rms_mean[ j ][ i ] = 0.0;
mean_meanerror[ j ][ i ] = 0.0;
// rms_meanerror[ j ][ i ] = 0.0;
mean_sigma[ j ][ i ] = 0.0;
// rms_sigma[ j ][ i ] = 0.0;
mean_sigmaerror[ j ][ i ] = 0.0;
// rms_sigmaerror[ j ][ i ] = 0.0;
// mean_chi[ j ][ i ] = 0.0;
// rms_chi[ j ][ i ] = 0.0;
ratio_hist[ j ][ i ] = 0.0;
ratio_error_stat_hist[ j ][ i ] = 0.0;
ratio_error_sys_hist[ j ][ i ] = 0.0;
ratio_error_hist[ j ][ i ] = 0.0;
resolution_hist[ j ][ i ] = 0.0;
resolution_error_stat_hist[ j ][ i ] = 0.0;
resolution_error_sys_hist[ j ][ i ] = 0.0;
resolution_error_hist[ j ][ i ] = 0.0;
ratio_hist90[ j ][ i ] = 0.0;
ratio_error_stat_hist90[ j ][ i ] = 0.0;
ratio_error_sys_hist90[ j ][ i ] = 0.0;
ratio_error_hist90[ j ][ i ] = 0.0;
resolution_hist90[ j ][ i ] = 0.0;
resolution_error_stat_hist90[ j ][ i ] = 0.0;
resolution_error_sys_hist90[ j ][ i ] = 0.0;
resolution_error_hist90[ j ][ i ] = 0.0;
ratio[ j ][ i ] = 0.0;
ratio_error_stat[ j ][ i ] = 0.0;
ratio_error_sys[ j ][ i ] = 0.0;
ratio_error[ j ][ i ] = 0.0;
resolution[ j ][ i ] = 0.0;
resolution_error_stat[ j ][ i ] = 0.0;
resolution_error_sys[ j ][ i ] = 0.0;
resolution_error[ j ][ i ] = 0.0;
}
}
for( int i = 0; i < n; i++ ) {
// for data
denergy[ i ] = 0.0;
denergyerror[ i ] = 0.0;
dmean[ i ] = 0.0;
dmeanerror[ i ] = 0.0;
drms[ i ] = 0.0;
drmserror[ i ] = 0.0;
dmean_hist90[ i ] = 0.0;
dmeanerror_hist90[ i ] = 0.0;
drms_hist90[ i ] = 0.0;
drmserror_hist90[ i ] = 0.0;
dmean_mean[ i ] = 0.0;
// drms_mean[ i ] = 0.0;
dmean_meanerror[ i ] = 0.0;
// drms_meanerror[ i ] = 0.0;
dmean_sigma[ i ] = 0.0;
// drms_sigma[ i ] = 0.0;
dmean_sigmaerror[ i ] = 0.0;
// drms_sigmaerror[ i ] = 0.0;
// dmean_chi[ i ] = 0.0;
// drms_chi[ i ] = 0.0;
dratio_hist[ i ] = 0.0;
dratio_error_stat_hist[ i ] = 0.0;
dratio_error_sys_hist[ i ] = 0.0;
dratio_error_hist[ i ] = 0.0;
dresolution_hist[ i ] = 0.0;
dresolution_error_stat_hist[ i ] = 0.0;
dresolution_error_sys_hist[ i ] = 0.0;
dresolution_error_hist[ i ] = 0.0;
dratio_hist90[ i ] = 0.0;
dratio_error_stat_hist90[ i ] = 0.0;
dratio_error_sys_hist90[ i ] = 0.0;
dratio_error_hist90[ i ] = 0.0;
dresolution_hist90[ i ] = 0.0;
dresolution_error_stat_hist90[ i ] = 0.0;
dresolution_error_sys_hist90[ i ] = 0.0;
dresolution_error_hist90[ i ] = 0.0;
dratio[ i ] = 0.0;
dratio_error_stat[ i ] = 0.0;
dratio_error_sys[ i ] = 0.0;
dratio_error[ i ] = 0.0;
dresolution[ i ] = 0.0;
dresolution_error_stat[ i ] = 0.0;
dresolution_error_sys[ i ] = 0.0;
dresolution_error[ i ] = 0.0;
}
char fname[ 200 ];
for ( int i = 0; i < 200; i++ ) fname[ i ] = 0;
// for ann
FILE *file[nfiles];
for( int i = 0; i < nfiles; i++ ) {
sprintf( fname, "%d_out_ann.txt", i + 1 );
file[i] = fopen(fname, "r");
if ( !(long)file[i] ) return;
}
// for data
FILE *dfile= fopen("out_data.txt", "r");
if ( !(long)dfile ) return;
// for ann
for( int j = 0; j < nfiles; j++ ) {
for ( int i = 0; i < n; i++ ) {
fscanf( file[j], "%f %E %E %E %E %E %E %E %E %E %E %E %E\n", &energy[j][i], &mean_hist90[j][i], &meanerror_hist90[j][i], &rms_hist90[j][i], &rmserror_hist90[j][i], &mean[j][i], &meanerror[j][i], &rms[j][i], &rmserror[j][i], &mean_mean[j][i], &mean_meanerror[j][i], &mean_sigma[j][i], &mean_sigmaerror[j][i] );
if ( feof( file[j] ) ) break;
}
}
// for data
for ( int i = 0; i < n; i++ ) {
fscanf( dfile, "%f %E %E %E %E %E %E %E %E %E %E %E %E\n", &denergy[i], &dmean_hist90[i], &dmeanerror_hist90[i], &drms_hist90[i], &drmserror_hist90[i], &dmean[i], &dmeanerror[i], &drms[i], &drmserror[i], &dmean_mean[i], &dmean_meanerror[i], &dmean_sigma[i], &dmean_sigmaerror[i] );
if ( feof( dfile ) ) break;
}
for ( int j = 0; j < nfiles; j++ ) {
for ( int i = 0; i < n; i++ ) {
// for ann
ratio_hist[ j ][ i ] = ( mean[ j ][ i ] - energy[ j ][ i ] ) / energy[ j ][ i ];
ratio_error_stat_hist[ j ][ i ] = sqrt( pow( (meanerror[ j ][ i ]) / (energy[ j ][ i ]), 2 ) + pow( (mean[ j ][ i ] * energyerror[ j ][ i ]) / (energy[ j ][ i ] * energy[ j ][ i ]), 2 ) );
ratio_error_sys_hist[ j ][ i ] = 0.0;
ratio_error_hist[ j ][ i ] = sqrt( ( pow( ratio_error_stat_hist[ j ][ i ], 2 ) ) + ( pow( ratio_error_sys_hist[ j ][ i ], 2 ) ) );
ratio_hist90[ j ][ i ] = ( mean_hist90[ j ][ i ] - energy[ j ][ i ] ) / energy[ j ][ i ];
ratio_error_stat_hist90[ j ][ i ] = sqrt( pow( (meanerror_hist90[ j ][ i ]) / (energy[ j ][ i ]), 2 ) + pow( (mean_hist90[ j ][ i ] * energyerror[ j ][ i ]) / (energy[ j ][ i ] * energy[ j ][ i ]), 2 ) );
ratio_error_sys_hist90[ j ][ i ] = 0.0;
ratio_error_hist90[ j ][ i ] = sqrt( ( pow( ratio_error_stat_hist90[ j ][ i ], 2 ) ) + ( pow( ratio_error_sys_hist90[ j ][ i ], 2 ) ) );
ratio[ j ][ i ] = ( mean_mean[ j ][ i ] - energy[ j ][ i ] ) / energy[ j ][ i ];
ratio_error_stat[ j ][ i ] = sqrt( pow( (mean_meanerror[ j ][ i ]) / (energy[ j ][ i ]), 2 ) + pow( (mean_mean[ j ][ i ] * energyerror[ j ][ i ]) / (energy[ j ][ i ] * energy[ j ][ i ]), 2 ) );
ratio_error_sys[ j ][ i ] = 0.0;
ratio_error[ j ][ i ] = sqrt( ( pow( ratio_error_stat[ j ][ i ], 2 ) ) + ( pow( ratio_error_sys[ j ][ i ], 2 ) ) );
resolution_hist[ j ][ i ] = rms[ j ][ i ] / mean[ j ][ i ];
resolution_error_stat_hist[ j ][ i ] = sqrt( pow( (rmserror[ j ][ i ]) / (mean[ j ][ i ]), 2 ) + pow( (rms[ j ][ i ] * meanerror[ j ][ i ]) / (mean[ j ][ i ] * mean[ j ][ i ]), 2 ) );
resolution_error_sys_hist[ j ][ i ] = 0.0;
resolution_error_hist[ j ][ i ] = sqrt( ( pow( resolution_error_stat_hist[ j ][ i ], 2 ) ) + ( pow( resolution_error_sys_hist[ j ][ i ], 2 ) ) );
resolution_hist90[ j ][ i ] = rms_hist90[ j ][ i ] / mean_hist90[ j ][ i ];
resolution_error_stat_hist90[ j ][ i ] = sqrt( pow( (rmserror_hist90[ j ][ i ]) / (mean_hist90[ j ][ i ]), 2 ) + pow( (rms_hist90[ j ][ i ] * meanerror_hist90[ j ][ i ]) / (mean_hist90[ j ][ i ] * mean_hist90[ j ][ i ]), 2 ) );
resolution_error_sys_hist90[ j ][ i ] = 0.0;
resolution_error_hist90[ j ][ i ] = sqrt( ( pow( resolution_error_stat_hist90[ j ][ i ], 2 ) ) + ( pow( resolution_error_sys_hist90[ j ][ i ], 2 ) ) );
resolution[ j ][ i ] = mean_sigma[ j ][ i ] / mean_mean[ j ][ i ];
resolution_error_stat[ j ][ i ] = sqrt( pow( (mean_sigmaerror[ j ][ i ]) / (mean_mean[ j ][ i ]), 2 ) + pow( (mean_sigma[ j ][ i ] * mean_meanerror[ j ][ i ]) / (mean_mean[ j ][ i ] * mean_mean[ j ][ i ]), 2 ) );
resolution_error_sys[ j ][ i ] = 0.0;
resolution_error[ j ][ i ] = sqrt( ( pow( resolution_error_stat[ j ][ i ], 2 ) ) + ( pow( resolution_error_sys[ j ][ i ], 2 ) ) );
}
}
for ( int i = 0; i < n; i++ ) {
// for data
dratio_hist[ i ] = ( dmean[ i ] - denergy[ i ] ) / denergy[ i ];
dratio_error_stat_hist[ i ] = sqrt( pow( (dmeanerror[ i ]) / (denergy[ i ]), 2 ) + pow( (dmean[ i ] * denergyerror[ i ]) / (denergy[ i ] * denergy[ i ]), 2 ) );
dratio_error_sys_hist[ i ] = 0.0;
dratio_error_hist[ i ] = sqrt( ( pow( dratio_error_stat_hist[ i ], 2 ) ) + ( pow( dratio_error_sys_hist[ i ], 2 ) ) );
dratio_hist90[ i ] = ( dmean_hist90[ i ] - denergy[ i ] ) / denergy[ i ];
dratio_error_stat_hist90[ i ] = sqrt( pow( (dmeanerror_hist90[ i ]) / (denergy[ i ]), 2 ) + pow( (dmean_hist90[ i ] * denergyerror[ i ]) / (denergy[ i ] * denergy[ i ]), 2 ) );
dratio_error_sys_hist90[ i ] = 0.0;
dratio_error_hist90[ i ] = sqrt( ( pow( dratio_error_stat_hist90[ i ], 2 ) ) + ( pow( dratio_error_sys_hist90[ i ], 2 ) ) );
dratio[ i ] = ( dmean_mean[ i ] - denergy[ i ] ) / denergy[ i ];
dratio_error_stat[ i ] = sqrt( pow( (dmean_meanerror[ i ]) / (denergy[ i ]), 2 ) + pow( (dmean_mean[ i ] * denergyerror[ i ]) / (denergy[ i ] * denergy[ i ]), 2 ) );
dratio_error_sys[ i ] = 0.0;
dratio_error[ i ] = sqrt( ( pow( dratio_error_stat[ i ], 2 ) ) + ( pow( dratio_error_sys[ i ], 2 ) ) );
dresolution_hist[ i ] = drms[ i ] / dmean[ i ];
dresolution_error_stat_hist[ i ] = sqrt( pow( (drmserror[ i ]) / (dmean[ i ]), 2 ) + pow( (drms[ i ] * dmeanerror[ i ]) / (dmean[ i ] * dmean[ i ]), 2 ) );
dresolution_error_sys_hist[ i ] = 0.0;
dresolution_error_hist[ i ] = sqrt( ( pow( dresolution_error_stat_hist[ i ], 2 ) ) + ( pow( dresolution_error_sys_hist[ i ], 2 ) ) );
dresolution_hist90[ i ] = drms_hist90[ i ] / dmean_hist90[ i ];
dresolution_error_stat_hist90[ i ] = sqrt( pow( (drmserror_hist90[ i ]) / (dmean_hist90[ i ]), 2 ) + pow( (drms_hist90[ i ] * dmeanerror_hist90[ i ]) / (dmean_hist90[ i ] * dmean_hist90[ i ]), 2 ) );
dresolution_error_sys_hist90[ i ] = 0.0;
dresolution_error_hist90[ i ] = sqrt( ( pow( dresolution_error_stat_hist90[ i ], 2 ) ) + ( pow( dresolution_error_sys_hist90[ i ], 2 ) ) );
dresolution[ i ] = dmean_sigma[ i ] / dmean_mean[ i ];
dresolution_error_stat[ i ] = sqrt( pow( (dmean_sigmaerror[ i ]) / (dmean_mean[ i ]), 2 ) + pow( (dmean_sigma[ i ] * dmean_meanerror[ i ]) / (dmean_mean[ i ] * dmean_mean[ i ]), 2 ) );
dresolution_error_sys[ i ] = 0.0;
dresolution_error[ i ] = sqrt( ( pow( dresolution_error_stat[ i ], 2 ) ) + ( pow( dresolution_error_sys[ i ], 2 ) ) );
}
printf( "\n" );
for (int j = 0; j < nfiles; j++) {
printf( "File number: %d\n", j+1 );
for (int i = 0; i < n; i++) {
printf( " %f ", energy[j][i] );
printf( " %f ", energyerror[j][i] );
// for ann
printf( " %f ", mean[j][i] );
printf( " %f ", meanerror[j][i] );
printf( " %f ", rms[j][i] );
printf( " %f ", rmserror[j][i] );
printf( " %f ", mean_hist90[j][i] );
printf( " %f ", meanerror_hist90[j][i] );
printf( " %f ", rms_hist90[j][i] );
printf( " %f ", rmserror_hist90[j][i] );
printf( " %f ", ratio_hist[j][i] );
printf( " %f ", ratio_error_hist[j][i] );
printf( " %f ", resolution_hist[j][i] );
printf( " %f ", resolution_error_hist[j][i] );
printf( " %f ", ratio_hist90[j][i] );
printf( " %f ", ratio_error_hist90[j][i] );
printf( " %f ", resolution_hist90[j][i] );
printf( " %f ", resolution_error_hist90[j][i] );
printf( " %f ", mean_mean[j][i] );
printf( " %f ", mean_meanerror[j][i] );
printf( " %f ", mean_sigma[j][i] );
printf( " %f ", mean_sigmaerror[j][i] );
printf( " %f ", ratio[j][i] );
printf( " %f ", ratio_error[j][i] );
printf( " %f ", resolution[j][i] );
printf( " %f ", resolution_error[j][i] );
printf( "\n" );
printf( "\n" );
printf( "\n" );
}
}
const int nBins1 = 100;
const float binLo1 = -0.5;
const float binHi1 = 0.5;
const int nBins2 = 10;
const float binLo2 = 0.0;
const float binHi2 = 130.0;
const int nBins3 = 10;
const float binLo3 = 0.0;
const float binHi3 = 9.0;
const int nBins4 = 10;
const float binLo4 = 0.0;
const float binHi4 = 0.5;
TH1F *hist1[n]; // lin1
TH1F *hist2[n]; // lin2
TH1F *hist3[n]; // abs
TH1F *hist4[n]; // rel
/* char fname1[ 200 ];
for ( int i = 0; i < 200; i++ ) fname1[ i ] = 0;
char fname2[ 200 ];
for ( int i = 0; i < 200; i++ ) fname2[ i ] = 0;
char fname3[ 200 ];
for ( int i = 0; i < 200; i++ ) fname3[ i ] = 0;
char fname4[ 200 ];
for ( int i = 0; i < 200; i++ ) fname4[ i ] = 0;
sprintf( fname1, "%d_out_ann.txt", i );
*/
for( int i = 0; i < n; i++ ) {
hist1[i] = new TH1F("hist1", "hist1", nBins1, binLo1, binHi1);
hist2[i] = new TH1F("hist2", "hist2", nBins2, binLo2, binHi2);
hist3[i] = new TH1F("hist3", "hist3", nBins3, binLo3, binHi3);
hist4[i] = new TH1F("hist4", "hist4", nBins4, binLo4, binHi4);
}
for ( int j = 0; j < nfiles; j++ ) {
for ( int i = 0; i < n; i++ ) {
hist1[i] -> Fill( ratio_hist90[ j ][ i ] );
hist2[i] -> Fill( mean_hist90[ j ][ i ] );
hist3[i] -> Fill( rms_hist90[ j ][ i ] );
hist4[i] -> Fill( resolution_hist90[ j ][ i ] );
}
}
for ( int i = 0; i < n; i++ ) {
cout << "Underflow hist1[" << i << "] === " << hist1[i]->GetBinContent( 0 ) << endl;
cout << "Overflow hist1[" << i << "] === " << hist1[i]->GetBinContent( nBins1 + 1 ) << endl;
cout << "Underflow hist2[" << i << "] === " << hist2[i]->GetBinContent( 0 ) << endl;
cout << "Overflow hist2[" << i << "] === " << hist2[i]->GetBinContent( nBins2 + 1 ) << endl;
cout << "Underflow hist3[" << i << "] === " << hist3[i]->GetBinContent( 0 ) << endl;
cout << "Overflow hist3[" << i << "] === " << hist3[i]->GetBinContent( nBins3 + 1 ) << endl;
cout << "Underflow hist4[" << i << "] === " << hist4[i]->GetBinContent( 0 ) << endl;
cout << "Overflow hist4[" << i << "] === " << hist4[i]->GetBinContent( nBins4 + 1 ) << endl;
}
c1->cd();
hist1[28]->DrawCopy();
float mean1[n];
float meanerror1[n];
float rms1[n];
float rmserror1[n];
float mean2[n];
float meanerror2[n];
float rms2[n];
float rmserror2[n];
float mean3[n];
float meanerror3[n];
float rms3[n];
float rmserror3[n];
float mean4[n];
float meanerror4[n];
float rms4[n];
float rmserror4[n];
for ( int i = 0; i < n; i++ ) {
mean1[i] = 0;
meanerror1[i] = 0;
rms1[i] = 0;
rmserror1[i] = 0;
mean2[i] = 0;
meanerror2[i] = 0;
rms2[i] = 0;
rmserror2[i] = 0;
mean3[i] = 0;
meanerror3[i] = 0;
rms3[i] = 0;
rmserror3[i] = 0;
mean4[i] = 0;
meanerror4[i] = 0;
rms4[i] = 0;
rmserror4[i] = 0;
}
for ( int i = 0; i < n; i++ ) {
mean1[i] = hist1[i] -> GetMean();
meanerror1[i] = hist1[i] -> GetMeanError();
rms1[i] = hist1[i] -> GetRMS();
rmserror1[i] = hist1[i] -> GetRMSError();
cout << "1_" << i + 1 << ": "
<< " Mean1_" << i + 1 << ": " << mean1[i]
<< " Mean1_" << i + 1 << " error: "<< meanerror1[i]
<< " RMS1_" << i + 1 << ": " << rms1[i]
<< " RMS1_" << i + 1 << " error: " << rmserror1[i]
<< endl;
mean2[i] = hist2[i] -> GetMean();
meanerror2[i] = hist2[i] -> GetMeanError();
rms2[i] = hist2[i] -> GetRMS();
rmserror2[i] = hist2[i] -> GetRMSError();
cout << "2_" << i + 1 << ": "
<< " Mean2_" << i + 1 << ": " << mean2[i]
<< " Mean2_" << i + 1 << " error: "<< meanerror2[i]
<< " RMS2_" << i + 1 << ": " << rms2[i]
<< " RMS2_" << i + 1 << " error: " << rmserror2[i]
<< endl;
mean3[i] = hist3[i] -> GetMean();
meanerror3[i] = hist3[i] -> GetMeanError();
rms3[i] = hist3[i] -> GetRMS();
rmserror3[i] = hist3[i] -> GetRMSError();
cout << "3_" << i + 1 << ": "
<< " Mean3_" << i + 1 << ": " << mean3[i]
<< " Mean3_" << i + 1 << " error: "<< meanerror3[i]
<< " RMS3_" << i + 1 << ": " << rms3[i]
<< " RMS3_" << i + 1 << " error: " << rmserror3[i]
<< endl;
mean4[i] = hist4[i] -> GetMean();
meanerror4[i] = hist4[i] -> GetMeanError();
rms4[i] = hist4[i] -> GetRMS();
rmserror4[i] = hist4[i] -> GetRMSError();
cout << "4_" << i + 1 << ": "
<< " Mean4_" << i + 1 << ": " << mean4[i]
<< " Mean4_" << i + 1 << " error: "<< meanerror4[i]
<< " RMS4_" << i + 1 << ": " << rms4[i]
<< " RMS4_" << i + 1 << " error: " << rmserror4[i]
<< endl;
}
//
// Open file for output
//
FILE *out = fopen("systematic.txt", "a+");
printf("File open... ");
if (!out) {
printf("[FAIL]\n");
return;
} else printf("[OK]\n");
for ( int i = 0; i < n; i++ ) {
fprintf( out, "%f %E %E %E %E\n", energy[0][i], rms1[i], rms2[i], rms3[i], rms4[i] );
}
TH1F *dhist1[n]; // lin1 with data
TH1F *dhist2[n]; // lin2 with data
TH1F *dhist3[n]; // abs with data
TH1F *dhist4[n]; // rel with data
for( int i = 0; i < n; i++ ) {
dhist1[i] = new TH1F("dhist1", "dhist1", nBins1, binLo1, binHi1);
dhist2[i] = new TH1F("dhist2", "dhist2", nBins2, binLo2, binHi2);
dhist3[i] = new TH1F("dhist3", "dhist3", nBins3, binLo3, binHi3);
dhist4[i] = new TH1F("dhist4", "dhist4", nBins4, binLo4, binHi4);
}
for ( int j = 0; j < nfiles; j++ ) {
for ( int i = 0; i <n; i++ ) {
dhist1[i] -> Fill( ratio_hist90[ j ][ i ] );
dhist2[i] -> Fill( mean_hist90[ j ][ i ] );
dhist3[i] -> Fill( rms_hist90[ j ][ i ] );
dhist4[i] -> Fill( resolution_hist90[ j ][ i ] );
}
}
for ( int i = 0; i < n; i++ ) {
dhist1[i] -> Fill( dratio_hist90[ i ] );
dhist2[i] -> Fill( dmean_hist90[ i ] );
dhist3[i] -> Fill( drms_hist90[ i ] );
dhist4[i] -> Fill( dresolution_hist90[ i ] );
}
for ( int i = 0; i < n; i++ ) {
delete hist1[i];
delete hist2[i];
delete hist3[i];
delete hist4[i];
delete dhist1[i];
delete dhist2[i];
delete dhist3[i];
delete dhist4[i];
}
fclose( out );
// file -> Close();
/*
TGraphErrors *agr;
TGraphErrors *bgr;
TGraphErrors *cgr;
TGraphErrors *dgr;
char fname[ 100 ];
for ( int i = 0; i < 100; i++ ) fname[ i ] = 0;
c1->cd();
agr = new TGraphErrors( n, energy, ratio_hist90, energyerror, ratio_error_sys_hist90 );
agr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, ratio_hist90, energyerror, ratio_error_stat_hist90 );
bgr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy, ratio_hist902, energyerror, ratio_error_sys_hist902 );
cgr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
dgr = new TGraphErrors( n, energy, ratio_hist902, energyerror, ratio_error_stat_hist902 );
dgr->GetYaxis()->SetTitle("( E_{reco} - E_{true} ) / E_{true}");
dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Linearity" );
agr->GetYaxis()->SetRangeUser(-0.4, 0.3);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c1->Update();
c2->cd();
agr = new TGraphErrors( n, energy, mean_hist90, energyerror, energyerror );
agr->GetYaxis()->SetTitle("E_{reco}, GeV");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, mean_hist90, energyerror, meanerror_hist90 );
bgr->GetYaxis()->SetTitle("E_{reco}, GeV");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy, mean_hist902, energyerror, energyerror );
cgr->GetYaxis()->SetTitle("E_{reco}, GeV");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
dgr = new TGraphErrors( n, energy, mean_hist902, energyerror, meanerror_hist902 );
dgr->GetYaxis()->SetTitle("E_{reco}, GeV");
dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Linearity 2" );
agr->GetYaxis()->SetRangeUser(0.0, 130.0);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c2->Update();
c3->cd();
agr = new TGraphErrors( n, energy, rms_hist90, energyerror, energyerror );
agr->GetYaxis()->SetTitle("#DeltaE_{reco}, GeV");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, rms_hist90, energyerror, rmserror_hist90 );
bgr->GetYaxis()->SetTitle("#DeltaE_{reco}, GeV");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy, rms_hist902, energyerror, energyerror );
cgr->GetYaxis()->SetTitle("#DeltaE_{reco}, GeV");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
dgr = new TGraphErrors( n, energy, rms_hist902, energyerror, rmserror_hist902 );
dgr->GetYaxis()->SetTitle("#DeltaE_{reco}, GeV");
dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Absolute energy resolution" );
agr->GetYaxis()->SetRangeUser(0.0, 9.0);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c3->Update();
c4->cd();
agr = new TGraphErrors( n, energy, resolution_hist90, energyerror, resolution_error_sys_hist90 );
agr->GetYaxis()->SetTitle("#DeltaE_{reco} / E_{reco}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, resolution_hist90, energyerror, resolution_error_stat_hist90 );
bgr->GetYaxis()->SetTitle("#DeltaE_{reco} / E_{reco}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
cgr = new TGraphErrors( n, energy, resolution_hist902, energyerror, resolution_error_sys_hist902 );
cgr->GetYaxis()->SetTitle("#DeltaE_{reco} / E_{reco}");
cgr->GetXaxis()->SetTitle("E_{true}, GeV");
dgr = new TGraphErrors( n, energy, resolution_hist902, energyerror, resolution_error_stat_hist902 );
dgr->GetYaxis()->SetTitle("#DeltaE_{reco} / E_{reco}");
dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Relative energy resolution" );
agr->GetYaxis()->SetRangeUser(0.0, 0.30);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c4->Update();
c5->cd();
agr = new TGraphErrors( n, energy, ratio_abs_hist90, energyerror, ratio_abs_error_sys_hist90 );
agr->GetYaxis()->SetTitle("( #DeltaE_{ann} - #DeltaE_{reco} ) / #DeltaE_{reco}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, ratio_abs_hist90, energyerror, ratio_abs_error_stat_hist90 );
bgr->GetYaxis()->SetTitle("( #DeltaE_{ann} - #DeltaE_{reco} ) / #DeltaE_{reco}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
// cgr = new TGraphErrors( n, energy, ratio_abs_hist90, energyerror, ratio_abs_error_sys_hist90 );
// cgr->GetYaxis()->SetTitle("( #DeltaE_{ann} - #DeltaE_{reco} ) / #DeltaE_{reco}");
// cgr->GetXaxis()->SetTitle("E_{true}, GeV");
// dgr = new TGraphErrors( n, energy, ratio_abs_hist90, energyerror, ratio_abs_error_stat_hist90 );
// dgr->GetYaxis()->SetTitle("( #DeltaE_{ann} - #DeltaE_{reco} ) / #DeltaE_{reco}");
// dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Absolute difference" );
// agr->GetYaxis()->SetRangeUser(-1.0, 1.0);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c5->Update();
c6->cd();
agr = new TGraphErrors( n, energy, ratio_abs_other_hist90, energyerror, ratio_abs_other_error_sys_hist90 );
agr->GetYaxis()->SetTitle("#DeltaE_{ann} / #DeltaE_{reco}");
agr->GetXaxis()->SetTitle("E_{true}, GeV");
bgr = new TGraphErrors( n, energy, ratio_abs_other_hist90, energyerror, ratio_abs_other_error_stat_hist90 );
bgr->GetYaxis()->SetTitle("#DeltaE_{ann} / #DeltaE_{reco}");
bgr->GetXaxis()->SetTitle("E_{true}, GeV");
// cgr = new TGraphErrors( n, energy, ratio_abs_other_hist90, energyerror, ratio_abs_other_error_sys_hist90 );
// cgr->GetYaxis()->SetTitle("#DeltaE_{ann} / #DeltaE_{reco}");
// cgr->GetXaxis()->SetTitle("E_{true}, GeV");
// dgr = new TGraphErrors( n, energy, ratio_abs_other_hist90, energyerror, ratio_abs_other_error_stat_hist90 );
// dgr->GetYaxis()->SetTitle("#DeltaE_{ann} / #DeltaE_{reco}");
// dgr->GetXaxis()->SetTitle("E_{true}, GeV");
sprintf( fname, "Absolute difference 2" );
// agr->GetYaxis()->SetRangeUser(-1.0, 1.0);
agr->SetTitle(fname);
agr->SetFillColor(kCyan);
agr->SetFillStyle(3001);
agr->SetMarkerColor(kCyan);
agr->SetLineColor(kCyan);
agr->SetLineWidth(3);
agr->SetMarkerStyle(34);
agr->Draw("A 3");
bgr->SetMarkerColor(kBlue);
bgr->SetLineColor(kBlue);
bgr->SetLineWidth(3);
bgr->SetFillColor(kCyan);
bgr->SetMarkerStyle(20);
bgr->Draw("P SAME");
cgr->SetMarkerColor(kYellow-6);
cgr->SetFillStyle(3001);
cgr->SetLineColor(kYellow-6);
cgr->SetLineWidth(3);
cgr->SetFillColor(kYellow-6);
cgr->SetMarkerStyle(20);
cgr->Draw("3 SAME");
dgr->SetMarkerColor(kRed);
dgr->SetLineColor(kRed);
dgr->SetLineWidth(3);
dgr->SetFillColor(kYellow-6);
dgr->SetMarkerStyle(20);
dgr->Draw("P SAME");
c6->Update();
TLegend *lsc1 = new TLegend(0.55,0.62,0.90,0.92);
lsc1->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc1->AddEntry(dgr,"ann, hist90 (stat)","pl");
TLegend *lsc2 = new TLegend(0.55,0.62,0.90,0.92);
lsc2->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc2->AddEntry(dgr,"ann, hist90 (stat)","pl");
TLegend *lsc3 = new TLegend(0.55,0.62,0.90,0.92);
lsc3->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc3->AddEntry(dgr,"ann, hist90 (stat)","pl");
TLegend *lsc4 = new TLegend(0.55,0.62,0.90,0.92);
lsc4->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc4->AddEntry(dgr,"ann, hist90 (stat)","pl");
TLegend *lsc5 = new TLegend(0.55,0.62,0.90,0.92);
lsc5->AddEntry(bgr,"mc vs ann, hist90 (stat)","pl");
// lsc5->AddEntry(dgr,"mc vs ann, hist90 (stat)","pl");
TLegend *lsc6 = new TLegend(0.55,0.62,0.90,0.92);
lsc6->AddEntry(bgr,"mc vs ann, hist90 (stat)","pl");
// lsc6->AddEntry(dgr,"mc vs ann, hist90 (stat)","pl");
TLegend *lsc7 = new TLegend(0.55,0.62,0.90,0.92);
lsc7->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc7->AddEntry(dgr,"ann, hist90 (stat)","pl");
TLegend *lsc8 = new TLegend(0.55,0.62,0.90,0.92);
lsc8->AddEntry(bgr,"mc, hist90 (stat)","pl");
lsc8->AddEntry(dgr,"ann, hist90 (stat)","pl");
c1->cd();
lsc1->Draw();
c2->cd();
lsc2->Draw();
c3->cd();
lsc3->Draw();
c4->cd();
lsc4->Draw();
c5->cd();
lsc5->Draw();
c6->cd();
lsc6->Draw();
c7->cd();
lsc7->Draw();
c8->cd();
lsc8->Draw();
*/
}