Message: RE: Help on AIDA histograms Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question RE: Help on AIDA histograms 

Forum: Analysis
Re: Question Help on AIDA histograms (Gabriel Sawakuchi)
Re: None RE: Help on AIDA histograms
Date: 17 Nov, 2005
From: Gabriel Sawakuchi <Gabriel Sawakuchi>

Thanks for the help Tony.
But since I do not have any knowledge of java I am having a 
hard time to understand your script. I am trying to compile it
in javac and use JAS3 to view the histograms.

I am geting this 4 errors:

--------------------------------------------------------------
/home/gbiel/geant4/MySimulation/DoseDist1/test.java:35: cannot resolve symbol
symbol  : method plot (java.lang.Object)
location: interface hep.aida.IPlotterRegion
    plotter.region(0).plot(histograms.get(i));
                  ^
/home/gbiel/geant4/MySimulation/DoseDist1/test.java:46: add(hep.aida.IHistogram1D) in hep.aida.IHistogram1D cannot be applied to (java.lang.Object)
    s.add(histograms.get(i));
     ^
/home/gbiel/geant4/MySimulation/DoseDist1/test.java:47: add(hep.aida.IHistogram1D) in hep.aida.IHistogram1D cannot be applied to (java.lang.Object)
    if (i>0)      s.add(stack.get(i-1));
                   ^
/home/gbiel/geant4/MySimulation/DoseDist1/test.java:53: cannot resolve symbol
symbol  : method plot (java.lang.Object)
location: interface hep.aida.IPlotterRegion
    plotter.region(0).plot(stack.get(i-1));
                  ^
4 errors
4:00:29 PM ----------- compile failed
--------------------------------------------------------------

Could you help me to fix it ? Following is the script I am using.

**********************************************************************
import hep.aida.*;
import java.util.Random;
import java.util.ArrayList;

public class test
{   
  public static void main(String[] argv) {

  IAnalysisFactory af = IAnalysisFactory.create();
  ITree tree = af.createTreeFactory().create();
  IHistogramFactory hf = af.createHistogramFactory(tree);

  Random r = new Random();

  // Make 14 random histograms
  ArrayList histograms = new ArrayList();
  for (int i=0; i<14; i++)
  {
    IHistogram1D histogram = hf.createHistogram1D("Histogram "+i,50,0,1);
    for (int j=0; j<10000; j++)
    {
      histogram.fill(r.nextDouble());
    }
    histograms.add(histogram);
  }

//*********************************************************************************
// Overlay them

  IPlotter plotter = af.createPlotterFactory().create("Overlay Example");
  plotter.createRegions(1,1);

  for (int i=0; i<histograms.size(); i++)
  {
    plotter.region(0).plot(histograms.get(i));
  }
  plotter.show();

//*********************************************************************************
// Stack them on top of each other

  ArrayList stack = new ArrayList();
  for (int i=0; i<histograms.size(); i++)
  {
    IHistogram1D s = hf.createHistogram1D("Stack "+i,50,0,1);
    s.add(histograms.get(i));
    if (i>0)      s.add(stack.get(i-1));
    stack.add(s);
  }
  IPlotter plotter1 = af.createPlotterFactory().create("Stack Example");  
  for (int i=stack.size(); i>0; i--)
  {
    plotter.region(0).plot(stack.get(i-1));
  }
  plotter.show();
}
}

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 More: RE: Help on AIDA histograms   (Gabriel Sawakuchi - 18 Nov, 2005)
(_ Feedback: RE: Help on AIDA histograms   (Gabriel Sawakuchi - 23 Nov, 2005)
 Add Message Add Message
to: "RE: Help on AIDA histograms"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]