-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyzeData_ABCD.C
4258 lines (3709 loc) · 202 KB
/
analyzeData_ABCD.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
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TMath.h"
#include "TRandom3.h"
#include <TTreeReader.h>
#include <TTreeReaderValue.h>
#include <TTreeReaderArray.h>
#include <vector>
#include <map>
#include <fstream> // std::ofstream
R__LOAD_LIBRARY(libTreePlayer)
int getStation(float hitX, float hitY){
float hitR = sqrt(pow(hitX,2)+pow(hitY,2));
if(hitR > 400. && hitR < 480.){ return 1; }
else if(hitR > 485. && hitR < 560.){ return 2; }
else if(hitR > 590. && hitR < 650.){ return 3; }
else if(hitR > 690. && hitR < 800.){ return 4; }
else{ return -1; }
}
int getWheel(float hitZ){
if(hitZ > 0){
if(hitZ < 127.){ return 0; }
else if(hitZ < 395.){ return 1; }
else if(hitZ < 661.){ return 2; }
else{ return -99; }
}
else{
return -1*getWheel(-1.0*hitZ);
}
}
int getRPCLayer(float hitX, float hitY){
float hitR = sqrt(pow(hitX,2)+pow(hitY,2));
if(hitR > 410. && hitR < 440.){ return 1; }
else if(hitR > 445. && hitR < 475.){ return 2; }
else if(hitR > 490. && hitR < 520.){ return 3; }
else if(hitR > 525. && hitR < 555.){ return 4; }
else if(hitR > 600. && hitR < 630.){ return 5; }
else if(hitR > 700. && hitR < 770.){ return 6; }
else{ return -1; }
}
void analyzeData_ABCD(){
TString name;
TString years[3] = {"2018","2017","2016"};
TString runNames[3] = {"17Sept2018_Run2018","Run2017","Run2016"};
TString dates[20] = {"17Sep2018","17Nov2017","07Aug17"};
//TString dir("/mnt/hadoop/store/group/phys_exotica/delayedjets/displacedJetMuonAnalyzer/driftTube/V1p17/Data");
TString dir("/storage/user/mcitron/skims/v3/");
TFile *_ofile = TFile::Open("outData_ABCD_new.root","RECREATE");
TH1D *h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETLow_rpcCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_rpcSpreadCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[4];
TH1D *h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_rpcNoMatch_jetMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcBad_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcNoMatch_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcSpread_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcNegativeSpread_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcNegativeNoSpread_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto[4];
TH1D *h_dtRechitClusterSize_rpcMatch_clusterMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_rpcNoMatch_clusterMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRnoLepton[4];
TH1D *h_dtRechitClusterSize_fullSelection_rpcCR[4];
TH1D *h_dtRechitClusterSize_lowClusterMET_fullSelection_rpcCR[4];
TH1D *h_dtRechitClusterSize_highClusterMET_fullSelection_rpcCR[4];
TH1D *h_dtRechitClusterSize_fullSelection_clusterMETCR[4];
TH1D *h_dtRechitClusterSize_goodRPC_fullSelection_clusterMETCR[4];
TH1D *h_dtRechitClusterSize_badRPC_fullSelection_clusterMETCR[4];
TH1D *h_dtRechitClusterSize_lowClusterMET_lowClusterSize_SR[4];
TH1D *h_dtRechitClusterSize_highClusterMET_lowClusterSize_SR[4];
TH1D *h_dtRechitClusterSize_highClusterMET_highClusterSize_SR[4];
TH1D *h_dPhiClusterRPC_fullVeto[4];
TH1D *h_dZClusterRPC_fullVeto[4];
TH1D *h_rpcSpread_invertedJetVeto[4];
TH1D *h_rpcSpread_invertedJetVeto_muonVeto[4];
TH1D *h_rpcSpread_fullVeto[4];
TH1D *h_rpcSpread_fullVeto_negBx[4];
TH1D *h_nRPCMatched_fullVeto_clusterMETCR[4];
TH1D *h_rpcSpread_fullVeto_clusterMETCR[4];
TH1D *h_rpcBx_fullVeto_clusterMETCR[4];
TH1D *h_dPhiJetMET_fullVeto_clusterMETCR[4];
TH1D *h_dtRechitClusterMaxStation_fullVeto_clusterMETCR[4];
TH1D *h_nRPCMatched_Nminus1_clusterMETCR[4];
TH1D *h_rpcSpread_Nminus1_clusterMETCR[4];
TH1D *h_rpcBx_Nminus1_clusterMETCR[4];
TH1D *h_dPhiJetMET_Nminus1_clusterMETCR[4];
TH1D *h_dtRechitClusterMaxStation_Nminus1_clusterMETCR[4];
TH1D *h_dPhiClusterMET_fullVeto_rpcCR[4];
TH1D *h_dPhiJetMET_fullVeto_rpcCR[4];
TH1D *h_dtRechitClusterMaxStation_fullVeto_rpcCR[4];
TH1D *h_dPhiClusterMET_Nminus1_rpcCR[4];
TH1D *h_dPhiJetMET_Nminus1_rpcCR[4];
TH1D *h_dtRechitClusterMaxStation_Nminus1_rpcCR[4];
TH1D *h_nStations1_50hits_clusterMETCR[4];
TH1D *h_nStations25_50hits_clusterMETCR[4];
TH1D *h_nStations50_50hits_clusterMETCR[4];
TH1D *h_nStations1_100hits_clusterMETCR[4];
TH1D *h_nStations25_100hits_clusterMETCR[4];
TH1D *h_nStations50_100hits_clusterMETCR[4];
TH1D *h_nStations1_150hits_clusterMETCR[4];
TH1D *h_nStations25_150hits_clusterMETCR[4];
TH1D *h_nStations50_150hits_clusterMETCR[4];
TH1D *h_nWheels1_50hits_clusterMETCR[4];
TH1D *h_nWheels25_50hits_clusterMETCR[4];
TH1D *h_nWheels50_50hits_clusterMETCR[4];
TH1D *h_nWheels1_100hits_clusterMETCR[4];
TH1D *h_nWheels25_100hits_clusterMETCR[4];
TH1D *h_nWheels50_100hits_clusterMETCR[4];
TH1D *h_nWheels1_150hits_clusterMETCR[4];
TH1D *h_nWheels25_150hits_clusterMETCR[4];
TH1D *h_nWheels50_150hits_clusterMETCR[4];
TH1D *h_nRPCStations1_50hits_clusterMETCR[4];
TH1D *h_nRPCStations5_50hits_clusterMETCR[4];
TH1D *h_nRPCStations10_50hits_clusterMETCR[4];
TH1D *h_nRPCStations1_100hits_clusterMETCR[4];
TH1D *h_nRPCStations5_100hits_clusterMETCR[4];
TH1D *h_nRPCStations10_100hits_clusterMETCR[4];
TH1D *h_nRPCStations1_150hits_clusterMETCR[4];
TH1D *h_nRPCStations5_150hits_clusterMETCR[4];
TH1D *h_nRPCStations10_150hits_clusterMETCR[4];
TH1D *h_nRPCWheels1_50hits_clusterMETCR[4];
TH1D *h_nRPCWheels5_50hits_clusterMETCR[4];
TH1D *h_nRPCWheels10_50hits_clusterMETCR[4];
TH1D *h_nRPCWheels1_100hits_clusterMETCR[4];
TH1D *h_nRPCWheels5_100hits_clusterMETCR[4];
TH1D *h_nRPCWheels10_100hits_clusterMETCR[4];
TH1D *h_nRPCWheels1_150hits_clusterMETCR[4];
TH1D *h_nRPCWheels5_150hits_clusterMETCR[4];
TH1D *h_nRPCWheels10_150hits_clusterMETCR[4];
TH1D *h_matchedRPCStation_MB3Cluster_clusterMETCR[4];
TH1D *h_matchedRPCStation_MB4Cluster_clusterMETCR[4];
TH1D *h_matchedRPCStation_MB4Cluster_spreadRPC_clusterMETCR[4];
TH1D *h_matchedRPCStation_MB3Cluster_spreadRPC_clusterMETCR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_rpcCR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_rpcCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_rpcCR[4];
TH1D *h_dtRechitClusterJetVetoPt[4];
TH1D *h_dtRechitClusterMuonVetoPt[4];
TH1D *h_dtRechitClusterMB1Veto[4];
TH1D *h_efficiency[4];
TH1D *h_dtRechitClusterNSegmentStation2_dPhiJetMET[4];
TH1D *h_dtRechitClusterNSegmentStation3_dPhiJetMET[4];
TH1D *h_dtRechitClusterNSegmentStation4_dPhiJetMET[4];
TH1D *h_dtRechitClusterNStation_dPhiJetMET[4];
TH1D *h_nDtRechitClusters_dPhiJetMET[4];
TH1D *h_nDtRechitClustersVeto_dPhiJetMET[4];
TH1D *h_dtRechitClustersDR_dPhiJetMET[4];
TH1D *h_dtRechitClustersVetoDR_dPhiJetMET[4];
TH1D *h_dtRechitClusterMaxStation_dPhiJetMET[4];
TH1D *h_dtRechitClusterMaxStationRatio_dPhiJetMET[4];
TH1D *h_dtRechitClusterMaxChamberRatio_dPhiJetMET[4];
TH1D *h_dtRechitClusterNChamber_dPhiJetMET[4];
TH1D *h_dtRechitClusterMaxChamber_dPhiJetMET[4];
TH1D *h_dtRechitClusterX_dPhiJetMET[4];
TH1D *h_dtRechitClusterY_dPhiJetMET[4];
TH1D *h_dtRechitClusterZ_dPhiJetMET[4];
TH1D *h_dtRechitClusterEta_dPhiJetMET[4];
TH1D *h_dtRechitClusterPhi_dPhiJetMET[4];
TH1D *h_dtRechitClusterTime_dPhiJetMET[4];
TH1D *h_dtRechitClusterXSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterYSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterZSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterEtaSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterPhiSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterTimeSpread_dPhiJetMET[4];
TH1D *h_dtRechitClusterMajorAxis_dPhiJetMET[4];
TH1D *h_dtRechitClusterMinorAxis_dPhiJetMET[4];
TH1D *h_nRB1Match_dPhiJetMET[4];
TH1D *h_nRB1Match_MB1Veto_dPhiJetMET[4];
TH1D *h_nMB1MatchAdjacent_dPhiJetMET[4];
TH1D *h_nMB1MatchAdjacent_MB1Veto_dPhiJetMET[4];
TH1D *h_nRB1Match_dPhiClusterMET[4];
TH1D *h_nRB1Match_MB1Veto_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent_MB1Veto_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacentPi2_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacentPi2_MB1Veto_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent0p8_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent0p8_MB1Veto_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent0p8Pi2_dPhiClusterMET[4];
TH1D *h_nMB1MatchAdjacent0p8Pi2_MB1Veto_dPhiClusterMET[4];
TH1D *h_nMB1MatchJet_invertedJetVeto[4];
TH1D *h_matchedJetPt_invertedJetVeto[4];
TH2D *h_matchedJetPt_nMB1Match_invertedJetVeto[4];
TH2D *h_matchedJetPt_nMB1Match_invertedJetVetoNoJetMET[4];
TH2D *h_matchedJetPt_nMB1Match_invertedJetVetoNoClusterMET[4];
TH2D *h_matchedJetPt_nMB1Match_invertedJetVetoLooseMuonNoClusterMET[4];
TH2D *h_matchedJetPt_nMB1Match_invertedJetVetoAllMuonNoClusterMET[4];
TH1D *h_nMB1Match_veryLowdPhiClusterMET_lowClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_lowdPhiClusterMET_lowClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_highdPhiClusterMET_lowClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_veryLowdPhiClusterMET_highClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_lowdPhiClusterMET_highClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_highdPhiClusterMET_highClusterSize_fullSelection_MB1CR[4];
TH1D *h_nMB1Match_veryLowdPhiClusterMET_lowClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_nMB1Match_lowdPhiClusterMET_lowClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_nMB1Match_highdPhiClusterMET_lowClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_nMB1Match_veryLowdPhiClusterMET_highClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_nMB1Match_lowdPhiClusterMET_highClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_nMB1Match_highdPhiClusterMET_highClusterSize_fullSelection_MB1HitsCR[4];
TH2D *h_dPhiClusterMET_nMB1Match_lowClusterSize_fullSelection_MB1HitsCR[4];
TH2D *h_dPhiClusterMET_nMB1Match_lowClusterSize_fullSelection_MB1Hits30CR[4];
TH2D *h_dPhiClusterMET_nMB1Match_lowClusterSize_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH2D *h_dPhiClusterMET_nMB1Match_highClusterSize_fullSelection_MB1HitsCR[4];
TH2D *h_dPhiClusterMET_nMB1Match_highClusterSize_fullSelection_MB1Hits30CR[4];
TH2D *h_dPhiClusterMET_nMB1Match_highClusterSize_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB1CR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB1CR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB1CR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB1CR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHFLeadCut_MB1CR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB1HitsCR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB1HitsCR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB1HitsCR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB1HitsCR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHF50Cut_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionInvertedNHF50Cut_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHFLeadCut_MB1HitsCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithInvertedNHFLeadCut_MB1HitsCR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB1Hits30CR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB1Hits30CR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB1Hits30CR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB1Hits30CR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB1Hits30CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1Hits30CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1Hits30MaxMB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1Hits30MaxMB3CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1Hits30MaxMB4CR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1HitsNoMB1ClusterCR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB2CR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB2CR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB2CR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB2CR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacent0p8MB1Cut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithOtherStationsCut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHF50Cut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionInvertedNHF50Cut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHFLeadCut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithInvertedNHFLeadCut_MB2CR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB2withMB1CR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB2withMB1CR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB2withMB1CR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB2withMB1CR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHF50Cut_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionInvertedNHF50Cut_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHFLeadCut_MB2withMB1CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithInvertedNHFLeadCut_MB2withMB1CR[4];
TH1D *h_dtRechitClusterSize_lowdPhiClusterMET_fullSelection_MB1or2CR[4];
TH1D *h_dtRechitClusterSizeTotal_lowdPhiClusterMET_fullSelection_MB1or2CR[4];
TH1D *h_dtRechitClusterSize_highdPhiClusterMET_fullSelection_MB1or2CR[4];
TH1D *h_dPhiClusterMET_lowClusterSize_fullSelection_MB1or2CR[4];
TH1D *h_dPhiClusterMET_highClusterSize_fullSelection_MB1or2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_MB1or2CR[4];
TH1D *h_nMatchedHitsMB2_fullSelection_SRMB3[4];
TH1D *h_nMatchedHitsMB4_fullSelection_SRMB3[4];
TH1D *h_nMatchedHitsMB2and4_lowClusterSize_fullSelection_SRMB3[4];
TH1D *h_nMatchedHitsMB2and4_highClusterSize_fullSelection_SRMB3[4];
TH1D *h_nMatchedHitsMB2_fullSelection_SRMB4[4];
TH1D *h_nMatchedHitsMB3_fullSelection_SRMB4[4];
TH1D *h_nMatchedHitsMB2and3_lowClusterSize_fullSelection_SRMB4[4];
TH1D *h_nMatchedHitsMB2and3_highClusterSize_fullSelection_SRMB4[4];
TH1D *h_nMatchedHitsMB3_fullSelection_MB2CR[4];
TH1D *h_nMatchedHitsMB4_fullSelection_MB2CR[4];
TH1D *h_nMatchedHitsMB3and4_lowClusterSize_fullSelection_MB2CR[4];
TH1D *h_nMatchedHitsMB3and4_highClusterSize_fullSelection_MB2CR[4];
TH1D *h_nMatchedHitsMB2_fullSelectionWithAdjacentMB1Cut_SRMB3[4];
TH1D *h_nMatchedHitsMB4_fullSelectionWithAdjacentMB1Cut_SRMB3[4];
TH1D *h_nMatchedHitsMB2and4_lowClusterSize_fullSelectionWithAdjacentMB1Cut_SRMB3[4];
TH1D *h_nMatchedHitsMB2and4_highClusterSize_fullSelectionWithAdjacentMB1Cut_SRMB3[4];
TH1D *h_nMatchedHitsMB2_fullSelectionWithAdjacentMB1Cut_SRMB4[4];
TH1D *h_nMatchedHitsMB3_fullSelectionWithAdjacentMB1Cut_SRMB4[4];
TH1D *h_nMatchedHitsMB2and3_lowClusterSize_fullSelectionWithAdjacentMB1Cut_SRMB4[4];
TH1D *h_nMatchedHitsMB2and3_highClusterSize_fullSelectionWithAdjacentMB1Cut_SRMB4[4];
TH1D *h_nMatchedHitsMB3_fullSelectionWithAdjacentMB1Cut_MB2CR[4];
TH1D *h_nMatchedHitsMB4_fullSelectionWithAdjacentMB1Cut_MB2CR[4];
TH1D *h_nMatchedHitsMB3and4_lowClusterSize_fullSelectionWithAdjacentMB1Cut_MB2CR[4];
TH1D *h_nMatchedHitsMB3and4_highClusterSize_fullSelectionWithAdjacentMB1Cut_MB2CR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_SRMB3[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelection_SRMB4[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacent0p8MB1Cut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_SRMB3[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithAdjacentMB1Cut_SRMB4[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithOtherStationsCut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithOtherStationsCut_SRMB3[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithOtherStationsCut_SRMB4[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHF50Cut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionInvertedNHF50Cut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithNHFLeadCut_SR[4];
TH2D *h_dtRechitClusterSize_dPhiClusterMET_fullSelectionWithInvertedNHFLeadCut_SR[4];
TH1D *h_dtRechitClusterSize_SRhighNHF[4];
TH1D *h_MET_SRhighNHF[4];
TH1D *h_dPhiClusterMET_SRhighNHF[4];
TH1D *h_dtRechitClusterSize_MB2CRhighNHF[4];
TH1D *h_MET_MB2CRhighNHF[4];
TH1D *h_dPhiClusterMET_MB2CRhighNHF[4];
TH1D *h_dtRechitClusterSize_MB1CRhighNHF[4];
TH1D *h_MET_MB1CRhighNHF[4];
TH1D *h_dPhiClusterMET_MB1CRhighNHF[4];
TH1D *h_dtRechitClusterSize_MB2withMB1CRhighNHF[4];
TH1D *h_MET_MB2withMB1CRhighNHF[4];
TH1D *h_dPhiClusterMET_MB2withMB1CRhighNHF[4];
TH1D *h_dtRechitClusterSize_MB1HitsCRhighNHF[4];
TH1D *h_MET_MB1HitsCRhighNHF[4];
TH1D *h_dPhiClusterMET_MB1HitsCRhighNHF[4];
TH1D *h_dtRechitClusterSize_SRlowNHF[4];
TH1D *h_MET_SRlowNHF[4];
TH1D *h_dPhiClusterMET_SRlowNHF[4];
TH1D *h_dtRechitClusterSize_MB2CRlowNHF[4];
TH1D *h_MET_MB2CRlowNHF[4];
TH1D *h_dPhiClusterMET_MB2CRlowNHF[4];
TH1D *h_dtRechitClusterSize_MB1CRlowNHF[4];
TH1D *h_MET_MB1CRlowNHF[4];
TH1D *h_dPhiClusterMET_MB1CRlowNHF[4];
TH1D *h_dtRechitClusterSize_MB2withMB1CRlowNHF[4];
TH1D *h_MET_MB2withMB1CRlowNHF[4];
TH1D *h_dPhiClusterMET_MB2withMB1CRlowNHF[4];
TH1D *h_dtRechitClusterSize_MB1HitsCRlowNHF[4];
TH1D *h_MET_MB1HitsCRlowNHF[4];
TH1D *h_dPhiClusterMET_MB1HitsCRlowNHF[4];
std::vector<TString> selsStrings = {"oneCluster_lowNHF","oneVetoCluster_lowNHF","oneCluster_highNHF","oneVetoCluster_highNHF"};
std::map<const TString, TH1D*> runNumHists;
std::map<const TString, TH1D*> etaClusterHists;
std::map<const TString, TH1D*> phiClusterHists;
std::map<const TString, TH2D*> etaPhiClusterHists;
TH1D *h_MET_highNHF[4];
TH1D *h_MET_oneCluster_highNHF[4];
TH1D *h_MET_oneVetoCluster_highNHF[4];
TH1D *h_MET_lowNHF[4];
TH1D *h_MET_oneCluster_lowNHF[4];
TH1D *h_MET_oneVetoCluster_lowNHF[4];
TH1D *h_leadJetPt_highNHF[4];
TH1D *h_leadJetPt_oneCluster_highNHF[4];
TH1D *h_leadJetPt_lowNHF[4];
TH1D *h_leadJetPt_oneCluster_lowNHF[4];
TH1D *h_leadJetPt_oneVetoCluster_highNHF[4];
TH1D *h_leadJetPt_oneVetoCluster_lowNHF[4];
TH1D *h_leadJetPt_MB1CR[4];
TH1D *h_leadJetPt_MB2withMB1CR[4];
TH1D *h_leadJetPt_MB1HitsCR[4];
TH1D *h_leadJetPt_MB2CR[4];
TH1D *h_leadJetPt_SR[4];
TH1D *h_leadJetPtMET_highNHF[4];
TH1D *h_leadJetPtMET_oneCluster_highNHF[4];
TH1D *h_leadJetPtMET_lowNHF[4];
TH1D *h_leadJetPtMET_oneCluster_lowNHF[4];
TH1D *h_leadJetPtMET_oneVetoCluster_highNHF[4];
TH1D *h_leadJetPtMET_oneVetoCluster_lowNHF[4];
TH1D *h_leadJetPtMET_MB1CR[4];
TH1D *h_leadJetPtMET_MB2withMB1CR[4];
TH1D *h_leadJetPtMET_MB1HitsCR[4];
TH1D *h_leadJetPtMET_MB2CR[4];
TH1D *h_leadJetPtMET_SR[4];
TH1D *h_rpcBxMedian_MB1CR[4];
TH1D *h_rpcBxMedian_MB2CR[4];
TH1D *h_rpcBxMedian_MB2withMB1CR[4];
TH1D *h_rpcBxMedian_SR[4];
TH1D *h_rpcBxMedian_MB1HitsCR[4];
TH1D *h_jetNeutralHadronicEnergyFraction_passJetMET[4];
TH1D *h_jetNeutralHadronicEnergyFraction_passStationsWheels[4];
TH1D *h_jetNeutralHadronicEnergyFraction_SR[4];
TH1D *h_jetChargedHadronicEnergyFraction_passJetMET[4];
TH1D *h_jetChargedHadronicEnergyFraction_passStationsWheels[4];
TH1D *h_jetChargedHadronicEnergyFraction_SR[4];
TH1D *h_jetNeutralEMEnergyFraction_passJetMET[4];
TH1D *h_jetNeutralEMEnergyFraction_passStationsWheels[4];
TH1D *h_jetNeutralEMEnergyFraction_SR[4];
TH1D *h_jetChargedEMEnergyFraction_passJetMET[4];
TH1D *h_jetChargedEMEnergyFraction_passStationsWheels[4];
TH1D *h_jetChargedEMEnergyFraction_SR[4];
TH1D *h_jetChargedEMEnergyFraction_MB2CR[4];
TH1D *h_jetChargedEMEnergyFraction_MB2withMB1CR[4];
TH1D *h_jetChargedEMEnergyFraction_MB1CR[4];
TH1D *h_jetChargedEMEnergyFraction_MB1HitsCR[4];
TH1D *h_jetNeutralEMEnergyFraction_MB2CR[4];
TH1D *h_jetNeutralEMEnergyFraction_MB2withMB1CR[4];
TH1D *h_jetNeutralEMEnergyFraction_MB1CR[4];
TH1D *h_jetNeutralEMEnergyFraction_MB1HitsCR[4];
TH1D *h_jetChargedHadronicEnergyFraction_MB2CR[4];
TH1D *h_jetChargedHadronicEnergyFraction_MB2withMB1CR[4];
TH1D *h_jetChargedHadronicEnergyFraction_MB1CR[4];
TH1D *h_jetChargedHadronicEnergyFraction_MB1HitsCR[4];
TH1D *h_jetNeutralHadronicEnergyFraction_MB2CR[4];
TH1D *h_jetNeutralHadronicEnergyFraction_MB2withMB1CR[4];
TH1D *h_jetNeutralHadronicEnergyFraction_MB1CR[4];
TH1D *h_jetNeutralHadronicEnergyFraction_MB1HitsCR[4];
TH1D *h_leadingJetChargedEMEnergyFraction_passStationsWheels[4];
TH1D *h_leadingJetChargedEMEnergyFraction_SR[4];
TH1D *h_leadingJetNeutralEMEnergyFraction_passStationsWheels[4];
TH1D *h_leadingJetNeutralEMEnergyFraction_SR[4];
TH1D *h_leadingJetChargedHadronicEnergyFraction_passStationsWheels[4];
TH1D *h_leadingJetChargedHadronicEnergyFraction_SR[4];
TH1D *h_leadingJetNeutralHadronicEnergyFraction_passStationsWheels[4];
TH1D *h_leadingJetNeutralHadronicEnergyFraction_SR[4];
Double_t dtR = 0.0;
Double_t dPhi_tmp = 0.0;
Double_t dPhi_min = 0.0;
Double_t dPhi_min_invertedJet = 0.0;
Double_t dPhiClusterRPC = 0.0;
Double_t dZClusterRPC = 0.0;
Double_t dPhiClusterMET_max = 0.0;
Double_t dPhiClusterMET = 0.0;
vector<Int_t> rpcBx = {};
vector<Int_t> rpcMatchStation = {};
Int_t rpcSpread = 0;
Double_t rpcMedian = 0;
Double_t chargedHadFraction_mindPhi = 0.0;
Double_t chargedEMFraction_mindPhi = 0.0;
Double_t neutralHadFraction_mindPhi = 0.0;
Double_t neutralEMFraction_mindPhi = 0.0;
vector<Double_t> clusterEta = {};
vector<Double_t> clusterPhi = {};
vector<Int_t> clusterSize = {};
Int_t clusterSizeTotal = 0;
Int_t nClustersVeto_dPhiJetMET = 0;
Int_t evtNum = 0;
Bool_t HLT = false;
Bool_t goodInvertedJet = false;
Bool_t passMuon = false;
Bool_t passMuonLoose = false;
Bool_t passMuon_alt = false;
Bool_t passMB1 = false;
Bool_t passJet = false;
Bool_t passMET = false;
Bool_t passOneJet = false;
Bool_t passJetMET = false;
Bool_t passNHFJet50 = false;
Bool_t passNHFJetLead = false;
Bool_t passStations25 = false;
Bool_t passWheels25 = false;
Bool_t passJetVeto = false;
Bool_t passMuonVeto = false;
Bool_t passMuonVetoLoose = false;
Bool_t passRpcMatch = false;
Bool_t passRpcMatchMB1CRwithNHFLead = false;
Bool_t passRpcMatchMB1HitsCR = false;
Bool_t passRpcMatchMB1HitsCRwithAdjacent = false;
Bool_t passRpcMatchMB1HitsCRwithAdjacent0p8 = false;
Bool_t passRpcMatchMB1HitsCRwithNHF50 = false;
Bool_t passRpcMatchMB1HitsCRinvertedNHF50 = false;
Bool_t passRpcMatchMB1HitsCRwithNHFLead = false;
Bool_t passRpcMatchMB1HitsCRinvertedNHFLead = false;
Bool_t passRpcMatchMB1Hits30CR = false;
Bool_t passRpcMatchMB1Hits30MaxMB2CR = false;
Bool_t passRpcMatchMB1Hits30MaxMB3CR = false;
Bool_t passRpcMatchMB1Hits30MaxMB4CR = false;
Bool_t passRpcMatchMB1HitsNoMB1ClusterCR = false;
Bool_t passRpcMatchMB1or2CR = false;
Bool_t passRpcMatchMB2CR = false;
Bool_t passRpcMatchMB2CRwithAdjacent = false;
Bool_t passRpcMatchMB2CRwithAdjacent0p8 = false;
Bool_t passRpcMatchMB2CRwithOther = false;
Bool_t passRpcMatchMB2CRwithNHF50 = false;
Bool_t passRpcMatchMB2CRinvertedNHF50 = false;
Bool_t passRpcMatchMB2CRwithNHFLead = false;
Bool_t passRpcMatchMB2CRinvertedNHFLead = false;
Bool_t passRpcMatchMB2withMB1CR = false;
Bool_t passRpcMatchMB2withMB1CRwithAdjacent = false;
Bool_t passRpcMatchMB2withMB1CRwithNHF50 = false;
Bool_t passRpcMatchMB2withMB1CRinvertedNHF50 = false;
Bool_t passRpcMatchMB2withMB1CRwithNHFLead = false;
Bool_t passRpcMatchMB2withMB1CRinvertedNHFLead = false;
Bool_t passMB1Veto = false;
Bool_t passMaxStation = false;
Bool_t passClusterMET = false;
Bool_t passRPCMatch = false;
Bool_t passRPCSpread = false;
Bool_t passRPCBx = false;
Bool_t passNoVetoCluster = false;
Bool_t passClusterSize = false;
Bool_t passMB1CR = false;
Int_t clusterSizeMB1CR = 0;
Double_t dPhiClusterMETMB1CR = 0.0;
Int_t clusterSizeMB1CRwithNHFLead = 0;
Double_t dPhiClusterMETMB1CRwithNHFLead = 0.0;
Int_t clusterSizeMB1HitsCR = 0;
Double_t dPhiClusterMETMB1HitsCR = 0.0;
Int_t clusterSizeMB1HitsCRwithAdjacent = 0;
Double_t dPhiClusterMETMB1HitsCRwithAdjacent = 0.0;
Int_t clusterSizeMB1HitsCRwithNHF50 = 0;
Double_t dPhiClusterMETMB1HitsCRwithNHF50 = 0.0;
Int_t clusterSizeMB1HitsCRinvertedNHF50 = 0;
Double_t dPhiClusterMETMB1HitsCRinvertedNHF50 = 0.0;
Int_t clusterSizeMB1HitsCRwithNHFLead = 0;
Double_t dPhiClusterMETMB1HitsCRwithNHFLead = 0.0;
Int_t clusterSizeMB1HitsCRinvertedNHFLead = 0;
Double_t dPhiClusterMETMB1HitsCRinvertedNHFLead = 0.0;
Int_t clusterSizeMB1Hits30CR = 0;
Double_t dPhiClusterMETMB1Hits30CR = 0.0;
Int_t clusterSizeMB1Hits30MaxMB2CR = 0;
Double_t dPhiClusterMETMB1Hits30MaxMB2CR = 0.0;
Int_t clusterSizeMB1Hits30MaxMB3CR = 0;
Double_t dPhiClusterMETMB1Hits30MaxMB3CR = 0.0;
Int_t clusterSizeMB1Hits30MaxMB4CR = 0;
Double_t dPhiClusterMETMB1Hits30MaxMB4CR = 0.0;
Int_t clusterSizeMB1HitsNoMB1ClusterCR = 0;
Double_t dPhiClusterMETMB1HitsNoMB1ClusterCR = 0.0;
Int_t clusterSizeMB1or2CR = 0;
Double_t dPhiClusterMETMB1or2CR = 0.0;
Int_t clusterSizeMB2CR = 0;
Double_t dPhiClusterMETMB2CR = 0.0;
Int_t clusterSizeMB2CRwithAdjacent = 0;
Double_t dPhiClusterMETMB2CRwithAdjacent = 0.0;
Int_t clusterSizeMB2CRwithAdjacent0p8 = 0;
Double_t dPhiClusterMETMB2CRwithAdjacent0p8 = 0.0;
Int_t clusterSizeMB2CRwithOther = 0;
Double_t dPhiClusterMETMB2CRwithOther = 0.0;
Int_t clusterSizeMB2CRwithNHF50 = 0;
Double_t dPhiClusterMETMB2CRwithNHF50 = 0.0;
Int_t clusterSizeMB2CRinvertedNHF50 = 0;
Double_t dPhiClusterMETMB2CRinvertedNHF50 = 0.0;
Int_t clusterSizeMB2CRwithNHFLead = 0;
Double_t dPhiClusterMETMB2CRwithNHFLead = 0.0;
Int_t clusterSizeMB2CRinvertedNHFLead = 0;
Double_t dPhiClusterMETMB2CRinvertedNHFLead = 0.0;
Int_t clusterSizeMB2withMB1CR = 0;
Double_t dPhiClusterMETMB2withMB1CR = 0.0;
Int_t clusterSizeMB2withMB1CRwithAdjacent = 0;
Double_t dPhiClusterMETMB2withMB1CRwithAdjacent = 0.0;
Int_t clusterSizeMB2withMB1CRwithNHF50 = 0;
Double_t dPhiClusterMETMB2withMB1CRwithNHF50 = 0.0;
Int_t clusterSizeMB2withMB1CRinvertedNHF50 = 0;
Double_t dPhiClusterMETMB2withMB1CRinvertedNHF50 = 0.0;
Int_t clusterSizeMB2withMB1CRwithNHFLead = 0;
Double_t dPhiClusterMETMB2withMB1CRwithNHFLead = 0.0;
Int_t clusterSizeMB2withMB1CRinvertedNHFLead = 0;
Double_t dPhiClusterMETMB2withMB1CRinvertedNHFLead = 0.0;
Int_t nPassMET = 0;
Int_t nPassOneJet = 0;
Int_t nPassNoVetoCluster = 0;
Int_t nPassJetMET = 0;
Int_t nPassStations25 = 0;
Int_t nPassWheels25 = 0;
Int_t nPassMB1CR = 0;
Int_t nPassJetVeto = 0;
Int_t nPassMuonVeto = 0;
Int_t nPassMuonVetoLoose = 0;
Int_t nPassRpcMatch = 0;
Int_t nPassHighClusterMETMB1CR = 0;
Int_t nPassHighClusterMETHighClusterSizeMB1CR = 0;
Int_t nPassHighClusterMETLowClusterSizeMB1CR = 0;
Int_t nPassLowClusterMETMB1CR = 0;
Int_t nPassLowClusterMETHighClusterSizeMB1CR = 0;
Int_t nPassLowClusterMETLowClusterSizeMB1CR = 0;
Int_t nPassHighClusterMETMB1HitsCR = 0;
Int_t nPassHighClusterMETHighClusterSizeMB1HitsCR = 0;
Int_t nPassHighClusterMETLowClusterSizeMB1HitsCR = 0;
Int_t nPassLowClusterMETMB1HitsCR = 0;
Int_t nPassLowClusterMETHighClusterSizeMB1HitsCR = 0;
Int_t nPassLowClusterMETLowClusterSizeMB1HitsCR = 0;
Int_t nPassCluster_JetMET_StationsWheels_InvertedJet = 0;
Int_t nPassMaxStation_InvertedJet = 0;
Int_t nPassMuonVeto_InvertedJet = 0;
Int_t nPassRpcMatch_InvertedJet = 0;
Int_t nPassInvertedJetVeto_InvertedJet = 0;
Int_t nPassdPhiClusterMET_InvertedJet = 0;
Int_t nPassClusterSize_InvertedJet = 0;
Int_t nPassLooseMuonVeto_InvertedJet = 0;
Int_t nPassRpcMatch_InvertedJetLooseMuon = 0;
Int_t nPassInvertedJetVeto_InvertedJetLooseMuon = 0;
Int_t nPassdPhiClusterMET_InvertedJetLooseMuon = 0;
Int_t nPassClusterSize_InvertedJetLooseMuon = 0;
Bool_t passClusterCR = false;
Bool_t passNoVeto_clusterCR = false;
Bool_t passFullVeto_clusterCR = false;
Bool_t passRPCMatch_clusterCR = false;
Bool_t passRPCSpread_clusterCR = false;
Bool_t passRPCBx_clusterCR = false;
Bool_t passMaxStation_clusterCR = false;
Bool_t passLepton_clusterCR = false;
Bool_t pass50Hits_clusterCR = false;
Bool_t pass25Hits_clusterCR = false;
Bool_t passNoVeto = false;
Bool_t passFullVeto_rpcCR = false;
Bool_t passRPCCR = false;
Bool_t passClusterMET_rpcCR = false;
Bool_t passJetMET_rpcCR = false;
Bool_t passMaxStation_rpcCR = false;
Bool_t passLepton_rpcCR = false;
Bool_t pass50Hits_rpcCR = false;
Bool_t pass25Hits_rpcCR = false;
Bool_t passFullPlus = false;
Int_t nPassClusterCR = 0;
Int_t nPassNoVeto_clusterCR = 0;
Int_t nPassFullVeto_clusterCR = 0;
Int_t nPassRPCMatch_clusterCR = 0;
Int_t nPassRPCSpread_clusterCR = 0;
Int_t nPassRPCBx_clusterCR = 0;
Int_t nPassMaxStation_clusterCR = 0;
Int_t nPassLepton_clusterCR = 0;
Int_t nPass50Hits_clusterCR = 0;
Int_t nPass25Hits_clusterCR = 0;
Int_t nPassNoVeto = 0;
Int_t nPassFullVeto_rpcCR = 0;
Int_t nPassRPCCR = 0;
Int_t nPassClusterMET_rpcCR = 0;
Int_t nPassJetMET_rpcCR = 0;
Int_t nPassMaxStation_rpcCR = 0;
Int_t nPassLepton_rpcCR = 0;
Int_t nPass50Hits_rpcCR = 0;
Int_t nPass25Hits_rpcCR = 0;
Int_t nPassFullPlus = 0;
Int_t passLowClusterMET_rpcCR = false;
Int_t passHighClusterMET_rpcCR = false;
Int_t passLowClusterMET_LowClusterSize = false;
Int_t passHighClusterMET_LowClusterSize = false;
Int_t passHighClusterMET_HighClusterSize = false;
Int_t SRyieldA = 0;
Int_t SRyieldB = 0;
Int_t SRyieldC = 0;
Bool_t passABCD = false;
Bool_t passABCDwithAdjacent = false;
Bool_t passABCDwithAdjacent0p8 = false;
Bool_t passABCDwithOther = false;
Bool_t passABCDwithNHF50 = false;
Bool_t passABCDinvertedNHF50 = false;
Bool_t passABCDwithNHFLead = false;
Bool_t passABCDinvertedNHFLead = false;
Int_t clusterSizeSR = 0;
Double_t dPhiClusterMETSR = 0.0;
Int_t clusterSizeSRwithAdjacent = 0;
Double_t dPhiClusterMETSRwithAdjacent = 0.0;
Int_t clusterSizeSRwithAdjacent0p8 = 0;
Double_t dPhiClusterMETSRwithAdjacent0p8 = 0.0;
Int_t clusterSizeSRwithOther = 0;
Double_t dPhiClusterMETSRwithOther = 0.0;
Int_t clusterSizeSRwithNHF50 = 0;
Double_t dPhiClusterMETSRwithNHF50 = 0.0;
Int_t clusterSizeSRinvertedNHF50 = 0;
Double_t dPhiClusterMETSRinvertedNHF50 = 0.0;
Int_t clusterSizeSRwithNHFLead = 0;
Double_t dPhiClusterMETSRwithNHFLead = 0.0;
Int_t clusterSizeSRinvertedNHFLead = 0;
Double_t dPhiClusterMETSRinvertedNHFLead = 0.0;
Int_t maxStationSR = 0;
Int_t maxStationSRwithAdjacent = 0;
Int_t maxStationSRwithOther = 0;
ofstream eventListInvertedJet;
eventListInvertedJet.open("events/invertedJet_events.txt");
ofstream eventListMB1;
eventListMB1.open("events/MB1CR_tailEvents.txt");
ofstream eventListRPC;
eventListRPC.open("events/rpcCR_tailEvents.txt");
Int_t event100_rpc = 0;
Int_t event150_rpc = 0;
ofstream eventListClusterMET;
eventListClusterMET.open("events/clusterMETCR_tailEvents.txt");
Int_t event100_clusterMET = 0;
Int_t event150_clusterMET = 0;
ofstream eventListSRB;
eventListSRB.open("events/regionB_events.txt");
ofstream eventListMB2CR;
eventListMB2CR.open("events/MB2CR_highClusterSize.txt");
ofstream eventListAdjacentMB1;
eventListAdjacentMB1.open("events/AdjacentMB1Hits_events.txt");
ofstream eventListInvertedJetIDSR;
eventListInvertedJetIDSR.open("events/invertedJetID_SRevents.txt");
ofstream eventListInvertedJetIDABC;
eventListInvertedJetIDABC.open("events/invertedJetID_ABCevents.txt");
Int_t nStations1 = 0;
Int_t nStations25 = 0;
Int_t nStations50 = 0;
Int_t hitStation1 = 0;
Int_t hitStation2 = 0;
Int_t hitStation3 = 0;
Int_t hitStation4 = 0;
Int_t nWheels1 = 0;
Int_t nWheels25 = 0;
Int_t nWheels50 = 0;
Int_t hitWheelm1 = 0;
Int_t hitWheelm2 = 0;
Int_t hitWheel0 = 0;
Int_t hitWheel1 = 0;
Int_t hitWheel2 = 0;
Int_t nRPCStations1 = 0;
Int_t nRPCStations5 = 0;
Int_t nRPCStations10 = 0;
Int_t hitRPCStation1 = 0;
Int_t hitRPCStation2 = 0;
Int_t hitRPCStation3 = 0;
Int_t hitRPCStation4 = 0;
Int_t nRPCWheels1 = 0;
Int_t nRPCWheels5 = 0;
Int_t nRPCWheels10 = 0;
Int_t hitRPCWheelm1 = 0;
Int_t hitRPCWheelm2 = 0;
Int_t hitRPCWheel0 = 0;
Int_t hitRPCWheel1 = 0;
Int_t hitRPCWheel2 = 0;
Int_t rpcStation = 99;
Int_t rpcWheel = 99;
Int_t dtStation = 99;
Int_t dtWheel = 99;
Int_t maxClusterSize = 0;
Int_t maxGoodClusterSize = 0;
Int_t hitsMB1 = 0;
Int_t nMB1MatchCluster = 0;
Int_t nMB2MatchCluster = 0;
Int_t nMB3MatchCluster = 0;
Int_t nMB4MatchCluster = 0;
Int_t nMB1MatchClusterMB1CR = 0;
Int_t nMB1MatchClusterMB1HitsCR = 0;
Int_t nMB1MatchClusterMB1Hits30CR = 0;
Int_t nMB1MatchClusterMB1HitsNoMB1ClusterCR = 0;
Int_t nMB1MatchClusterMB1or2CR = 0;
Int_t nMB1MatchClusterMB2CR = 0;
Int_t nMB1MatchClusterMB2withMB1CR = 0;
Int_t nMB1MatchClusterAdjacentPlus = 0;
Int_t nMB1MatchClusterAdjacentMinus = 0;
Int_t nMB1MatchClusterAdjacent0p8Plus = 0;
Int_t nMB1MatchClusterAdjacent0p8Minus = 0;
Int_t nMB1MatchPi2AdjacentPlus = 0;
Int_t nMB1MatchPi2AdjacentMinus = 0;
Int_t nMB1MatchPi2Adjacent0p8Plus = 0;
Int_t nMB1MatchPi2Adjacent0p8Minus = 0;
Int_t nRB1MatchCluster = 0;
Int_t invertedJetMB1 = 0;
TRandom3 *rand = new TRandom3();
Int_t pmRand = 0;
for(Int_t itr_year=0; itr_year<3; itr_year++){
TString year = years[itr_year];
name = "h_dtRechitClusterNSegmentStation2_dPhiJetMET_"+year;
h_dtRechitClusterNSegmentStation2_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterNSegmentStation3_dPhiJetMET_"+year;
h_dtRechitClusterNSegmentStation3_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterNSegmentStation4_dPhiJetMET_"+year;
h_dtRechitClusterNSegmentStation4_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterMaxStation_dPhiJetMET_"+year;
h_dtRechitClusterMaxStation_dPhiJetMET[itr_year] = new TH1D(name,"",5,0,5);
name = "h_dtRechitClusterNStation_dPhiJetMET_"+year;
h_dtRechitClusterNStation_dPhiJetMET[itr_year] = new TH1D(name,"",5,0,5);
name = "h_nDtRechitClusters_dPhiJetMET_"+year;
h_nDtRechitClusters_dPhiJetMET[itr_year] = new TH1D(name,"",5,0,5);
name = "h_nDtRechitClustersVeto_dPhiJetMET_"+year;
h_nDtRechitClustersVeto_dPhiJetMET[itr_year] = new TH1D(name,"",5,0,5);
name = "h_dtRechitClustersDR_dPhiJetMET_"+year;
h_dtRechitClustersDR_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,2);
name = "h_dtRechitClustersVetoDR_dPhiJetMET_"+year;
h_dtRechitClustersVetoDR_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,2);
name = "h_dtRechitClusterMaxStationRatio_dPhiJetMET_"+year;
h_dtRechitClusterMaxStationRatio_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,1);
name = "h_dtRechitClusterMaxChamberRatio_dPhiJetMET_"+year;
h_dtRechitClusterMaxChamberRatio_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,1);
name = "h_dtRechitClusterNChamber_dPhiJetMET_"+year;
h_dtRechitClusterNChamber_dPhiJetMET[itr_year] = new TH1D(name,"",6,0,6);
name = "h_dtRechitClusterMaxChamber_dPhiJetMET_"+year;
h_dtRechitClusterMaxChamber_dPhiJetMET[itr_year] = new TH1D(name,"",6,0,6);
name = "h_dtRechitClusterX_dPhiJetMET_"+year;
h_dtRechitClusterX_dPhiJetMET[itr_year] = new TH1D(name,"",100,-800,800);
name = "h_dtRechitClusterY_dPhiJetMET_"+year;
h_dtRechitClusterY_dPhiJetMET[itr_year] = new TH1D(name,"",100,-800,800);
name = "h_dtRechitClusterZ_dPhiJetMET_"+year;
h_dtRechitClusterZ_dPhiJetMET[itr_year] = new TH1D(name,"",100,-600,600);
name = "h_dtRechitClusterEta_dPhiJetMET_"+year;
h_dtRechitClusterEta_dPhiJetMET[itr_year] = new TH1D(name,"",50,-1.5,1.5);
name = "h_dtRechitClusterPhi_dPhiJetMET_"+year;
h_dtRechitClusterPhi_dPhiJetMET[itr_year] = new TH1D(name,"",100,-3.5,3.5);
name = "h_dtRechitClusterTime_dPhiJetMET_"+year;
h_dtRechitClusterTime_dPhiJetMET[itr_year] = new TH1D(name,"",50,300,800);
name = "h_dtRechitClusterXSpread_dPhiJetMET_"+year;
h_dtRechitClusterXSpread_dPhiJetMET[itr_year] = new TH1D(name,"",100,0,500);
name = "h_dtRechitClusterYSpread_dPhiJetMET_"+year;
h_dtRechitClusterYSpread_dPhiJetMET[itr_year] = new TH1D(name,"",100,0,500);
name = "h_dtRechitClusterZSpread_dPhiJetMET_"+year;
h_dtRechitClusterZSpread_dPhiJetMET[itr_year] = new TH1D(name,"",100,0,140);
name = "h_dtRechitClusterEtaSpread_dPhiJetMET_"+year;
h_dtRechitClusterEtaSpread_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,0.5);
name = "h_dtRechitClusterPhiSpread_dPhiJetMET_"+year;
h_dtRechitClusterPhiSpread_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,1);
name = "h_dtRechitClusterTimeSpread_dPhiJetMET_"+year;
h_dtRechitClusterTimeSpread_dPhiJetMET[itr_year] = new TH1D(name,"",100,0,150);
name = "h_dtRechitClusterMajorAxis_dPhiJetMET_"+year;
h_dtRechitClusterMajorAxis_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,1);
name = "h_dtRechitClusterMinorAxis_dPhiJetMET_"+year;
h_dtRechitClusterMinorAxis_dPhiJetMET[itr_year] = new TH1D(name,"",50,0,1);
name = "h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiJetMETLow_rpcCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETLow_rpcSpreadCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETLow_rpcSpreadCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETHigh_rpcSpreadCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiJetMETLow_rpcCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiJetMETLow_rpcCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiJetMETHigh_rpcCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiClusterMETLow_rpcCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiClusterMETHigh_rpcCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcMatch_jetMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcNoMatch_jetMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiClusterMETLow_jetMETCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRnoLepton_"+year;
h_dtRechitClusterSize_dPhiClusterMETHigh_jetMETCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton_"+year;
h_dtRechitClusterSize_rpcMatch_jetMETCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcNoMatch_jetMETCRnoLepton_"+year;
h_dtRechitClusterSize_rpcNoMatch_jetMETCRnoLepton[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiJetMETLow_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_dPhiJetMETHigh_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcGood_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcBad_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcBad_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcMatch_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcNoMatch_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcNoMatch_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcSpread_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcSpread_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcNoSpread_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);
name = "h_dtRechitClusterSize_rpcNegativeSpread_clusterMETCRmuonVeto_"+year;
h_dtRechitClusterSize_rpcNegativeSpread_clusterMETCRmuonVeto[itr_year] = new TH1D(name,"",50,0,500);