20 Histo1D::Histo1D(uint32_t numBins,
double minValue,
double maxValue,
const std::string& name,
21 const std::string& title)
28 if (numBins == 0 || maxValue <= minValue)
29 throw std::runtime_error(
"Histo1D: Invalid specifications " + std::to_string(numBins) +
" "
30 + std::to_string(minValue) +
" " + std::to_string(maxValue));
74 for (uint32_t bin = 0; bin <
fNumBins; bin++) {
90 for (uint32_t bin = 0; bin <
fNumBins; bin++)
95 throw std::runtime_error(
"Histo1D: Trying to add incompatible histograms");
106 for (uint32_t bin = 0; bin <
fNumBins; bin++) {
111 double mean =
Mean();
112 return sqrt(sum1 / sum2 - mean * mean);
119 std::stringstream ss;
122 <<
" title <" <<
fTitle <<
">";
friend fvec sqrt(const fvec &a)
double Content(uint32_t bin) const
Histogram content in a bin.
void Clear()
Clear histogram contents.
double Stddev() const
Second moment of distribution.
double Mean() const
First moment of distribution.
Histo1D & operator+=(const Histo1D &other)
Add another histogram to an existing one.
std::string ToString() const
Properties to string.
void Add(double value, double weight=1.)
Add an entry to the histogram.
std::vector< double > fContent
Histo1D()
Default constructor: needed for boost serialization of vector of Histo1D, need copy ctor call after!