CMS 3D CMS Logo

Functions
testtree Namespace Reference

Functions

def create_tree (filename="test_tree.root")
 

Function Documentation

◆ create_tree()

def testtree.create_tree (   filename = "test_tree.root")

Definition at line 6 of file testtree.py.

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()

References print(), and FastTimerService_cff.range.

Referenced by eventstfile_test.EventsTFileTestCase.test(), and chain_test.ChainTestCase.test_get().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
testtree.create_tree
def create_tree(filename="test_tree.root")
Definition: testtree.py:6