hep.aida.ref.dataset.binner
Class DefaultBinner
- java.lang.Object
-
- hep.aida.ref.dataset.binner.DefaultBinner
-
- All Implemented Interfaces:
- Binner
- Direct Known Subclasses:
- EfficiencyBinner
public class DefaultBinner extends java.lang.Object implements Binner
The default implementation of a Binner.
-
-
Constructor Summary
Constructors Constructor and Description DefaultBinner(int[] bins, java.lang.String options)Creates a new instance of Binner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddContentToBin(int[] bin, int entries, double height, double[] mean, double[] rms)Add a set of entries to the existing content of the bin.intentries(int[] bin)Get the number of entries in a bin.voidfill(int[] bin, double[] x, double weight)Fill a bin with a new entry.doubleheight(int[] bin)Get the height of a bin.doublemean(int[] bin, int coord)Get the mean of a bin along a given coordinate.doubleminusError(int[] bin)Get the minus error on a bin.doubleplusError(int[] bin)Get the plus error on a bin.voidremoveContentFromBin(int[] bin, int entries, double height, double[] mean, double[] rms)Remove a set of entries from a bin.voidreset()Reset the content of the Binner.voidresetBin(int[] bin)Reset the content of a bin.doublerms(int[] bin, int coord)Get the rms of a bin along a given coordinate.voidscale(double scaleFactor)Scale all the bins by a given scale factor.voidsetBinContent(int[] bin, int entries, double height, double[] mean, double[] rms)Set at once the content of a bin.voidsetBinError(BinError binError)Set the BinError with which the plus and minus error on the bin are calculated.
-
-
-
Constructor Detail
-
DefaultBinner
public DefaultBinner(int[] bins, java.lang.String options)Creates a new instance of Binner.- Parameters:
bins- The array containing the number of bins per coordinate.options- The options.
-
-
Method Detail
-
fill
public void fill(int[] bin, double[] x, double weight)Fill a bin with a new entry.
-
setBinContent
public void setBinContent(int[] bin, int entries, double height, double[] mean, double[] rms)Set at once the content of a bin.- Specified by:
setBinContentin interfaceBinner- Parameters:
bin- The array specifying the bin.entries- The entries in the bin.height- The height of the bin.mean- The array with the coordinate meansrms- The array with the coordinate rmss
-
addContentToBin
public void addContentToBin(int[] bin, int entries, double height, double[] mean, double[] rms)Description copied from interface:BinnerAdd a set of entries to the existing content of the bin. Notice that this is meant to be used instead of fill ONLY when the number of entries in the set is greater than one.- Specified by:
addContentToBinin interfaceBinner- Parameters:
bin- The array specifying the bin.entries- The entries in the bin.height- The height of the bin.mean- The array with the coordinate meansrms- The array with the coordinate rmss
-
removeContentFromBin
public void removeContentFromBin(int[] bin, int entries, double height, double[] mean, double[] rms)Description copied from interface:BinnerRemove a set of entries from a bin.- Specified by:
removeContentFromBinin interfaceBinner- Parameters:
bin- The array specifying the bin.entries- The entries in the bin.height- The height of the bin.mean- The array with the coordinate meansrms- The array with the coordinate rmss
-
resetBin
public void resetBin(int[] bin)
Reset the content of a bin.
-
entries
public int entries(int[] bin)
Get the number of entries in a bin.
-
height
public double height(int[] bin)
Get the height of a bin.
-
plusError
public double plusError(int[] bin)
Get the plus error on a bin.
-
minusError
public double minusError(int[] bin)
Get the minus error on a bin.- Specified by:
minusErrorin interfaceBinner- Parameters:
bin- The array specifying the bin.
-
mean
public double mean(int[] bin, int coord)Get the mean of a bin along a given coordinate.
-
rms
public double rms(int[] bin, int coord)Get the rms of a bin along a given coordinate.
-
scale
public void scale(double scaleFactor)
Scale all the bins by a given scale factor.
-
setBinError
public void setBinError(BinError binError)
Set the BinError with which the plus and minus error on the bin are calculated.- Parameters:
binError- The BinError.
-
-
DMelt 3.0 © DataMelt by jWork.ORG