| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | List of all members
Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity > Struct Template Reference

A counter aiming at computing sum and average. More...

`#include <GaudiKernel/Counters.h>`

Inheritance diagram for Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >:
[legend]
Collaboration diagram for Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >:
[legend]

## Public Member Functions
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...
Public Member Functions inherited from Gaudi::Accumulators::BufferableCounter< Arithmetic, Atomicity, Accumulator >
Buffer< Arithmetic, Accumulator > | buffer ()
| PrintableCounter ()=default
template<class OWNER >
| PrintableCounter (OWNER *o, const std::string &tag)
Public Member Functions inherited from Gaudi::Accumulators::PrintableCounter
| PrintableCounter ()=default
template<class OWNER >
| PrintableCounter (OWNER *o, const std::string &tag)
virtual | ~PrintableCounter ()=default
| destructor More...
template<typename stream >
stream & | printImpl (stream &s, const std::string &tag) const
virtual std::ostream & | print (std::ostream &o, const std::string &tag) const
| prints the counter to a stream in table format, with the given tag More...
virtual MsgStream & | print (MsgStream &o, const std::string &tag) const
std::string | toString () const
| get a string representation More...
Public Member Functions inherited from Gaudi::Accumulators::AveragingAccumulator< Arithmetic, Atomicity >
template<typename Result = fp_result_type<Arithmetic>>
auto | mean () const
Public Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
constexpr | AccumulatorSet ()=default
AccumulatorSet & | operator+= (const InputType by)
OutputType | value () const
void | reset ()
template<atomicity Ato>
void | mergeAndReset (AccumulatorSet< Arithmetic, Ato, Bases... > &&other)

## Additional Inherited Members
Public Types inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
using | InputType = Arithmetic
using | OutputType = std::tuple< typename Bases< Arithmetic, Atomicity >::OutputType... >
Protected Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
void | reset (const std::tuple< typename Bases< Arithmetic, Atomicity >::OutputType... > &t)

## Detailed Description

### template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
struct Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >

A counter aiming at computing sum and average.

See also
  Gaudi::Accumulators for detailed documentation

Definition at line 688 of file Counters.h.

## Member Function Documentation

## ◆ print() [1/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

std::ostream& Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >::print | ( | std::ostream & | ,
|  | bool | tableFormat = `false`
| ) |  | const
| inline override virtual

prints the counter to a stream

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 699 of file Counters.h.

699 {
700 return printImpl( o, tableFormat );
701 }
Gaudi::Accumulators::AveragingCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:694

## ◆ print() [2/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

MsgStream& Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >::print | ( | MsgStream & | o,
|  | bool | tableFormat = `false`
| ) |  | const
| inline override virtual

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 702 of file Counters.h.

702 { return printImpl( o, tableFormat ); }
Gaudi::Accumulators::AveragingCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:694

## ◆ printImpl()

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename stream >

stream& Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >::printImpl | ( | stream & | o,
|  | bool | tableFormat
| ) |  | const
| inline

Definition at line 694 of file Counters.h.

694 {
695 auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |" : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g|" );
696 return o << boost::format{fmt} % this->nEntries() % this->sum() % this->mean();
697 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:910
Gaudi::Accumulators::AveragingAccumulator::mean
auto mean() const
Definition: Counters.h:512

## ◆ toBePrinted()

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

bool Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >::toBePrinted | ( |  | ) | const
| inline override virtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 704 of file Counters.h.

704 {
705 return this->nEntries() > 0;
706 ;
707 }
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:910

The documentation for this struct was generated from the following file:

- GaudiKernel/GaudiKernel/Counters.h