This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
root:example_ttree [2017/06/22 15:25] – iwn | root:example_ttree [2017/06/22 15:25] (current) – iwn | ||
---|---|---|---|
Line 15: | Line 15: | ||
start = time.time() | start = time.time() | ||
- | from ROOT import gRandom, TFile, TTree, TH1D, TObject | + | from ROOT import gRandom, TFile, TTree, TH1D |
from array import array | from array import array | ||
import numpy # alternative to array | import numpy # alternative to array | ||
Line 78: | Line 78: | ||
# overwrite the tree in the output file and close the file | # overwrite the tree in the output file and close the file | ||
- | f.Write("", | + | f.Write("", |
f.Close() | f.Close() | ||
Line 97: | Line 97: | ||
h1.Fill(gRandom.Gaus(2, | h1.Fill(gRandom.Gaus(2, | ||
- | f.Write("", | + | f.Write("", |
f.Close() | f.Close() | ||
Line 124: | Line 124: | ||
h1.Fill(gRandom.Gaus(4, | h1.Fill(gRandom.Gaus(4, | ||
- | f.Write("", | + | f.Write("", |
f.Close() | f.Close() | ||
Line 154: | Line 154: | ||
t.Fill() | t.Fill() | ||
- | f.Write("", | + | f.Write("", |
f.Close() | f.Close() | ||