Particle Identification and Tracking
|
Base class for historgram objects. More...
#include <histogram.h>
Public Member Functions | |
template<class T > | |
void | add_data_point (T in) |
Add a data point to the histogram. More... | |
std::vector< int > | get_bin_values () const |
Returns a vector of length number_bins of the values in the bins. More... | |
std::vector< float > | get_bin_edges () const |
Returns a vector of the edges in the bins, has length number_bins + 1. More... | |
void | print () const |
Spits something reasonable out to std. More... | |
int | get_over_count () |
Get the number of elements added that were greater than the maximum value. More... | |
int | get_under_count () |
Get the number of elements added that were less than the minimum value. More... | |
Histogram (int num_bins, float bottom, float top) | |
Default constructor. More... | |
void | output_to_wrapper (Generic_wrapper *wrapper_out, const std::string &g_name, const std::string &count_name, const std::string &edges_name, const Md_store *g_md_store) const |
Output data to the wrapper. More... | |
void | display () const |
displays the histogram using gnuplot More... | |
void | display (gnuplot::Gnuplot &g) const |
displays the histogram using gnuplot More... | |
~Histogram () | |
Protected Attributes | |
std::vector< int > | hist_array_ |
Vector of the number of counts per bin. More... | |
int | under_count_ |
Number of points that are below the bottom of the histogram. More... | |
int | over_count_ |
Number of points that are over the top of the histogram. More... | |
int | number_bins_ |
Total number of bins. More... | |
float | top_edge_ |
The maximum value to be included in the histogram. More... | |
float | bottom_edge_ |
The minimum value to be included in the histogram. More... | |
float | bin_width_ |
Width of each bin. More... | |
Base class for historgram objects.
Implements a linearly spaced histogram.
Histogram::Histogram | ( | int | num_bins, |
float | bottom, | ||
float | top | ||
) |
Default constructor.
References bin_width_, bottom_edge_, and top_edge_.
|
inline |
void utilities::Histogram::add_data_point | ( | T | in) |
Add a data point to the histogram.
This may be better to do with just a number of overlaoded functions.
References bin_width_, bottom_edge_, hist_array_, over_count_, top_edge_, and under_count_.
Referenced by tracking::Corr_theta_2pt::compute(), tracking::Track_shelf::disp_sq_hist(), and tracking::Track_shelf::track_length_histogram().
void utilities::Histogram::display | ( | ) | const |
displays the histogram using gnuplot
void utilities::Histogram::display | ( | gnuplot::Gnuplot & | g) | const |
displays the histogram using gnuplot
g | Gnuplot object to use |
vectord Histogram::get_bin_edges | ( | ) | const |
Returns a vector of the edges in the bins, has length number_bins + 1.
References bin_width_, bottom_edge_, number_bins_, and top_edge_.
vectori Histogram::get_bin_values | ( | ) | const |
Returns a vector of length number_bins of the values in the bins.
References hist_array_.
|
inline |
Get the number of elements added that were greater than the maximum value.
References over_count_.
|
inline |
Get the number of elements added that were less than the minimum value.
References under_count_.
void Histogram::output_to_wrapper | ( | Generic_wrapper * | wrapper_out, |
const std::string & | g_name, | ||
const std::string & | count_name, | ||
const std::string & | edges_name, | ||
const Md_store * | g_md_store | ||
) | const |
Output data to the wrapper.
References utilities::Generic_wrapper::add_dset(), utilities::Generic_wrapper::add_meta_data(), bin_width_, bottom_edge_, utilities::Generic_wrapper::close_group(), utilities::Generic_wrapper::close_wrapper(), hist_array_, utilities::Generic_wrapper::is_open(), utilities::Generic_wrapper::open_group(), utilities::Generic_wrapper::open_wrapper(), over_count_, top_edge_, under_count_, utilities::V_FLOAT, and utilities::V_INT.
Referenced by main(), and tracking::Corr_theta_2pt::out_to_wrapper().
void Histogram::print | ( | ) | const |
Spits something reasonable out to std.
References hist_array_, over_count_, and under_count_.
|
protected |
Width of each bin.
Referenced by add_data_point(), get_bin_edges(), Histogram(), and output_to_wrapper().
|
protected |
The minimum value to be included in the histogram.
Referenced by add_data_point(), get_bin_edges(), Histogram(), 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 get_bin_edges().
|
protected |
Number of points that are over the top of the histogram.
Referenced by add_data_point(), get_over_count(), output_to_wrapper(), and print().
|
protected |
The maximum value to be included in the histogram.
Referenced by add_data_point(), get_bin_edges(), Histogram(), and output_to_wrapper().
|
protected |
Number of points that are below the bottom of the histogram.
Referenced by add_data_point(), get_under_count(), output_to_wrapper(), and print().