Extend Stat helper by an equidistant binned histogram.
More...
#include <StatUtils.h>
Extend Stat helper by an equidistant binned histogram.
Definition at line 80 of file StatUtils.h.
◆ StatHist() [1/2]
ActsUtils::StatHist::StatHist |
( |
| ) |
|
|
default |
The default constructor will disable histogramming.
◆ StatHist() [2/2]
ActsUtils::StatHist::StatHist |
( |
unsigned int |
n_bins, |
|
|
float |
xmin, |
|
|
float |
xmax |
|
) |
| |
|
inline |
Set up class to also fill a histogram.
- Parameters
-
n_bins | number of bins without over and underflow |
the | value at the lower edge of the first bin |
the | value at the upper edge of the last bin |
Definition at line 89 of file StatUtils.h.
◆ add()
void ActsUtils::StatHist::add |
( |
double |
val | ) |
|
|
inline |
Gather statistics and fill the histogram if not disabled.
Definition at line 116 of file StatUtils.h.
◆ createEmptyClone()
StatHist ActsUtils::StatHist::createEmptyClone |
( |
| ) |
|
|
inline |
◆ histogramToString()
std::string ActsUtils::StatHist::histogramToString |
( |
| ) |
const |
|
inline |
Create a string showing the contents of the histogram The string.
Definition at line 152 of file StatUtils.h.
153 std::stringstream
msg;
155 unsigned int max_val = 0;
160 unsigned int w =
static_cast<unsigned int>(
log(1.*max_val) /
log(10.))+1;
163 << std::setw(wtitle) <<
"lower edge" <<
" |";
167 msg <<
" | " << std::endl;
◆ lowerEdge()
double ActsUtils::StatHist::lowerEdge |
( |
unsigned int |
i | ) |
const |
|
inline |
Get the lower edge of the given bin.
- Parameters
-
i | the bin (0: underflow; n+1 overflow) |
Definition at line 146 of file StatUtils.h.
◆ max()
double ActsUtils::Stat::max |
( |
| ) |
const |
|
inlineinherited |
◆ mean()
double ActsUtils::Stat::mean |
( |
| ) |
const |
|
inlineinherited |
◆ min()
double ActsUtils::Stat::min |
( |
| ) |
const |
|
inlineinherited |
◆ n()
unsigned int ActsUtils::Stat::n |
( |
| ) |
const |
|
inlineinherited |
◆ operator+=() [1/2]
@breif Add the statistics gathered in the Stat object b
Definition at line 44 of file StatUtils.h.
◆ operator+=() [2/2]
Add the statistucs and histogrammed data fro the given object.
Definition at line 134 of file StatUtils.h.
137 for (
unsigned int bin_i=0; bin_i<
m_histogram.size(); ++bin_i) {
◆ reset()
void ActsUtils::StatHist::reset |
( |
| ) |
|
|
inline |
Set histogram contents and statistics to zero.
Definition at line 126 of file StatUtils.h.
◆ rms()
double ActsUtils::Stat::rms |
( |
| ) |
const |
|
inlineinherited |
◆ rms2()
double ActsUtils::Stat::rms2 |
( |
| ) |
const |
|
inlineinherited |
◆ setBinning()
void ActsUtils::StatHist::setBinning |
( |
unsigned int |
n_bins, |
|
|
float |
xmin, |
|
|
float |
xmax |
|
) |
| |
|
inline |
Define histogramm bins and enable histogramming.
- Parameters
-
n_bins | number of bins without over and underflow |
the | value at the lower edge of the first bin |
the | value at the upper edge of the last bin |
Definition at line 98 of file StatUtils.h.
◆ m_histogram
std::vector<unsigned int> ActsUtils::StatHist::m_histogram |
◆ m_max
double ActsUtils::Stat::m_max =-std::numeric_limits<double>::max() |
|
inherited |
◆ m_min
double ActsUtils::Stat::m_min =std::numeric_limits<double>::max() |
|
inherited |
◆ m_n
unsigned int ActsUtils::Stat::m_n =0 |
|
inherited |
◆ m_scale
double ActsUtils::StatHist::m_scale {1.0} |
◆ m_sum
double ActsUtils::Stat::m_sum =0. |
|
inherited |
◆ m_sum2
double ActsUtils::Stat::m_sum2 =0. |
|
inherited |
◆ m_xmin
double ActsUtils::StatHist::m_xmin {} |
The documentation for this class was generated from the following file: