Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
Heppy
python
analyzers
examples
SimpleTreeAnalyzer.py
Go to the documentation of this file.
1
from
PhysicsTools.Heppy.analyzers.core.TreeAnalyzerNumpy
import
TreeAnalyzerNumpy
2
3
4
class
SimpleTreeAnalyzer
(TreeAnalyzerNumpy):
5
6
def
beginLoop
(self, setup):
7
super(SimpleTreeAnalyzer, self).
beginLoop
(setup)
8
self.
bookJet
(
'jet1'
)
9
self.
bookJet
(
'jet2'
)
10
self.
bookJet
(
'jet1_gen'
)
11
self.
bookJet
(
'jet2_gen'
)
12
13
def
process
(self, event):
14
if
len(event.jets)>0:
15
self.
fillJet
(
'jet1'
, event.jets[0])
16
self.
fillJet
(
'jet1_gen'
, event.jets[0].gen)
17
if
len(event.jets)>1:
18
self.
fillJet
(
'jet2'
, event.jets[1])
19
self.
fillJet
(
'jet2_gen'
, event.jets[1].gen)
20
self.tree.tree.Fill()
21
22
def
bookJet
(self, name):
23
self.tree.var(
'{name}_pt'
.
format
(name=name) )
24
25
def
fillJet
(self, name, jet):
26
if
jet:
27
self.tree.fill(
'{name}_pt'
.
format
(name=name), jet.pt())
28
SimpleTreeAnalyzer.SimpleTreeAnalyzer
Definition:
SimpleTreeAnalyzer.py:4
SimpleTreeAnalyzer.SimpleTreeAnalyzer.fillJet
def fillJet
Definition:
SimpleTreeAnalyzer.py:25
SimpleTreeAnalyzer.SimpleTreeAnalyzer.process
def process
Definition:
SimpleTreeAnalyzer.py:13
SimpleTreeAnalyzer.SimpleTreeAnalyzer.beginLoop
def beginLoop
Definition:
SimpleTreeAnalyzer.py:6
SimpleTreeAnalyzer.SimpleTreeAnalyzer.bookJet
def bookJet
Definition:
SimpleTreeAnalyzer.py:22
format
Generated for CMSSW Reference Manual by
1.8.5