Several histograms using Jaida
Source code name: "histo_jaida3.py"
Programming language: Python
Topic: Histograms/1D
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/histo_jaida3_6936.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



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

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

tree.mkdir("/Histograms");
tree.cd("/Histograms");

h1 = hf.createHistogram1D("Histogram 1D",50,-3,3);
h2 = hf.createHistogram2D("Histogram 2D",40,-3,3,40,-3,3);

tree.mkdir("/Clouds");
tree.cd("/Clouds");

cc1 = hf.createCloud1D("Cloud 1D");
cc2 = hf.createCloud2D("Cloud 2D");

r = Random()
for i in range(5000):
    h1.fill(r.nextGaussian())
    h2.fill(r.nextGaussian(),r.nextGaussian())
    cc1.fill(r.nextGaussian())
    cc2.fill(r.nextGaussian(),r.nextGaussian())

c1=HPlotter("CreateAndPlotHistograms",700,600,2,2)
c1.visible()

c1.cd(1,1)
c1.draw(h1)

c1.cd(2,1)
c1.draw(h2)

c1.cd(1,2)
c1.draw(cc1)

c1.cd(2,2)
c1.draw(cc2)


You see the box below because you did not login.