# example: make Jaida histogram and convert to jhepwork 
# jaida
from  hep.aida import *
from  hep.aida.dev import *
from  hep.aida.ref import *
from  hep.aida.ref.histogram import *
from  hep.aida.ref.histogram.binner import *
from  hep.aida.ref.root import *
from java.util import Random
# jhepwork stuff
from jhplot  import HPlot
from jhplot  import H1D


### your program here
# make JAIDA histograms
xAx =  FixedAxis(30, -2.0, 2.0);
h1 = Histogram1D("JAIDA histogram","JAIDA histogram", xAx );



rand = Random()
# fill histogram
for i in range(1000):
      h1.fill(rand.nextGaussian())

# plot it
c1 = HPlot("Canvas",600,400,0.12,1, 1)
c1.setDrawGrid(0,0)
c1.setDrawGrid(1,0)
c1.visible(1)
hh=H1D(h1)
hh.setFill(1)
c1.draw(hh)



# export to some image (png,eps,pdf,jpeg...)
c1.export(Editor.DocMasterName()+".png");
# jHepWork @S.Chekanov