The Gaudi Framework  v32r0 (3325bb39)
Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity > Struct Template Reference

A counter dealing with binomial data. More...

#include <GaudiKernel/Counters.h>

Inheritance diagram for Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >:
Collaboration diagram for Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >:

Public Member Functions

template<typename stream >
stream & printImpl (stream &o, bool tableFormat) const
 
std::ostreamprint (std::ostream &o, bool tableFormat=false) const override
 prints the counter to a stream More...
 
MsgStreamprint (MsgStream &o, bool tableFormat=false) const override
 
template<typename stream >
stream & printImpl (stream &o, const std::string &tag) const
 
virtual std::ostreamprint (std::ostream &o, const std::string &tag) const override
 prints the counter to a stream in table format, with the given tag More...
 
virtual MsgStreamprint (MsgStream &o, const std::string &tag) const override
 
virtual 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 ()
 
- 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
 
std::string toString () const
 get a string representation More...
 
- Public Member Functions inherited from Gaudi::Accumulators::BinomialAccumulator< Arithmetic, Atomicity >
unsigned long nEntries () const
 
template<typename Result = fp_result_type<Arithmetic>>
auto efficiency () const
 
auto eff () const
 
template<typename Result = fp_result_type<Arithmetic>>
auto efficiencyErr () const
 
auto effErr () const
 
- Public Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
constexpr AccumulatorSet ()=default
 
AccumulatorSetoperator+= (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::BinomialCounter< Arithmetic, Atomicity >

A counter dealing with binomial data.

See also
Gaudi::Accumulators for detailed documentation

Definition at line 774 of file Counters.h.

Member Function Documentation

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
std::ostream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::print ( std::ostream ,
bool  tableFormat = false 
) const
inlineoverridevirtual

prints the counter to a stream

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 786 of file Counters.h.

786  {
787  return printImpl( o, tableFormat );
788  }
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:779
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
MsgStream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::print ( MsgStream o,
bool  tableFormat = false 
) const
inlineoverridevirtual

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 789 of file Counters.h.

789 { return printImpl( o, tableFormat ); }
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:779
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
virtual std::ostream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::print ( std::ostream o,
const std::string tag 
) const
inlineoverridevirtual

prints the counter to a stream in table format, with the given tag

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 798 of file Counters.h.

798  {
799  return printImpl( o, tag );
800  }
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:779
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
virtual MsgStream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::print ( MsgStream o,
const std::string tag 
) const
inlineoverridevirtual

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 801 of file Counters.h.

801 { return printImpl( o, tag ); }
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:779
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename stream >
stream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::printImpl ( stream &  o,
bool  tableFormat 
) const
inline

Definition at line 779 of file Counters.h.

779  {
780  auto fmt = ( tableFormat ? "|%|10d| |%|11.5g| |(%|#9.7g| +- %|-#8.7g|)%% |"
781  : "#=%|-7lu| Sum=%|-11.5g| Eff=|(%|#9.7g| +- %|-#8.6g|)%%|" );
782  return o << boost::format{fmt} % this->nEntries() % this->nTrueEntries() % ( this->efficiency() * 100 ) %
783  ( this->efficiencyErr() * 100 );
784  }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
unsigned long nEntries() const
Definition: Counters.h:485
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename stream >
stream& Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::printImpl ( stream &  o,
const std::string tag 
) const
inline

Definition at line 792 of file Counters.h.

792  {
793  // override default print to add a '*' in from of the name
794  o << boost::format{" |*%|-48.48s|%|50t|"} % ( "\"" + tag + "\"" );
795  return print( o, true );
796  }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Counters.h:786
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
virtual bool Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >::toBePrinted ( ) const
inlineoverridevirtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 802 of file Counters.h.

802 { return this->nEntries() > 0; }
unsigned long nEntries() const
Definition: Counters.h:485

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