CMS 3D CMS Logo

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