The example algorithm.
More...
|
def | __init__ (self, name, args) |
|
def | execute (self) |
|
def | get_electrons (self) |
|
def | get_muons (self) |
|
def | get_taujets (self) |
|
def | get_met (self) |
|
def | find_zll (self, llist, h) |
|
def | find_ztt (self, parts, met, zll, h) |
|
def | find_hzz (self, candlist, h) |
|
The example algorithm.
We derive from PyAlgorithm, which means that this is a Gaudi algorithm in every sense.
Definition at line 343 of file PyAlgorithmExample.py.
◆ __init__()
def PyAlgorithmExample.PyAlgorithmExample.__init__ |
( |
|
self, |
|
|
|
name, |
|
|
|
args |
|
) |
| |
Definition at line 346 of file PyAlgorithmExample.py.
348 PyAlgorithm.__init__ (self, name)
360 h.ele0 = Partlisthists_Ele (
'ele0')
361 h.ele1 = Partlisthists_Ele (
'ele1')
362 h.ele2 = Partlisthists_Ele (
'ele2')
364 h.muo0 = Partlisthists_Muo (
'muo0')
365 h.muo1 = Partlisthists_Muo (
'muo1')
367 h.taujet0 = Partlisthists_Taujet (
'taujet0')
368 h.taujet1 = Partlisthists_Taujet (
'taujet1')
370 h.metx = mybook (
"metx", 100, 0, 500*GeV)
371 h.mety = mybook (
"mety", 100, 0, 500*GeV)
372 h.met = mybook (
"met", 100, 0, 500*GeV)
380 h.hzz = [Partlisthists_Z (
'hzz0', m_max=500*GeV),
381 Partlisthists_Z (
'hzz1', m_max=500*GeV)]
383 h.ncand = mybook (
"ncand", 10, 0, 10)
◆ execute()
def PyAlgorithmExample.PyAlgorithmExample.execute |
( |
|
self | ) |
|
Definition at line 396 of file PyAlgorithmExample.py.
401 eles = self.get_electrons()
402 muos = self.get_muons()
403 taujets = self.get_taujets()
409 zees = self.find_zll (eles, h.zee)
410 zmms = self.find_zll (muos, h.zmm)
419 if met.pt < args.met_cut:
return 1
423 if len (zlls) == 0:
return 1
427 if len (eles) + len (muos) + len (taujets) < 4:
return 1
432 parts = eles + muos + taujets
444 ztts = self.find_ztt (parts, met, z, h.ztt)
446 for z2
in ztts: candlist.append ((z, z2))
450 if len (candlist) == 0:
return 1
452 h.ncand.Fill (len (candlist))
455 hzzs = self.find_hzz (candlist, h.hzz)
◆ find_hzz()
def PyAlgorithmExample.PyAlgorithmExample.find_hzz |
( |
|
self, |
|
|
|
candlist, |
|
|
|
h |
|
) |
| |
Definition at line 628 of file PyAlgorithmExample.py.
628 def find_hzz (self, candlist, h):
632 hzzs = [Z (zll, ztt, PDG.Higgs0)
for (zll, ztt)
in candlist]
637 return hg.dr() < args.hzz_deltar_cut
638 hzzs = [hg
for hg
in hzzs
if select (hg)]
◆ find_zll()
def PyAlgorithmExample.PyAlgorithmExample.find_zll |
( |
|
self, |
|
|
|
llist, |
|
|
|
h |
|
) |
| |
Definition at line 557 of file PyAlgorithmExample.py.
557 def find_zll (self, llist, h):
562 zlist = [Z (l1, l2)
for (l1,l2)
in combo.combinations (llist, 2)
563 if l1.charge()*l2.charge() < 0]
569 return (z.dr() < args.zll_deltar_cut
and
570 abs(z.m() - MZ) < args.zll_deltam_cut)
571 zlist = [z
for z
in zlist
if select (z)]
◆ find_ztt()
def PyAlgorithmExample.PyAlgorithmExample.find_ztt |
( |
|
self, |
|
|
|
parts, |
|
|
|
met, |
|
|
|
zll, |
|
|
|
h |
|
) |
| |
Definition at line 583 of file PyAlgorithmExample.py.
583 def find_ztt (self, parts, met, zll, h):
587 parts = [p
for p
in parts
if p
not in zll]
593 for (l1, l2)
in combo.combinations (parts, 2):
596 if l1.charge() * l2.charge() > 0:
continue
602 (nu1, nu2) = neutrinos_from_colinear_approximation (l1, l2,
614 return (z.dr() < args.ztt_deltar_cut
and
615 abs(z.m() - MZ) < args.ztt_deltam_cut)
616 zlist = [z
for z
in zlist
if select (z)]
◆ get_electrons()
def PyAlgorithmExample.PyAlgorithmExample.get_electrons |
( |
|
self | ) |
|
Definition at line 463 of file PyAlgorithmExample.py.
463 def get_electrons (self):
468 def track_select (e):
470 return e.hasTrack()
and e.isEM()%16 == 0
474 return e.pt() > args.ele_pt_cut
and abs(e.eta()) < args.ele_eta_cut
479 eles = PyParticleTools.getElectrons (args.electron_container)
481 eles = [e
for e
in eles
if track_select (e)]
483 eles = [e
for e
in eles
if select (e)]
◆ get_met()
def PyAlgorithmExample.PyAlgorithmExample.get_met |
( |
|
self | ) |
|
Definition at line 540 of file PyAlgorithmExample.py.
543 met = PyParticleTools.getMissingET (args.met_container)
544 h.metx.Fill (met.etx())
545 h.mety.Fill (met.ety())
546 met.pt = math.hypot (met.etx(), met.ety())
◆ get_muons()
def PyAlgorithmExample.PyAlgorithmExample.get_muons |
( |
|
self | ) |
|
Definition at line 491 of file PyAlgorithmExample.py.
491 def get_muons (self):
497 return m.pt() > args.muo_pt_cut
and abs(m.eta()) < args.muo_eta_cut
502 muos = PyParticleTools.getMuons (args.muon_container)
504 muos = [m
for m
in muos
if select (m)]
◆ get_taujets()
def PyAlgorithmExample.PyAlgorithmExample.get_taujets |
( |
|
self | ) |
|
Definition at line 512 of file PyAlgorithmExample.py.
512 def get_taujets (self):
518 if (t.pt() < args.taujet_pt_cut
or
519 abs(t.eta()) > args.taujet_eta_cut):
522 if t.likelihood() < args.taujet_likeli_cut:
return 0
523 emfrac = t.etEM() / (t.etEM() + t.etHad())
524 if emfrac > args.taujet_max_emfrac:
return 0
530 taujets = PyParticleTools.getTauJets (args.taujet_container)
531 h.taujet0.fill (taujets)
532 taujets = [t
for t
in taujets
if select (t)]
533 h.taujet1.fill (taujets)
◆ args
PyAlgorithmExample.PyAlgorithmExample.args |
PyAlgorithmExample.PyAlgorithmExample.h |
The documentation for this class was generated from the following file: