"""-*- mode: python -*-

Demonstraton following example of CERN LCG PI example 1

  @author Paul F. Kunz <Paul_Kunz@slacs.stanford.edu>

"""
#
# $Id: static_hists.py.in,v 1.3 2004/12/07 19:46:56 pfkeb Exp $
#

import sys
sys.path.reverse()
sys.path.append('../../hippodraw/python')
sys.path.append('..//python')
sys.path.reverse()

import random
from time import sleep

import hippoplotter as plot

from hippo import NTuple
ntuple = NTuple ( )
ntuple.setLabels ( ('X value', 'Y value' ) )
plot.registerNTuple ( ntuple )

sthist = plot.StaticHist( title="Example static histogram",
                          xlabel = "X value", xrange = (0, 50),
                          xBinWidth = 2 )

sthist2 = plot.Static2DHist( title="Example static histogram",
                             xlabel = "X value", xrange = (0, 50),
                             ylabel = "Y value", yrange = (0, 50),
                             xBinWidth = 2 )


shoot = random.uniform

for i in range(10000):
    x = 50 * shoot ( 0, 1)
    y = 50 * shoot ( 0, 1)
    sthist.addValues ( (x, ) )
    sthist2.addValues ( (x, y) )

