12#include <boost/histogram/fwd.hpp>
13#include <boost/histogram/make_histogram.hpp>
14#include <boost/serialization/access.hpp>
24 template<
class ValueType>
35 template<
class OtherValueType>
69 fSumW2 += w.value * w.value;
132 template<
class Archive>
135 ar& make_nvp(
"fSumWV",
fSumWV);
136 ar& make_nvp(
"fSumWV2",
fSumWV2);
137 ar& make_nvp(
"fSumW",
fSumW);
138 ar& make_nvp(
"fSumW2",
fSumW2);
148#ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
151 template<
class T,
class U>
153 struct common_type<
boost::histogram::RootStyleProfileAccumulator<T>,
166 template<
class Axis,
class... Axes,
class = detail::requires_axis<Axis>>
170 std::forward<Axes>(axes)...);
A ROOT-style accumulator for the Boost-histogram profiles.
Value_t GetMean() const noexcept
Returns the mean value.
RootStyleProfileAccumulator(const RootStyleProfileAccumulator< OtherValueType > &other)
Copy constructor from the instances with other types.
ConstRef_t GetSumWV() const noexcept
Returns sum of products of weight multiplied by value.
bool operator==(const RootStyleProfileAccumulator &rhs) const noexcept
Equality operator.
void serialize(Archive &ar, const unsigned int)
Serialization rule.
RootStyleProfileAccumulator & operator*=(ConstRef_t s) noexcept
Scales all entries by value.
bool operator!=(const RootStyleProfileAccumulator &rhs) const noexcept
Non-equality operator.
void operator()(ConstRef_t v)
Inserts sample with 1. weight.
ConstRef_t GetSumW2() const noexcept
Returns sum of weight squares.
Value_t fSumWV
Sum of weight * value.
Value_t fSumW2
Sum of squared weights.
void operator()(const Weight_t &w, ConstRef_t v)
Inserts sample with weight.
Value_t GetSEM() const noexcept
Returns standard error of the mean.
RootStyleProfileAccumulator & operator+=(const RootStyleProfileAccumulator &rhs)
Adds another accumulator.
Value_t fSumW
Sum of weights.
Value_t fSumWV2
Sum of weight * value * value.
ConstRef_t GetSumW() const noexcept
Returns sum of weights.
RootStyleProfileAccumulator()=default
Default constructor.
ConstRef_t GetSumWV2() const noexcept
Returns sum of products of weight multiplied by squared value.
const Value_t & ConstRef_t
Value_t GetEffCount() const noexcept
Returns effective sum of values.
Value_t GetStdDev() const noexcept
Returns standard deviation of the sample.
RootStyleProfileAccumulator(ConstRef_t sumWV, ConstRef_t sumWV2, ConstRef_t sumW, ConstRef_t sumW2)
Constructor from the external counters.
Value_t GetVariance() const noexcept
Returns variance.
friend class boost::serialization::access
weight_type< Value_t > Weight_t
dense_storage< RootStyleProfileAccumulator< T > > RootStyleProfileStorage
auto MakeRootStyleProfile(Axis &&axis, Axes &&... axes)
Maker for RootStyleProfileAccumulator.