PhysicsTools
Heppy
python
analyzers
examples
SimpleTreeAnalyzer.py
Go to the documentation of this file.
1
from
__future__
import
absolute_import
2
from
PhysicsTools.Heppy.analyzers.core.TreeAnalyzerNumpy
import
TreeAnalyzerNumpy
3
from
.
import
ntuple
4
5
class
ZJetsTreeAnalyzer
(TreeAnalyzerNumpy):
6
7
def
beginLoop
(self, setup):
8
super(ZJetsTreeAnalyzer, self).
beginLoop
(setup)
9
ntuple.bookJet
(
'jet1'
)
10
ntuple.bookJet
(
'jet2'
)
11
ntuple.bookZ(
'dimuon'
)
12
13
14
def
process
(self, event):
15
if
len(event.jets)>0:
16
ntuple.fillJet
(
'jet1'
, event.jets[0])
17
if
len(event.jets)>1:
18
ntuple.fillJet
(
'jet2'
, event.jets[1])
19
if
len(event.dimuons>1):
20
ntuple.fillZ(
'dimuon'
, event.dimuons[0])
21
ntuple.tree.tree.Fill()
22
23
ntuple.fillJet
def fillJet(tree, pName, jet)
Definition:
ntuple.py:106
ntuple.bookJet
def bookJet(tree, pName)
Definition:
ntuple.py:100
SimpleTreeAnalyzer.ZJetsTreeAnalyzer.beginLoop
def beginLoop(self, setup)
Definition:
SimpleTreeAnalyzer.py:7
SimpleTreeAnalyzer.ZJetsTreeAnalyzer.process
def process(self, event)
Definition:
SimpleTreeAnalyzer.py:14
SimpleTreeAnalyzer.ZJetsTreeAnalyzer
Definition:
SimpleTreeAnalyzer.py:5
Generated for CMSSW Reference Manual by
1.8.16