diff --git a/boostedhiggs/hwwprocessor.py b/boostedhiggs/hwwprocessor.py index 9582d5da..9a0176f4 100644 --- a/boostedhiggs/hwwprocessor.py +++ b/boostedhiggs/hwwprocessor.py @@ -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] @@ -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)] @@ -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( ( @@ -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")