CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
testtree.py
Go to the documentation of this file.
1 from __future__ import print_function
2 from builtins import range
3 from ROOT import TFile
4 from PhysicsTools.HeppyCore.statistics.tree import Tree
5 
6 def create_tree(filename="test_tree.root"):
7  outfile = TFile(filename, 'recreate')
8  tree = Tree('test_tree', 'A test tree')
9  tree.var('var1')
10  for i in range(100):
11  tree.fill('var1', i)
12  tree.tree.Fill()
13  print('creating a tree', tree.tree.GetName(),\
14  tree.tree.GetEntries(), 'entries in',\
15  outfile.GetName())
16  outfile.Write()
const uint16_t range(const Frame &aFrame)
def create_tree
Definition: testtree.py:6
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47