import org.freehep.record.loop.event.*;
import hep.aida.*;

public class MyTest extends RecordAdapter
{
   private IHistogram1D rHist;
   public MyTest()
   {
      IAnalysisFactory af = IAnalysisFactory.create();
      IHistogramFactory hf = af.createHistogramFactory(af.createTreeFactory().create());
      
      rHist  = hf.createHistogram1D("R",50,0,6);      
   } 
   public void recordSupplied(RecordSuppliedEvent event)
   {
      ITuple row = (ITuple) event.getRecord();
      double x = row.getDouble(0);
      double y = row.getDouble(1);
      double r = Math.sqrt(x*x + y*y);
      rHist.fill(r);
   }
}