![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Data stucture for histograms of arbitray large dimensions. More...
#include <Histogram.hh>
Public Member Functions | |
| Histogram () | |
| Default constructor, initilizes everything to 0. More... | |
| Histogram (std::vector< size_t > number, const std::vector< double > &lower, const std::vector< double > &upper) | |
| Empty constructor, builds a histogram from the requested binning. More... | |
| Histogram (const Histogram &hist) | |
| Copy constructor. More... | |
| Histogram & | operator= (const Histogram &hist) |
| Equality operator. More... | |
| ~Histogram () | |
| Destructor. More... | |
| void | Initialize () |
| Initializes the histogram from the produced grid. More... | |
| void | Fill (const std::vector< double > &point, const double w=1.) |
| Fills the histogram with a given point and weight w. More... | |
| void | FillN (const std::vector< std::vector< double >> &points, const std::vector< double > w=std::vector< double >()) |
| Fills the histogram with an array of points with weights w. More... | |
| Bin | GetBin (const std::vector< size_t > &indices) const |
| Returns the bin as a Bin object (knows its indices, bounds and content) More... | |
| std::vector< Bin > | GetBinArray () const |
| Returns all the bins as an array of Bin objects. More... | |
| std::vector< double > | GetBinBarycentre (const std::vector< size_t > &indices) const |
| Returns the bin barycentre in the dimension of the space. More... | |
| double | GetBinCentre (const size_t index, const size_t i=0) const |
| Returns the bin centre in a particular dimension. More... | |
| void | SetBinContent (const std::vector< size_t > &indices, const double value) |
| Sets the content of bin indices. More... | |
| const double & | GetBinContent (const std::vector< size_t > &indices) const |
| Returns the content of bin indices. More... | |
| double | GetBinDensity (const std::vector< size_t > &indices) const |
| Returns an estimation of the probability density function in bin indices. More... | |
| std::vector< size_t > | GetBinID (const std::vector< double > &point) const |
| Returns the ids of the bin that contains the requested point. More... | |
| double | GetBinVolume () const |
| Returns the volume of a bin in this bucketting. More... | |
| const double & | GetBinWidth (const size_t i=0) const |
| Returns the bin width in a particular dimension. More... | |
| const size_t | GetEntries () const |
| Returns the amount of entries. More... | |
| const size_t & | GetDimension () const |
| Returns the dimension of the space. More... | |
| const std::vector< double > & | GetLowerBoundArray () const |
| Returns the array of lower bounds in each dimension. More... | |
| const double & | GetLowerBound (const size_t i=0) const |
| Returns the lower bound in dimension i. More... | |
| const std::vector< double > & | GetUpperBoundArray () const |
| Returns the array of upper bounds in each dimension. More... | |
| const double & | GetUpperBound (const size_t i=0) const |
| Returns the upper bound in dimension i. More... | |
| const Grid & | GetGrid () const |
| Returns the grid that encompasses the bins. More... | |
| Grid | GetInterpolationGrid () const |
| Returns a grid of the bin centres on which to interpolate. More... | |
| size_t | GetNbins () const |
| Returns the amount of total amount of bins (n-dimensional buckets) More... | |
| size_t | GetNbins (const size_t i=0) const |
| Returns the amount of bins in one projection. More... | |
| void | Scale (const double factor) |
| Scales the histogram by a certain factor. More... | |
| void | ScaleToDensity (const double norm=1.) |
| Scales the histogram contents to the estimated density. More... | |
| TObject * | ToROOT (const std::string name="") const |
| Returns a ROOT histogram for dimensions below 3. More... | |
Private Attributes | |
| Grid | _grid |
| Grid that contains the space division. More... | |
| std::vector< std::vector < double > > | _points |
| Points that filled the histogram. More... | |
| std::vector< double > | _contents |
| Binned data. More... | |
| std::vector< double > | _outflows |
| Under/overflow bins (3^_dim-1 bins) More... | |
Data stucture for histograms of arbitray large dimensions.
Produces a bucketing, provided with a set of data points in n dimensions. Returns the binning, their contents and densities.
The underlying structure is a Grid object. A histogram of
bins is simply a grid of
points that separates the right amount of cells.
| Histogram::Histogram | ( | ) |
Default constructor, initilizes everything to 0.
| Histogram::Histogram | ( | std::vector< size_t > | number, |
| const std::vector< double > & | lower, | ||
| const std::vector< double > & | upper | ||
| ) |
Empty constructor, builds a histogram from the requested binning.
| number | Number of bins in each projection |
| lower | Lower boundaries in each projection |
| upper | Upper boundaries in each projection |
| Histogram::Histogram | ( | const Histogram & | hist | ) |
Copy constructor.
| Histogram::~Histogram | ( | ) |
Destructor.
| void Histogram::Fill | ( | const std::vector< double > & | point, |
| const double | w = 1. |
||
| ) |
Fills the histogram with a given point and weight w.
| void Histogram::FillN | ( | const std::vector< std::vector< double >> & | points, |
| const std::vector< double > | w = std::vector<double>() |
||
| ) |
Fills the histogram with an array of points with weights w.
| Bin Histogram::GetBin | ( | const std::vector< size_t > & | indices | ) | const |
Returns the bin as a Bin object (knows its indices, bounds and content)
| std::vector< Bin > Histogram::GetBinArray | ( | ) | const |
Returns all the bins as an array of Bin objects.
| std::vector< double > Histogram::GetBinBarycentre | ( | const std::vector< size_t > & | indices | ) | const |
Returns the bin barycentre in the dimension of the space.
| double Histogram::GetBinCentre | ( | const size_t | index, |
| const size_t | i = 0 |
||
| ) | const |
Returns the bin centre in a particular dimension.
| const double & Histogram::GetBinContent | ( | const std::vector< size_t > & | indices | ) | const |
Returns the content of bin indices.
| double Histogram::GetBinDensity | ( | const std::vector< size_t > & | indices | ) | const |
Returns an estimation of the probability density function in bin indices.
| std::vector< size_t > Histogram::GetBinID | ( | const std::vector< double > & | point | ) | const |
Returns the ids of the bin that contains the requested point.
| double Histogram::GetBinVolume | ( | ) | const |
Returns the volume of a bin in this bucketting.
|
inline |
Returns the bin width in a particular dimension.
|
inline |
Returns the dimension of the space.
|
inline |
Returns the amount of entries.
|
inline |
Returns the grid that encompasses the bins.
| Grid Histogram::GetInterpolationGrid | ( | ) | const |
Returns a grid of the bin centres on which to interpolate.
|
inline |
Returns the lower bound in dimension i.
|
inline |
Returns the array of lower bounds in each dimension.
| size_t Histogram::GetNbins | ( | ) | const |
Returns the amount of total amount of bins (n-dimensional buckets)
|
inline |
Returns the amount of bins in one projection.
|
inline |
Returns the upper bound in dimension i.
|
inline |
Returns the array of upper bounds in each dimension.
| void Histogram::Initialize | ( | ) |
Initializes the histogram from the produced grid.
| void Histogram::Scale | ( | const double | factor | ) |
Scales the histogram by a certain factor.
| void Histogram::ScaleToDensity | ( | const double | norm = 1. | ) |
Scales the histogram contents to the estimated density.
| void Histogram::SetBinContent | ( | const std::vector< size_t > & | indices, |
| const double | value | ||
| ) |
Sets the content of bin indices.
| TObject * Histogram::ToROOT | ( | const std::string | name = "" | ) | const |
Returns a ROOT histogram for dimensions below 3.
|
private |
Binned data.
|
private |
Under/overflow bins (3^_dim-1 bins)
|
private |
Points that filled the histogram.
1.8.6