1 / 8

Computational Physics Java Analysis Studio

Computational Physics Java Analysis Studio. Dr. Guy Tel- Zur. FreeHEP (High-Energy Physics). http://jas.freehep.org/jas3/ http://www.freehep.org/ http://java.freehep.org/. Example 1 - Java. import hep.aida .*; import java.util.Random ; public class CreateAndPlotHistograms {

duc
Download Presentation

Computational Physics Java Analysis Studio

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computational PhysicsJava Analysis Studio Dr. Guy Tel-Zur

  2. FreeHEP (High-Energy Physics) • http://jas.freehep.org/jas3/ • http://www.freehep.org/ • http://java.freehep.org/

  3. Example 1 - Java

  4. import hep.aida.*; import java.util.Random; public class CreateAndPlotHistograms { public static void main(String[] argv) { IAnalysisFactoryaf = IAnalysisFactory.create(); ITree tree = af.createTreeFactory().create(); IHistogramFactoryhf = af.createHistogramFactory(tree); tree.mkdir("/Histograms"); tree.cd("/Histograms"); IHistogram1D h1 = hf.createHistogram1D("Histogram 1D",50,-3,3); IHistogram2D h2 = hf.createHistogram2D("Histogram 2D",40,-3,3,40,-3,3); tree.mkdir("/Clouds"); tree.cd("/Clouds"); ICloud1D c1 = hf.createCloud1D("Cloud 1D"); ICloud2D c2 = hf.createCloud2D("Cloud 2D"); IPlotter plotter = af.createPlotterFactory().create("CreateAndPlotHistograms.java plot");

  5. plotter.show(); plotter.createRegions(2,2); plotter.region(0).plot(h1); plotter.region(1).plot(h2); plotter.region(2).plot(c1); plotter.region(3).plot(c2); Random r = new Random(); for (int i = 0; i < 100000; i++ ) { h1.fill(r.nextGaussian()); h2.fill(r.nextGaussian(),r.nextGaussian()); c1.fill(r.nextGaussian()); c2.fill(r.nextGaussian(),r.nextGaussian()); } } }

  6. The same code in Python! from hep.aida import * from java.util import Random 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"); c1 = hf.createCloud1D("Cloud 1D"); c2 = hf.createCloud2D("Cloud 2D");

  7. plotter = factory.createPlotterFactory().create("CreateAndPlotHistograms.py plot"); plotter.show(); plotter.createRegions(2,2); plotter.region(0).plot(h1); plotter.region(1).plot(h2); plotter.region(2).plot(c1); plotter.region(3).plot(c2); r = Random() for i in range(100000): h1.fill(r.nextGaussian()) h2.fill(r.nextGaussian(),r.nextGaussian()) c1.fill(r.nextGaussian()) c2.fill(r.nextGaussian(),r.nextGaussian())

More Related