A counter aiming at computing average and sum2 / variance / standard deviation.
More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators.h>
|
| template<typename OWNER > |
| | StatCounter (OWNER *o, std::string const &name) |
| |
| template<typename stream > |
| stream & | printImpl (stream &o, bool tableFormat) const |
| |
| std::ostream & | print (std::ostream &o, bool tableFormat=false) const override |
| | prints the counter to a stream More...
|
| |
| MsgStream & | print (MsgStream &o, bool tableFormat=false) const override |
| |
| bool | toBePrinted () const override |
| | hint whether we should print that counter or not. More...
|
| |
| | BufferableCounter ()=default |
| |
| | BufferableCounter (OWNER *o, std::string const &name) |
| |
| | BufferableCounter (BufferableCounter const &)=delete |
| |
| BufferType | buffer () |
| |
| BufferableCounter & | operator= (BufferableCounter const &)=delete |
| |
| | ~BufferableCounter () |
| |
| | PrintableCounter ()=default |
| |
| virtual | ~PrintableCounter ()=default |
| | destructor More...
|
| |
| template<typename stream > |
| stream & | printImpl (stream &s, std::string_view tag) const |
| |
| virtual std::ostream & | print (std::ostream &o, std::string_view tag) const |
| | prints the counter to a stream in table format, with the given tag More...
|
| |
| virtual MsgStream & | print (MsgStream &o, std::string_view tag) const |
| |
| std::string | toString () const |
| | get a string representation More...
|
| |
| constexpr | AccumulatorSet ()=default |
| |
| template<atomicity ato> |
| | AccumulatorSet (construct_empty_t, const AccumulatorSet< Arithmetic, ato, InputType, Bases... > &) |
| | constructor of an empty AccumulatorSet, copying the (non existent) config from another GenericAccumulator More...
|
| |
| AccumulatorSet & | operator+= (const InputType by) |
| |
| OutputType | value () const |
| |
| void | reset () |
| |
| template<atomicity Ato> |
| void | mergeAndReset (AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &other) |
| |
| template<atomicity Ato> |
| void | operator+ (AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &&other) |
| |
|
| static const std::string | typeString { std::string{ "counter:StatCounter:" } + typeid( Arithmetic ).name() } |
| |
| static const std::string | typeString |
| |
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
struct Gaudi::Accumulators::StatCounter< Arithmetic, Atomicity >
A counter aiming at computing average and sum2 / variance / standard deviation.
- See also
- Gaudi::Accumulators for detailed documentation
Definition at line 1053 of file Accumulators.h.
◆ StatCounter()
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename OWNER >
Definition at line 1057 of file Accumulators.h.
1058 : BufferableCounter<Atomicity, StatAccumulator, Arithmetic>( o,
name, *
this ) {}
◆ fromJSON()
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
Definition at line 1087 of file Accumulators.h.
1089 j, { { {
"nEntries",
"sum" },
"sum2" },
"min",
"max" } );
◆ print() [1/2]
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
◆ print() [2/2]
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
◆ printImpl()
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename stream >
Definition at line 1062 of file Accumulators.h.
1063 auto fmt = ( tableFormat ?
"|%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |"
1064 :
"#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g| +- %|-#10.5g| Min/Max=%|#10.4g|/%|-#10.4g|" );
1065 return o <<
boost::format{
fmt } % this->nEntries() % this->sum() % this->mean() % this->standard_deviation() %
1066 this->min() % this->max();
◆ toBePrinted()
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
◆ mergeAndReset
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
◆ reset
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
◆ to_json
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
| void to_json |
( |
nlohmann::json & |
j, |
|
|
StatCounter< Arithmetic, Atomicity > const & |
c |
|
) |
| |
|
friend |
Definition at line 1076 of file Accumulators.h.
1077 j = { {
"type",
c.typeString },
1078 {
"empty",
c.nEntries() == 0 },
1079 {
"nEntries",
c.nEntries() },
1081 {
"mean",
c.mean() },
1082 {
"sum2",
c.sum2() },
1083 {
"standard_deviation",
c.standard_deviation() },
1085 {
"max",
c.max() } };
◆ typeString
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
The documentation for this struct was generated from the following file: