Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
HeppyCore
python
utils
testtree.py
Go to the documentation of this file.
1
from
ROOT
import
TFile
2
from
PhysicsTools.HeppyCore.statistics.tree
import
Tree
3
4
def
create_tree
(filename="test_tree.root"):
5
outfile = TFile(filename,
'recreate'
)
6
tree = Tree(
'test_tree'
,
'A test tree'
)
7
tree.var(
'var1'
)
8
for
i
in
range(100):
9
tree.fill(
'var1'
, i)
10
tree.tree.Fill()
11
print
'creating a tree'
, tree.tree.GetName(),\
12
tree.tree.GetEntries(),
'entries in'
,\
13
outfile.GetName()
14
outfile.Write()
testtree.create_tree
def create_tree
Definition:
testtree.py:4
Generated for CMSSW Reference Manual by
1.8.5