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

Implements a 2D histogram. More...

#include <histogram2d.h>

+ Collaboration diagram for utilities::Histogram2D:

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

Detailed Description

Implements a 2D histogram.

This class needs some work.

Constructor & Destructor Documentation

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

utilities::Histogram2D::~Histogram2D ( )
inline

Member Function Documentation

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

Todo:
update to new Generic_wrapper

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

Member Data Documentation

double utilities::Histogram2D::bin_width1_
protected

Width of each bin.

Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().

double utilities::Histogram2D::bin_width2_
protected

Width of each bin.

Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().

double utilities::Histogram2D::bottom_edge1_
protected

The minimum value to be included in the histogram.

Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().

double utilities::Histogram2D::bottom_edge2_
protected

The minimum value to be included in the histogram.

Referenced by add_data_point(), Histogram2D(), and output_to_wrapper().

std::vector<int> utilities::Histogram2D::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::Histogram2D::number_bins1_
protected

Total number of bins.

Referenced by add_data_point(), and output_to_wrapper().

int utilities::Histogram2D::number_bins2_
protected

Total number of bins.

Referenced by output_to_wrapper().

int utilities::Histogram2D::over_count1_
protected

Number of points that are over the top of the histogram.

Referenced by add_data_point().

int utilities::Histogram2D::over_count2_
protected

Number of points that are over the top of the histogram.

Referenced by add_data_point().

double utilities::Histogram2D::top_edge1_
protected

The maximum value to be included in the histogram.

Referenced by add_data_point(), and Histogram2D().

double utilities::Histogram2D::top_edge2_
protected

The maximum value to be included in the histogram.

Referenced by add_data_point(), and Histogram2D().

int utilities::Histogram2D::under_count1_
protected

Number of points that are below the bottom of the histogram.

Referenced by add_data_point().

int utilities::Histogram2D::under_count2_
protected

Number of points that are below the bottom of the histogram.

Referenced by add_data_point().


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