from paida import IAnalysisFactory analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### Creating profiles. histogramFactory = analysisFactory.createHistogramFactory(tree) ### Fixed bin width profile. p1dF = histogramFactory.createProfile1D('fixed1D', 'Fixed', 20, 0.0, 20.0) ### Variable bin width histogram. p2dF = histogramFactory.createProfile2D('fixed2D', 'Fixed', 20, 0.0, 20.0, 20, 0.0, 20.0) ### Filling with gaussian. import random r = random.Random() for i in range(1000): x = r.random() * 20.0 y = x + r.gauss(0.0, 2.0) z = x + y + r.gauss(0.0, 6.0) p1dF.fill(x, y) p2dF.fill(x, y, z) ### Plotting the histogram. plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') plotter.createRegions(1, 2) plotter.region(0).setTitle('Profile1D') plotter.region(0).style().setParameter('showTitle', 'true') plotter.region(0).plot(p1dF) plotter.region(1).setTitle('Profile2D') plotter.region(1).style().setParameter('showTitle', 'true') plotter.region(1).plot(p2dF) ### Wait. dummy = raw_input('Hit any key.')