![]() |
The Gaudi Framework
v36r9 (fd2bdac3)
|
Namespaces | |
details | |
naming | |
Classes | |
class | AccumulatorSet |
AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and Atomicity and increase them altogether. More... | |
struct | Adder |
An Adder ValueHandler operator(a, b) means a += b. More... | |
struct | Adder< Arithmetic, atomicity::full > |
Adder specialization in the case of atomicity full. More... | |
struct | Adder< Arithmetic, atomicity::none > |
Adder specialization in the case of atomicity none. More... | |
struct | AveragingAccumulatorBase |
AveragingAccumulatorBase. More... | |
struct | AveragingCounter |
A counter aiming at computing sum and average. More... | |
struct | Axis |
Definition of an Histogram Axis. More... | |
struct | Axis< Gaudi::Tests::Histograms::CustomAxis::Category > |
struct | BaseValueHandler |
Base type for all functors used as ValuesHandler. More... | |
struct | BaseValueHandler< Arithmetic, atomicity::full > |
BaseValueHandler specialization in the case of atomicity full. More... | |
struct | BaseValueHandler< Arithmetic, atomicity::none > |
BaseValueHandler specialization in the case of atomicity none. More... | |
struct | BinomialAccumulator |
BinomialAccumulator. More... | |
struct | BinomialCounter |
A counter dealing with binomial data. More... | |
class | Buffer |
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... | |
class | BufferableCounter |
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 | Constant |
A functor always returning the value N. More... | |
struct | construct_empty_t |
constant used to disambiguate construction of an empty Accumulator versus the copy constructor. More... | |
struct | CountAccumulator |
CountAccumulator. More... | |
struct | Counter |
A basic integral counter;. More... | |
struct | ExtractWeight |
A functor to extract weight, take a pair (valueTuple, weight) as input. More... | |
struct | Extremum |
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 | Extremum< Arithmetic, atomicity::full, Compare, Initial > |
Extremum specialization in the case of atomicity full. More... | |
struct | Extremum< Arithmetic, atomicity::none, Compare, Initial > |
Extremum specialization in the case of atomicity none. More... | |
struct | FalseAccumulator |
FalseAccumulator. More... | |
struct | FalseTo1 |
helper functor for the FalseAccumulator More... | |
class | GenericAccumulator |
Generic Accumulator, templated by. More... | |
struct | HistogramArrayBase |
generic class implementing an array of histograms The only addition to a raw array is the constructor that allows to build names and titles for the histograms automatically from the index of the histogram in the array There are 2 possibilities : More... | |
struct | HistogramArrayBase< Histo, N, std::index_sequence< NDs... > > |
class | HistogramingAccumulatorInternal |
Internal Accumulator class dealing with Histograming. More... | |
class | HistogramingCounterBaseInternal |
A base counter dealing with Histograms. More... | |
class | HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > > |
struct | HistoInputType |
small class used as InputType for regular Histograms More... | |
class | HistoInputType< Arithmetic, 1 > |
specialization of HistoInputType for ND == 1 in order to have simpler syntax that is, no tuple of one item More... | |
struct | Identity |
An Identity functor. More... | |
struct | IntegralAccumulator |
IntegralAccumulator. More... | |
struct | MaxAccumulator |
MaxAccumulator. More... | |
struct | MinAccumulator |
MinAccumulator. More... | |
class | MsgCounter |
struct | PrintableCounter |
An empty ancester of all counters that knows how to print themselves. More... | |
struct | SigmaAccumulatorBase |
SigmaAccumulatorBase. More... | |
struct | SigmaCounter |
A counter aiming at computing average and sum2 / variance / standard deviation. More... | |
struct | Square |
A Square functor. More... | |
struct | SquareAccumulator |
SquareAccumulator. More... | |
struct | StatCounter |
A counter aiming at computing average and sum2 / variance / standard deviation. More... | |
struct | SumAccumulator |
SumAccumulator. More... | |
struct | TrueAccumulator |
TrueAccumulator. More... | |
struct | TrueTo1 |
helper functor for the TrueAccumulator More... | |
struct | WeightedCountAccumulator |
WeightedCountAccumulator. More... | |
struct | WeightedHistoInputType |
small class used as InputType for weighted Histograms More... | |
struct | WeightedProduct |
A Product functor, take a pair (value, weight) as input. More... | |
struct | WeightedSquare |
A WeightedSquare functor, take a pair (value, weight) as input. More... | |
struct | WeightedSquareAccumulator |
WeightedSquareAccumulator. More... | |
struct | WeightedSumAccumulator |
WeightedSumAccumulator. More... | |
Typedefs | |
template<atomicity Atomicity, typename Arithmetic > | |
using | WeightedAveragingAccumulator = AveragingAccumulatorBase< Atomicity, Arithmetic, WeightedCountAccumulator, WeightedSumAccumulator > |
WeightedAveragingAccumulator. More... | |
template<atomicity Atomicity, typename Arithmetic > | |
using | WeightedSigmaAccumulator = SigmaAccumulatorBase< Atomicity, Arithmetic, WeightedAveragingAccumulator, WeightedSquareAccumulator > |
WeightedSigmaAccumulator. More... | |
template<atomicity Atomicity, typename Arithmetic , typename ND > | |
using | HistogramingAccumulator = HistogramingAccumulatorInternal< Atomicity, HistoInputType< Arithmetic, ND::value >, unsigned long, ND, IntegralAccumulator > |
Class implementing a regular histogram accumulator. More... | |
template<atomicity Atomicity, typename Arithmetic , typename ND > | |
using | WeightedHistogramingAccumulator = HistogramingAccumulatorInternal< Atomicity, WeightedHistoInputType< Arithmetic, ND::value >, Arithmetic, ND, WeightedCountAccumulator > |
Class implementing a weighted histogram accumulator. More... | |
template<atomicity Atomicity, typename Arithmetic , typename ND > | |
using | ProfileHistogramingAccumulator = HistogramingAccumulatorInternal< Atomicity, HistoInputType< Arithmetic, ND::value+1, ND::value >, Arithmetic, ND, SigmaAccumulator > |
Class implementing a profile histogram accumulator. More... | |
template<atomicity Atomicity, typename Arithmetic , typename ND > | |
using | WeightedProfileHistogramingAccumulator = HistogramingAccumulatorInternal< Atomicity, WeightedHistoInputType< Arithmetic, ND::value+1, ND::value >, Arithmetic, ND, WeightedSigmaAccumulator > |
Class implementing a weighted profile histogram accumulator. More... | |
template<unsigned int ND, atomicity Atomicity, typename Arithmetic , const char * Type, template< atomicity, typename, typename > typename Accumulator> | |
using | HistogramingCounterBase = HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::make_index_sequence< ND > > |
template<unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double> | |
using | Histogram = HistogramingCounterBase< ND, Atomicity, Arithmetic, naming::histogramString, HistogramingAccumulator > |
standard histograming counter. See HistogramingCounterBase for details More... | |
template<unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double> | |
using | WeightedHistogram = HistogramingCounterBase< ND, Atomicity, Arithmetic, naming::weightedHistogramString, WeightedHistogramingAccumulator > |
standard histograming counter with weight. See HistogramingCounterBase for details More... | |
template<unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double> | |
using | ProfileHistogram = HistogramingCounterBase< ND, Atomicity, Arithmetic, naming::profilehistogramString, ProfileHistogramingAccumulator > |
profile histograming counter. See HistogramingCounterBase for details More... | |
template<unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double> | |
using | WeightedProfileHistogram = HistogramingCounterBase< ND, Atomicity, Arithmetic, naming::weightedProfilehistogramString, WeightedProfileHistogramingAccumulator > |
weighted profile histograming counter. See HistogramingCounterBase for details More... | |
template<typename Histo , std::size_t N> | |
using | HistogramArray = HistogramArrayBase< Histo, N, std::make_index_sequence< Histo::NumberDimensions::value > > |
template<typename T , typename = int> | |
using | 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 | 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 | 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 | 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 | AveragingAccumulator = AveragingAccumulatorBase< Atomicity, Arithmetic, CountAccumulator, SumAccumulator > |
AveragingAccumulator. More... | |
template<atomicity Atomicity, typename Arithmetic > | |
using | SigmaAccumulator = SigmaAccumulatorBase< Atomicity, Arithmetic, AveragingAccumulator, SquareAccumulator > |
SigmaAccumulator. More... | |
template<atomicity Atomicity, typename Arithmetic > | |
using | StatAccumulator = AccumulatorSet< Arithmetic, Atomicity, Arithmetic, SigmaAccumulator, MinAccumulator, MaxAccumulator > |
StatAccumulator. More... | |
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full> | |
using | SummingCounter = AveragingCounter< Arithmetic, Atomicity > |
Enumerations | |
enum | atomicity { atomicity::none, atomicity::full } |
Defines atomicity of the accumulators. More... | |
Functions | |
template<typename Arithmetic > | |
void | to_json (nlohmann::json &j, const Axis< Arithmetic > &axis) |
automatic conversion of the Axis type to json More... | |
template<class Rep , class Period > | |
auto | sqrt (std::chrono::duration< Rep, Period > d) |
sqrt for std::chrono::duration More... | |
template<class Rep1 , class Rep2 , class Period > | |
auto | 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 | sqrt (T d) |
forward declaration of sqrt for custom types More... | |
std::ostream & | operator<< (std::ostream &s, const PrintableCounter &counter) |
external printout operator to a stream type More... | |
MsgStream & | operator<< (MsgStream &s, const PrintableCounter &counter) |
template<typename Counter , typename Container , typename Fun > | |
void | 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 | has_fetch_add_v = Gaudi::cpp17::is_detected_v<has_fetch_add_, T> |
constexpr construct_empty_t | construct_empty {} |
Efficient counter implementations for Gaudi.
A number of concepts and templated classes are defined:
All counters are serialized into JSON strings using nlohmann's json library (pure header) See https://github.com/nlohmann/json for details, but here are few notes :
Symetrically to serialization, all counters objects can be constructed from json objects using the same nlohmann's json library via a the fromJSON static method;
The serialized json needs to respect a given format, described in the documentation of Gaudi::Monitoring::Hub, but essentially boiling down to having a 'type' entry in the generated json dictionnary. This type defines the rest of the json structure.
Here is a list of types defined in this header and their corresponding fields. Note that there are 2 kinds of fields : raw ones and derived ones, built on top of raw ones. Note also that <prec> when present is a string defining the precision of the data when numerical. It is described at the end of the list for each dependent field, the computation formula is given
All Accumulators and Counters defined above are provided in their atomic and non atomic versions
Here is an example of the typical usage of these classes :
using Gaudi::Accumulators::AveragingAccumulator = typedef AveragingAccumulatorBase<Atomicity, Arithmetic, CountAccumulator, SumAccumulator> |
AveragingAccumulator.
An AveragingAccumulator is an Accumulator able to compute an average
Definition at line 734 of file Accumulators.h.
using Gaudi::Accumulators::fp_result_type = typedef 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
Definition at line 285 of file Accumulators.h.
using Gaudi::Accumulators::has_fetch_add_ = typedef decltype( std::declval<T&>().fetch_add( 0 ) ) |
type_traits for checking the presence of fetch_add
Definition at line 277 of file Accumulators.h.
using Gaudi::Accumulators::Histogram = typedef HistogramingCounterBase<ND, Atomicity, Arithmetic, naming::histogramString, HistogramingAccumulator> |
standard histograming counter. See HistogramingCounterBase for details
Definition at line 506 of file Histogram.h.
using Gaudi::Accumulators::HistogramArray = typedef HistogramArrayBase<Histo, N, std::make_index_sequence<Histo::NumberDimensions::value> > |
Definition at line 84 of file HistogramArray.h.
using Gaudi::Accumulators::HistogramingAccumulator = typedef HistogramingAccumulatorInternal<Atomicity, HistoInputType<Arithmetic, ND::value>, unsigned long, ND, IntegralAccumulator> |
Class implementing a regular histogram accumulator.
Actually only an alias to HistogramingAccumulatorInternal with proper template parameters
Definition at line 350 of file Histogram.h.
using Gaudi::Accumulators::HistogramingCounterBase = typedef HistogramingCounterBaseInternal<ND, Atomicity, Arithmetic, Type, Accumulator, std::make_index_sequence<ND> > |
Definition at line 495 of file Histogram.h.
using Gaudi::Accumulators::Maximum = typedef 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.
Definition at line 402 of file Accumulators.h.
using Gaudi::Accumulators::Minimum = typedef 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.
Definition at line 395 of file Accumulators.h.
using Gaudi::Accumulators::ProfileHistogram = typedef HistogramingCounterBase<ND, Atomicity, Arithmetic, naming::profilehistogramString, ProfileHistogramingAccumulator> |
profile histograming counter. See HistogramingCounterBase for details
Definition at line 516 of file Histogram.h.
using Gaudi::Accumulators::ProfileHistogramingAccumulator = typedef HistogramingAccumulatorInternal<Atomicity, HistoInputType<Arithmetic, ND::value + 1, ND::value>, Arithmetic, ND, SigmaAccumulator> |
Class implementing a profile histogram accumulator.
Actually only an alias to HistogramingAccumulatorInternal with proper template parameters
Definition at line 369 of file Histogram.h.
using Gaudi::Accumulators::SigmaAccumulator = typedef SigmaAccumulatorBase<Atomicity, Arithmetic, AveragingAccumulator, SquareAccumulator> |
SigmaAccumulator.
A SigmaAccumulator is an Accumulator able to compute an average and variance/rms
Definition at line 795 of file Accumulators.h.
using Gaudi::Accumulators::StatAccumulator = typedef AccumulatorSet<Arithmetic, Atomicity, Arithmetic, SigmaAccumulator, MinAccumulator, MaxAccumulator> |
StatAccumulator.
A StatAccumulator is an Accumulator able to compute an average, variance/rms and min/max
Definition at line 802 of file Accumulators.h.
using Gaudi::Accumulators::SummingCounter = typedef AveragingCounter<Arithmetic, Atomicity> |
Definition at line 976 of file Accumulators.h.
using Gaudi::Accumulators::WeightedAveragingAccumulator = typedef AveragingAccumulatorBase<Atomicity, Arithmetic, WeightedCountAccumulator, WeightedSumAccumulator> |
WeightedAveragingAccumulator.
An AveragingAccumulator is an Accumulator able to compute an average This implementation takes a pair (value, weight) as input
Definition at line 136 of file Histogram.h.
using Gaudi::Accumulators::WeightedHistogram = typedef HistogramingCounterBase<ND, Atomicity, Arithmetic, naming::weightedHistogramString, WeightedHistogramingAccumulator> |
standard histograming counter with weight. See HistogramingCounterBase for details
Definition at line 511 of file Histogram.h.
using Gaudi::Accumulators::WeightedHistogramingAccumulator = typedef HistogramingAccumulatorInternal<Atomicity, WeightedHistoInputType<Arithmetic, ND::value>, Arithmetic, ND, WeightedCountAccumulator> |
Class implementing a weighted histogram accumulator.
Actually only an alias to HistogramingAccumulatorInternal with proper template parameters
Definition at line 359 of file Histogram.h.
using Gaudi::Accumulators::WeightedProfileHistogram = typedef HistogramingCounterBase<ND, Atomicity, Arithmetic, naming::weightedProfilehistogramString, WeightedProfileHistogramingAccumulator> |
weighted profile histograming counter. See HistogramingCounterBase for details
Definition at line 521 of file Histogram.h.
using Gaudi::Accumulators::WeightedProfileHistogramingAccumulator = typedef HistogramingAccumulatorInternal<Atomicity, WeightedHistoInputType<Arithmetic, ND::value + 1, ND::value>, Arithmetic, ND, WeightedSigmaAccumulator> |
Class implementing a weighted profile histogram accumulator.
Actually only an alias to HistogramingAccumulatorInternal with proper template parameters
Definition at line 379 of file Histogram.h.
using Gaudi::Accumulators::WeightedSigmaAccumulator = typedef SigmaAccumulatorBase<Atomicity, Arithmetic, WeightedAveragingAccumulator, WeightedSquareAccumulator> |
WeightedSigmaAccumulator.
A SigmaAccumulator is an Accumulator able to compute an average and variance/rms This implementation takes a pair (value, weight) as input
Definition at line 145 of file Histogram.h.
|
strong |
Defines atomicity of the accumulators.
Enumerator | |
---|---|
none | |
full |
Definition at line 236 of file Accumulators.h.
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.
Definition at line 1195 of file Accumulators.h.
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.
Definition at line 40 of file Counters.h.
|
inline |
Definition at line 866 of file Accumulators.h.
|
inline |
external printout operator to a stream type
Definition at line 865 of file Accumulators.h.
auto Gaudi::Accumulators::sqrt | ( | std::chrono::duration< Rep, Period > | d | ) |
sqrt for std::chrono::duration
Definition at line 34 of file Counters.h.
auto Gaudi::Accumulators::sqrt | ( | T | d | ) |
forward declaration of sqrt for custom types
void Gaudi::Accumulators::to_json | ( | nlohmann::json & | j, |
const Axis< Arithmetic > & | axis | ||
) |
|
constexpr |
Definition at line 412 of file Accumulators.h.
|
inlineconstexpr |
Definition at line 279 of file Accumulators.h.