Linear Collider Forum



Home » Analysis and Reconstruction » Analysis Tools » Efficiency plot using AIDA
Re: Efficiency plot using AIDA [message #1543 is a reply to message #1542] Mon, 07 July 2008 12:31 Go to previous messageGo to previous message
tonyj
Messages: 138
Registered: January 2004

I tried the following:

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

public class CreateAndPlotHistograms
{
   public static void main(String[] argv)
   {
      IAnalysisFactory af = IAnalysisFactory.create();
      ITree tree = af.createTreeFactory().create();
      IHistogramFactory hf = af.createHistogramFactory(tree);

      IHistogram1D h1 = hf.createHistogram1D("Histogram 1D","Efficiency test",100,0,1,"type=efficiency");


      Random r = new Random();

      for (int i = 0; i < 10000; i++ ) 
      {
          double x = r.nextDouble();
          double eff = x;
          h1.fill(x,r.nextDouble()>eff ? 1 : 0);
      }

      IPlotter plotter = af.createPlotterFactory().create("CreateAndPlotHistograms.java plot");

      plotter.show();
      plotter.region(0).plot(h1);
   }
}

and got
http://forum.linearcollider.org/index.php?t=getfile&id=121&rid=3t:

which is clearly not correct.

  • Attachment: eff.png
    (Size: 26.99KB, Downloaded 1056 times)

[Updated on: Mon, 07 July 2008 12:32]

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:JAS3 classpath question/trying to get trivalPFA to compile
Next Topic:Fitting histograms with other histograms
Goto Forum:
  


Current Time: Thu Jul 19 23:53:15 Pacific Daylight Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software