MarlinUtil  1.12.1
PseudoHistogram.h
1 #include <iostream>
2 #include <math.h>
3 
12 
13  public:
14 
23  PseudoHistogram(int NOfBins, double min, double max);
24 
29 
34  void clearContent();
35 
42  void fill(double x, double w);
43 
51  int findBin(double x);
52 
58  double getBinContent(int bin);
59 
65  int getNumberOfEntries(int bin);
66 
73  bool isInRange(int bin);
74 
82  double integral(int startbin, int endbin);
83 
87  void printContent();
88 
89 
90  private:
91  int _FullNumberOfBins; // number of bins plus the over- and undeflow bin
92  int _NumberOfBins; // number of bins without the over- and undeflow bin
93  double _MinValue;
94  double _MaxValue;
95  double _BinWidth;
96  int* _NOfEntries;
97  double* _Content;
98  double* _UpperIntervalLimit;
99 
100 };
Simple class with a histogram-like array without any display features.
Definition: PseudoHistogram.h:11
int getNumberOfEntries(int bin)
Returns number of entries in bin.
Definition: PseudoHistogram.cc:116
~PseudoHistogram()
Destructor.
Definition: PseudoHistogram.cc:33
void fill(double x, double w)
Fill a value x with the weight w to the pseudo-histogram.
Definition: PseudoHistogram.cc:58
PseudoHistogram(int NOfBins, double min, double max)
Constructor with number of bins and lower and upper boundaries.
Definition: PseudoHistogram.cc:10
void clearContent()
Clears the content but leaves the structure of the object, i. e. bins and boundaries.
Definition: PseudoHistogram.cc:47
bool isInRange(int bin)
Checks if bin is in range of the pseudo-histogram (over- and underflow bins are taken into account) ...
Definition: PseudoHistogram.cc:130
int findBin(double x)
Find the bin containing x.
Definition: PseudoHistogram.cc:83
double getBinContent(int bin)
Returns content of bin.
Definition: PseudoHistogram.cc:102
void printContent()
Prints content of the pseudo-histogram on the standard output.
Definition: PseudoHistogram.cc:160
double integral(int startbin, int endbin)
Returns the weighted sum of the pseudo-histogram within startbin and endbin.
Definition: PseudoHistogram.cc:141