Skip to content
Snippets Groups Projects

Merging full workflow into Tanay's HiggsDNA

Open Sergi Castells requested to merge castells/higgs-dna-4-gamma-tanays-copy:master into master
Compare and Show latest version
13 files
+ 2124
323
Compare changes
  • Side-by-side
  • Inline
Files
13
@@ -188,12 +188,22 @@ def photon_preselection_h4g(
self, photons: awkward.Array, events: awkward.Array, year="2022"
) -> awkward.Array:
"""
print(awkward.num(events.Photon[awkward.num(events.Photon, axis=1) >= 2], axis=1), awkward.num(photons[awkward.num(photons, axis=1) >= 2], axis=1), set(photons.fields).symmetric_difference(set(events.Photon.fields)), photons[awkward.num(photons, axis=1) >= 2], events.Photon[awkward.num(events.Photon, axis=1) >= 2])
print(awkward.num(events.Photon[awkward.num(events.Photon, axis=1) >= 2], axis=1), awkward.num(photons[awkward.num(photons, axis=1) >= 2], axis=1), set(photons.fields).symmetric_difference(set(events.Photon.fields)), photons[awkward.num(photons, axis=1) >= 2], events.Photon[awkward.num(events.Photon, axis=1) >= 2])
print(awkward.num(events.Photon[awkward.num(events.Photon, axis=1) >= 2], axis=1), awkward.num(photons[awkward.num(photons, axis=1) >= 2], axis=1), set(photons.fields).symmetric_difference(set(events.Photon.fields)), photons[awkward.num(photons, axis=1) >= 2], events.Photon[awkward.num(events.Photon, axis=1) >= 2])
assert len(events.Photon[awkward.num(events.Photon, axis=1) >= 2]) == len(photons[awkward.num(photons, axis=1) >= 2])
"""
photons = photons[awkward.num(photons, axis=1) >= 2]
# run3 = True if "2022" in year or "2023" in year else False
run3 = True
if not run3:
rho = events.fixedGridRhoAll * awkward.ones_like(photons.pt)
else:
rho = events.Rho.fixedGridRhoAll * awkward.ones_like(photons.pt)
#rho = events.Rho.fixedGridRhoAll * awkward.ones_like(photons.pt)
rho = photons.fixedGridRhoAll
photons = photons[awkward.argsort(photons.pt, ascending=False, axis=1)]
@@ -319,5 +329,8 @@ def photon_preselection_h4g(
iso = iso_r9 | iso_charged | iso_charged_rel
all_cuts = pt_cuts & eta & e_veto & hlt_all & iso
#events.Photon = events.Photon[all_cuts]
#events = events[~awkward.is_none(events.Photon)]
#events = events[awkward.num(events.Photon, axis=1) >= 2]
return events, photons[all_cuts], all_cuts
Loading