-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDrawOneHistoWithSyst.C
1829 lines (1578 loc) · 96.8 KB
/
DrawOneHistoWithSyst.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
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef DrawOneHistoWithSyst_cxx
#define DrawOneHistoWithSyst_cxx
#include <TStyle.h>
#include <TString.h>
#include <TFile.h>
#include <TH1F.h>
#include <THStack.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TLatex.h>
#include <TPaveText.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <TMath.h>
//include "LoadData_2012.C"
#include "tdrstyle.C"
// #include "tPrimeStandardHistos.C"
using namespace std;
enum Samples_t {Data, ChargeMisID, FakeRate,
TTbar, ZJets, DY1050,
SingleTop, DrellYan, WJets,
WW, WZ, ZZ,
T_tW, Tbar_tW, T_t, Tbar_t, T_s, Tbar_s,
WWm, WWp, WWW,
TTW, TTZ, TTWW,
ZZZNoGs, WWZNoGs, WZZNoGs, WWds,
WGstarToLNu2E, WGstarToLNu2Mu, WGstarToLNu2Tau, ZGToLLG,
Tprime400_bWbW, Tprime400_bWtZ, Tprime400_bWtH, Tprime400_tHtZ, Tprime400_tZtZ, Tprime400_tHtH,
Tprime500_bWbW, Tprime500_bWtZ, Tprime500_bWtH, Tprime500_tHtZ, Tprime500_tZtZ, Tprime500_tHtH,
Tprime600_bWbW, Tprime600_bWtZ, Tprime600_bWtH, Tprime600_tHtZ, Tprime600_tZtZ, Tprime600_tHtH,
Tprime700_bWbW, Tprime700_bWtZ, Tprime700_bWtH, Tprime700_tHtZ, Tprime700_tZtZ, Tprime700_tHtH,
Tprime800_bWbW, Tprime800_bWtZ, Tprime800_bWtH, Tprime800_tHtZ, Tprime800_tZtZ, Tprime800_tHtH,
Tprime900_bWbW, Tprime900_bWtZ, Tprime900_bWtH, Tprime900_tHtZ, Tprime900_tZtZ, Tprime900_tHtH,
Tprime1000_bWbW, Tprime1000_bWtZ, Tprime1000_bWtH, Tprime1000_tHtZ, Tprime1000_tZtZ, Tprime1000_tHtH,
Tprime1100_bWbW, Tprime1100_bWtZ, Tprime1100_bWtH, Tprime1100_tHtZ, Tprime1100_tZtZ, Tprime1100_tHtH,
Tprime1200_bWbW, Tprime1200_bWtZ, Tprime1200_bWtH, Tprime1200_tHtZ, Tprime1200_tZtZ, Tprime1200_tHtH,
Tprime1300_bWbW, Tprime1300_bWtZ, Tprime1300_bWtH, Tprime1300_tHtZ, Tprime1300_tZtZ, Tprime1300_tHtH,
Tprime1400_bWbW, Tprime1400_bWtZ, Tprime1400_bWtH, Tprime1400_tHtZ, Tprime1400_tZtZ, Tprime1400_tHtH,
Tprime1500_bWbW, Tprime1500_bWtZ, Tprime1500_bWtH, Tprime1500_tHtZ, Tprime1500_tZtZ, Tprime1500_tHtH
};
const unsigned int totalSamples = 104;
Samples_t allSamples[totalSamples] = {Data, ChargeMisID, FakeRate,
TTbar, ZJets, DY1050,SingleTop, DrellYan, WJets,
WW, WZ, ZZ,
T_tW, Tbar_tW, T_t, Tbar_t, T_s, Tbar_s,
WWm, WWp, WWW,
TTW, TTZ, TTWW,
ZZZNoGs, WWZNoGs, WZZNoGs, WWds,
WGstarToLNu2E, WGstarToLNu2Mu, WGstarToLNu2Tau, ZGToLLG,
Tprime400_bWbW, Tprime400_bWtZ, Tprime400_bWtH, Tprime400_tHtZ, Tprime400_tZtZ, Tprime400_tHtH,
Tprime500_bWbW, Tprime500_bWtZ, Tprime500_bWtH, Tprime500_tHtZ, Tprime500_tZtZ, Tprime500_tHtH,
Tprime600_bWbW, Tprime600_bWtZ, Tprime600_bWtH, Tprime600_tHtZ, Tprime600_tZtZ, Tprime600_tHtH,
Tprime700_bWbW, Tprime700_bWtZ, Tprime700_bWtH, Tprime700_tHtZ, Tprime700_tZtZ, Tprime700_tHtH,
Tprime800_bWbW, Tprime800_bWtZ, Tprime800_bWtH, Tprime800_tHtZ, Tprime800_tZtZ, Tprime800_tHtH,
Tprime900_bWbW, Tprime900_bWtZ, Tprime900_bWtH, Tprime900_tHtZ, Tprime900_tZtZ, Tprime900_tHtH,
Tprime1000_bWbW, Tprime1000_bWtZ, Tprime1000_bWtH, Tprime1000_tHtZ, Tprime1000_tZtZ, Tprime1000_tHtH,
Tprime1100_bWbW, Tprime1100_bWtZ, Tprime1100_bWtH, Tprime1100_tHtZ, Tprime1100_tZtZ, Tprime1100_tHtH,
Tprime1200_bWbW, Tprime1200_bWtZ, Tprime1200_bWtH, Tprime1200_tHtZ, Tprime1200_tZtZ, Tprime1200_tHtH,
Tprime1300_bWbW, Tprime1300_bWtZ, Tprime1300_bWtH, Tprime1300_tHtZ, Tprime1300_tZtZ, Tprime1300_tHtH,
Tprime1400_bWbW, Tprime1400_bWtZ, Tprime1400_bWtH, Tprime1400_tHtZ, Tprime1400_tZtZ, Tprime1400_tHtH,
Tprime1500_bWbW, Tprime1500_bWtZ, Tprime1500_bWtH, Tprime1500_tHtZ, Tprime1500_tZtZ, Tprime1500_tHtH
};
TString allNames[totalSamples] = {"Data", "ChargeMisID", "FakeRate",
"TTbar", "ZJets", "DY1050","SingleTop", "DrellYan","WJets",
"WW", "WZ", "ZZ",
"T_tW", "Tbar_tW", "T_t", "Tbar_t", "T_s", "Tbar_s",
"WWm", "WWp", "WWW",
"TTW", "TTZ", "TTWW",
"ZZZNoGs", "WWZNoGs", "WZZNoGs", "WWds",
"WGstarToLNu2E", "WGstarToLNu2Mu", "WGstarToLNu2Tau", "ZGToLLG",
"Tprime400_BWBW", "Tprime400_BWTZ", "Tprime400_BWTH", "Tprime400_THTZ", "Tprime400_TZTZ", "Tprime400_THTH",
"Tprime500_BWBW", "Tprime500_BWTZ", "Tprime500_BWTH", "Tprime500_THTZ", "Tprime500_TZTZ", "Tprime500_THTH",
"Tprime600_BWBW", "Tprime600_BWTZ", "Tprime600_BWTH", "Tprime600_THTZ", "Tprime600_TZTZ", "Tprime600_THTH",
"Tprime700_BWBW", "Tprime700_BWTZ", "Tprime700_BWTH", "Tprime700_THTZ", "Tprime700_TZTZ", "Tprime700_THTH",
"Tprime800_BWBW", "Tprime800_BWTZ", "Tprime800_BWTH", "Tprime800_THTZ", "Tprime800_TZTZ", "Tprime800_THTH",
"Tprime900_BWBW", "Tprime900_BWTZ", "Tprime900_BWTH", "Tprime900_THTZ", "Tprime900_TZTZ", "Tprime900_THTH",
"Tprime1000_BWBW", "Tprime1000_BWTZ", "Tprime1000_BWTH", "Tprime1000_THTZ", "Tprime1000_TZTZ", "Tprime1000_THTH",
"Tprime1100_BWBW", "Tprime1100_BWTZ", "Tprime1100_BWTH", "Tprime1100_THTZ", "Tprime1100_TZTZ", "Tprime1100_THTH",
"Tprime1200_BWBW", "Tprime1200_BWTZ", "Tprime1200_BWTH", "Tprime1200_THTZ", "Tprime1200_TZTZ", "Tprime1200_THTH",
"Tprime1300_BWBW", "Tprime1300_BWTZ", "Tprime1300_BWTH", "Tprime1300_THTZ", "Tprime1300_TZTZ", "Tprime1300_THTH",
"Tprime1400_BWBW", "Tprime1400_BWTZ", "Tprime1400_BWTH", "Tprime1400_THTZ", "Tprime1400_TZTZ", "Tprime1400_THTH",
"Tprime1500_BWBW", "Tprime1500_BWTZ", "Tprime1500_BWTH", "Tprime1500_THTZ", "Tprime1500_TZTZ", "Tprime1500_THTH"
};
TString legendNames[totalSamples] = {"Data", "Charge MisID", "Non-prompt",
"t#bar{t}", "ZJets", "DY1050","Single top", "Drell Yan","W+Jets",
"WW", "WZ", "ZZ",
"T_tW", "Tbar_tW", "T_t", "Tbar_t", "T_s", "Tbar_s",
"WWm", "WWp", "WWW",
"t#bar{t}W", "t#bar{t}Z", "t#bar{t}WW",
"ZZZNoGs", "WWZNoGs", "WZZNoGs", "WWds",
"WGstarToLNu2E", "WGstarToLNu2Mu", "WGstarToLNu2Tau", "ZGToLLG",
"t'400 bWbW", "t'400 bWtZ", "t'400 bWtH", "t'400 tHtZ", "t'400 tZtZ", "t'400 tHtH",
"t'500 bWbW", "t'500 bWtZ", "t'500 bWtH", "t'500 tHtZ", "t'500 tZtZ", "t'500 tHtH",
"t'600 bWbW", "t'600 bWtZ", "t'600 bWtH", "t'600 tHtZ", "t'600 tZtZ", "t'600 tHtH",
"t'700 bWbW", "t'700 bWtZ", "t'700 bWtH", "t'700 tHtZ", "t'700 tZtZ", "t'700 tHtH",
"t'800 bWbW", "t'800 bWtZ", "t'800 bWtH", "t'800 tHtZ", "t'800 tZtZ", "t'800 tHtH",
"t'900 bWbW", "t'900 bWtZ", "t'900 bWtH", "t'900 tHtZ", "t'900 tZtZ", "t'900 tHtH",
"t'1000 bWbW", "t'1000 bWtZ", "t'1000 bWtH", "t'1000 tHtZ", "t'1000 tZtZ", "t'1000 tHtH",
"t'1100 bWbW", "t'1100 bWtZ", "t'1100 bWtH", "t'1100 tHtZ", "t'1100 tZtZ", "t'1100 tHtH",
"t'1200 bWbW", "t'1200 bWtZ", "t'1200 bWtH", "t'1200 tHtZ", "t'1200 tZtZ", "t'1200 tHtH",
"t'1300 bWbW", "t'1300 bWtZ", "t'1300 bWtH", "t'1300 tHtZ", "t'1300 tZtZ", "t'1300 tHtH",
"t'1400 bWbW", "t'1400 bWtZ", "t'1400 bWtH", "t'1400 tHtZ", "t'1400 tZtZ", "t'1400 tHtH",
"t'1500 bWbW", "t'1500 bWtZ", "t'1500 bWtH", "t'1500 tHtZ", "t'1500 tZtZ", "t'1500 tHtH"
};
Color_t color[totalSamples] = {
kBlack, kRed, kGray, // Data, ChargeMisID, FakeRate,
kRed+1, kBlue,kBlue, kMagenta, kBlue, kBlue+3, // TTbar, ZJets, DY1050,Single Top, DY,WJets,
kGreen -3,kGreen -3,kGreen -3, //WW, WZ, ZZ,
//kGreen-9, kViolet+1, kAzure-2,
kMagenta, kMagenta, kMagenta, kMagenta, kMagenta, kMagenta, //Single Top
kGreen-3, kGreen-3, kGreen+2, // WWm, WWp, WWW,
kOrange, kOrange,kOrange+2, // TTW, TTZ, TTWW,
kCyan, kBlue, kOrange+4, kViolet+2, kMagenta, 0,kMagenta,
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 400
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 500
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 600
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 700
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 800
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 900
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 1000
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 1100
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 1200
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 1300
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4, // Tprime 1400
kViolet-4, kRed-4, kGreen-4, kGray+2, kBlue-4, kMagenta-4 // Tprime 1500
// kCyan, kBlue, kOrange+4, kViolet+2, kMagenta, kMagenta+4, // Tprime 400
};
vector <unsigned int> indices(totalSamples, -1);
//This is for OS:
/*
// const unsigned int NSAMPLES = 10;
// Samples_t samples[NSAMPLES] = {
// Data, TTbar, SingleTop, DrellYan,
// Tprime800_bWbW, Tprime800_bWtH, Tprime800_tZtZ, Tprime800_tHtH, Tprime800_bWtZ, Tprime800_tHtZ
// //ZJets, DY1050
// };
*/
const unsigned int NSAMPLES = 16;
Samples_t samples[NSAMPLES] = {
Data,
TTbar, ZJets, DY1050 , //WJets,
T_tW, Tbar_tW, T_t, Tbar_t, T_s, Tbar_s,
Tprime800_bWbW, Tprime800_bWtH, Tprime800_tZtZ, Tprime800_tHtH, Tprime800_bWtZ, Tprime800_tHtZ
// // Tprime500_bWbW, Tprime500_bWtH, Tprime500_tZtZ, Tprime500_tHtH, Tprime500_bWtZ, Tprime500_tHtZ
};
/*
//This is for SS:
const unsigned int NSAMPLES = 15;
Samples_t samples[NSAMPLES] = {
Data,
WZ, ZZ,
WWm, WWp, WWW,
TTW, TTZ, ChargeMisID, FakeRate, //, TTZ FakeRate
Tprime800_bWtH, Tprime800_tZtZ, Tprime800_tHtH, Tprime800_bWtZ, Tprime800_tHtZ
//Tprime1000_bWtH, Tprime1000_tZtZ, Tprime1000_tHtH, Tprime1000_bWtZ, Tprime1000_tHtZ
};
*/
//This is for multi-lepton:
/*
const unsigned int NSAMPLES = 20;
Samples_t samples[NSAMPLES] = {
Data,
WWm, WWp, WWW, TTW, TTWW, ZZ, WZ,
ZZZNoGs, WWZNoGs, WZZNoGs, TTbar, ZJets, DY1050, TTZ, //FakeRate,
Tprime800_bWtH, Tprime800_tZtZ, Tprime800_tHtH, Tprime800_bWtZ, Tprime800_tHtZ
// Tprime1000_bWtH, Tprime1000_tZtZ, Tprime1000_tHtH, Tprime1000_bWtZ, Tprime1000_tHtZ
};*/
// const unsigned int NSAMPLES = 11;
// Samples_t samples[NSAMPLES] = {
// Data,
// TTbar, ZJets, DY1050, WJets,
// T_tW, Tbar_tW, T_t, Tbar_t, T_s, Tbar_s
// //WW,
// // WZ,
// // ZZ,
// // // // WGEl, WGMu,
// // // For Tri: 16
// // Tprime500_tZtZ, Tprime500_bWtZ, Tprime500_tHtZ
// // WWm, WWp, WWW,
// // TTW, TTZ};
// };
//
float dySF[4] = {1.13,1.,1.04,1.1};
vector <TString> sNames;
vector <double> xSection;
vector <TH1D*> Histos;
vector <double> sScale;
vector <double> systUnc;
/**
#DrawOneHisto parameter list:
#1: Input directory in root file
#2: Channel (ElEl, ElMu or MuMu
#3: Prefix for histograms
#4: Name of histogram
#5: Log or not log
#6: x-Axis name
#7: Optional: rebin by this number
*/
float getMyEntries(TH1* histo)
{
float tot=0.;
for (int i=0;i<histo->GetNbinsX()+1;++i) {
if (histo->GetBinContent(i)>0.) tot+=histo->GetBinContent(i);
}
return tot;
}
float getMinEntries(TH1* histo)
{
float min=999999.;
for (int i=0;i<histo->GetNbinsX()+1;++i) {
if ((histo->GetBinContent(i)>0.) && (histo->GetBinContent(i)<min)) min=histo->GetBinContent(i);
}
return min;
}
float getMinEntries(TH1* histo, float min)
{
for (int i=0;i<histo->GetNbinsX()+1;++i) {
if ((histo->GetBinContent(i)>0.) && (histo->GetBinContent(i)<min)) min=histo->GetBinContent(i);
}
return min;
}
double uncertainty (Samples_t sampleIndex );
int main( int argc, const char* argv[] ){
if (argc < 9){
cout<<"Need at least 8 arguments. Only "<<argc<<" found."<<endl;
return 1;
}
setTDRStyle();
//Root file information
TString rootFile = argv[1];
TString inDir = argv[2];
TString inSuff = argv[3];
TString inPref = argv[4];
TString inName = argv[5];
cout << "a\n";
//Drawing information
int yLog = atoi(argv[6]);
TString xTitle = argv[7];
TString yTitle = argv[8];
cout << "a\n"<<argc<<endl;
int rebin = 1;
if (argc > 9) rebin = atoi(argv[9]);
float minX = -999, maxX;
if (argc > 10) {
minX = atof(argv[10]);
maxX = atof(argv[11]);
}
TString plotType;
if(argc > 12) plotType = argv[12];
cout << "a\n";
cout<<inDir<<" ";
cout<<inSuff<<" ";
cout<<inPref<<" ";
cout<<inName<<" ";
cout<<yLog<<" ";
cout<<xTitle<<" ";
cout<<rebin<<" ";
cout<<minX<<" ";
cout<<maxX<<endl;
const unsigned int NCHAN = 4;
TFile *file0 = TFile::Open(rootFile);
if (file0==0) {
cout << "\n\nERROR: "<<rootFile<< " does not exist\n\n";
return 1;
}
file0->cd();
TH1F* histArray[NSAMPLES][NCHAN];
if (inPref != "Top") inPref = "_"+inPref;
else inPref = "";
if (inDir != "Top") file0->cd(inDir);
for (unsigned int isam = 0; isam < NSAMPLES; isam++){
// cout << "ab "<<samples[isam]<< indices.size()<< endl;
indices[samples[isam]] = isam;
sNames.push_back(allNames[samples[isam]]);
TString sampleName;
if (isam < NSAMPLES) sampleName = sNames[isam];
else sampleName = "FakeRate";
cout << isam<<" "<<allNames[samples[isam]]<<" "<<color[samples[isam]]<<" "<<inName<<inPref<<"_"<<sampleName<<endl;;
histArray[isam][0] = (TH1F*)gDirectory->Get(inName+inPref+"_"+sampleName+"_"+"MuMu");
histArray[isam][1] = (TH1F*)gDirectory->Get(inName+inPref+"_"+sampleName+"_"+"ElMu");
histArray[isam][2] = (TH1F*)gDirectory->Get(inName+inPref+"_"+sampleName+"_"+"ElEl");
if ((histArray[isam][0]==0) || (histArray[isam][0]==0) || (histArray[isam][0]==0)) {
cout << "\n\nERROR: One of the histograms do not exist: "<< inName<<inPref<<"_"<<sampleName<<"\n\n";
gDirectory->ls();
return 1;
}
// cout << histArray[isam][0]->GetName()<<endl;
// cout << histArray[isam][0]->GetNbinsX()<<endl;
if (rebin != 1){
if(plotType=="Thesis"){
histArray[isam][0]->Rebin(rebin);
histArray[isam][1]->Rebin(rebin);
histArray[isam][2]->Rebin(rebin);
}
if(plotType=="MET_Fig2"){
Double_t rebin_array[27] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360, 380, 400, 420, 440, 460, 480, 500, 600};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(26, "temp1", rebin_array);
histArray[isam][0]->SetBinError(26, histArray[isam][0]->GetBinError(26)/5.);
histArray[isam][0]->SetBinContent(26, histArray[isam][0]->GetBinContent(26)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(26, "temp2", rebin_array);
histArray[isam][1]->SetBinError(26, histArray[isam][1]->GetBinError(26)/5.);
histArray[isam][1]->SetBinContent(26, histArray[isam][1]->GetBinContent(26)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(26, "temp3", rebin_array);
histArray[isam][2]->SetBinError(26, histArray[isam][2]->GetBinError(26)/5.);
histArray[isam][2]->SetBinContent(26, histArray[isam][2]->GetBinContent(26)/5.);
}
if(plotType=="MET_Fig3"){
Double_t rebin_array[26] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360, 380, 400, 420, 440, 460, 480, 600};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(25, "temp1", rebin_array);
histArray[isam][0]->SetBinError(25, histArray[isam][0]->GetBinError(25)/6.);
histArray[isam][0]->SetBinContent(25, histArray[isam][0]->GetBinContent(25)/6.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(25, "temp2", rebin_array);
histArray[isam][1]->SetBinError(25, histArray[isam][1]->GetBinError(25)/6.);
histArray[isam][1]->SetBinContent(25, histArray[isam][1]->GetBinContent(25)/6.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(25, "temp3", rebin_array);
histArray[isam][2]->SetBinError(25, histArray[isam][2]->GetBinError(25)/6.);
histArray[isam][2]->SetBinContent(25, histArray[isam][2]->GetBinContent(25)/6.);
}
if(plotType=="Jet1Pt_Fig3"){
histArray[isam][0]->Rebin(rebin);
histArray[isam][1]->Rebin(rebin);
histArray[isam][2]->Rebin(rebin);
}
if(plotType=="Jet2Pt_Fig3"){
Double_t rebin_array[15] = {0.0, 50.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0, 800.0, 1000.0};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(14, "temp1", rebin_array);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/4.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/4.);
histArray[isam][0]->SetBinError(14, histArray[isam][0]->GetBinError(14)/4.);
histArray[isam][0]->SetBinContent(14, histArray[isam][0]->GetBinContent(14)/4.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(14, "temp2", rebin_array);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/4.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/4.);
histArray[isam][1]->SetBinError(14, histArray[isam][1]->GetBinError(14)/4.);
histArray[isam][1]->SetBinContent(14, histArray[isam][1]->GetBinContent(14)/4.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(14, "temp3", rebin_array);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/4.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/4.);
histArray[isam][2]->SetBinError(14, histArray[isam][2]->GetBinError(14)/4.);
histArray[isam][2]->SetBinContent(14, histArray[isam][2]->GetBinContent(14)/4.);
}
if(plotType=="Lep1Pt_Fig4"){
/*
histArray[isam][0]->Rebin(rebin);
histArray[isam][1]->Rebin(rebin);
histArray[isam][2]->Rebin(rebin);
*/
Double_t rebin_array[18] = {0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 400, 450, 500};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(17, "temp1", rebin_array);
histArray[isam][0]->SetBinError(15, histArray[isam][0]->GetBinError(15)/2.);
histArray[isam][0]->SetBinContent(15, histArray[isam][0]->GetBinContent(15)/2.);
histArray[isam][0]->SetBinError(16, histArray[isam][0]->GetBinError(16)/2.);
histArray[isam][0]->SetBinContent(16, histArray[isam][0]->GetBinContent(16)/2.);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/2.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/2.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(17, "temp1", rebin_array);
histArray[isam][1]->SetBinError(15, histArray[isam][1]->GetBinError(15)/2.);
histArray[isam][1]->SetBinContent(15, histArray[isam][1]->GetBinContent(15)/2.);
histArray[isam][1]->SetBinError(16, histArray[isam][1]->GetBinError(16)/2.);
histArray[isam][1]->SetBinContent(16, histArray[isam][1]->GetBinContent(16)/2.);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/2.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/2.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(17, "temp1", rebin_array);
histArray[isam][2]->SetBinError(15, histArray[isam][2]->GetBinError(15)/2.);
histArray[isam][2]->SetBinContent(15, histArray[isam][2]->GetBinContent(15)/2.);
histArray[isam][2]->SetBinError(16, histArray[isam][2]->GetBinError(16)/2.);
histArray[isam][2]->SetBinContent(16, histArray[isam][2]->GetBinContent(16)/2.);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/2.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/2.);
/*
Double_t rebin_array[24] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360, 380, 400, 440, 480, 520};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(23, "temp1", rebin_array);
histArray[isam][0]->SetBinError(21, histArray[isam][0]->GetBinError(21)/2.);
histArray[isam][0]->SetBinContent(21, histArray[isam][0]->GetBinContent(21)/2.);
histArray[isam][0]->SetBinError(22, histArray[isam][0]->GetBinError(22)/2.);
histArray[isam][0]->SetBinContent(22, histArray[isam][0]->GetBinContent(22)/2.);
histArray[isam][0]->SetBinError(23, histArray[isam][0]->GetBinError(23)/2.);
histArray[isam][0]->SetBinContent(23, histArray[isam][0]->GetBinContent(23)/2.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(23, "temp2", rebin_array);
histArray[isam][1]->SetBinError(21, histArray[isam][1]->GetBinError(21)/2.);
histArray[isam][1]->SetBinContent(21, histArray[isam][1]->GetBinContent(21)/2.);
histArray[isam][1]->SetBinError(22, histArray[isam][1]->GetBinError(22)/2.);
histArray[isam][1]->SetBinContent(22, histArray[isam][1]->GetBinContent(22)/2.);
histArray[isam][1]->SetBinError(23, histArray[isam][1]->GetBinError(23)/2.);
histArray[isam][1]->SetBinContent(23, histArray[isam][1]->GetBinContent(23)/2.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(23, "temp3", rebin_array);
histArray[isam][2]->SetBinError(21, histArray[isam][2]->GetBinError(21)/2.);
histArray[isam][2]->SetBinContent(21, histArray[isam][2]->GetBinContent(21)/2.);
histArray[isam][2]->SetBinError(22, histArray[isam][2]->GetBinError(22)/2.);
histArray[isam][2]->SetBinContent(22, histArray[isam][2]->GetBinContent(22)/2.);
histArray[isam][2]->SetBinError(23, histArray[isam][2]->GetBinError(23)/2.);
histArray[isam][2]->SetBinContent(23, histArray[isam][2]->GetBinContent(23)/2.);
*/
}
if(plotType=="Lep2Pt_Fig4"){
Double_t rebin_array[19] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 400};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(18, "temp1", rebin_array);
histArray[isam][0]->SetBinError(18, histArray[isam][0]->GetBinError(18)/3.);
histArray[isam][0]->SetBinContent(18, histArray[isam][0]->GetBinContent(18)/3.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(18, "temp2", rebin_array);
histArray[isam][1]->SetBinError(18, histArray[isam][1]->GetBinError(18)/3.);
histArray[isam][1]->SetBinContent(18, histArray[isam][1]->GetBinContent(18)/3.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(18, "temp3", rebin_array);
histArray[isam][2]->SetBinError(18, histArray[isam][2]->GetBinError(18)/3.);
histArray[isam][2]->SetBinContent(18, histArray[isam][2]->GetBinContent(18)/3.);
}
if(plotType=="minMlb_Fig4"){
Double_t rebin_array[19] = {0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 325, 350, 375, 400, 600, 900}; //rebinning for sum lepton pt in OS
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(18, "temp1", rebin_array);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/8.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/8.);
histArray[isam][0]->SetBinError(18, histArray[isam][0]->GetBinError(18)/12.);
histArray[isam][0]->SetBinContent(18, histArray[isam][0]->GetBinContent(18)/12.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(18, "temp2", rebin_array);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/8.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/8.);
histArray[isam][1]->SetBinError(18, histArray[isam][1]->GetBinError(18)/12.);
histArray[isam][1]->SetBinContent(18, histArray[isam][1]->GetBinContent(18)/12.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(18, "temp3", rebin_array);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/8.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/8.);
histArray[isam][2]->SetBinError(18, histArray[isam][2]->GetBinError(18)/12.);
histArray[isam][2]->SetBinContent(18, histArray[isam][2]->GetBinContent(18)/12.);
}
if(plotType=="HT_Fig5"){
Double_t rebin_array[16] = {0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 2000, 2500}; //HT
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(15, "temp1", rebin_array);
histArray[isam][0]->SetBinError(12, histArray[isam][0]->GetBinError(12)/2.);
histArray[isam][0]->SetBinContent(12, histArray[isam][0]->GetBinContent(12)/2.);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/2.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/2.);
histArray[isam][0]->SetBinError(14, histArray[isam][0]->GetBinError(14)/4.);
histArray[isam][0]->SetBinContent(14, histArray[isam][0]->GetBinContent(14)/4.);
histArray[isam][0]->SetBinError(15, histArray[isam][0]->GetBinError(15)/5.);
histArray[isam][0]->SetBinContent(15, histArray[isam][0]->GetBinContent(15)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(15, "temp2", rebin_array);
histArray[isam][1]->SetBinError(12, histArray[isam][1]->GetBinError(12)/2.);
histArray[isam][1]->SetBinContent(12, histArray[isam][1]->GetBinContent(12)/2.);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/2.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/2.);
histArray[isam][1]->SetBinError(14, histArray[isam][1]->GetBinError(14)/4.);
histArray[isam][1]->SetBinContent(14, histArray[isam][1]->GetBinContent(14)/4.);
histArray[isam][1]->SetBinError(15, histArray[isam][1]->GetBinError(15)/5.);
histArray[isam][1]->SetBinContent(15, histArray[isam][1]->GetBinContent(15)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(15, "temp3", rebin_array);
histArray[isam][2]->SetBinError(12, histArray[isam][2]->GetBinError(12)/2.);
histArray[isam][2]->SetBinContent(12, histArray[isam][2]->GetBinContent(12)/2.);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/2.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/2.);
histArray[isam][2]->SetBinError(14, histArray[isam][2]->GetBinError(14)/4.);
histArray[isam][2]->SetBinContent(14, histArray[isam][2]->GetBinContent(14)/4.);
histArray[isam][2]->SetBinError(15, histArray[isam][2]->GetBinError(15)/5.);
histArray[isam][2]->SetBinContent(15, histArray[isam][2]->GetBinContent(15)/5.);
}
if(plotType=="sumPtL_Fig5"){
Double_t rebin_array[20] = {0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 275, 300, 350, 400, 500, 600, 700, 800, 900}; //rebinning for sum lepton pt
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(19, "temp1", rebin_array);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/2.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/2.);
histArray[isam][0]->SetBinError(14, histArray[isam][0]->GetBinError(14)/2.);
histArray[isam][0]->SetBinContent(14, histArray[isam][0]->GetBinContent(14)/2.);
histArray[isam][0]->SetBinError(15, histArray[isam][0]->GetBinError(15)/4.);
histArray[isam][0]->SetBinContent(15, histArray[isam][0]->GetBinContent(15)/4.);
histArray[isam][0]->SetBinError(16, histArray[isam][0]->GetBinError(16)/4.);
histArray[isam][0]->SetBinContent(16, histArray[isam][0]->GetBinContent(16)/4.);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/4.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/4.);
histArray[isam][0]->SetBinError(18, histArray[isam][0]->GetBinError(18)/4.);
histArray[isam][0]->SetBinContent(18, histArray[isam][0]->GetBinContent(18)/4.);
histArray[isam][0]->SetBinError(19, histArray[isam][0]->GetBinError(19)/4.);
histArray[isam][0]->SetBinContent(19, histArray[isam][0]->GetBinContent(19)/4.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(19, "temp2", rebin_array);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/2.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/2.);
histArray[isam][1]->SetBinError(14, histArray[isam][1]->GetBinError(14)/2.);
histArray[isam][1]->SetBinContent(14, histArray[isam][1]->GetBinContent(14)/2.);
histArray[isam][1]->SetBinError(15, histArray[isam][1]->GetBinError(15)/4.);
histArray[isam][1]->SetBinContent(15, histArray[isam][1]->GetBinContent(15)/4.);
histArray[isam][1]->SetBinError(16, histArray[isam][1]->GetBinError(16)/4.);
histArray[isam][1]->SetBinContent(16, histArray[isam][1]->GetBinContent(16)/4.);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/4.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/4.);
histArray[isam][1]->SetBinError(18, histArray[isam][1]->GetBinError(18)/4.);
histArray[isam][1]->SetBinContent(18, histArray[isam][1]->GetBinContent(18)/4.);
histArray[isam][1]->SetBinError(19, histArray[isam][1]->GetBinError(19)/4.);
histArray[isam][1]->SetBinContent(19, histArray[isam][1]->GetBinContent(19)/4.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(19, "temp3", rebin_array);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/2.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/2.);
histArray[isam][2]->SetBinError(14, histArray[isam][2]->GetBinError(14)/2.);
histArray[isam][2]->SetBinContent(14, histArray[isam][2]->GetBinContent(14)/2.);
histArray[isam][2]->SetBinError(15, histArray[isam][2]->GetBinError(15)/4.);
histArray[isam][2]->SetBinContent(15, histArray[isam][2]->GetBinContent(15)/4.);
histArray[isam][2]->SetBinError(16, histArray[isam][2]->GetBinError(16)/4.);
histArray[isam][2]->SetBinContent(16, histArray[isam][2]->GetBinContent(16)/4.);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/4.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/4.);
histArray[isam][2]->SetBinError(18, histArray[isam][2]->GetBinError(18)/4.);
histArray[isam][2]->SetBinContent(18, histArray[isam][2]->GetBinContent(18)/4.);
histArray[isam][2]->SetBinError(19, histArray[isam][2]->GetBinError(19)/4.);
histArray[isam][2]->SetBinContent(19, histArray[isam][2]->GetBinContent(19)/4.);
}
if(plotType=="ST_Fig5" || plotType=="leptonJetsSum_Fig5"){
histArray[isam][0]->Rebin(rebin);
histArray[isam][1]->Rebin(rebin);
histArray[isam][2]->Rebin(rebin);
//Double_t rebin_array[38] = {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1800, 1900, 2000}; //rebinning ST
/*Double_t rebin_array[38] = {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200, 1250, 1300, 1350, 1400, 1450, 1500, 1550, 1600, 1650, 1700, 1800, 1900, 2000};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(37, "temp1", rebin_array);
histArray[isam][0]->SetBinError(35, histArray[isam][0]->GetBinError(35)/2.);
histArray[isam][0]->SetBinContent(35, histArray[isam][0]->GetBinContent(35)/2.);
histArray[isam][0]->SetBinError(36, histArray[isam][0]->GetBinError(36)/2.);
histArray[isam][0]->SetBinContent(36, histArray[isam][0]->GetBinContent(36)/2.);
histArray[isam][0]->SetBinError(37, histArray[isam][0]->GetBinError(37)/2.);
histArray[isam][0]->SetBinContent(37, histArray[isam][0]->GetBinContent(37)/2.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(37, "temp2", rebin_array);
histArray[isam][1]->SetBinError(35, histArray[isam][1]->GetBinError(35)/2.);
histArray[isam][1]->SetBinContent(35, histArray[isam][1]->GetBinContent(35)/2.);
histArray[isam][1]->SetBinError(36, histArray[isam][1]->GetBinError(36)/2.);
histArray[isam][1]->SetBinContent(36, histArray[isam][1]->GetBinContent(36)/2.);
histArray[isam][1]->SetBinError(37, histArray[isam][1]->GetBinError(37)/2.);
histArray[isam][1]->SetBinContent(37, histArray[isam][1]->GetBinContent(37)/2.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(37, "temp3", rebin_array);
histArray[isam][2]->SetBinError(35, histArray[isam][2]->GetBinError(35)/2.);
histArray[isam][2]->SetBinContent(35, histArray[isam][2]->GetBinContent(35)/2.);
histArray[isam][2]->SetBinError(36, histArray[isam][2]->GetBinError(36)/2.);
histArray[isam][2]->SetBinContent(36, histArray[isam][2]->GetBinContent(36)/2.);
histArray[isam][2]->SetBinError(37, histArray[isam][2]->GetBinError(37)/2.);
histArray[isam][2]->SetBinContent(37, histArray[isam][2]->GetBinContent(37)/2.);*/
}
if(plotType=="leptonJetsSum_Fig6"){
Double_t rebin_array[23] = {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000, 1500, 2000}; //rebinning ST
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(22, "temp1", rebin_array);
histArray[isam][0]->SetBinError(21, histArray[isam][0]->GetBinError(21)/10.);
histArray[isam][0]->SetBinContent(21, histArray[isam][0]->GetBinContent(21)/10.);
histArray[isam][0]->SetBinError(22, histArray[isam][0]->GetBinError(22)/10.);
histArray[isam][0]->SetBinContent(22, histArray[isam][0]->GetBinContent(22)/10.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(22, "temp2", rebin_array);
histArray[isam][1]->SetBinError(21, histArray[isam][1]->GetBinError(21)/10.);
histArray[isam][1]->SetBinContent(21, histArray[isam][1]->GetBinContent(21)/10.);
histArray[isam][1]->SetBinError(22, histArray[isam][1]->GetBinError(22)/10.);
histArray[isam][1]->SetBinContent(22, histArray[isam][1]->GetBinContent(22)/10.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(22, "temp3", rebin_array);
histArray[isam][2]->SetBinError(21, histArray[isam][2]->GetBinError(21)/10.);
histArray[isam][2]->SetBinContent(21, histArray[isam][2]->GetBinContent(21)/10.);
histArray[isam][2]->SetBinError(22, histArray[isam][2]->GetBinError(22)/10.);
histArray[isam][2]->SetBinContent(22, histArray[isam][2]->GetBinContent(22)/10.);
}
if(plotType=="MET_Fig13"){
Double_t rebin_array[18] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 400, 600};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(17, "temp1", rebin_array);
histArray[isam][0]->SetBinError(16, histArray[isam][0]->GetBinError(16)/5.);
histArray[isam][0]->SetBinContent(16, histArray[isam][0]->GetBinContent(16)/5.);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/5.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(17, "temp2", rebin_array);
histArray[isam][1]->SetBinError(16, histArray[isam][1]->GetBinError(16)/5.);
histArray[isam][1]->SetBinContent(16, histArray[isam][1]->GetBinContent(16)/5.);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/5.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(17, "temp3", rebin_array);
histArray[isam][2]->SetBinError(16, histArray[isam][2]->GetBinError(16)/5.);
histArray[isam][2]->SetBinContent(16, histArray[isam][2]->GetBinContent(16)/5.);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/5.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/5.);
}
if(plotType=="Jet1Pt_Fig14"){
Double_t rebin_array[14] = {0.0, 50.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 600.0, 700.0, 1000.0};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(13, "temp1", rebin_array);
histArray[isam][0]->SetBinError(11, histArray[isam][0]->GetBinError(11)/2.);
histArray[isam][0]->SetBinContent(11, histArray[isam][0]->GetBinContent(11)/2.);
histArray[isam][0]->SetBinError(12, histArray[isam][0]->GetBinError(12)/2.);
histArray[isam][0]->SetBinContent(12, histArray[isam][0]->GetBinContent(12)/2.);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/6.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/6.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(13, "temp2", rebin_array);
histArray[isam][1]->SetBinError(11, histArray[isam][1]->GetBinError(11)/2.);
histArray[isam][1]->SetBinContent(11, histArray[isam][1]->GetBinContent(11)/2.);
histArray[isam][1]->SetBinError(12, histArray[isam][1]->GetBinError(12)/2.);
histArray[isam][1]->SetBinContent(12, histArray[isam][1]->GetBinContent(12)/2.);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/6.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/6.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(13, "temp3", rebin_array);
histArray[isam][2]->SetBinError(11, histArray[isam][2]->GetBinError(11)/2.);
histArray[isam][2]->SetBinContent(11, histArray[isam][2]->GetBinContent(11)/2.);
histArray[isam][2]->SetBinError(12, histArray[isam][2]->GetBinError(12)/2.);
histArray[isam][2]->SetBinContent(12, histArray[isam][2]->GetBinContent(12)/2.);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/6.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/6.);
}
if(plotType=="Jet2Pt_Fig14"){
Double_t rebin_array[9] = {0.0, 50.0, 100.0, 150.0, 200.0, 250.0, 300.0, 350.0, 500.0};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(8, "temp1", rebin_array);
histArray[isam][0]->SetBinError(8, histArray[isam][0]->GetBinError(8)/3.);
histArray[isam][0]->SetBinContent(8, histArray[isam][0]->GetBinContent(8)/3.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(8, "temp2", rebin_array);
histArray[isam][1]->SetBinError(8, histArray[isam][1]->GetBinError(8)/3.);
histArray[isam][1]->SetBinContent(8, histArray[isam][1]->GetBinContent(8)/3.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(8, "temp3", rebin_array);
histArray[isam][2]->SetBinError(8, histArray[isam][2]->GetBinError(8)/3.);
histArray[isam][2]->SetBinContent(8, histArray[isam][2]->GetBinContent(8)/3.);
}
if(plotType=="Lep1Pt_Fig14"){
Double_t rebin_array[16] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 300, 400, 500};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(15, "temp1", rebin_array);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/3.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/3.);
histArray[isam][0]->SetBinError(14, histArray[isam][0]->GetBinError(14)/5.);
histArray[isam][0]->SetBinContent(14, histArray[isam][0]->GetBinContent(14)/5.);
histArray[isam][0]->SetBinError(15, histArray[isam][0]->GetBinError(15)/5.);
histArray[isam][0]->SetBinContent(15, histArray[isam][0]->GetBinContent(15)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(15, "temp2", rebin_array);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/3.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/3.);
histArray[isam][1]->SetBinError(14, histArray[isam][1]->GetBinError(14)/5.);
histArray[isam][1]->SetBinContent(14, histArray[isam][1]->GetBinContent(14)/5.);
histArray[isam][1]->SetBinError(15, histArray[isam][1]->GetBinError(15)/5.);
histArray[isam][1]->SetBinContent(15, histArray[isam][1]->GetBinContent(15)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(15, "temp3", rebin_array);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/3.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/3.);
histArray[isam][2]->SetBinError(14, histArray[isam][2]->GetBinError(14)/5.);
histArray[isam][2]->SetBinContent(14, histArray[isam][2]->GetBinContent(14)/5.);
histArray[isam][2]->SetBinError(15, histArray[isam][2]->GetBinError(15)/5.);
histArray[isam][2]->SetBinContent(15, histArray[isam][2]->GetBinContent(15)/5.);
}
if(plotType=="Lep2Pt_Fig14"){
Double_t rebin_array[10] = {0, 20, 40, 60, 80, 100, 120, 140, 180, 260};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(9, "temp1", rebin_array);
histArray[isam][0]->SetBinError(8, histArray[isam][0]->GetBinError(8)/2.);
histArray[isam][0]->SetBinContent(8, histArray[isam][0]->GetBinContent(8)/2.);
histArray[isam][0]->SetBinError(9, histArray[isam][0]->GetBinError(9)/4.);
histArray[isam][0]->SetBinContent(9, histArray[isam][0]->GetBinContent(9)/4.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(9, "temp2", rebin_array);
histArray[isam][1]->SetBinError(8, histArray[isam][1]->GetBinError(8)/2.);
histArray[isam][1]->SetBinContent(8, histArray[isam][1]->GetBinContent(8)/2.);
histArray[isam][1]->SetBinError(9, histArray[isam][1]->GetBinError(9)/4.);
histArray[isam][1]->SetBinContent(9, histArray[isam][1]->GetBinContent(9)/4.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(9, "temp3", rebin_array);
histArray[isam][2]->SetBinError(8, histArray[isam][2]->GetBinError(8)/2.);
histArray[isam][2]->SetBinContent(8, histArray[isam][2]->GetBinContent(8)/2.);
histArray[isam][2]->SetBinError(9, histArray[isam][2]->GetBinError(9)/4.);
histArray[isam][2]->SetBinContent(9, histArray[isam][2]->GetBinContent(9)/4.);
}
if(plotType=="MET_Fig15"){
Double_t rebin_array[12] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 200, 300, 400};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(11, "temp1", rebin_array);
histArray[isam][0]->SetBinError(9, histArray[isam][0]->GetBinError(9)/2.);
histArray[isam][0]->SetBinContent(9, histArray[isam][0]->GetBinContent(9)/2.);
histArray[isam][0]->SetBinError(10, histArray[isam][0]->GetBinError(10)/5.);
histArray[isam][0]->SetBinContent(10, histArray[isam][0]->GetBinContent(10)/5.);
histArray[isam][0]->SetBinError(11, histArray[isam][0]->GetBinError(11)/5.);
histArray[isam][0]->SetBinContent(11, histArray[isam][0]->GetBinContent(11)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(11, "temp2", rebin_array);
histArray[isam][1]->SetBinError(9, histArray[isam][1]->GetBinError(9)/2.);
histArray[isam][1]->SetBinContent(9, histArray[isam][1]->GetBinContent(9)/2.);
histArray[isam][1]->SetBinError(10, histArray[isam][1]->GetBinError(10)/5.);
histArray[isam][1]->SetBinContent(10, histArray[isam][1]->GetBinContent(10)/5.);
histArray[isam][1]->SetBinError(11, histArray[isam][1]->GetBinError(11)/5.);
histArray[isam][1]->SetBinContent(11, histArray[isam][1]->GetBinContent(11)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(11, "temp3", rebin_array);
histArray[isam][2]->SetBinError(9, histArray[isam][2]->GetBinError(9)/2.);
histArray[isam][2]->SetBinContent(9, histArray[isam][2]->GetBinContent(9)/2.);
histArray[isam][2]->SetBinError(10, histArray[isam][2]->GetBinError(10)/5.);
histArray[isam][2]->SetBinContent(10, histArray[isam][2]->GetBinContent(10)/5.);
histArray[isam][2]->SetBinError(11, histArray[isam][2]->GetBinError(11)/5.);
histArray[isam][2]->SetBinContent(11, histArray[isam][2]->GetBinContent(11)/5.);
}
if(plotType=="minMlb_Fig15"){
Double_t rebin_array[11] = {0, 25, 50, 75, 100, 125, 150, 175, 200, 300, 500}; //rebinning for sum lepton pt in OS
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(10, "temp1", rebin_array);
histArray[isam][0]->SetBinError(9, histArray[isam][0]->GetBinError(9)/4.);
histArray[isam][0]->SetBinContent(9, histArray[isam][0]->GetBinContent(9)/4.);
histArray[isam][0]->SetBinError(10, histArray[isam][0]->GetBinError(10)/8.);
histArray[isam][0]->SetBinContent(10, histArray[isam][0]->GetBinContent(10)/8.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(10, "temp2", rebin_array);
histArray[isam][1]->SetBinError(9, histArray[isam][1]->GetBinError(9)/4.);
histArray[isam][1]->SetBinContent(9, histArray[isam][1]->GetBinContent(9)/4.);
histArray[isam][1]->SetBinError(10, histArray[isam][1]->GetBinError(10)/8.);
histArray[isam][1]->SetBinContent(10, histArray[isam][1]->GetBinContent(10)/8.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(10, "temp3", rebin_array);
histArray[isam][2]->SetBinError(9, histArray[isam][2]->GetBinError(9)/4.);
histArray[isam][2]->SetBinContent(9, histArray[isam][2]->GetBinContent(9)/4.);
histArray[isam][2]->SetBinError(10, histArray[isam][2]->GetBinError(10)/8.);
histArray[isam][2]->SetBinContent(10, histArray[isam][2]->GetBinContent(10)/8.);
}
if(plotType=="HT_Fig16"){
Double_t rebin_array[11] = {0, 100, 200, 300, 400, 500, 600, 700, 800, 1000, 1600}; //HT
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(10, "temp1", rebin_array);
histArray[isam][0]->SetBinError(9, histArray[isam][0]->GetBinError(9)/2.);
histArray[isam][0]->SetBinContent(9, histArray[isam][0]->GetBinContent(9)/2.);
histArray[isam][0]->SetBinError(10, histArray[isam][0]->GetBinError(10)/6.);
histArray[isam][0]->SetBinContent(10, histArray[isam][0]->GetBinContent(10)/6.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(10, "temp2", rebin_array);
histArray[isam][1]->SetBinError(9, histArray[isam][1]->GetBinError(9)/2.);
histArray[isam][1]->SetBinContent(9, histArray[isam][1]->GetBinContent(9)/2.);
histArray[isam][1]->SetBinError(10, histArray[isam][1]->GetBinError(10)/6.);
histArray[isam][1]->SetBinContent(10, histArray[isam][1]->GetBinContent(10)/6.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(10, "temp3", rebin_array);
histArray[isam][2]->SetBinError(9, histArray[isam][2]->GetBinError(9)/2.);
histArray[isam][2]->SetBinContent(9, histArray[isam][2]->GetBinContent(9)/2.);
histArray[isam][2]->SetBinError(10, histArray[isam][2]->GetBinError(10)/6.);
histArray[isam][2]->SetBinContent(10, histArray[isam][2]->GetBinContent(10)/6.);
}
if(plotType=="sumPtL_Fig16"){
Double_t rebin_array[13] = {0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 250, 300, 500}; //rebinning for sum lepton pt
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(12, "temp1", rebin_array);
histArray[isam][0]->SetBinError(11, histArray[isam][0]->GetBinError(11)/2.);
histArray[isam][0]->SetBinContent(11, histArray[isam][0]->GetBinContent(11)/2.);
histArray[isam][0]->SetBinError(12, histArray[isam][0]->GetBinError(12)/8.);
histArray[isam][0]->SetBinContent(12, histArray[isam][0]->GetBinContent(12)/8.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(12, "temp2", rebin_array);
histArray[isam][1]->SetBinError(11, histArray[isam][1]->GetBinError(11)/2.);
histArray[isam][1]->SetBinContent(11, histArray[isam][1]->GetBinContent(11)/2.);
histArray[isam][1]->SetBinError(12, histArray[isam][1]->GetBinError(12)/8.);
histArray[isam][1]->SetBinContent(12, histArray[isam][1]->GetBinContent(12)/8.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(12, "temp3", rebin_array);
histArray[isam][2]->SetBinError(11, histArray[isam][2]->GetBinError(11)/2.);
histArray[isam][2]->SetBinContent(11, histArray[isam][2]->GetBinContent(11)/2.);
histArray[isam][2]->SetBinError(12, histArray[isam][2]->GetBinError(12)/8.);
histArray[isam][2]->SetBinContent(12, histArray[isam][2]->GetBinContent(12)/8.);
}
if(plotType=="ST_Fig16"){
Double_t rebin_array[17] = {200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 900, 1000, 1200, 1500};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(16, "temp1", rebin_array);
histArray[isam][0]->SetBinError(13, histArray[isam][0]->GetBinError(13)/2.);
histArray[isam][0]->SetBinContent(13, histArray[isam][0]->GetBinContent(13)/2.);
histArray[isam][0]->SetBinError(14, histArray[isam][0]->GetBinError(14)/2.);
histArray[isam][0]->SetBinContent(14, histArray[isam][0]->GetBinContent(14)/2.);
histArray[isam][0]->SetBinError(15, histArray[isam][0]->GetBinError(15)/4.);
histArray[isam][0]->SetBinContent(15, histArray[isam][0]->GetBinContent(15)/4.);
histArray[isam][0]->SetBinError(16, histArray[isam][0]->GetBinError(16)/6.);
histArray[isam][0]->SetBinContent(16, histArray[isam][0]->GetBinContent(16)/6.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(16, "temp2", rebin_array);
histArray[isam][1]->SetBinError(13, histArray[isam][1]->GetBinError(13)/2.);
histArray[isam][1]->SetBinContent(13, histArray[isam][1]->GetBinContent(13)/2.);
histArray[isam][1]->SetBinError(14, histArray[isam][1]->GetBinError(14)/2.);
histArray[isam][1]->SetBinContent(14, histArray[isam][1]->GetBinContent(14)/2.);
histArray[isam][1]->SetBinError(15, histArray[isam][1]->GetBinError(15)/4.);
histArray[isam][1]->SetBinContent(15, histArray[isam][1]->GetBinContent(15)/4.);
histArray[isam][1]->SetBinError(16, histArray[isam][1]->GetBinError(16)/6.);
histArray[isam][1]->SetBinContent(16, histArray[isam][1]->GetBinContent(16)/6.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(16, "temp3", rebin_array);
histArray[isam][2]->SetBinError(13, histArray[isam][2]->GetBinError(13)/2.);
histArray[isam][2]->SetBinContent(13, histArray[isam][2]->GetBinContent(13)/2.);
histArray[isam][2]->SetBinError(14, histArray[isam][2]->GetBinError(14)/2.);
histArray[isam][2]->SetBinContent(14, histArray[isam][2]->GetBinContent(14)/2.);
histArray[isam][2]->SetBinError(15, histArray[isam][2]->GetBinError(15)/4.);
histArray[isam][2]->SetBinContent(15, histArray[isam][2]->GetBinContent(15)/4.);
histArray[isam][2]->SetBinError(16, histArray[isam][2]->GetBinError(16)/6.);
histArray[isam][2]->SetBinContent(16, histArray[isam][2]->GetBinContent(16)/6.);
}
if(plotType=="leptonJetsSum_Fig16"){
Double_t rebin_array[19] = {0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 1000, 1500}; //rebinning ST
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(18, "temp1", rebin_array);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/4.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/4.);
histArray[isam][0]->SetBinError(18, histArray[isam][0]->GetBinError(18)/10.);
histArray[isam][0]->SetBinContent(18, histArray[isam][0]->GetBinContent(18)/10.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(18, "temp2", rebin_array);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/4.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/4.);
histArray[isam][1]->SetBinError(18, histArray[isam][1]->GetBinError(18)/10.);
histArray[isam][1]->SetBinContent(18, histArray[isam][1]->GetBinContent(18)/10.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(18, "temp3", rebin_array);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/4.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/4.);
histArray[isam][2]->SetBinError(18, histArray[isam][2]->GetBinError(18)/10.);
histArray[isam][2]->SetBinContent(18, histArray[isam][2]->GetBinContent(18)/10.);
}
if(plotType=="MET_Fig18"){
Double_t rebin_array[18] = {0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 400, 600};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(17, "temp1", rebin_array);
histArray[isam][0]->SetBinError(16, histArray[isam][0]->GetBinError(16)/5.);
histArray[isam][0]->SetBinContent(16, histArray[isam][0]->GetBinContent(16)/5.);
histArray[isam][0]->SetBinError(17, histArray[isam][0]->GetBinError(17)/5.);
histArray[isam][0]->SetBinContent(17, histArray[isam][0]->GetBinContent(17)/5.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(17, "temp2", rebin_array);
histArray[isam][1]->SetBinError(16, histArray[isam][1]->GetBinError(16)/5.);
histArray[isam][1]->SetBinContent(16, histArray[isam][1]->GetBinContent(16)/5.);
histArray[isam][1]->SetBinError(17, histArray[isam][1]->GetBinError(17)/5.);
histArray[isam][1]->SetBinContent(17, histArray[isam][1]->GetBinContent(17)/5.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(17, "temp3", rebin_array);
histArray[isam][2]->SetBinError(16, histArray[isam][2]->GetBinError(16)/5.);
histArray[isam][2]->SetBinContent(16, histArray[isam][2]->GetBinContent(16)/5.);
histArray[isam][2]->SetBinError(17, histArray[isam][2]->GetBinError(17)/5.);
histArray[isam][2]->SetBinContent(17, histArray[isam][2]->GetBinContent(17)/5.);
}
if(plotType=="Jet1Pt_Fig19"){
Double_t rebin_array[6] = {0.0, 100.0, 200.0, 400.0, 600.0, 1000.0};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(5, "temp1", rebin_array);
histArray[isam][0]->SetBinError(3, histArray[isam][0]->GetBinError(3)/2.);
histArray[isam][0]->SetBinContent(3, histArray[isam][0]->GetBinContent(3)/2.);
histArray[isam][0]->SetBinError(4, histArray[isam][0]->GetBinError(4)/2.);
histArray[isam][0]->SetBinContent(4, histArray[isam][0]->GetBinContent(4)/2.);
histArray[isam][0]->SetBinError(5, histArray[isam][0]->GetBinError(5)/4.);
histArray[isam][0]->SetBinContent(5, histArray[isam][0]->GetBinContent(5)/4.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(5, "temp2", rebin_array);
histArray[isam][1]->SetBinError(3, histArray[isam][1]->GetBinError(3)/2.);
histArray[isam][1]->SetBinContent(3, histArray[isam][1]->GetBinContent(3)/2.);
histArray[isam][1]->SetBinError(4, histArray[isam][1]->GetBinError(4)/2.);
histArray[isam][1]->SetBinContent(4, histArray[isam][1]->GetBinContent(4)/2.);
histArray[isam][1]->SetBinError(5, histArray[isam][1]->GetBinError(5)/4.);
histArray[isam][1]->SetBinContent(5, histArray[isam][1]->GetBinContent(5)/4.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(5, "temp3", rebin_array);
histArray[isam][2]->SetBinError(3, histArray[isam][2]->GetBinError(3)/2.);
histArray[isam][2]->SetBinContent(3, histArray[isam][2]->GetBinContent(3)/2.);
histArray[isam][2]->SetBinError(4, histArray[isam][2]->GetBinError(4)/2.);
histArray[isam][2]->SetBinContent(4, histArray[isam][2]->GetBinContent(4)/2.);
histArray[isam][2]->SetBinError(5, histArray[isam][2]->GetBinError(5)/4.);
histArray[isam][2]->SetBinContent(5, histArray[isam][2]->GetBinContent(5)/4.);
}
if(plotType=="Jet2Pt_Fig19"){
Double_t rebin_array[4] = {0.0, 100.0, 200.0, 600.0};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(3, "temp1", rebin_array);
histArray[isam][0]->SetBinError(3, histArray[isam][0]->GetBinError(3)/4.);
histArray[isam][0]->SetBinContent(3, histArray[isam][0]->GetBinContent(3)/4.);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(3, "temp2", rebin_array);
histArray[isam][1]->SetBinError(3, histArray[isam][1]->GetBinError(3)/4.);
histArray[isam][1]->SetBinContent(3, histArray[isam][1]->GetBinContent(3)/4.);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(3, "temp3", rebin_array);
histArray[isam][2]->SetBinError(3, histArray[isam][2]->GetBinError(3)/4.);
histArray[isam][2]->SetBinContent(3, histArray[isam][2]->GetBinContent(3)/4.);
}
if(plotType=="Lep1Pt_Fig19"){
Double_t rebin_array[6] = {0, 50, 100, 150, 300, 500};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(5, "temp1", rebin_array);
histArray[isam][0]->SetBinError(4, histArray[isam][0]->GetBinError(4)/3.0);
histArray[isam][0]->SetBinContent(4, histArray[isam][0]->GetBinContent(4)/3.0);
histArray[isam][0]->SetBinError(5, histArray[isam][0]->GetBinError(5)/4.0);
histArray[isam][0]->SetBinContent(5, histArray[isam][0]->GetBinContent(5)/4.0);
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(5, "temp2", rebin_array);
histArray[isam][1]->SetBinError(4, histArray[isam][1]->GetBinError(4)/3.0);
histArray[isam][1]->SetBinContent(4, histArray[isam][1]->GetBinContent(4)/3.0);
histArray[isam][1]->SetBinError(5, histArray[isam][1]->GetBinError(5)/4.0);
histArray[isam][1]->SetBinContent(5, histArray[isam][1]->GetBinContent(5)/4.0);
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(5, "temp3", rebin_array);
histArray[isam][2]->SetBinError(4, histArray[isam][2]->GetBinError(4)/3.0);
histArray[isam][2]->SetBinContent(4, histArray[isam][2]->GetBinContent(4)/3.0);
histArray[isam][2]->SetBinError(5, histArray[isam][2]->GetBinError(5)/4.0);
histArray[isam][2]->SetBinContent(5, histArray[isam][2]->GetBinContent(5)/4.0);
}
if(plotType=="Lep2Pt_Fig19"){//check this
//100, 150, 260
Double_t rebin_array[5] = {0.0, 50.0, 100, 150, 260};
histArray[isam][0] = (TH1F*)histArray[isam][0]->Rebin(4, "temp1", rebin_array);
histArray[isam][0]->SetBinError(4, histArray[isam][0]->GetBinError(4)*(5.0/11.0));
histArray[isam][0]->SetBinContent(4, histArray[isam][0]->GetBinContent(4)*(5.0/11.0));
histArray[isam][1] = (TH1F*)histArray[isam][1]->Rebin(4, "temp2", rebin_array);
histArray[isam][1]->SetBinError(4, histArray[isam][1]->GetBinError(4)*(5.0/11.0));
histArray[isam][1]->SetBinContent(4, histArray[isam][1]->GetBinContent(4)*(5.0/11.0));
histArray[isam][2] = (TH1F*)histArray[isam][2]->Rebin(4, "temp3", rebin_array);
histArray[isam][2]->SetBinError(4, histArray[isam][2]->GetBinError(4)*(5.0/11.0));
histArray[isam][2]->SetBinContent(4, histArray[isam][2]->GetBinContent(4)*(5.0/11.0));