Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Accumulators.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 
12 #pragma once
13 
14 #include <Gaudi/MonitoringHub.h>
15 
16 #include <chrono>
17 
18 namespace Gaudi::Accumulators {
19  template <class Rep, class Period>
21  template <class Rep1, class Rep2, class Period>
23 } // namespace Gaudi::Accumulators
24 
25 // Fix builds with GCC 11 and C++20
26 #if defined( __GNUC__ ) && ( __GNUC__ == 11 ) && !defined( __clang__ )
27 namespace std::chrono {
28  template <typename Ratio>
29  static constexpr const char* suffix( const Ratio& ) {
30  if constexpr ( std::ratio_equal_v<Ratio, std::ratio<1>> ) {
31  return "s";
32  } else if constexpr ( std::ratio_equal_v<Ratio, std::milli> ) {
33  return "ms";
34  } else if constexpr ( std::ratio_equal_v<Ratio, std::micro> ) {
35  return "us";
36  } else if constexpr ( std::ratio_equal_v<Ratio, std::nano> ) {
37  return "ns";
38  } else if constexpr ( std::ratio_equal_v<Ratio, std::ratio<60>> ) {
39  return "m";
40  } else if constexpr ( std::ratio_equal_v<Ratio, std::ratio<3600>> ) {
41  return "h";
42  }
43  return "";
44  }
45  template <class Rep, class Period>
47  return os << d.count() << suffix( Period{} );
48  }
49 } // namespace std::chrono
50 #endif
51 
234 #include <atomic>
235 #include <boost/format.hpp>
236 #include <cmath>
237 #include <iostream>
238 #include <limits>
239 #include <nlohmann/json.hpp>
240 #include <sstream>
241 #include <tuple>
242 #include <type_traits>
243 #include <utility>
244 
246 #include <GaudiKernel/MsgStream.h>
247 #include <GaudiKernel/detected.h>
248 
249 // Json serialization for std::chrono::duration
250 namespace nlohmann {
251  template <class Rep, class Period>
252  struct adl_serializer<std::chrono::duration<Rep, Period>> {
253  static void to_json( json& j, const std::chrono::duration<Rep, Period>& d ) { j = d.count(); }
255  d = std::chrono::duration<Rep, Period>{ j.get<Rep>() };
256  }
257  };
258 } // namespace nlohmann
259 
260 namespace Gaudi::Accumulators {
261 
263  enum class atomicity { none, full };
264 
266  template <class T>
267  auto sqrt( T d );
268 
272  template <typename T, T N>
273  struct Constant {
274  template <typename U>
275  constexpr T operator()( U&& ) const noexcept {
276  return N;
277  }
278  };
279 
283  struct Identity {
284  template <typename U>
285  constexpr decltype( auto ) operator()( U&& v ) const noexcept {
286  return std::forward<U>( v );
287  }
288  };
289 
293  struct Square {
294  template <typename U>
295  constexpr decltype( auto ) operator()( U&& v ) const noexcept {
296  return v * v;
297  }
298  };
299 
303  template <typename T, typename = int>
304  using has_fetch_add_ = decltype( std::declval<T&>().fetch_add( 0 ) );
305  template <typename T>
306  inline constexpr bool has_fetch_add_v = Gaudi::cpp17::is_detected_v<has_fetch_add_, T>;
307 
311  template <typename Arithmetic, typename Result = double>
312  using fp_result_type = std::conditional_t<std::is_integral_v<Arithmetic>, Result, Arithmetic>;
313 
317  template <typename Arithmetic, atomicity Atomicity>
319 
323  template <typename Arithmetic>
324  struct BaseValueHandler<Arithmetic, atomicity::none> {
325  using OutputType = Arithmetic;
326  using InternalType = Arithmetic;
327  static constexpr OutputType getValue( const InternalType& v ) noexcept { return v; }
328  static Arithmetic exchange( InternalType& v, Arithmetic newv ) noexcept { return std::exchange( v, newv ); }
329  };
330 
334  template <typename Arithmetic>
335  struct BaseValueHandler<Arithmetic, atomicity::full> {
336  using OutputType = Arithmetic;
338  static constexpr OutputType getValue( const InternalType& v ) noexcept {
339  return v.load( std::memory_order_relaxed );
340  }
341  static Arithmetic exchange( InternalType& v, Arithmetic newv ) noexcept { return v.exchange( newv ); }
342  };
343 
348  template <typename Arithmetic, atomicity Atomicity>
349  struct Adder;
350 
354  template <typename Arithmetic>
355  struct Adder<Arithmetic, atomicity::none> : BaseValueHandler<Arithmetic, atomicity::none> {
358  static constexpr OutputType DefaultValue() { return Arithmetic{}; }
359  static void merge( InternalType& a, Arithmetic b ) noexcept { a += b; }
360  };
361 
365  template <typename AtomicType, typename Arithmetic>
366  void fetch_add( AtomicType& atVar, Arithmetic value ) {
367  if constexpr ( has_fetch_add_v<AtomicType> ) {
368  atVar.fetch_add( value, std::memory_order_relaxed );
369  } else {
371  while ( !atVar.compare_exchange_weak( current, current + value ) )
372  ;
373  }
374  }
375 
379  template <typename Arithmetic>
380  struct Adder<Arithmetic, atomicity::full> : BaseValueHandler<Arithmetic, atomicity::full> {
383  static constexpr OutputType DefaultValue() { return Arithmetic{}; }
384  static void merge( InternalType& a, Arithmetic b ) noexcept {
385  if constexpr ( !std::is_floating_point_v<Arithmetic> ) { // avoid comparisons for floating points
386  if ( DefaultValue() == b ) return; // avoid atomic operation if b is "0"
387  }
388  fetch_add( a, b );
389  }
390  };
391 
396  template <typename Arithmetic, atomicity Atomicity, typename Compare, Arithmetic ( *Initial )()>
397  struct Extremum;
398 
402  template <typename Arithmetic, typename Compare, Arithmetic ( *Initial )()>
403  struct Extremum<Arithmetic, atomicity::none, Compare, Initial> : BaseValueHandler<Arithmetic, atomicity::none> {
406  static constexpr OutputType DefaultValue() { return Initial(); }
407  static void merge( InternalType& a, Arithmetic b ) noexcept {
408  if ( Compare{}( b, a ) ) a = b;
409  }
410  };
411 
415  template <typename Arithmetic, typename Compare, Arithmetic ( *Initial )()>
416  struct Extremum<Arithmetic, atomicity::full, Compare, Initial> : BaseValueHandler<Arithmetic, atomicity::full> {
419  static constexpr OutputType DefaultValue() { return Initial(); }
420  static void merge( InternalType& a, Arithmetic b ) noexcept {
421  Arithmetic prev_value = BaseValueHandler<Arithmetic, atomicity::full>::getValue( a );
422  while ( Compare{}( b, prev_value ) && !a.compare_exchange_weak( prev_value, b ) )
423  ;
424  }
425  };
426 
431  template <typename Arithmetic, atomicity Atomicity = atomicity::full>
433 
438  template <typename Arithmetic, atomicity Atomicity = atomicity::full>
440 
447  explicit construct_empty_t() = default;
448  };
450 
468  template <typename InputTypeT, typename InnerType, atomicity Atomicity = atomicity::full,
469  typename InputTransform = Identity, typename OutputTransform = Identity,
470  typename ValueHandler = Adder<InnerType, Atomicity>>
472  template <typename, typename, atomicity, typename, typename, typename>
473  friend class GenericAccumulator;
474 
475  public:
476  using InputType = InputTypeT;
477  using OutputType = std::decay_t<std::invoke_result_t<OutputTransform, InnerType>>;
478  using InternalType = InnerType;
481  ValueHandler::merge( m_value, InputTransform{}( by ) );
482  return *this;
483  }
484  GenericAccumulator() = default;
486  template <atomicity ato, typename VH>
489  : GenericAccumulator() {}
490  template <typename... Args>
491  GenericAccumulator( std::in_place_t, Args&&... args ) : m_value( std::forward<Args>( args )... ) {}
492  GenericAccumulator( const GenericAccumulator& other ) : m_value( ValueHandler::getValue( other.m_value ) ) {}
494  m_value = ValueHandler::getValue( other.m_value );
495  return *this;
496  }
497  OutputType value() const { return OutputTransform{}( ValueHandler::getValue( m_value ) ); }
498  void reset() { reset( ValueHandler::DefaultValue() ); }
499  template <atomicity ato, typename VH>
501  ValueHandler::merge( m_value, VH::exchange( other.m_value, VH::DefaultValue() ) );
502  }
503  template <atomicity ato, typename VH>
505  ValueHandler::merge( m_value, other.m_value );
506  }
507 
508  protected:
509  GenericAccumulator( InnerType in ) : m_value( std::move( in ) ) {}
510  auto rawValue() const { return ValueHandler::getValue( m_value ); }
511  void reset( InnerType in ) { m_value = std::move( in ); }
512  static InnerType extractJSONData( const nlohmann::json& j, const JSONStringEntriesType& entries ) {
513  return j.at( entries ).get<InnerType>();
514  }
515 
516  private:
517  typename ValueHandler::InternalType m_value{ ValueHandler::DefaultValue() };
518  };
519 
525  template <typename Arithmetic, atomicity Atomicity, typename InputTypeT = Arithmetic,
526  template <atomicity, typename> class... Bases>
527  class AccumulatorSet : public Bases<Atomicity, Arithmetic>... {
528  public:
529  using InputType = InputTypeT;
533  constexpr AccumulatorSet() = default;
535  template <atomicity ato>
537  : AccumulatorSet() {}
539  ( Bases<Atomicity, Arithmetic>::operator+=( by ), ... );
540  return *this;
541  }
542  OutputType value() const { return std::make_tuple( Bases<Atomicity, Arithmetic>::value()... ); }
543  void reset() { ( Bases<Atomicity, Arithmetic>::reset(), ... ); }
544  template <atomicity Ato>
546  ( Bases<Atomicity, Arithmetic>::mergeAndReset( static_cast<Bases<Ato, Arithmetic>&>( other ) ), ... );
547  }
548  template <atomicity Ato>
550  ( Bases<Atomicity, Arithmetic>::operator+( static_cast<Bases<Ato, Arithmetic>&&>( other ) ), ... );
551  }
552 
553  protected:
555  void reset( const InternalType& t ) {
556  std::apply( [this]( const auto&... i ) { ( this->Bases<Atomicity, Arithmetic>::reset( i ), ... ); }, t );
557  }
559  return extractJSONDataHelper( j, entries, std::index_sequence_for<Bases<Atomicity, Arithmetic>...>{} );
560  }
561 
562  private:
563  template <size_t... Is>
565  std::index_sequence<Is...> ) {
566  return extractJSONDataHelper( j, std::get<Is>( entries )... );
567  }
568  static InternalType
570  typename Bases<Atomicity, Arithmetic>::JSONStringEntriesType... entries ) {
571  return { Bases<Atomicity, Arithmetic>::extractJSONData( j, entries )... };
572  }
573  };
574 
579  template <atomicity Atomicity, typename Arithmetic = double>
581  : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity, Maximum<Arithmetic, Atomicity>> {
582  using GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity,
584  Arithmetic max() const { return this->value(); }
585  };
586 
591  template <atomicity Atomicity, typename Arithmetic = double>
593  : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity, Minimum<Arithmetic, Atomicity>> {
594  using GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity,
596  Arithmetic min() const { return this->value(); }
597  };
598 
605  template <atomicity Atomicity, typename Arithmetic = double>
606  struct CountAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, Constant<unsigned long, 1UL>> {
609  ( *this ) += Arithmetic{};
610  return *this;
611  }
613  auto copy = *this;
614  ++( *this );
615  return copy;
616  }
617  unsigned long nEntries() const { return this->value(); }
618  };
619 
624  template <atomicity Atomicity, typename Arithmetic = double>
625  struct SumAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity> {
627  Arithmetic sum() const { return this->value(); }
628  };
629 
635  template <atomicity Atomicity, typename Arithmetic = unsigned long>
636  struct IntegralAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity> {
637  static_assert( std::is_integral_v<Arithmetic>,
638  "Invalid Arithmetic type for IntegralAccumulator. It must be an integral type" );
639 
642  ( *this ) += 1;
643  return *this;
644  }
646  auto copy = *this;
647  ++( *this );
648  return copy;
649  }
650  Arithmetic nEntries() const { return this->value(); }
651  Arithmetic sum() const { return this->value(); }
652  };
653 
658  template <atomicity Atomicity, typename Arithmetic = double>
659  struct SquareAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Square> {
661  Arithmetic sum2() const { return this->value(); }
662  };
663 
665  struct TrueTo1 {
666  unsigned int operator()( bool v ) const { return v; }
667  };
668 
674  template <atomicity Atomicity, typename Arithmetic>
675  struct TrueAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, TrueTo1> {
677  unsigned long nTrueEntries() const { return this->value(); }
678  };
679 
681  struct FalseTo1 {
682  unsigned int operator()( bool v ) const { return !v; }
683  };
684 
690  template <atomicity Atomicity, typename Arithmetic>
691  struct FalseAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, FalseTo1> {
693  unsigned long nFalseEntries() const { return this->value(); }
694  };
695 
701  template <atomicity Atomicity, typename Arithmetic>
702  struct BinomialAccumulator : AccumulatorSet<bool, Atomicity, bool, TrueAccumulator, FalseAccumulator> {
704  unsigned long nEntries() const { return this->nTrueEntries() + this->nFalseEntries(); }
705 
706  template <typename Result = fp_result_type<Arithmetic>>
707  auto efficiency() const {
708  auto nbEntries = nEntries();
709  if ( 1 > nbEntries ) return Result{ -1 };
710  return static_cast<Result>( this->nTrueEntries() ) / nbEntries;
711  }
712  auto eff() const { return efficiency(); }
713 
714  template <typename Result = fp_result_type<Arithmetic>>
715  auto efficiencyErr() const {
716  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
717  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
719  using std::sqrt;
720  auto nbEntries = nEntries();
721  if ( 1 > nbEntries ) return Result{ -1 };
722  return sqrt( static_cast<Result>( this->nTrueEntries() * this->nFalseEntries() ) / nbEntries ) / nbEntries;
723  }
724  auto effErr() const { return efficiencyErr(); }
726  struct binomial_t {
727  unsigned long nPass;
728  unsigned long nTotal;
729  };
730  BinomialAccumulator& operator+=( binomial_t b ) {
731  assert( b.nPass <= b.nTotal );
732  TrueAccumulator<atomicity::none, bool> t{ std::in_place, b.nPass };
734  FalseAccumulator<atomicity::none, bool> f{ std::in_place, b.nTotal - b.nPass };
736  return *this;
737  }
738  };
739 
745  template <atomicity Atomicity, typename Arithmetic, template <atomicity, typename> typename CountAcc,
746  template <atomicity, typename> typename SumAcc>
748  : AccumulatorSet<Arithmetic, Atomicity, typename CountAcc<Atomicity, Arithmetic>::InputType, CountAcc, SumAcc> {
749  static_assert( std::is_same_v<typename CountAcc<Atomicity, Arithmetic>::InputType,
750  typename SumAcc<Atomicity, Arithmetic>::InputType>,
751  "Incompatible Counters in definition of AveragingAccumulator. Both should have identical Input" );
753  SumAcc>::AccumulatorSet;
754  template <typename Result = fp_result_type<Arithmetic>>
755  auto mean() const {
756  auto n = this->nEntries();
757  Result sum = this->sum();
758  return ( n > 0 ) ? static_cast<Result>( sum / n ) : Result{};
759  }
760  };
761 
766  template <atomicity Atomicity, typename Arithmetic>
768 
774  template <atomicity Atomicity, typename Arithmetic, template <atomicity, typename> typename AvgAcc,
775  template <atomicity, typename> typename SquareAcc>
777  : AccumulatorSet<Arithmetic, Atomicity, typename AvgAcc<Atomicity, Arithmetic>::InputType, AvgAcc, SquareAcc> {
778  static_assert( std::is_same_v<typename AvgAcc<Atomicity, Arithmetic>::InputType,
779  typename SquareAcc<Atomicity, Arithmetic>::InputType>,
780  "Incompatible Counters in definition of SigmaAccumulator. Both should have identical Input" );
782  SquareAcc>::AccumulatorSet;
783  template <typename Result = fp_result_type<Arithmetic>>
784  auto biased_sample_variance() const {
785  auto n = this->nEntries();
786  Result sum = this->sum();
787  return ( n > 0 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / n ) : Result{};
788  }
789 
790  template <typename Result = fp_result_type<Arithmetic>>
792  auto n = this->nEntries();
793  Result sum = this->sum();
794  return ( n > 1 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / ( n - 1 ) ) : Result{};
795  }
796 
797  template <typename Result = fp_result_type<Arithmetic>>
798  auto standard_deviation() const {
799  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
800  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
802  using std::sqrt;
803  Result v = biased_sample_variance();
804  return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v ) );
805  }
806  [[deprecated( "The name 'rms' has changed to standard_deviation" )]] Arithmetic rms() const {
807  return standard_deviation();
808  }
809 
810  template <typename Result = fp_result_type<Arithmetic>>
811  auto meanErr() const {
812  auto n = this->nEntries();
813  if ( 0 == n ) return Result{};
814  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
815  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
817  using std::sqrt;
818  Result v = biased_sample_variance();
819  return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v / n ) );
820  }
821  };
822 
827  template <atomicity Atomicity, typename Arithmetic>
829 
834  template <atomicity Atomicity, typename Arithmetic>
837 
844  template <template <atomicity Ato, typename... Int> class ContainedAccumulator, atomicity Atomicity, typename... Args>
845  class Buffer : public ContainedAccumulator<atomicity::none, Args...> {
846  using prime_type = ContainedAccumulator<Atomicity, Args...>;
847  using base_type = ContainedAccumulator<atomicity::none, Args...>;
848 
849  public:
850  Buffer() = delete;
851  Buffer( prime_type& p ) : base_type( construct_empty, p ), m_prime( &p ) {}
852  Buffer( const Buffer& ) = delete;
853  void operator=( const Buffer& ) = delete;
854  Buffer( Buffer&& other ) : base_type( std::move( other ) ), m_prime( other.m_prime ) { other.m_prime = nullptr; }
855  void push() {
856  if ( m_prime ) { m_prime->mergeAndReset( static_cast<base_type&>( *this ) ); }
857  }
858  ~Buffer() { push(); }
859 
860  private:
861  prime_type* m_prime = nullptr;
862  };
863 
869  PrintableCounter() = default;
871  virtual ~PrintableCounter() = default;
872  // add tag to printout
873  template <typename stream>
874  stream& printImpl( stream& s, std::string_view tag ) const {
875  s << boost::format{ " | %|-48.48s|%|50t|" } % ( std::string{ '\"' }.append( tag ).append( "\"" ) );
876  return print( s, true );
877  }
879  virtual std::ostream& print( std::ostream&, bool tableFormat = false ) const = 0;
880  virtual MsgStream& print( MsgStream&, bool tableFormat = true ) const = 0;
882  virtual std::ostream& print( std::ostream& o, std::string_view tag ) const { return printImpl( o, tag ); }
883  virtual MsgStream& print( MsgStream& o, std::string_view tag ) const { return printImpl( o, tag ); }
886  virtual bool toBePrinted() const { return true; }
889  std::ostringstream ost;
890  print( ost );
891  return ost.str();
892  }
893  };
894 
898  inline std::ostream& operator<<( std::ostream& s, const PrintableCounter& counter ) { return counter.print( s ); }
899  inline MsgStream& operator<<( MsgStream& s, const PrintableCounter& counter ) { return counter.print( s ); }
906  template <atomicity Atomicity, template <atomicity Ato, typename... Int> class Accumulator, typename... Args>
907  class BufferableCounter : public PrintableCounter, public Accumulator<Atomicity, Args...> {
908  public:
909  using Accumulator<Atomicity, Args...>::Accumulator;
910  using BufferType = Buffer<Accumulator, Atomicity, Args...>;
911  BufferableCounter() = default;
912  template <typename OWNER>
913  BufferableCounter( OWNER* o, std::string const& name ) : BufferableCounter( o, name, *this ) {}
914  BufferType buffer() { return { *this }; }
918  if ( m_monitoringHub ) { m_monitoringHub->removeEntity( *this ); }
919  }
920 
921  inline static const std::string typeString{ "counter" };
922 
923  protected:
924  template <typename OWNER, typename SELF, typename... CARGS>
925  BufferableCounter( OWNER* o, std::string const& name, SELF& self, CARGS... args )
926  : Accumulator<Atomicity, Args...>( args... ), m_monitoringHub( &o->serviceLocator()->monitoringHub() ) {
927  m_monitoringHub->registerEntity( o->name(), name, self.typeString, self );
928  }
929 
930  private:
931  Monitoring::Hub* m_monitoringHub{ nullptr };
932  };
933 
938  template <atomicity Atomicity = atomicity::full, typename Arithmetic = unsigned long>
939  struct Counter : BufferableCounter<Atomicity, IntegralAccumulator, Arithmetic> {
940  inline static const std::string typeString{ std::string{ "counter:Counter:" } + typeid( Arithmetic ).name() };
942  template <typename OWNER>
943  Counter( OWNER* o, std::string const& name )
944  : BufferableCounter<Atomicity, IntegralAccumulator, Arithmetic>( o, name, *this ) {}
945  Counter& operator++() { return ( *this ) += 1; }
946  Counter& operator+=( const Arithmetic v ) {
948  return *this;
949  }
951 
952  template <typename stream>
953  stream& printImpl( stream& o, bool tableFormat ) const {
954  // Avoid printing empty counters in non DEBUG mode
955  auto fmt = ( tableFormat ? "|%|10d| |" : "#=%|-7lu|" );
956  return o << boost::format{ fmt } % this->nEntries();
957  }
958 
959  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
960  return printImpl( o, tableFormat );
961  }
962  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
963  bool toBePrinted() const override { return this->nEntries() > 0; }
964  friend void reset( Counter& c ) { c.reset(); }
965  friend void mergeAndReset( Counter& c, Counter& o ) { c.mergeAndReset( o ); }
966  friend void to_json( nlohmann::json& j, Counter const& c ) {
967  j = { { "type", c.typeString }, { "empty", c.nEntries() == 0 }, { "nEntries", c.nEntries() } };
968  }
969  static Counter fromJSON( const nlohmann::json& j ) {
971  }
972  };
973 
978  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
979  struct AveragingCounter : BufferableCounter<Atomicity, AveragingAccumulator, Arithmetic> {
980  inline static const std::string typeString{ std::string{ "counter:AveragingCounter:" } +
981  typeid( Arithmetic ).name() };
983  template <typename OWNER>
984  AveragingCounter( OWNER* o, std::string const& name )
985  : BufferableCounter<Atomicity, AveragingAccumulator, Arithmetic>( o, name, *this ) {}
987 
988  template <typename stream>
989  stream& printImpl( stream& o, bool tableFormat ) const {
990  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |" : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g|" );
991  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean();
992  }
993 
994  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
995  return printImpl( o, tableFormat );
996  }
997  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
998 
999  bool toBePrinted() const override { return this->nEntries() > 0; }
1000  friend void reset( AveragingCounter& c ) { return c.reset(); }
1001  friend void mergeAndReset( AveragingCounter& c, AveragingCounter& o ) { c.mergeAndReset( o ); }
1002  friend void to_json( nlohmann::json& j, AveragingCounter const& c ) {
1003  j = { { "type", c.typeString },
1004  { "empty", c.nEntries() == 0 },
1005  { "nEntries", c.nEntries() },
1006  { "sum", c.sum() },
1007  { "mean", c.mean() } };
1008  }
1010  return AveragingAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { "nEntries", "sum" } );
1011  }
1012  };
1013  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1015 
1020  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1021  struct SigmaCounter : BufferableCounter<Atomicity, SigmaAccumulator, Arithmetic> {
1022  inline static const std::string typeString{ std::string{ "counter:SigmaCounter:" } + typeid( Arithmetic ).name() };
1024  template <typename OWNER>
1025  SigmaCounter( OWNER* o, std::string const& name )
1026  : BufferableCounter<Atomicity, SigmaAccumulator, Arithmetic>( o, name, *this ) {}
1028 
1029  template <typename stream>
1030  stream& printImpl( stream& o, bool tableFormat ) const {
1031  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |"
1032  : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g| +- %|-#10.5g|" );
1033  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean() % this->standard_deviation();
1034  }
1035 
1036  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1037  return printImpl( o, tableFormat );
1038  }
1039  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1040  bool toBePrinted() const override { return this->nEntries() > 0; }
1041  friend void reset( SigmaCounter& c ) { c.reset(); }
1042  friend void mergeAndReset( SigmaCounter& c, SigmaCounter& o ) { c.mergeAndReset( o ); }
1043  friend void to_json( nlohmann::json& j, SigmaCounter const& c ) {
1044  j = { { "type", c.typeString },
1045  { "empty", c.nEntries() == 0 },
1046  { "nEntries", c.nEntries() },
1047  { "sum", c.sum() },
1048  { "mean", c.mean() },
1049  { "sum2", c.sum2() },
1050  { "standard_deviation", c.standard_deviation() } };
1051  }
1053  return SigmaAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { { "nEntries", "sum" }, "sum2" } );
1054  }
1055  };
1056 
1061  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1062  struct StatCounter : BufferableCounter<Atomicity, StatAccumulator, Arithmetic> {
1063  inline static const std::string typeString{ std::string{ "counter:StatCounter:" } + typeid( Arithmetic ).name() };
1065  template <typename OWNER>
1066  StatCounter( OWNER* o, std::string const& name )
1067  : BufferableCounter<Atomicity, StatAccumulator, Arithmetic>( o, name, *this ) {}
1069 
1070  template <typename stream>
1071  stream& printImpl( stream& o, bool tableFormat ) const {
1072  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |"
1073  : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g| +- %|-#10.5g| Min/Max=%|#10.4g|/%|-#10.4g|" );
1074  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean() % this->standard_deviation() %
1075  this->min() % this->max();
1076  }
1077 
1078  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1079  return printImpl( o, tableFormat );
1080  }
1081  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1082  bool toBePrinted() const override { return this->nEntries() > 0; }
1083  friend void reset( StatCounter& c ) { c.reset(); }
1084  friend void mergeAndReset( StatCounter& c, StatCounter& o ) { c.mergeAndReset( o ); }
1085  friend void to_json( nlohmann::json& j, StatCounter const& c ) {
1086  j = { { "type", c.typeString },
1087  { "empty", c.nEntries() == 0 },
1088  { "nEntries", c.nEntries() },
1089  { "sum", c.sum() },
1090  { "mean", c.mean() },
1091  { "sum2", c.sum2() },
1092  { "standard_deviation", c.standard_deviation() },
1093  { "min", c.min() },
1094  { "max", c.max() } };
1095  }
1098  j, { { { "nEntries", "sum" }, "sum2" }, "min", "max" } );
1099  }
1100  };
1101 
1106  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1107  struct BinomialCounter : BufferableCounter<Atomicity, BinomialAccumulator, Arithmetic> {
1108  inline static const std::string typeString{ std::string{ "counter:BinomialCounter:" } +
1109  typeid( Arithmetic ).name() };
1111  template <typename OWNER>
1112  BinomialCounter( OWNER* o, std::string const& name )
1113  : BufferableCounter<Atomicity, BinomialAccumulator, Arithmetic>( o, name, *this ) {}
1114 
1115  template <typename stream>
1116  stream& printImpl( stream& o, bool tableFormat ) const {
1117  auto fmt = ( tableFormat ? "|%|10d| |%|11.5g| |(%|#9.7g| +- %|-#8.7g|)%% |"
1118  : "#=%|-7lu| Sum=%|-11.5g| Eff=|(%|#9.7g| +- %|-#8.6g|)%%|" );
1119  return o << boost::format{ fmt } % this->nEntries() % this->nTrueEntries() % ( this->efficiency() * 100 ) %
1120  ( this->efficiencyErr() * 100 );
1121  }
1122 
1123  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1124  return printImpl( o, tableFormat );
1125  }
1126  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1127 
1128  template <typename stream>
1129  stream& printImpl( stream& o, std::string_view tag ) const {
1130  // override default print to add a '*' in from of the name
1131  o << boost::format{ " |*%|-48.48s|%|50t|" } % ( std::string{ "\"" }.append( tag ).append( "\"" ) );
1132  return print( o, true );
1133  }
1135  std::ostream& print( std::ostream& o, std::string_view tag ) const override { return printImpl( o, tag ); }
1136  MsgStream& print( MsgStream& o, std::string_view tag ) const override { return printImpl( o, tag ); }
1137  bool toBePrinted() const override { return this->nEntries() > 0; }
1138  friend void reset( BinomialCounter& c ) { c.reset(); }
1139  friend void mergeAndReset( BinomialCounter& c, BinomialCounter& o ) { c.mergeAndReset( o ); }
1140  friend void to_json( nlohmann::json& j, BinomialCounter const& c ) {
1141  j = { { "type", c.typeString },
1142  { "empty", c.nEntries() == 0 },
1143  { "nEntries", c.nTrueEntries() + c.nFalseEntries() },
1144  { "nTrueEntries", c.nTrueEntries() },
1145  { "nFalseEntries", c.nFalseEntries() },
1146  { "efficiency", c.efficiency() },
1147  { "efficiencyErr", c.efficiencyErr() } };
1148  }
1150  return BinomialAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { "nTrueEntries", "nFalseEntries" } );
1151  }
1152  };
1153 
1154  namespace details::MsgCounter {
1155  template <atomicity Atomicity>
1156  struct Handler : Adder<unsigned long, Atomicity> {
1158  static void merge( typename Base::InternalType& orig, bool b ) {
1159  if ( b ) Base::merge( orig, 1 );
1160  }
1161  };
1162  // note that Arithmetic type is unused in this case but needs to be there in case
1163  // we want to create AccumulatorSets with this Accumulator
1164  template <atomicity Atomicity, typename Arithmetic = double>
1166  } // namespace details::MsgCounter
1167 
1168  template <MSG::Level level, atomicity Atomicity = atomicity::full>
1170  public:
1171  inline static const std::string typeString{ "counter:MsgCounter" };
1172  template <typename OWNER>
1173  MsgCounter( OWNER* o, std::string const& ms, unsigned long nMax = 10 )
1174  : m_monitoringHub{ &o->serviceLocator()->monitoringHub() }, logger( o ), msg( ms ), max( nMax ) {
1175  m_monitoringHub->registerEntity( o->name(), ms, typeString, *this );
1176  }
1177  template <typename OWNER>
1178  MsgCounter( OWNER* o, std::string const& ms, int nMax ) : MsgCounter( o, ms, static_cast<unsigned long>( nMax ) ) {}
1180  ( *this ) += true;
1181  return *this;
1182  }
1183  MsgCounter& operator+=( const bool by ) {
1185  if ( by ) log();
1186  return *this;
1187  }
1188  MsgCounter( MsgCounter const& ) = delete;
1189  MsgCounter& operator=( MsgCounter const& ) = delete;
1191  if ( m_monitoringHub ) m_monitoringHub->removeEntity( *this );
1192  }
1193  template <typename stream>
1194  stream& printImpl( stream& o, bool tableFormat ) const {
1195  return o << boost::format{ tableFormat ? "|%|10d| |" : "#=%|-7lu|" } % this->value();
1196  }
1198  std::ostream& print( std::ostream& os, bool tableFormat ) const override { return printImpl( os, tableFormat ); }
1199  MsgStream& print( MsgStream& os, bool tableFormat ) const override { return printImpl( os, tableFormat ); }
1200  bool toBePrinted() const override { return this->value() > 0; }
1201  friend void reset( MsgCounter& c ) { c.reset(); }
1202  friend void mergeAndReset( MsgCounter& c, MsgCounter& o ) { c.mergeAndReset( o ); }
1203  friend void to_json( nlohmann::json& j, MsgCounter const& c ) {
1204  j = { { "type", c.typeString }, { "empty", c.value() == 0 },
1205  { "nEntries", c.value() }, { "level", level },
1206  { "max", c.max }, { "msg", c.msg } };
1207  }
1209  return { j.at( "msg" ).get<std::string>(), j.at( "max" ).get<unsigned long>(),
1210  j.at( "nEntries" ).get<unsigned long>() };
1211  }
1212 
1213  private:
1214  MsgCounter( std::string const& ms, unsigned long nMax, unsigned long count )
1215  : details::MsgCounter::MsgAccumulator<Atomicity>{ count }, msg( ms ), max( nMax ) {}
1216 
1218  const CommonMessagingBase* logger{ nullptr };
1220  unsigned long max;
1221  void log() {
1222  if ( this->value() <= max && logger ) {
1223  if ( this->value() == max ) {
1224  logger->msgStream( level ) << "Suppressing message: " << std::quoted( msg, '\'' ) << endmsg;
1225  } else {
1226  logger->msgStream( level ) << msg << endmsg;
1227  }
1228  }
1229  }
1230  };
1231 
1237  template <typename Counter, typename Container, typename Fun>
1238  void accumulate( Counter& counter, const Container& container, Fun f = Identity{} ) {
1239  auto b = counter.buffer();
1240  for ( const auto& elem : container ) b += f( elem );
1241  }
1242 
1243 } // namespace Gaudi::Accumulators
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(std::string const &ms, unsigned long nMax, unsigned long count)
Definition: Accumulators.h:1214
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::full >::OutputType
Arithmetic OutputType
Definition: Accumulators.h:336
Gaudi::Accumulators::PrintableCounter
An empty ancester of all counters that knows how to print themselves.
Definition: Accumulators.h:868
Gaudi::Accumulators::PrintableCounter::printImpl
stream & printImpl(stream &s, std::string_view tag) const
Definition: Accumulators.h:874
Gaudi::Accumulators::sqrt
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition: Counters.h:34
Gaudi::Accumulators::GenericAccumulator< bool, unsigned long, Atomicity, TrueTo1 >::InternalType
unsigned long InternalType
Definition: Accumulators.h:478
Gaudi::Accumulators::BinomialCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1108
Gaudi::Accumulators::AccumulatorSet::extractJSONData
static InternalType extractJSONData(const nlohmann::json &j, const JSONStringEntriesType &entries)
Definition: Accumulators.h:558
std::make_tuple
T make_tuple(T... args)
Gaudi::Accumulators::MsgCounter::logger
const CommonMessagingBase * logger
Definition: Accumulators.h:1218
Gaudi::Accumulators::MsgCounter::mergeAndReset
friend void mergeAndReset(MsgCounter &c, MsgCounter &o)
Definition: Accumulators.h:1202
Gaudi::Accumulators::StatCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1071
Gaudi::Accumulators::CountAccumulator::operator++
CountAccumulator & operator++()
Definition: Accumulators.h:608
Gaudi::Accumulators::MsgCounter::log
void log()
Definition: Accumulators.h:1221
Write.stream
stream
Definition: Write.py:32
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::none >::InternalType
Arithmetic InternalType
Definition: Accumulators.h:326
Gaudi::Accumulators::Buffer::prime_type
ContainedAccumulator< Atomicity, Args... > prime_type
Definition: Accumulators.h:846
std::string
STL class.
Gaudi::Accumulators::Buffer::push
void push()
Definition: Accumulators.h:855
Gaudi::Accumulators::TrueAccumulator
TrueAccumulator.
Definition: Accumulators.h:675
IOTest.N
N
Definition: IOTest.py:112
Gaudi::Accumulators::BinomialCounter::print
std::ostream & print(std::ostream &o, std::string_view tag) const override
prints the counter to a stream in table format, with the given tag
Definition: Accumulators.h:1135
Gaudi::Accumulators::BaseValueHandler
Base type for all functors used as ValuesHandler.
Definition: Accumulators.h:318
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter(BufferableCounter const &)=delete
Gaudi::Accumulators::AccumulatorSet::operator+=
AccumulatorSet & operator+=(const InputType by)
Definition: Accumulators.h:538
Gaudi::Accumulators::SigmaCounter::reset
friend void reset(SigmaCounter &c)
Definition: Accumulators.h:1041
Gaudi::Accumulators::operator*
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.
Definition: Counters.h:40
Gaudi::Accumulators::GenericAccumulator::m_value
ValueHandler::InternalType m_value
Definition: Accumulators.h:517
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(MsgCounter const &)=delete
Gaudi::Accumulators::MsgCounter::m_monitoringHub
Monitoring::Hub * m_monitoringHub
Definition: Accumulators.h:1217
std::move
T move(T... args)
Gaudi::Accumulators::SigmaCounter
A counter aiming at computing average and sum2 / variance / standard deviation.
Definition: Accumulators.h:1021
Gaudi::Accumulators::Adder< Arithmetic, atomicity::full >::DefaultValue
static constexpr OutputType DefaultValue()
Definition: Accumulators.h:383
Gaudi::Accumulators::AccumulatorSet::mergeAndReset
void mergeAndReset(AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &other)
Definition: Accumulators.h:545
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::full >::getValue
static constexpr OutputType getValue(const InternalType &v) noexcept
Definition: Accumulators.h:338
Gaudi::Accumulators::PrintableCounter::toBePrinted
virtual bool toBePrinted() const
hint whether we should print that counter or not.
Definition: Accumulators.h:886
Gaudi::Accumulators::BufferableCounter::operator=
BufferableCounter & operator=(BufferableCounter const &)=delete
MonitoringHub.h
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator(InnerType in)
Definition: Accumulators.h:509
Gaudi::Accumulators::StatCounter::mergeAndReset
friend void mergeAndReset(StatCounter &c, StatCounter &o)
Definition: Accumulators.h:1084
Gaudi::Accumulators::GenericAccumulator::rawValue
auto rawValue() const
Definition: Accumulators.h:510
Gaudi::Accumulators::AccumulatorSet
AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and At...
Definition: Accumulators.h:527
Gaudi::Accumulators::SumAccumulator
SumAccumulator.
Definition: Accumulators.h:625
Gaudi::Accumulators::BufferableCounter::buffer
BufferType buffer()
Definition: Accumulators.h:914
Gaudi::Accumulators::Counter
A basic integral counter;.
Definition: Accumulators.h:939
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(OWNER *o, std::string const &ms, unsigned long nMax=10)
Definition: Accumulators.h:1173
Gaudi::Accumulators::AveragingCounter::AveragingCounter
AveragingCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:984
Gaudi::Accumulators::atomicity::full
@ full
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::none >::exchange
static Arithmetic exchange(InternalType &v, Arithmetic newv) noexcept
Definition: Accumulators.h:328
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Accumulators::StatCounter::fromJSON
static StatCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1096
Gaudi::Accumulators::MsgCounter::print
MsgStream & print(MsgStream &os, bool tableFormat) const override
Definition: Accumulators.h:1199
Gaudi::Accumulators::SigmaCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1036
Gaudi::Accumulators::PrintableCounter::~PrintableCounter
virtual ~PrintableCounter()=default
destructor
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::none >::getValue
static constexpr OutputType getValue(const InternalType &v) noexcept
Definition: Accumulators.h:327
Gaudi::Accumulators::PrintableCounter::toString
std::string toString() const
get a string representation
Definition: Accumulators.h:888
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter()=default
Gaudi::Accumulators::details::MsgCounter::Handler
Definition: Accumulators.h:1156
Gaudi::Accumulators::BinomialCounter::to_json
friend void to_json(nlohmann::json &j, BinomialCounter const &c)
Definition: Accumulators.h:1140
Gaudi::Accumulators::MsgCounter::msg
std::string msg
Definition: Accumulators.h:1219
Gaudi::Accumulators::IntegralAccumulator
IntegralAccumulator.
Definition: Accumulators.h:636
jsonFromLHCbLog.json
json
Definition: jsonFromLHCbLog.py:86
Gaudi::Accumulators::BinomialCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1137
Gaudi::Accumulators::AveragingCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:994
Gaudi::Accumulators::Extremum< Arithmetic, atomicity::none, Compare, Initial >::merge
static void merge(InternalType &a, Arithmetic b) noexcept
Definition: Accumulators.h:407
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator(std::in_place_t, Args &&... args)
Definition: Accumulators.h:491
Gaudi::Accumulators::SquareAccumulator
SquareAccumulator.
Definition: Accumulators.h:659
std::chrono::duration
Gaudi::Accumulators::MsgCounter::reset
friend void reset(MsgCounter &c)
Definition: Accumulators.h:1201
Gaudi::Accumulators::GenericAccumulator::reset
void reset()
Definition: Accumulators.h:498
Gaudi::Accumulators::Counter::fromJSON
static Counter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:969
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::none >::OutputType
Arithmetic OutputType
Definition: Accumulators.h:325
Gaudi::Accumulators::PrintableCounter::print
virtual MsgStream & print(MsgStream &, bool tableFormat=true) const =0
nlohmann
Definition: Accumulators.h:250
Gaudi::Accumulators::MsgCounter::operator++
MsgCounter & operator++()
Definition: Accumulators.h:1179
Gaudi::Accumulators::MsgCounter::~MsgCounter
~MsgCounter()
Definition: Accumulators.h:1190
CommonMessagingBase
Definition: CommonMessaging.h:68
Gaudi::Accumulators::MinAccumulator
MinAccumulator.
Definition: Accumulators.h:593
Gaudi::Accumulators::AveragingCounter
A counter aiming at computing sum and average.
Definition: Accumulators.h:979
Gaudi::Accumulators::PrintableCounter::PrintableCounter
PrintableCounter()=default
Gaudi::Accumulators::AccumulatorSet::reset
void reset()
Definition: Accumulators.h:543
Gaudi::Accumulators::Buffer::Buffer
Buffer(const Buffer &)=delete
Gaudi::Accumulators::Counter::mergeAndReset
friend void mergeAndReset(Counter &c, Counter &o)
Definition: Accumulators.h:965
Gaudi::Accumulators::BinomialCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:1126
Gaudi::Accumulators::AccumulatorSet::AccumulatorSet
AccumulatorSet(construct_empty_t, const AccumulatorSet< Arithmetic, ato, InputType, Bases... > &)
constructor of an empty AccumulatorSet, copying the (non existent) config from another GenericAccumul...
Definition: Accumulators.h:536
Gaudi::Accumulators::BinomialCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1123
std::tuple
Gaudi::Accumulators::MinAccumulator::min
Arithmetic min() const
Definition: Accumulators.h:596
std::operator<<
ostream & operator<<(ostream &s, const MyCustomType &m)
Definition: CustomPropertiesAlg.cpp:47
gaudirun.c
c
Definition: gaudirun.py:525
Gaudi::Accumulators::PrintableCounter::print
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
Definition: Accumulators.h:882
Gaudi::Accumulators::SigmaAccumulatorBase::meanErr
auto meanErr() const
Definition: Accumulators.h:811
class
#define class
Definition: HistogramPersistencySvc.cpp:54
Gaudi::Accumulators::BinomialAccumulator::operator+=
BinomialAccumulator & operator+=(binomial_t b)
Definition: Accumulators.h:730
Gaudi::Accumulators::BinomialCounter::BinomialCounter
BinomialCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1112
Gaudi::Accumulators::AccumulatorSet::operator+
void operator+(AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &&other)
Definition: Accumulators.h:549
Gaudi::Accumulators::MsgCounter::operator=
MsgCounter & operator=(MsgCounter const &)=delete
Gaudi::Accumulators::Counter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:953
Gaudi::Accumulators::TrueTo1
helper functor for the TrueAccumulator
Definition: Accumulators.h:665
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(OWNER *o, std::string const &ms, int nMax)
Definition: Accumulators.h:1178
Gaudi::Accumulators::AveragingAccumulatorBase
AveragingAccumulatorBase.
Definition: Accumulators.h:748
Gaudi::Accumulators::BaseValueHandler< Arithmetic, atomicity::full >::exchange
static Arithmetic exchange(InternalType &v, Arithmetic newv) noexcept
Definition: Accumulators.h:341
Gaudi::Accumulators::Buffer::base_type
ContainedAccumulator< atomicity::none, Args... > base_type
Definition: Accumulators.h:847
Gaudi::Accumulators::SigmaCounter::SigmaCounter
SigmaCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1025
Gaudi::Accumulators::BinomialAccumulator::binomial_t
Definition: Accumulators.h:726
std::sqrt
T sqrt(T... args)
Gaudi::Accumulators::Counter::operator+=
Counter & operator+=(const Arithmetic v)
Definition: Accumulators.h:946
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:913
Gaudi::Accumulators::AccumulatorSet::extractJSONDataHelper
static InternalType extractJSONDataHelper(const nlohmann::json &j, typename Bases< Atomicity, Arithmetic >::JSONStringEntriesType... entries)
Definition: Accumulators.h:569
Gaudi::Accumulators::Square
A Square functor.
Definition: Accumulators.h:293
Gaudi::Accumulators::Counter::operator++
Counter & operator++()
Definition: Accumulators.h:945
Gaudi::Units::ms
constexpr double ms
Definition: SystemOfUnits.h:154
Gaudi::Accumulators::GenericAccumulator< bool, unsigned long, Atomicity, TrueTo1 >::InputType
bool InputType
Definition: Accumulators.h:476
Gaudi::Accumulators::MsgCounter::operator+=
MsgCounter & operator+=(const bool by)
Definition: Accumulators.h:1183
Gaudi::Accumulators::Counter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:962
Gaudi::Accumulators::GenericAccumulator::operator+=
GenericAccumulator operator+=(const InputType by)
Definition: Accumulators.h:480
Gaudi::Accumulators::StatCounter::StatCounter
StatCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1066
Gaudi::Accumulators::StatCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1078
bug_34121.t
t
Definition: bug_34121.py:31
Gaudi::Accumulators::BinomialAccumulator
BinomialAccumulator.
Definition: Accumulators.h:702
Gaudi::Accumulators::BinomialAccumulator::eff
auto eff() const
Definition: Accumulators.h:712
Gaudi::Accumulators::IntegralAccumulator::nEntries
Arithmetic nEntries() const
Definition: Accumulators.h:650
Gaudi::Accumulators::Extremum
An Extremum ValueHandler, to be reused for Minimum and Maximum operator(a, b) means if (Compare(b,...
Definition: Accumulators.h:397
Gaudi::Accumulators::IntegralAccumulator::operator++
IntegralAccumulator & operator++()
Definition: Accumulators.h:641
Gaudi::Accumulators::AveragingCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:989
Gaudi::Accumulators::Adder
An Adder ValueHandler operator(a, b) means a += b.
Definition: Accumulators.h:349
Gaudi::Accumulators::CountAccumulator::operator++
CountAccumulator operator++(int)
Definition: Accumulators.h:612
Gaudi::Accumulators::has_fetch_add_v
constexpr bool has_fetch_add_v
Definition: Accumulators.h:306
Gaudi::Accumulators::SigmaAccumulatorBase::unbiased_sample_variance
auto unbiased_sample_variance() const
Definition: Accumulators.h:791
details
Definition: AnyDataWrapper.h:19
std::ratio
Gaudi::Accumulators::BinomialAccumulator::efficiencyErr
auto efficiencyErr() const
Definition: Accumulators.h:715
ProduceConsume.j
j
Definition: ProduceConsume.py:104
std::ostream
STL class.
Gaudi::Accumulators::StatCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:1081
nlohmann::adl_serializer< std::chrono::duration< Rep, Period > >::from_json
static void from_json(const json &j, std::chrono::duration< Rep, Period > &d)
Definition: Accumulators.h:254
Gaudi::Accumulators::Counter::reset
friend void reset(Counter &c)
Definition: Accumulators.h:964
Gaudi::Accumulators::Extremum< Arithmetic, atomicity::full, Compare, Initial >::DefaultValue
static constexpr OutputType DefaultValue()
Definition: Accumulators.h:419
Gaudi::Accumulators::BinomialCounter::printImpl
stream & printImpl(stream &o, std::string_view tag) const
Definition: Accumulators.h:1129
Gaudi::Accumulators::AccumulatorSet::InternalType
std::tuple< typename Bases< Atomicity, Arithmetic >::InternalType... > InternalType
Definition: Accumulators.h:531
Gaudi::Accumulators::AveragingAccumulatorBase::mean
auto mean() const
Definition: Accumulators.h:755
Gaudi::Accumulators::Buffer::Buffer
Buffer(prime_type &p)
Definition: Accumulators.h:851
Gaudi::Accumulators::Extremum< Arithmetic, atomicity::none, Compare, Initial >::DefaultValue
static constexpr OutputType DefaultValue()
Definition: Accumulators.h:406
Gaudi::Accumulators::Buffer::Buffer
Buffer(Buffer &&other)
Definition: Accumulators.h:854
Gaudi::Accumulators::StatCounter::reset
friend void reset(StatCounter &c)
Definition: Accumulators.h:1083
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator(construct_empty_t, const GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &)
constructor of an empty GenericAccumulator, copying the (non existent) config from another GenericAcc...
Definition: Accumulators.h:487
Gaudi::Accumulators::GenericAccumulator< double, double, Atomicity, Identity, Identity, Maximum< double, Atomicity > >::GenericAccumulator
friend class GenericAccumulator
Definition: Accumulators.h:473
Gaudi::Accumulators::GenericAccumulator< bool, unsigned long, Atomicity, TrueTo1 >::OutputType
std::decay_t< std::invoke_result_t< Identity, unsigned long > > OutputType
Definition: Accumulators.h:477
Gaudi::Accumulators::Counter::typeString
static const std::string typeString
Definition: Accumulators.h:940
Gaudi::Accumulators::AccumulatorSet::value
OutputType value() const
Definition: Accumulators.h:542
Gaudi::Accumulators::GenericAccumulator::operator=
GenericAccumulator & operator=(const GenericAccumulator &other)
Definition: Accumulators.h:493
Gaudi::Accumulators::details::MsgCounter::MsgAccumulator
GenericAccumulator< bool, unsigned long, Atomicity, Identity, Identity, Handler< Atomicity > > MsgAccumulator
Definition: Accumulators.h:1165
Gaudi::Accumulators::BinomialCounter
A counter dealing with binomial data.
Definition: Accumulators.h:1107
Gaudi::Accumulators::details::MsgCounter::Handler::merge
static void merge(typename Base::InternalType &orig, bool b)
Definition: Accumulators.h:1158
Gaudi::Accumulators::Buffer::~Buffer
~Buffer()
Definition: Accumulators.h:858
Gaudi::Monitoring::Hub::registerEntity
void registerEntity(std::string c, std::string n, std::string t, T &ent)
Definition: MonitoringHub.h:140
Gaudi::Accumulators::Adder< Arithmetic, atomicity::none >::merge
static void merge(InternalType &a, Arithmetic b) noexcept
Definition: Accumulators.h:359
Gaudi::Accumulators::AccumulatorSet::extractJSONDataHelper
static InternalType extractJSONDataHelper(const nlohmann::json &j, const JSONStringEntriesType &entries, std::index_sequence< Is... >)
Definition: Accumulators.h:564
Gaudi::Accumulators::BinomialAccumulator::binomial_t::nPass
unsigned long nPass
Definition: Accumulators.h:727
CommonMessaging.h
Gaudi::Accumulators::Buffer::operator=
void operator=(const Buffer &)=delete
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
Gaudi::Accumulators::GenericAccumulator::mergeAndReset
void mergeAndReset(GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &other)
Definition: Accumulators.h:500
Gaudi::Accumulators::MsgCounter::print
std::ostream & print(std::ostream &os, bool tableFormat) const override
prints the counter to a stream
Definition: Accumulators.h:1198
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
Gaudi::Monitoring::Hub::removeEntity
void removeEntity(T &ent)
Definition: MonitoringHub.h:148
Gaudi::Accumulators::MsgCounter
Definition: Accumulators.h:1169
std::atomic< Arithmetic >
Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, CountAcc< Atomicity, Arithmetic >::InputType, CountAcc, SumAcc >::InputType
CountAcc< Atomicity, Arithmetic >::InputType InputType
Definition: Accumulators.h:529
Gaudi::Accumulators::FalseAccumulator::nFalseEntries
unsigned long nFalseEntries() const
Definition: Accumulators.h:693
Gaudi::Accumulators::BinomialAccumulator::efficiency
auto efficiency() const
Definition: Accumulators.h:707
Gaudi::Accumulators::AccumulatorSet::AccumulatorSet
constexpr AccumulatorSet()=default
Gaudi::Accumulators::GenericAccumulator
Generic Accumulator, templated by.
Definition: Accumulators.h:471
gaudirun.level
level
Definition: gaudirun.py:364
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter(OWNER *o, std::string const &name, SELF &self, CARGS... args)
Definition: Accumulators.h:925
Gaudi::Accumulators::Constant
A functor always returning the value N.
Definition: Accumulators.h:273
MsgStream
Definition: MsgStream.h:33
Gaudi::Accumulators::BinomialCounter::mergeAndReset
friend void mergeAndReset(BinomialCounter &c, BinomialCounter &o)
Definition: Accumulators.h:1139
nlohmann::adl_serializer< std::chrono::duration< Rep, Period > >::to_json
static void to_json(json &j, const std::chrono::duration< Rep, Period > &d)
Definition: Accumulators.h:253
Gaudi::Accumulators::GenericAccumulator::value
OutputType value() const
Definition: Accumulators.h:497
cpluginsvc.n
n
Definition: cpluginsvc.py:234
std::string::append
T append(T... args)
Gaudi::Accumulators::GenericAccumulator::reset
void reset(InnerType in)
Definition: Accumulators.h:511
CommonMessagingBase::msgStream
MsgStream & msgStream() const
Return an uninitialized MsgStream.
Definition: CommonMessaging.h:81
Gaudi::Accumulators::StatCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1082
Gaudi::Accumulators::BufferableCounter
An empty ancester of all counters that provides a buffer method that returns a buffer on itself Also ...
Definition: Accumulators.h:907
Gaudi::Accumulators::StatCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1063
std::ostringstream
STL class.
Gaudi::Accumulators::Identity
An Identity functor.
Definition: Accumulators.h:283
Gaudi::Accumulators::SigmaCounter::to_json
friend void to_json(nlohmann::json &j, SigmaCounter const &c)
Definition: Accumulators.h:1043
Gaudi::Accumulators::BinomialAccumulator::effErr
auto effErr() const
Definition: Accumulators.h:724
Gaudi::Accumulators
Definition: CounterArray.h:18
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator()=default
merge
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition: merge.C:430
Gaudi::Accumulators::MsgCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1194
Gaudi::Accumulators::Buffer::Buffer
Buffer()=delete
Gaudi::Accumulators::SigmaCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1022
Gaudi::Accumulators::fp_result_type
std::conditional_t< std::is_integral_v< Arithmetic >, Result, Arithmetic > fp_result_type
type_trait for the result type of a floating point operation on the type Arithmetic
Definition: Accumulators.h:312
Gaudi::Accumulators::MaxAccumulator
MaxAccumulator.
Definition: Accumulators.h:581
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
Gaudi::Accumulators::MsgCounter::max
unsigned long max
Definition: Accumulators.h:1220
Gaudi::Accumulators::SigmaAccumulatorBase::rms
Arithmetic rms() const
Definition: Accumulators.h:806
Gaudi::Accumulators::CountAccumulator
CountAccumulator.
Definition: Accumulators.h:606
Gaudi::Accumulators::AccumulatorSet::AccumulatorSet
AccumulatorSet(const InternalType &t)
Definition: Accumulators.h:554
Gaudi::Accumulators::AveragingCounter::to_json
friend void to_json(nlohmann::json &j, AveragingCounter const &c)
Definition: Accumulators.h:1002
Gaudi::Accumulators::PrintableCounter::print
virtual MsgStream & print(MsgStream &o, std::string_view tag) const
Definition: Accumulators.h:883
gaudirun.args
args
Definition: gaudirun.py:336
Gaudi::Accumulators::GenericAccumulator::extractJSONData
static InnerType extractJSONData(const nlohmann::json &j, const JSONStringEntriesType &entries)
Definition: Accumulators.h:512
Gaudi::Accumulators::MsgCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1200
Gaudi::Accumulators::FalseAccumulator
FalseAccumulator.
Definition: Accumulators.h:691
Gaudi::Accumulators::MaxAccumulator::max
Arithmetic max() const
Definition: Accumulators.h:584
Gaudi::Accumulators::SigmaAccumulatorBase::standard_deviation
auto standard_deviation() const
Definition: Accumulators.h:798
Gaudi::Accumulators::construct_empty_t::construct_empty_t
construct_empty_t()=default
std
STL namespace.
Gaudi::Accumulators::construct_empty
constexpr construct_empty_t construct_empty
Definition: Accumulators.h:449
fmt
Gaudi::Accumulators::FalseTo1
helper functor for the FalseAccumulator
Definition: Accumulators.h:681
Gaudi::Accumulators::BinomialCounter::fromJSON
static BinomialCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1149
detected.h
Gaudi::Accumulators::AccumulatorSet::reset
void reset(const InternalType &t)
Definition: Accumulators.h:555
Gaudi::Accumulators::SigmaAccumulatorBase
SigmaAccumulatorBase.
Definition: Accumulators.h:777
Gaudi::Accumulators::Buffer
Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-sa...
Definition: Accumulators.h:845
Gaudi::Accumulators::CountAccumulator::nEntries
unsigned long nEntries() const
Definition: Accumulators.h:617
Gaudi::Accumulators::GenericAccumulator::operator+
void operator+(GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &&other)
Definition: Accumulators.h:504
Gaudi::Accumulators::SigmaCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1030
std::chrono::duration::count
T count(T... args)
Gaudi::Accumulators::AveragingCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:999
Gaudi::Accumulators::atomicity
atomicity
Defines atomicity of the accumulators.
Definition: Accumulators.h:263
Gaudi::Accumulators::fetch_add
void fetch_add(AtomicType &atVar, Arithmetic value)
generic fetch_add, also dealing with atomic types with no fetch_add member method
Definition: Accumulators.h:366
Gaudi::Accumulators::IntegralAccumulator::sum
Arithmetic sum() const
Definition: Accumulators.h:651
Properties.v
v
Definition: Properties.py:122
Gaudi::Accumulators::Adder< Arithmetic, atomicity::full >::merge
static void merge(InternalType &a, Arithmetic b) noexcept
Definition: Accumulators.h:384
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator(const GenericAccumulator &other)
Definition: Accumulators.h:492
Gaudi::Accumulators::Adder< Arithmetic, atomicity::none >::DefaultValue
static constexpr OutputType DefaultValue()
Definition: Accumulators.h:358
Gaudi::Accumulators::StatCounter
A counter aiming at computing average and sum2 / variance / standard deviation.
Definition: Accumulators.h:1062
Gaudi::Accumulators::construct_empty_t
constant used to disambiguate construction of an empty Accumulator versus the copy constructor.
Definition: Accumulators.h:446
std::ostringstream::str
T str(T... args)
Gaudi::Accumulators::AveragingCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:997
Gaudi::Accumulators::BinomialAccumulator::nEntries
unsigned long nEntries() const
Definition: Accumulators.h:704
Gaudi::Accumulators::BinomialCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1116
plotSpeedupsPyRoot.counter
counter
Definition: plotSpeedupsPyRoot.py:175
Gaudi::Accumulators::SigmaCounter::fromJSON
static SigmaCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1052
Gaudi::Accumulators::SigmaAccumulatorBase::biased_sample_variance
auto biased_sample_variance() const
Definition: Accumulators.h:784
Gaudi::Accumulators::TrueAccumulator::nTrueEntries
unsigned long nTrueEntries() const
Definition: Accumulators.h:677
Gaudi::Accumulators::BinomialCounter::reset
friend void reset(BinomialCounter &c)
Definition: Accumulators.h:1138
Gaudi::Accumulators::PrintableCounter::print
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
Gaudi::Monitoring::Hub
Central entity in a Gaudi application that manages monitoring objects (i.e.
Definition: MonitoringHub.h:50
Gaudi::Accumulators::FalseTo1::operator()
unsigned int operator()(bool v) const
Definition: Accumulators.h:682
Gaudi::Accumulators::Counter::Counter
Counter(OWNER *o, std::string const &name)
Definition: Accumulators.h:943
Gaudi::Accumulators::atomicity::none
@ none
Gaudi::Accumulators::IntegralAccumulator::operator++
IntegralAccumulator operator++(int)
Definition: Accumulators.h:645
Gaudi::Accumulators::Extremum< Arithmetic, atomicity::full, Compare, Initial >::merge
static void merge(InternalType &a, Arithmetic b) noexcept
Definition: Accumulators.h:420
Gaudi::Accumulators::TrueTo1::operator()
unsigned int operator()(bool v) const
Definition: Accumulators.h:666
Gaudi::Accumulators::MsgCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1171
Gaudi::Accumulators::BinomialCounter::print
MsgStream & print(MsgStream &o, std::string_view tag) const override
Definition: Accumulators.h:1136
Gaudi::Accumulators::AveragingCounter::mergeAndReset
friend void mergeAndReset(AveragingCounter &c, AveragingCounter &o)
Definition: Accumulators.h:1001
Gaudi::Accumulators::SigmaCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1040
Gaudi::Accumulators::StatCounter::to_json
friend void to_json(nlohmann::json &j, StatCounter const &c)
Definition: Accumulators.h:1085
Gaudi::Accumulators::SumAccumulator::sum
Arithmetic sum() const
Definition: Accumulators.h:627
Gaudi::Accumulators::MsgCounter::fromJSON
static MsgCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1208
Gaudi::Accumulators::AveragingCounter::fromJSON
static AveragingCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1009
Gaudi::Accumulators::Counter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:963
Gaudi::Accumulators::Constant::operator()
constexpr T operator()(U &&) const noexcept
Definition: Accumulators.h:275
Gaudi::Accumulators::accumulate
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 buff...
Definition: Accumulators.h:1238
std::numeric_limits
Gaudi::operator+
decltype(auto) operator+(const T &v, const Property< TP, V, H > &p)
implemantation of (value + property)
Definition: Property.h:438
Gaudi::Accumulators::AveragingCounter::typeString
static const std::string typeString
Definition: Accumulators.h:980
Gaudi::Accumulators::Counter::to_json
friend void to_json(nlohmann::json &j, Counter const &c)
Definition: Accumulators.h:966
Gaudi::Accumulators::operator<<
std::ostream & operator<<(std::ostream &s, const PrintableCounter &counter)
external printout operator to a stream type
Definition: Accumulators.h:898
Gaudi::Accumulators::SigmaCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:1039
Gaudi::Accumulators::MsgCounter::to_json
friend void to_json(nlohmann::json &j, MsgCounter const &c)
Definition: Accumulators.h:1203
Gaudi::Accumulators::SigmaCounter::mergeAndReset
friend void mergeAndReset(SigmaCounter &c, SigmaCounter &o)
Definition: Accumulators.h:1042
Gaudi::Accumulators::BufferableCounter::~BufferableCounter
~BufferableCounter()
Definition: Accumulators.h:917
MsgStream.h
Gaudi::Accumulators::AveragingCounter::reset
friend void reset(AveragingCounter &c)
Definition: Accumulators.h:1000
Gaudi::Accumulators::Counter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:959
Gaudi::Accumulators::BinomialAccumulator::binomial_t::nTotal
unsigned long nTotal
Definition: Accumulators.h:728
Gaudi::Accumulators::has_fetch_add_
decltype(std::declval< T & >().fetch_add(0)) has_fetch_add_
type_traits for checking the presence of fetch_add
Definition: Accumulators.h:304
AlgTools.Int
Int
Definition: AlgTools.py:21
Gaudi::Accumulators::SquareAccumulator::sum2
Arithmetic sum2() const
Definition: Accumulators.h:661
std::chrono