Particle Identification and Tracking
Public Member Functions | Protected Attributes | List of all members
utilities::Histogram Class Reference

Base class for historgram objects. More...

#include <histogram.h>

+ Collaboration diagram for utilities::Histogram:

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...
 

Detailed Description

Base class for historgram objects.

Implements a linearly spaced histogram.

Constructor & Destructor Documentation

Histogram::Histogram ( int  num_bins,
float  bottom,
float  top 
)

Default constructor.

References bin_width_, bottom_edge_, and top_edge_.

utilities::Histogram::~Histogram ( )
inline

Member Function Documentation

template<class T >
void utilities::Histogram::add_data_point ( 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

Parameters
gGnuplot 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_.

int utilities::Histogram::get_over_count ( )
inline

Get the number of elements added that were greater than the maximum value.

References over_count_.

int utilities::Histogram::get_under_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
void Histogram::print ( ) const

Spits something reasonable out to std.

References hist_array_, over_count_, and under_count_.

Member Data Documentation

float utilities::Histogram::bin_width_
protected

Width of each bin.

Referenced by add_data_point(), get_bin_edges(), Histogram(), and output_to_wrapper().

float utilities::Histogram::bottom_edge_
protected

The minimum value to be included in the histogram.

Referenced by add_data_point(), get_bin_edges(), Histogram(), and output_to_wrapper().

std::vector<int> utilities::Histogram::hist_array_
protected

Vector of the number of counts per bin.

Referenced by add_data_point(), get_bin_values(), output_to_wrapper(), and print().

int utilities::Histogram::number_bins_
protected

Total number of bins.

Referenced by get_bin_edges().

int utilities::Histogram::over_count_
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().

float utilities::Histogram::top_edge_
protected

The maximum value to be included in the histogram.

Referenced by add_data_point(), get_bin_edges(), Histogram(), and output_to_wrapper().

int utilities::Histogram::under_count_
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().


The documentation for this class was generated from the following files: