Skip to content

Commit

Permalink
fix hem cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Aug 23, 2023
1 parent 8f5276a commit 0dd4760
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/HHbbVV/processors/bbVVSkimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,25 +397,26 @@ def process(self, events: ak.Array):
# 2018 HEM cleaning
# https://indico.cern.ch/event/1249623/contributions/5250491/attachments/2594272/4477699/HWW_0228_Draft.pdf
if year == "2018":
check_fatjets = events.FatJet[:, :2]
hem_cleaning = (
((events.run >= 319077) & isData) # if data check if in Runs C or D
# else for MC randomly cut based on lumi fraction of C&D
| ((np.random.rand(len(events)) < 0.632) & ~isData)
) & (
ak.any(
(
(events.Jet.pt > 30.0)
& (events.Jet.eta > -3.2)
& (events.Jet.eta < -1.3)
& (events.Jet.phi > -1.57)
& (events.Jet.phi < -0.87)
(check_fatjets.pt > 30.0)
& (check_fatjets.eta > -3.2)
& (check_fatjets.eta < -1.3)
& (check_fatjets.phi > -1.57)
& (check_fatjets.phi < -0.87)
),
-1,
)
| ((events.MET.phi > -1.62) & (events.MET.pt < 470.0) & (events.MET.phi < -0.62))
)

add_selection("hem_cleaning", ~hem_cleaning, *selection_args)
add_selection("hem_cleaning", ~np.array(hem_cleaning).astype(bool), *selection_args)

# remove weird jets which have <4 particles (due to photon scattering?)
pfcands_sel = []
Expand Down Expand Up @@ -578,7 +579,7 @@ def process(self, events: ak.Array):
# Lund plane SFs
################

if isSignal:
if isSignal and self._systematics:
# TODO: remember to add new LP variables
items = [
("lp_sf_lnN", 101),
Expand Down
2 changes: 1 addition & 1 deletion src/condor/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def main(args):
"eosoutroot": f"{eosoutput_dir}/root/nano_skim_{j}.root",
"save_ak15": "--save-ak15" if args.save_ak15 else "--no-save-ak15",
"save_all": "--save-all" if args.save_all else "--no-save-all",
"save_all": "--vbf-search" if args.vbf_search else "--no-vbf-search",
"vbf_search": "--vbf-search" if args.vbf_search else "--no-vbf-search",
"save_systematics": "--save-systematics"
if args.save_systematics
else "--no-save-systematics",
Expand Down
17 changes: 17 additions & 0 deletions src/condor/submit_configs/skimmer_inputs_23_08_22_5xhy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Skimmer":
{
"XHY":
{
"subsamples":
[
"NMSSM_XToYHTo2W2BTo4Q2B_MX-900_MY-80",
"NMSSM_XToYHTo2W2BTo4Q2B_MX-1200_MY-190",
"NMSSM_XToYHTo2W2BTo4Q2B_MX-2000_MY-125",
"NMSSM_XToYHTo2W2BTo4Q2B_MX-3000_MY-250",
"NMSSM_XToYHTo2W2BTo4Q2B_MX-4000_MY-150",
],
"files_per_job": 20,
},
},
}
1 change: 0 additions & 1 deletion src/condor/submit_from_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def add_bool_arg(parser, name, help, default=False, no_name=None):
if __name__ == "__main__":
parser = argparse.ArgumentParser()
run_utils.parse_common_args(parser)
parser.add_argument("--tag", default="Test", help="process tag", type=str)
parser.add_argument("--jet", default="AK8", help="jet", type=str)
parser.add_argument(
"--submit", dest="submit", action="store_true", help="submit jobs when created"
Expand Down
2 changes: 2 additions & 0 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def run(p: processor, fileset: dict, args):
pickle.dump(out, filehandler)
filehandler.close()

print(out)

# need to combine all the files from these processors before transferring to EOS
# otherwise it will complain about too many small files
if args.processor in ["skimmer", "input", "ttsfs"]:
Expand Down

0 comments on commit 0dd4760

Please sign in to comment.