Skip to content

Commit

Permalink
add jetvetomap by default
Browse files Browse the repository at this point in the history
  • Loading branch information
cmantill committed Oct 10, 2024
1 parent 1f80c03 commit 21611d4
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions boostedhiggs/hwwprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,22 +357,16 @@ def process(self, events: ak.Array):

ht = ak.sum(jets.pt, axis=1)

loose_jet_selector = (
(jets.pt > 15)
& jets.isTight
& ((jets.pt >= 50) | ((jets.pt < 50) & (jets.puId & 2) == 2))
& (jets.neEmEF < 0.9) # neutral energy fraction
)
vetomapjets = jets[loose_jet_selector]
_, cut_jetveto = get_JetVetoMap(vetomapjets, self._year)

jet_selector = (
(jets.pt > 30)
(jets.pt > 15)
& (abs(jets.eta) < 5.0)
& jets.isTight
& ((jets.pt >= 50) | ((jets.pt < 50) & (jets.puId & 2) == 2))
& (jets.chEmEF + jets.neEmEF < 0.9) # neutral and charged energy fraction
)
goodjets = jets[jet_selector]
jets = jets[jet_selector]
jet_veto_map, _ = get_JetVetoMap(jets, self._year)
jets = jets[(jets.pt > 30) & jet_veto_map]
ak4_outside_ak8_selector = jets.delta_r(candidatefj) > 0.8
ak4_outside_ak8 = jets[ak4_outside_ak8_selector]

Expand Down Expand Up @@ -474,8 +468,6 @@ def process(self, events: ak.Array):
"VH_fj_pt": VH_fj.pt,
"VH_fj_eta": VH_fj.eta,
"VH_fj_VScore": VScore(VH_fj),
# add jetveto as optional selection
"jetvetomap": cut_jetveto,
# added on October 9th
"loose_lep1_miso": ak.firsts(
muons[loose_muons1][ak.argsort(muons[loose_muons1].pt, ascending=False)]
Expand Down Expand Up @@ -642,7 +634,7 @@ def process(self, events: ak.Array):
# hem-cleaning selection
if self._year == "2018":
hem_veto = ak.any(
((goodjets.eta > -3.2) & (goodjets.eta < -1.3) & (goodjets.phi > -1.57) & (goodjets.phi < -0.87)),
((jets.eta > -3.2) & (jets.eta < -1.3) & (jets.phi > -1.57) & (jets.phi < -0.87)),
-1,
) | ak.any(
(
Expand Down Expand Up @@ -679,7 +671,7 @@ def process(self, events: ak.Array):
nPU=ak.to_numpy(events.Pileup.nPU),
)

add_pileupid_weights(self.weights[ch], self._year, self._yearmod, goodjets, events.GenJet, wp="L")
add_pileupid_weights(self.weights[ch], self._year, self._yearmod, jets, events.GenJet, wp="L")

if ch == "mu":
add_lepton_weight(self.weights[ch], candidatelep, self._year + self._yearmod, "muon")
Expand Down

0 comments on commit 21611d4

Please sign in to comment.