# Hit dependent pt = cl_E / cosh(track eta) if >= 4 tracks else cl_pt good_els = [el for el in event.electrons if el.author in (1, 3) and abs(el.etas2) < 1.37 or 1.52 < abs(el.etas2) < 2.37 and el.hit_dependent_pt > 25000 and el.loose and not (el.OQ & 1446)] if len(good_els) >= 2: counts(GT2EL) if len(good_phs) + len(good_els) >= 2: counts(PASSED) # Magic flag causes events to be dumped later. ana.should_dump = True if not sum(1 for p in good_phs if p.ambiguity_resolved) >= 2 and not len(good_els) >= 2: # We only have one AR photon and one electron. counts(OGOE) class GravitonSkim(AnalysisBase): def __init__(self, tree, options): super(GravitonSkim, self).__init__(tree, options) self.tasks.extend([ do_skim, ]) graviton_skim = make_main(GravitonSkim) if __name__ == "__main__": graviton_skim()
from minty.main import make_main from .d3pd import PurityAnalysis purity_main = make_main(PurityAnalysis)
self.etabins_sym = "var", 0., 0.60, 1.37, 1.52, 1.81, 2.37 self.etabins = mirror_bins(self.etabins_sym) self.etabins_many = double_bins(self.etabins, 3) # Tasks to run in order self.tasks.extend([ do_cutflows, ]) def initialize_counters(self): self.loose_events = set() self.interesting_indexes = [] self.gg_cand_has_ee = [] self.good_events = [] self.mass_values = [] super(GravitonAnalysis, self).initialize_counters() def flush(self): self.h.write_object("loose_event_indexes", self.loose_events) self.h.write_object("interesting", self.interesting_indexes) self.h.write_object("gg_cand_has_ee", self.gg_cand_has_ee) self.h.write_object("good_events", self.good_events) self.h.write_object("mass_values", self.mass_values) super(GravitonAnalysis, self).flush() graviton_main = make_main(GravitonAnalysis) if __name__ == "__main__": graviton_main()
ptstr = "{0}GeV".format(pt/1000) plot_photons(ana, event, ptstr, counts, photons, plotbulk=True) class PtBumpAnalysis(AnalysisBase): def __init__(self, tree, options): super(PtBumpAnalysis, self).__init__(tree, options) self.ptbins = ("var", 15, 20, 25, 30, 35, 40, 50, 60, 100, 140, 180, 220, 300, 380, 460, 620, 1000) self.ptbins = scale_bins(self.ptbins, 1000) self.ptbins_wide = "var", 15, 45, 60, 80, 120, 200, 400, 1000 self.ptbins_wide = scale_bins(self.ptbins_wide, 1000) self.etabins_sym = "var", 0., 0.60, 1.37, 1.52, 1.81, 2.37 self.etabins = mirror_bins(self.etabins_sym) self.etabins_many = double_bins(self.etabins, 3) # Tasks to run in order self.tasks.extend([ multi_pt_cutflow, ]) ptbumpana_main = make_main(PtBumpAnalysis) if __name__ == "__main__": ptbumpana_main()