 
from hep.aida import IAnalysisFactory 
from java.util import Random
from jhplot import *

af   = IAnalysisFactory.create();
tree = af.createTreeFactory().create();
hf   = af.createHistogramFactory(tree);

r = Random(12345)
h1 = hf.createHistogram1D("test 1d",50,-3,6)
h2 = hf.createHistogram1D("test 2d",50,-3,6)
      
for i in range(10000):
   h1.fill(r.nextGaussian())
   h2.fill(3+r.nextGaussian())

plus = hf.add("h1+h2",h1,h2)
minus = hf.subtract("h1-h2",h1,h2)
mul = hf.multiply("h1*h2",h1,h2)
div = hf.divide("h1 divded by h2",h1,h2)


c1=HPlotter("ScansAndContour.py plot",700,600)
c1.visible()
plotter = c1.getPlotter()
plotter.createRegions(2,2,0)
plotter.region(0).plot(plus)
plotter.region(1).plot(minus)
plotter.region(2).plot(mul)
plotter.region(3).plot(div)
