|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ACTSUTILS_STAT_H
6 #define ACTSUTILS_STAT_H 1
27 unsigned int n()
const {
return m_n; }
32 double rms()
const {
return std::sqrt(
rms2() ); }
61 template <
class T_Stream>
64 out << std::setw(14) <<
stat.min() <<
" < "
65 << std::setw(14) <<
stat.mean() <<
" +- " << std::setw(14) <<
stat.rms() <<
" < "
66 << std::setw(14) <<
stat.max()
67 <<
" / " << std::setw(9) <<
stat.n();
70 out << std::setw(14*4+9+3*3+4) <<
stat.mean();
137 for (
unsigned int bin_i=0; bin_i<
m_histogram.size(); ++bin_i) {
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;
Extend Stat helper by an equidistant binned histogram.
Stat & operator+=(const Stat &b)
@breif Add the statistics gathered in the Stat object b
double lowerEdge(unsigned int i) const
Get the lower edge of the given bin.
@ u
Enums for curvilinear frames.
Simple class to gather statistics : min, max, mean, rms.
void add(double val)
@bruef Gather a new value will update min, max and the sums to compute mean and rms
void dumpStat(T_Stream &out, const Stat &stat)
Dump the given statistics object to the given output stream.
StatHist()=default
The default constructor will disable histogramming.
std::string histogramToString() const
Create a string showing the contents of the histogram The string.
StatHist & operator+=(const StatHist &b)
Add the statistucs and histogrammed data fro the given object.
StatHist createEmptyClone()
StatHist(unsigned int n_bins, float xmin, float xmax)
Set up class to also fill a histogram.
void setBinning(unsigned int n_bins, float xmin, float xmax)
Define histogramm bins and enable histogramming.
std::ostream & operator<<(std::ostream &out, const Stat &stat)
void reset()
Set statistics to zero.
void add(double val)
Gather statistics and fill the histogram if not disabled.
void reset()
Set histogram contents and statistics to zero.
std::vector< unsigned int > m_histogram