HerdSoftware  0.3.2
Public Member Functions | Public Attributes | List of all members
BinnedProfile< T > Struct Template Reference

Handler struct for binned profile of various variables. More...

#include <BinnedProfile.h>

Public Member Functions

 BinnedProfile (unsigned int n, T v)
 Construct a new binned profile. More...
 
void SetRange (float start, float end)
 Setup the bin edges from a given range. More...
 

Public Attributes

std::vector< T > values
 
std::vector< float > binEdges
 The bin contents. More...
 

Detailed Description

template<typename T>
struct BinnedProfile< T >

Handler struct for binned profile of various variables.

This class is meant to be a helper for handling binning of countinuous or irregularly-sampled quantities. It holds both the values of the distribution in each bin as well as the edges of each bin. (If you have N bins, there will be N values and N+1 bin edges).

Template Parameters
Tthe type of the binned variable

Constructor & Destructor Documentation

◆ BinnedProfile()

template<typename T>
BinnedProfile< T >::BinnedProfile ( unsigned int  n,
v 
)
inline

Construct a new binned profile.

Be sure to call SetRange after constructing a new profile in order to properly compute the bin edges

Parameters
nThe number of values to be hold (number of bins)
vThe initial (default) value for the bin content

Member Function Documentation

◆ SetRange()

template<typename T>
void BinnedProfile< T >::SetRange ( float  start,
float  end 
)
inline

Setup the bin edges from a given range.

Parameters
startThe lower bin edge of the first bin
endThe upper bin edge of the last bin

Member Data Documentation

◆ binEdges

template<typename T>
std::vector<float> BinnedProfile< T >::binEdges

The bin contents.

◆ values

template<typename T>
std::vector<T> BinnedProfile< T >::values

The documentation for this struct was generated from the following file: