The Gaudi Framework  master (37c0b60a)
Accumulators.h File Reference
#include <Gaudi/MonitoringHub.h>
#include <chrono>
#include <atomic>
#include <boost/format.hpp>
#include <cmath>
#include <iostream>
#include <limits>
#include <nlohmann/json.hpp>
#include <sstream>
#include <tuple>
#include <type_traits>
#include <utility>
#include <GaudiKernel/CommonMessaging.h>
#include <GaudiKernel/MsgStream.h>
#include <GaudiKernel/detected.h>
Include dependency graph for Accumulators.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nlohmann::adl_serializer< std::chrono::duration< Rep, Period > >
 
struct  Gaudi::Accumulators::Constant< T, N >
 A functor always returning the value N. More...
 
struct  Gaudi::Accumulators::Identity
 An Identity functor. More...
 
struct  Gaudi::Accumulators::Square
 A Square functor. More...
 
struct  Gaudi::Accumulators::BaseValueHandler< Arithmetic, Atomicity >
 Base type for all functors used as ValuesHandler. More...
 
struct  Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::none >
 BaseValueHandler specialization in the case of atomicity none. More...
 
struct  Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::full >
 BaseValueHandler specialization in the case of atomicity full. More...
 
struct  Gaudi::Accumulators::Adder< Arithmetic, Atomicity >
 An Adder ValueHandler operator(a, b) means a += b. More...
 
struct  Gaudi::Accumulators::Adder< Arithmetic, atomicity::none >
 Adder specialization in the case of atomicity none. More...
 
struct  Gaudi::Accumulators::Adder< Arithmetic, atomicity::full >
 Adder specialization in the case of atomicity full. More...
 
struct  Gaudi::Accumulators::Extremum< Arithmetic, Atomicity, Compare, Initial >
 An Extremum ValueHandler, to be reused for Minimum and Maximum operator(a, b) means if (Compare(b,a)) a = b In case of full atomicity, compare_exchange_weak is used. More...
 
struct  Gaudi::Accumulators::Extremum< Arithmetic, atomicity::none, Compare, Initial >
 Extremum specialization in the case of atomicity none. More...
 
struct  Gaudi::Accumulators::Extremum< Arithmetic, atomicity::full, Compare, Initial >
 Extremum specialization in the case of atomicity full. More...
 
struct  Gaudi::Accumulators::construct_empty_t
 constant used to disambiguate construction of an empty Accumulator versus the copy constructor. More...
 
class  Gaudi::Accumulators::GenericAccumulator< InputTypeT, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >
 Generic Accumulator, templated by. More...
 
class  Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, InputTypeT, Bases >
 AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and Atomicity and increase them altogether. More...
 
struct  Gaudi::Accumulators::MaxAccumulator< Atomicity, Arithmetic >
 MaxAccumulator. More...
 
struct  Gaudi::Accumulators::MinAccumulator< Atomicity, Arithmetic >
 MinAccumulator. More...
 
struct  Gaudi::Accumulators::CountAccumulator< Atomicity, Arithmetic >
 CountAccumulator. More...
 
struct  Gaudi::Accumulators::SumAccumulator< Atomicity, Arithmetic >
 SumAccumulator. More...
 
struct  Gaudi::Accumulators::IntegralAccumulator< Atomicity, Arithmetic >
 IntegralAccumulator. More...
 
struct  Gaudi::Accumulators::SquareAccumulator< Atomicity, Arithmetic >
 SquareAccumulator. More...
 
struct  Gaudi::Accumulators::TrueTo1
 helper functor for the TrueAccumulator More...
 
struct  Gaudi::Accumulators::TrueAccumulator< Atomicity, Arithmetic >
 TrueAccumulator. More...
 
struct  Gaudi::Accumulators::FalseTo1
 helper functor for the FalseAccumulator More...
 
struct  Gaudi::Accumulators::FalseAccumulator< Atomicity, Arithmetic >
 FalseAccumulator. More...
 
struct  Gaudi::Accumulators::BinomialAccumulator< Atomicity, Arithmetic >
 BinomialAccumulator. More...
 
struct  Gaudi::Accumulators::BinomialAccumulator< Atomicity, Arithmetic >::binomial_t
 
struct  Gaudi::Accumulators::AveragingAccumulatorBase< Atomicity, Arithmetic, CountAcc, SumAcc >
 AveragingAccumulatorBase. More...
 
struct  Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >
 SigmaAccumulatorBase. More...
 
class  Gaudi::Accumulators::Buffer< ContainedAccumulator, Atomicity, Args >
 Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-safe Accumulator for all previous updates in one go. More...
 
struct  Gaudi::Accumulators::PrintableCounter
 An empty ancester of all counters that knows how to print themselves. More...
 
class  Gaudi::Accumulators::BufferableCounter< Atomicity, Accumulator, Args >
 An empty ancester of all counters that provides a buffer method that returns a buffer on itself Also registers the counter to its owner, with default type "counter" Due to this registration, move semantic is disabled. More...
 
struct  Gaudi::Accumulators::Counter< Atomicity, Arithmetic >
 A basic integral counter;. More...
 
struct  Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >
 A counter aiming at computing sum and average. More...
 
struct  Gaudi::Accumulators::SigmaCounter< Arithmetic, Atomicity >
 A counter aiming at computing average and sum2 / variance / standard deviation. More...
 
struct  Gaudi::Accumulators::StatCounter< Arithmetic, Atomicity >
 A counter aiming at computing average and sum2 / variance / standard deviation. More...
 
struct  Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >
 A counter dealing with binomial data. More...
 
struct  Gaudi::Accumulators::details::MsgCounter::Handler< Atomicity >
 
class  Gaudi::Accumulators::MsgCounter< level, Atomicity >
 

Namespaces

 Gaudi
 This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from python with a format liks : ( nbins, min, max, title ) where title can be ommited.
 
 Gaudi::Accumulators
 
 nlohmann
 
 Gaudi::Accumulators::details
 
 Gaudi::Accumulators::details::MsgCounter
 

Typedefs

template<typename T , typename = int>
using Gaudi::Accumulators::has_fetch_add_ = decltype(std::declval< T & >().fetch_add(0))
 type_traits for checking the presence of fetch_add More...
 
template<typename Arithmetic , typename Result = double>
using Gaudi::Accumulators::fp_result_type = std::conditional_t< std::is_integral_v< Arithmetic >, Result, Arithmetic >
 type_trait for the result type of a floating point operation on the type Arithmetic More...
 
template<typename Arithmetic , atomicity Atomicity = atomicity::full>
using Gaudi::Accumulators::Minimum = Extremum< Arithmetic, Atomicity, std::less< Arithmetic >, std::numeric_limits< Arithmetic >::max >
 A Minimun ValueHandler operator(a, b) means a = min(a, b) In case of full atomicity, compare_exchange_weak is used. More...
 
template<typename Arithmetic , atomicity Atomicity = atomicity::full>
using Gaudi::Accumulators::Maximum = Extremum< Arithmetic, Atomicity, std::greater< Arithmetic >, std::numeric_limits< Arithmetic >::lowest >
 An Maximum ValueHandler operator(a, b) means a = max(a, b) In case of full atomicity, compare_exchange_weak is used. More...
 
template<atomicity Atomicity, typename Arithmetic >
using Gaudi::Accumulators::AveragingAccumulator = AveragingAccumulatorBase< Atomicity, Arithmetic, CountAccumulator, SumAccumulator >
 AveragingAccumulator. More...
 
template<atomicity Atomicity, typename Arithmetic >
using Gaudi::Accumulators::SigmaAccumulator = SigmaAccumulatorBase< Atomicity, Arithmetic, AveragingAccumulator, SquareAccumulator >
 SigmaAccumulator. More...
 
template<atomicity Atomicity, typename Arithmetic >
using Gaudi::Accumulators::StatAccumulator = AccumulatorSet< Arithmetic, Atomicity, Arithmetic, SigmaAccumulator, MinAccumulator, MaxAccumulator >
 StatAccumulator. More...
 
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
using Gaudi::Accumulators::SummingCounter = AveragingCounter< Arithmetic, Atomicity >
 
template<atomicity Atomicity, typename Arithmetic = double>
using Gaudi::Accumulators::details::MsgCounter::MsgAccumulator = GenericAccumulator< bool, unsigned long, Atomicity, Identity, Identity, Handler< Atomicity > >
 

Enumerations

enum  Gaudi::Accumulators::atomicity { Gaudi::Accumulators::atomicity::none, Gaudi::Accumulators::atomicity::full }
 Defines atomicity of the accumulators. More...
 

Functions

template<class Rep , class Period >
auto Gaudi::Accumulators::sqrt (std::chrono::duration< Rep, Period > d)
 sqrt for std::chrono::duration More...
 
template<class Rep1 , class Rep2 , class Period >
auto Gaudi::Accumulators::operator* (const std::chrono::duration< Rep1, Period > &lhs, const std::chrono::duration< Rep2, Period > &rhs)
 Multiplication of two std::chrono::duration objects with same Period. More...
 
template<class T >
auto Gaudi::Accumulators::sqrt (T d)
 forward declaration of sqrt for custom types More...
 
template<typename AtomicType , typename Arithmetic >
void Gaudi::Accumulators::fetch_add (AtomicType &atVar, Arithmetic value)
 generic fetch_add, also dealing with atomic types with no fetch_add member method More...
 
std::ostreamGaudi::Accumulators::operator<< (std::ostream &s, const PrintableCounter &counter)
 external printout operator to a stream type More...
 
MsgStreamGaudi::Accumulators::operator<< (MsgStream &s, const PrintableCounter &counter)
 
template<typename Counter , typename Container , typename Fun >
void Gaudi::Accumulators::accumulate (Counter &counter, const Container &container, Fun f=Identity{})
 A helper function for accumulating data from a container into a counter This is internally using buffers so that the original counter is only updated once. More...
 

Variables

template<typename T >
constexpr bool Gaudi::Accumulators::has_fetch_add_v = Gaudi::cpp17::is_detected_v<has_fetch_add_, T>
 
constexpr construct_empty_t Gaudi::Accumulators::construct_empty {}