Created
January 30, 2015 10:57
-
-
Save alexpearce/5fcc81a93bda3c0b6008 to your computer and use it in GitHub Desktop.
TTree::SetAlias example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ROOT | |
import numpy | |
f = ROOT.TFile('alias.root', 'recreate') | |
t = ROOT.TTree('t', 't') | |
a = numpy.zeros(1, dtype=float) | |
t.Branch('a', a, 'a/D') | |
for i in range(10): | |
a[0] = i*i | |
t.Fill() | |
t.Write() | |
f.Close() | |
f = ROOT.TFile('alias.root', 'update') | |
t = f.Get('t') | |
t.SetAlias('b', 'a/10.0') | |
t.Write() | |
f.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment