Main Page
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
_
a
c
d
e
f
l
m
o
p
s
t
u
v
+
Related Functions
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Package Documentation
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
PhysicsTools
HeppyCore
python
framework
eventstfile.py
Go to the documentation of this file.
1
# Copyright (C) 2014 Colin Bernet
2
# https://github.com/cbernet/heppy/blob/master/LICENSE
3
4
from
ROOT
import
TFile
5
6
class
Events
(
object
):
7
'''Event list from a tree in a root file.
8
'''
9
def
__init__
(self, filename, treename, options=None):
10
self.
file
= TFile(filename)
11
if
self.
file
.IsZombie():
12
raise
ValueError(
'file {fnam} does not exist'
.
format
(fnam=filename))
13
self.
tree
= self.
file
.
Get
(treename)
14
if
self.
tree
==
None
:
# is None would not work
15
raise
ValueError(
'tree {tree} does not exist in file {fnam}'
.
format
(
16
tree = treename,
17
fnam = filename
18
))
19
20
def
size
(self):
21
return
self.
tree
.GetEntries()
22
23
def
to
(self, iEv):
24
'''navigate to event iEv.'''
25
self.
tree
.GetEntry(iEv)
26
return
self.
tree
27
28
def
__iter__
(self):
29
return
iter(self.
tree
)
eventstfile.Events.file
file
Definition:
eventstfile.py:10
eventstfile.Events.__iter__
def __iter__(self)
Definition:
eventstfile.py:28
eventstfile.Events
Definition:
eventstfile.py:6
eventstfile.Events.to
def to(self, iEv)
Definition:
eventstfile.py:23
eventstfile.Events.__init__
def __init__(self, filename, treename, options=None)
Definition:
eventstfile.py:9
eventstfile.Events.tree
tree
Definition:
eventstfile.py:13
eventstfile.Events.size
def size(self)
Definition:
eventstfile.py:20
format
resolutioncreator_cfi.object
object
Definition:
resolutioncreator_cfi.py:4
Get
T * Get(Args... args)
Definition:
Trend.h:122
Generated for CMSSW Reference Manual by
1.8.14