from paida import * ### In AIDA system, an analysisFactory creates some treeFactories, ### and a treeFactory creates some trees. analysisFactory = IAnalysisFactory.create() treeFactory = analysisFactory.createTreeFactory() tree = treeFactory.create() ### The tree with zipped XML format and allowing to create new r/w mode file. #tree = treeFactory.create('exampleBasic.aida', 'xml', False, True, 'compress=yes') ### Creating a histogram. histogramFactory = analysisFactory.createHistogramFactory(tree) h1d = histogramFactory.createHistogram1D('name', 'title', 20, 0.0, 20.0) ### Filling with gaussian. import random r = random.Random() for i in range(1000): h1d.fill(r.gauss(10.0, 3.0)) ### Plotting the histogram. ### analysisFactory -> plotterFactory -> plotter -> region(s) plotterFactory = analysisFactory.createPlotterFactory() plotter = plotterFactory.create('PAIDA Plotter') region = plotter.createRegion() region.plot(h1d) ### Save plots to a file. plotter.writeToFile('sampleBasic.ps') ### Wait. dummy = raw_input('Hit any key.')