from jhplot import *
from jhplot.io import *
import os.path
# write events to serialized files
file="output.ser"
f=HFile(file,"w")
h1=H1D("Histo",100,0,10)
p0=P0D();
p0.add(1)
p0.add(2)
p1=P1D()
p1.add(1,2)
p1.add(2,4)
f.write("data/h1",h1)
f.write("data/p0",p0)
f.write("data/p1",p1)
# obg =f.getObjectMap()
#print f.getEntries()
#print obg
f.close()
# read all the entries
f=HFile(file)
obg =f.getObjectMap()
print obg
print f.getEntries()
obg =f.getObjectMap()
print obg
h=f.read("data/h1")
print h.toString()
f.close()
Ads help maintain this website.