package jasext.jhplotserver;

import hep.aida.IAxis;
import hep.aida.ref.histogram.Histogram1D;

public class RefHistogram1D extends AdapterHistogram1D {

	public RefHistogram1D(Histogram1D rootHisto) {
		super(rootHisto);
		th1d = rootHisto;
	}

	public double[][] rebin(int bins, double p2, double p3, boolean p4,
			boolean p5) {
	
		
		 IAxis a=th1d.axis();
         int ibins=a.bins(); // +2;
         double[] newHeights = new double[ibins];
        double[] newErrors = new double[ibins];
         double[] newMeans = new double[ibins];
         double[] newRmss = new double[ibins];
         int[] newEntries = new int[ibins];

         for (int i = 0; i < ibins-2; i++) {
             newHeights[i + 1] = th1d.binHeight(i);
             newErrors[i + 1] = th1d.binError(i);
             newEntries[i + 1] = th1d.binEntries(i);
             newMeans[i + 1] = th1d.binMean(i);
             newRmss[i + 1] = th1d.binRms(i);
           
     }
         
         
         return (new double[][] { newHeights, newErrors });
         
         
		
	}

	private Histogram1D th1d;
}

 

Ads help maintain this website.