Particle Identification and Tracking
|
Implements a 2D histogram. More...
#include <histogram2d.h>
Public Member Functions | |
template<class T > | |
void | add_data_point (T in1, T in2) |
Add a data point to the histogram. More... | |
std::vector< int > | get_bin_values () |
Returns a vector of length number_bins of the values in the bins. More... | |
void | print () |
Spits something reasonable out to std. More... | |
Histogram2D (int num_bins1, double bottom1, double top1, int num_bins2, double bottom2, double top2) | |
Default constructor. More... | |
void | output_to_wrapper (Generic_wrapper_base *wrapper_out) |
Out puts the values of the histogram to a (bins +2)x2 array. More... | |
~Histogram2D () | |
void | add_data_point (const utilities::Tuple< float, 2 > &in) |
Adds a data point using a Tuple. More... | |
Protected Attributes | |
std::vector< int > | hist_array_ |
Vector of the number of counts per bin. More... | |
int | under_count1_ |
Number of points that are below the bottom of the histogram. More... | |
int | over_count1_ |
Number of points that are over the top of the histogram. More... | |
int | number_bins1_ |
Total number of bins. More... | |
double | top_edge1_ |
The maximum value to be included in the histogram. More... | |
double | bottom_edge1_ |
The minimum value to be included in the histogram. More... | |
double | bin_width1_ |
Width of each bin. More... | |
int | under_count2_ |
Number of points that are below the bottom of the histogram. More... | |
int | over_count2_ |
Number of points that are over the top of the histogram. More... | |
int | number_bins2_ |
Total number of bins. More... | |
double | top_edge2_ |
The maximum value to be included in the histogram. More... | |
double | bottom_edge2_ |
The minimum value to be included in the histogram. More... | |
double | bin_width2_ |
Width of each bin. More... | |
Implements a 2D histogram.
This class needs some work.
Histogram2D::Histogram2D | ( | int | num_bins1, |
double | bottom1, | ||
double | top1, | ||
int | num_bins2, | ||
double | bottom2, | ||
double | top2 | ||
) |
Default constructor.
References bin_width1_, bin_width2_, bottom_edge1_, bottom_edge2_, top_edge1_, and top_edge2_.
|
inline |
void utilities::Histogram2D::add_data_point | ( | T | in1, |
T | in2 | ||
) |
Add a data point to the histogram.
This may be better to do with just a number of overlaoded functions.
References bin_width1_, bin_width2_, bottom_edge1_, bottom_edge2_, hist_array_, number_bins1_, over_count1_, over_count2_, top_edge1_, top_edge2_, under_count1_, and under_count2_.
void utilities::Histogram2D::add_data_point | ( | const utilities::Tuple< float, 2 > & | in) |
Adds a data point using a Tuple.
vectori Histogram2D::get_bin_values | ( | ) |
Returns a vector of length number_bins of the values in the bins.
References hist_array_.
void Histogram2D::output_to_wrapper | ( | Generic_wrapper_base * | wrapper_out) |
Out puts the values of the histogram to a (bins +2)x2 array.
the first column is the values of the bins, the second the bottom edge of the bins. The extra entry at the end are the number of entries outside of the
References bin_width1_, bin_width2_, bottom_edge1_, bottom_edge2_, hist_array_, number_bins1_, and number_bins2_.
void Histogram2D::print | ( | ) |
Spits something reasonable out to std.
References hist_array_.
|
protected |
Width of each bin.
Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().
|
protected |
Width of each bin.
Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().
|
protected |
The minimum value to be included in the histogram.
Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().
|
protected |
The minimum value to be included in the histogram.
Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().
|
protected |
Vector of the number of counts per bin.
Referenced by add_data_point(), get_bin_values(), output_to_wrapper(), and print().
|
protected |
Total number of bins.
Referenced by add_data_point(), and output_to_wrapper().
|
protected |
Total number of bins.
Referenced by output_to_wrapper().
|
protected |
Number of points that are over the top of the histogram.
Referenced by add_data_point().
|
protected |
Number of points that are over the top of the histogram.
Referenced by add_data_point().
|
protected |
The maximum value to be included in the histogram.
Referenced by add_data_point(), and Histogram2D().
|
protected |
The maximum value to be included in the histogram.
Referenced by add_data_point(), and Histogram2D().
|
protected |
Number of points that are below the bottom of the histogram.
Referenced by add_data_point().
|
protected |
Number of points that are below the bottom of the histogram.
Referenced by add_data_point().