-
Notifications
You must be signed in to change notification settings - Fork 1
/
regions.py
127 lines (110 loc) · 4.46 KB
/
regions.py
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
# import awkward as ak
# def get_mask_wmunu1b(cms_events):
# mask_wmunu1b = ( (cms_events.mettrig ) &
# (cms_events.filters) &
# (cms_events.nEleLoose==0 ) &
# #(cms_events.npho==0) &
# (cms_events.metpt>100.) &
# (cms_events.ncleanpho==0) &
# (cms_events.ntau==0) &
# (cms_events.nMuLoose==1) &
# (cms_events.nMuTight==1) &
# (cms_events.delta_met_topmu < 0.5 ) &
# (cms_events.recoil_Wmunu0>250.) &
# (cms_events.min_dphi_jet_met > 0.5) &
# (cms_events.nJetLoose==1 ) &
# (cms_events.nJetTight==1 ) &
# (cms_events.nJetb ==1 ) &
# (cms_events.mt_Wmunu0 >=0 ) & (cms_events.mt_Wmunu0 < 160 )
# )
# return mask_wmunu1b
def get_mask_preselection(cms_events):
mask_preselection = (cms_events.dibjet_mass > 0) & (cms_events.diphoton_mass > 0)
return mask_preselection
#------------------------
def get_mask_selection(cms_events):
mask_selection = (
(cms_events.lead_isScEtaEB == 1)
& (cms_events.sublead_isScEtaEB == 1)
)
return mask_selection
#-----------------
# Check https://btv-wiki.docs.cern.ch/ScaleFactors/Run3Summer22/ for the tagger point score
def get_mask_srbbgg(cms_events): # Pass medium Btag and pass tight photonID
mask_srbbgg = (
(cms_events.lead_pho_mvaID_WP80 == 1) # tight cut mvaID80
& (cms_events.sublead_pho_mvaID_WP80 == 1)
& (cms_events.lead_bjet_PNetB > 0.2605)
& (cms_events.sublead_bjet_PNetB > 0.2605)
& (cms_events.lead_isScEtaEB == 1)
& (cms_events.sublead_isScEtaEB == 1)
# & (
# (
# (cms_events.signal == 0)
# & (
# ((cms_events.diphoton_mass > 130) | (cms_events.diphoton_mass < 90))
# & ((cms_events.dibjet_mass > 130) | (cms_events.dibjet_mass < 90))
# )
# )
# | (
# (cms_events.signal == 1)
# & (cms_events.diphoton_mass > 0)
# & (cms_events.dibjet_mass > 0)
# )
# )
)
return mask_srbbgg
def get_mask_srbbggMET(cms_events):
mask_srbbggMET = (
(cms_events.lead_pho_mvaID_WP80 == 1) # Tight working point(80% efficiency)
& (cms_events.sublead_pho_mvaID_WP80 == 1)
& (cms_events.lead_bjet_PNetB > 0.2605)
& (cms_events.sublead_bjet_PNetB > 0.2605)
& (cms_events.lead_isScEtaEB == 1) # photon in the barrel region
& (cms_events.sublead_isScEtaEB == 1) # photon in the barrel region
& (
(
(cms_events.signal == 0)
& (
((cms_events.diphoton_mass > 130) | (cms_events.diphoton_mass < 90))
& ((cms_events.dibjet_mass > 130) | (cms_events.dibjet_mass < 90))
)
)
| (
(cms_events.signal == 1)
& (cms_events.diphoton_mass > 0)
& (cms_events.dibjet_mass > 0)
)
)
)
return mask_srbbggMET
def get_mask_crantibbgg(cms_events): # Fail medium Btag and pass tight photonID
mask_crantibbgg = (
#(cms_events.lead_pho_mvaID_WP90 == 1)
#& (cms_events.sublead_pho_mvaID_WP90 == 1)
(cms_events.lead_pho_mvaID_WP80 == 1)
& (cms_events.sublead_pho_mvaID_WP80 == 1)
& (cms_events.lead_bjet_PNetB < 0.2605)
& (cms_events.sublead_bjet_PNetB < 0.2605)
& (cms_events.lead_isScEtaEB == 1)
& (cms_events.sublead_isScEtaEB == 1)
)
return mask_crantibbgg
def get_mask_crbbantigg(cms_events): # pass medium Btag, pass loose photonID, and fail tight photonID
mask_crbbantigg = (
(cms_events.lead_pho_mvaID_WP80 == 0)
& (cms_events.sublead_pho_mvaID_WP80 == 0)
& (cms_events.lead_pho_mvaID_WP90 == 1)
& (cms_events.sublead_pho_mvaID_WP90 == 1)
& (
(cms_events.lead_bjet_PNetB > 0.2605)
# & (cms_events.lead_bjet_PNetB > 0.0499)
)
& (
(cms_events.sublead_bjet_PNetB > 0.2605)
# & (cms_events.sublead_bjet_PNetB > 0.0499)
) # Loose btagging score
& (cms_events.lead_isScEtaEB == 1)
& (cms_events.sublead_isScEtaEB == 1)
)
return mask_crbbantigg