histogram.hpp
Go to the documentation of this file.
double & operator()(uint32_t i)
Return a reference to the weight on bin i.
Definition: histogram.hpp:204
void get_bin_range(double &min, double &max) const
Return bin range.
Definition: histogram.cpp:185
const std::vector< double > & get_data(void) const
Return a reference to the histogram data.
Definition: histogram.hpp:194
void accumulate_linear(double x, double weight=1.0)
Accumulate weight on bins around x linearly.
Definition: histogram.cpp:242
void get_range(double range[2]) const
Return data range.
Definition: histogram.cpp:271
void accumulate(uint32_t i)
Accumulate unity weight on bin i.
Definition: histogram.hpp:130
const Histogram1D & operator*=(double x)
Scale histogram.
Definition: histogram.cpp:287
double coord(uint32_t i) const
Return the coordinate on bin i.
Definition: histogram.cpp:265
void accumulate_closest(double x, double weight=1.0)
Accumulate weight to closest bin to x.
Definition: histogram.cpp:199
const double & operator()(uint32_t i) const
Return a const reference to the weight on bin i.
Definition: histogram.hpp:198
Histogram1D(uint32_t n, const double range[2])
Constructor for n bin histogram with ranges.
Definition: histogram.cpp:51
std::vector< double > & get_data(void)
Return a reference to the histogram data.
Definition: histogram.hpp:190
void accumulate(uint32_t i, double weight)
Accumulate weight on bin i.
Definition: histogram.hpp:122
void convert_to_density(void)
Convert histogram to density.
Definition: histogram.cpp:278
void accumulate_closest(double x, double y, double weight)
Accumulate weight to closest bin to (x,y).
Definition: histogram.cpp:547
void get_bin_range(double &min, double &max) const
Return bin range.
Definition: histogram.cpp:532
double jcoord(uint32_t j) const
Return the coordinate along the second axis on bin j.
Definition: histogram.cpp:497
const Histogram2D & operator*=(double x)
Scale histogram.
Definition: histogram.cpp:521
uint32_t m(void) const
Return the number of bins along the second axis.
Definition: histogram.hpp:260
void accumulate(uint32_t i, uint32_t j, double weight)
Accumulate weight on bin (i,j).
Definition: histogram.hpp:282
double icoord(uint32_t i) const
Return the coordinate along the first axis on bin i.
Definition: histogram.cpp:491
const std::vector< double > & get_data(void) const
Return a reference to the histogram data.
Definition: histogram.hpp:328
Histogram2D(uint32_t n, uint32_t m, const double range[4])
Constructor for n x m histogram with ranges.
Definition: histogram.cpp:304
const double & operator()(uint32_t i, uint32_t j) const
Return a const reference to the weight on bin (i,j).
Definition: histogram.hpp:332
void convert_to_density(void)
Convert histogram to density.
Definition: histogram.cpp:512
double nstep(void) const
Return the step size along along the first axis.
Definition: histogram.hpp:264
double & operator()(uint32_t i, uint32_t j)
Return a reference to the weight on bin (i,j).
Definition: histogram.hpp:338
uint32_t n(void) const
Return the number of bins along the first axis.
Definition: histogram.hpp:256
double mstep(void) const
Return the step size along along the second axis.
Definition: histogram.hpp:268
void get_range(double range[4]) const
Return data range.
Definition: histogram.cpp:503
std::vector< double > & get_data(void)
Return a reference to the histogram data.
Definition: histogram.hpp:322
void accumulate_linear(double x, double y, double weight)
Accumulate weight on bins around (x,y) linearly.
Definition: histogram.cpp:558
histogram_accumulation_e
Histogram accumulation type.
Definition: histogram.hpp:53
@ HISTOGRAM_ACCUMULATION_CLOSEST
Closest bin to point.
Definition: histogram.hpp:54
@ HISTOGRAM_ACCUMULATION_LINEAR
Linear accumulation around point.
Definition: histogram.hpp:55