MarlinUtil  1.12.1
Public Member Functions | List of all members
PseudoHistogram Class Reference

Simple class with a histogram-like array without any display features. More...

#include <PseudoHistogram.h>

Public Member Functions

 PseudoHistogram (int NOfBins, double min, double max)
 Constructor with number of bins and lower and upper boundaries. More...
 
 ~PseudoHistogram ()
 Destructor.
 
void clearContent ()
 Clears the content but leaves the structure of the object, i. e. bins and boundaries.
 
void fill (double x, double w)
 Fill a value x with the weight w to the pseudo-histogram. More...
 
int findBin (double x)
 Find the bin containing x. More...
 
double getBinContent (int bin)
 Returns content of bin. More...
 
int getNumberOfEntries (int bin)
 Returns number of entries in bin. More...
 
bool isInRange (int bin)
 Checks if bin is in range of the pseudo-histogram (over- and underflow bins are taken into account) More...
 
double integral (int startbin, int endbin)
 Returns the weighted sum of the pseudo-histogram within startbin and endbin. More...
 
void printContent ()
 Prints content of the pseudo-histogram on the standard output.
 

Detailed Description

Simple class with a histogram-like array without any display features.

Author
O. Wendt (DESY)
Version
Id:
PseudoHistogram.h,v 1.4 2007-07-23 10:57:29 engels Exp

Constructor & Destructor Documentation

PseudoHistogram::PseudoHistogram ( int  NOfBins,
double  min,
double  max 
)

Constructor with number of bins and lower and upper boundaries.

Parameters
NOfBins: number of bins in the histogram. Over- and underflow bin are created additionally.
min: smallest value in the histogram
max: largest value in the histogram

Member Function Documentation

void PseudoHistogram::fill ( double  x,
double  w 
)

Fill a value x with the weight w to the pseudo-histogram.

Parameters
x: value to fill in the histogram
w: weight of the value x
int PseudoHistogram::findBin ( double  x)

Find the bin containing x.

Parameters
x: value on the x axis
Returns
the bin containing x
double PseudoHistogram::getBinContent ( int  bin)

Returns content of bin.

Parameters
bin: number of the bin

References isInRange().

Referenced by integral().

int PseudoHistogram::getNumberOfEntries ( int  bin)

Returns number of entries in bin.

Parameters
bin: number of the bin

References isInRange().

double PseudoHistogram::integral ( int  startbin,
int  endbin 
)

Returns the weighted sum of the pseudo-histogram within startbin and endbin.

Parameters
startbin: number of the start bin for the integral
endbin: number of the end bin for the integral

References getBinContent(), and isInRange().

bool PseudoHistogram::isInRange ( int  bin)

Checks if bin is in range of the pseudo-histogram (over- and underflow bins are taken into account)

Parameters
bin: number of the bin

Referenced by getBinContent(), getNumberOfEntries(), and integral().


The documentation for this class was generated from the following files: