Skip to content

Commit

Permalink
add NLheLeptons
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Jul 8, 2018
1 parent 1e9685a commit cd7bb51
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scribblers/lhetop.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,28 @@ def end(self):
self.out = None

##__________________________________________________________________||
class NLheLeptons(object):

def __repr__(self):
name_value_pairs = ()
return '{}({})'.format(
self.__class__.__name__,
', '.join(['{}={!r}'.format(n, v) for n, v in name_value_pairs]),
)

def begin(self, event):
self.out = [ ]
self._attach_to_event(event)

def _attach_to_event(self, event):
event.nLheLeptons = self.out

def event(self, event):
self._attach_to_event(event)

status = np.array(event.GenPart_status)
abspdgid = np.absolute(np.array(event.GenPart_pdgId))
b = (status == 23) & ( (11 == abspdgid) | (13 == abspdgid) | (15 == abspdgid))
self.out[:] = [abspdgid[b].size]

##__________________________________________________________________||

0 comments on commit cd7bb51

Please sign in to comment.