The Gaudi Framework  master (37c0b60a)
Accumulators.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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__ ) && __cplusplus >= 202002L
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 #if __cplusplus >= 201703L
478  using OutputType = std::decay_t<std::invoke_result_t<OutputTransform, InnerType>>;
479 #else
480  using OutputType = std::decay_t<std::result_of_t<OutputTransform( InnerType )>>;
481 #endif
482  using InternalType = InnerType;
485  ValueHandler::merge( m_value, InputTransform{}( by ) );
486  return *this;
487  }
488  GenericAccumulator() = default;
490  template <atomicity ato, typename VH>
493  : GenericAccumulator() {}
494  template <typename... Args>
495  GenericAccumulator( std::in_place_t, Args&&... args ) : m_value( std::forward<Args>( args )... ) {}
496  GenericAccumulator( const GenericAccumulator& other ) : m_value( ValueHandler::getValue( other.m_value ) ) {}
498  m_value = ValueHandler::getValue( other.m_value );
499  return *this;
500  }
501  OutputType value() const { return OutputTransform{}( ValueHandler::getValue( m_value ) ); }
502  void reset() { reset( ValueHandler::DefaultValue() ); }
503  template <atomicity ato, typename VH>
505  ValueHandler::merge( m_value, VH::exchange( other.m_value, VH::DefaultValue() ) );
506  }
507  template <atomicity ato, typename VH>
509  ValueHandler::merge( m_value, other.m_value );
510  }
511 
512  protected:
513  GenericAccumulator( InnerType in ) : m_value( std::move( in ) ) {}
514  auto rawValue() const { return ValueHandler::getValue( m_value ); }
515  void reset( InnerType in ) { m_value = std::move( in ); }
516  static InnerType extractJSONData( const nlohmann::json& j, const JSONStringEntriesType& entries ) {
517  return j.at( entries ).get<InnerType>();
518  }
519 
520  private:
521  typename ValueHandler::InternalType m_value{ ValueHandler::DefaultValue() };
522  };
523 
529  template <typename Arithmetic, atomicity Atomicity, typename InputTypeT = Arithmetic,
530  template <atomicity, typename> class... Bases>
531  class AccumulatorSet : public Bases<Atomicity, Arithmetic>... {
532  public:
533  using InputType = InputTypeT;
537  constexpr AccumulatorSet() = default;
539  template <atomicity ato>
541  : AccumulatorSet() {}
543  ( Bases<Atomicity, Arithmetic>::operator+=( by ), ... );
544  return *this;
545  }
546  OutputType value() const { return std::make_tuple( Bases<Atomicity, Arithmetic>::value()... ); }
547  void reset() { ( Bases<Atomicity, Arithmetic>::reset(), ... ); }
548  template <atomicity Ato>
550  ( Bases<Atomicity, Arithmetic>::mergeAndReset( static_cast<Bases<Ato, Arithmetic>&>( other ) ), ... );
551  }
552  template <atomicity Ato>
554  ( Bases<Atomicity, Arithmetic>::operator+( static_cast<Bases<Ato, Arithmetic>&&>( other ) ), ... );
555  }
556 
557  protected:
559  void reset( const InternalType& t ) {
560  std::apply( [this]( const auto&... i ) { ( this->Bases<Atomicity, Arithmetic>::reset( i ), ... ); }, t );
561  }
563  return extractJSONDataHelper( j, entries, std::index_sequence_for<Bases<Atomicity, Arithmetic>...>{} );
564  }
565 
566  private:
567  template <size_t... Is>
569  std::index_sequence<Is...> ) {
570  return extractJSONDataHelper( j, std::get<Is>( entries )... );
571  }
572  static InternalType
574  typename Bases<Atomicity, Arithmetic>::JSONStringEntriesType... entries ) {
575  return { Bases<Atomicity, Arithmetic>::extractJSONData( j, entries )... };
576  }
577  };
578 
583  template <atomicity Atomicity, typename Arithmetic = double>
585  : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity, Maximum<Arithmetic, Atomicity>> {
586  using GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity,
588  Arithmetic max() const { return this->value(); }
589  };
590 
595  template <atomicity Atomicity, typename Arithmetic = double>
597  : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity, Minimum<Arithmetic, Atomicity>> {
598  using GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity, Identity,
600  Arithmetic min() const { return this->value(); }
601  };
602 
609  template <atomicity Atomicity, typename Arithmetic = double>
610  struct CountAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, Constant<unsigned long, 1UL>> {
613  ( *this ) += Arithmetic{};
614  return *this;
615  }
617  auto copy = *this;
618  ++( *this );
619  return copy;
620  }
621  unsigned long nEntries() const { return this->value(); }
622  };
623 
628  template <atomicity Atomicity, typename Arithmetic = double>
629  struct SumAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity> {
631  Arithmetic sum() const { return this->value(); }
632  };
633 
639  template <atomicity Atomicity, typename Arithmetic = unsigned long>
640  struct IntegralAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Identity> {
641  static_assert( std::is_integral_v<Arithmetic>,
642  "Invalid Arithmetic type for IntegralAccumulator. It must be an integral type" );
643 
646  ( *this ) += 1;
647  return *this;
648  }
650  auto copy = *this;
651  ++( *this );
652  return copy;
653  }
654  Arithmetic nEntries() const { return this->value(); }
655  Arithmetic sum() const { return this->value(); }
656  };
657 
662  template <atomicity Atomicity, typename Arithmetic = double>
663  struct SquareAccumulator : GenericAccumulator<Arithmetic, Arithmetic, Atomicity, Square> {
665  Arithmetic sum2() const { return this->value(); }
666  };
667 
669  struct TrueTo1 {
670  unsigned int operator()( bool v ) const { return v; }
671  };
672 
678  template <atomicity Atomicity, typename Arithmetic>
679  struct TrueAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, TrueTo1> {
681  unsigned long nTrueEntries() const { return this->value(); }
682  };
683 
685  struct FalseTo1 {
686  unsigned int operator()( bool v ) const { return !v; }
687  };
688 
694  template <atomicity Atomicity, typename Arithmetic>
695  struct FalseAccumulator : GenericAccumulator<Arithmetic, unsigned long, Atomicity, FalseTo1> {
697  unsigned long nFalseEntries() const { return this->value(); }
698  };
699 
705  template <atomicity Atomicity, typename Arithmetic>
706  struct BinomialAccumulator : AccumulatorSet<bool, Atomicity, bool, TrueAccumulator, FalseAccumulator> {
708  unsigned long nEntries() const { return this->nTrueEntries() + this->nFalseEntries(); }
709 
710  template <typename Result = fp_result_type<Arithmetic>>
711  auto efficiency() const {
712  auto nbEntries = nEntries();
713  if ( 1 > nbEntries ) return Result{ -1 };
714  return static_cast<Result>( this->nTrueEntries() ) / nbEntries;
715  }
716  auto eff() const { return efficiency(); }
717 
718  template <typename Result = fp_result_type<Arithmetic>>
719  auto efficiencyErr() const {
720  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
721  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
723  using std::sqrt;
724  auto nbEntries = nEntries();
725  if ( 1 > nbEntries ) return Result{ -1 };
726  return sqrt( static_cast<Result>( this->nTrueEntries() * this->nFalseEntries() ) / nbEntries ) / nbEntries;
727  }
728  auto effErr() const { return efficiencyErr(); }
730  struct binomial_t {
731  unsigned long nPass;
732  unsigned long nTotal;
733  };
734  BinomialAccumulator& operator+=( binomial_t b ) {
735  assert( b.nPass <= b.nTotal );
736  TrueAccumulator<atomicity::none, bool> t{ std::in_place, b.nPass };
738  FalseAccumulator<atomicity::none, bool> f{ std::in_place, b.nTotal - b.nPass };
740  return *this;
741  }
742  };
743 
749  template <atomicity Atomicity, typename Arithmetic, template <atomicity, typename> typename CountAcc,
750  template <atomicity, typename> typename SumAcc>
752  : AccumulatorSet<Arithmetic, Atomicity, typename CountAcc<Atomicity, Arithmetic>::InputType, CountAcc, SumAcc> {
753  static_assert( std::is_same_v<typename CountAcc<Atomicity, Arithmetic>::InputType,
754  typename SumAcc<Atomicity, Arithmetic>::InputType>,
755  "Incompatible Counters in definition of AveragingAccumulator. Both should have identical Input" );
757  SumAcc>::AccumulatorSet;
758  template <typename Result = fp_result_type<Arithmetic>>
759  auto mean() const {
760  auto n = this->nEntries();
761  Result sum = this->sum();
762  return ( n > 0 ) ? static_cast<Result>( sum / n ) : Result{};
763  }
764  };
765 
770  template <atomicity Atomicity, typename Arithmetic>
772 
778  template <atomicity Atomicity, typename Arithmetic, template <atomicity, typename> typename AvgAcc,
779  template <atomicity, typename> typename SquareAcc>
781  : AccumulatorSet<Arithmetic, Atomicity, typename AvgAcc<Atomicity, Arithmetic>::InputType, AvgAcc, SquareAcc> {
782  static_assert( std::is_same_v<typename AvgAcc<Atomicity, Arithmetic>::InputType,
783  typename SquareAcc<Atomicity, Arithmetic>::InputType>,
784  "Incompatible Counters in definition of SigmaAccumulator. Both should have identical Input" );
786  SquareAcc>::AccumulatorSet;
787  template <typename Result = fp_result_type<Arithmetic>>
788  auto biased_sample_variance() const {
789  auto n = this->nEntries();
790  Result sum = this->sum();
791  return ( n > 0 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / n ) : Result{};
792  }
793 
794  template <typename Result = fp_result_type<Arithmetic>>
796  auto n = this->nEntries();
797  Result sum = this->sum();
798  return ( n > 1 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / ( n - 1 ) ) : Result{};
799  }
800 
801  template <typename Result = fp_result_type<Arithmetic>>
802  auto standard_deviation() const {
803  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
804  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
806  using std::sqrt;
807  Result v = biased_sample_variance();
808  return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v ) );
809  }
810  [[deprecated( "The name 'rms' has changed to standard_deviation" )]] Arithmetic rms() const {
811  return standard_deviation();
812  }
813 
814  template <typename Result = fp_result_type<Arithmetic>>
815  auto meanErr() const {
816  auto n = this->nEntries();
817  if ( 0 == n ) return Result{};
818  // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
819  // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
821  using std::sqrt;
822  Result v = biased_sample_variance();
823  return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v / n ) );
824  }
825  };
826 
831  template <atomicity Atomicity, typename Arithmetic>
833 
838  template <atomicity Atomicity, typename Arithmetic>
841 
848  template <template <atomicity Ato, typename... Int> class ContainedAccumulator, atomicity Atomicity, typename... Args>
849  class Buffer : public ContainedAccumulator<atomicity::none, Args...> {
850  using prime_type = ContainedAccumulator<Atomicity, Args...>;
851  using base_type = ContainedAccumulator<atomicity::none, Args...>;
852 
853  public:
854  Buffer() = delete;
855  Buffer( prime_type& p ) : base_type( construct_empty, p ), m_prime( &p ) {}
856  Buffer( const Buffer& ) = delete;
857  void operator=( const Buffer& ) = delete;
858  Buffer( Buffer&& other ) : base_type( std::move( other ) ), m_prime( other.m_prime ) { other.m_prime = nullptr; }
859  void push() {
860  if ( m_prime ) { m_prime->mergeAndReset( static_cast<base_type&>( *this ) ); }
861  }
862  ~Buffer() { push(); }
863 
864  private:
865  prime_type* m_prime = nullptr;
866  };
867 
873  PrintableCounter() = default;
875  virtual ~PrintableCounter() = default;
876  // add tag to printout
877  template <typename stream>
878  stream& printImpl( stream& s, std::string_view tag ) const {
879  s << boost::format{ " | %|-48.48s|%|50t|" } % ( std::string{ '\"' }.append( tag ).append( "\"" ) );
880  return print( s, true );
881  }
883  virtual std::ostream& print( std::ostream&, bool tableFormat = false ) const = 0;
884  virtual MsgStream& print( MsgStream&, bool tableFormat = true ) const = 0;
886  virtual std::ostream& print( std::ostream& o, std::string_view tag ) const { return printImpl( o, tag ); }
887  virtual MsgStream& print( MsgStream& o, std::string_view tag ) const { return printImpl( o, tag ); }
890  virtual bool toBePrinted() const { return true; }
893  std::ostringstream ost;
894  print( ost );
895  return ost.str();
896  }
897  };
898 
902  inline std::ostream& operator<<( std::ostream& s, const PrintableCounter& counter ) { return counter.print( s ); }
903  inline MsgStream& operator<<( MsgStream& s, const PrintableCounter& counter ) { return counter.print( s ); }
910  template <atomicity Atomicity, template <atomicity Ato, typename... Int> class Accumulator, typename... Args>
911  class BufferableCounter : public PrintableCounter, public Accumulator<Atomicity, Args...> {
912  public:
913  using Accumulator<Atomicity, Args...>::Accumulator;
914  using BufferType = Buffer<Accumulator, Atomicity, Args...>;
915  BufferableCounter() = default;
916  template <typename OWNER>
917  BufferableCounter( OWNER* o, std::string const& name ) : BufferableCounter( o, name, *this ) {}
918  BufferType buffer() { return { *this }; }
922  if ( m_monitoringHub ) { m_monitoringHub->removeEntity( *this ); }
923  }
924 
925  inline static const std::string typeString{ "counter" };
926 
927  protected:
928  template <typename OWNER, typename SELF, typename... CARGS>
929  BufferableCounter( OWNER* o, std::string const& name, SELF& self, CARGS... args )
930  : Accumulator<Atomicity, Args...>( args... ), m_monitoringHub( &o->serviceLocator()->monitoringHub() ) {
931  m_monitoringHub->registerEntity( o->name(), name, self.typeString, self );
932  }
933 
934  private:
935  Monitoring::Hub* m_monitoringHub{ nullptr };
936  };
937 
942  template <atomicity Atomicity = atomicity::full, typename Arithmetic = unsigned long>
943  struct Counter : BufferableCounter<Atomicity, IntegralAccumulator, Arithmetic> {
944  inline static const std::string typeString{ std::string{ "counter:Counter:" } + typeid( Arithmetic ).name() };
946  template <typename OWNER>
947  Counter( OWNER* o, std::string const& name )
948  : BufferableCounter<Atomicity, IntegralAccumulator, Arithmetic>( o, name, *this ) {}
949  Counter& operator++() { return ( *this ) += 1; }
950  Counter& operator+=( const Arithmetic v ) {
952  return *this;
953  }
955 
956  template <typename stream>
957  stream& printImpl( stream& o, bool tableFormat ) const {
958  // Avoid printing empty counters in non DEBUG mode
959  auto fmt = ( tableFormat ? "|%|10d| |" : "#=%|-7lu|" );
960  return o << boost::format{ fmt } % this->nEntries();
961  }
962 
963  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
964  return printImpl( o, tableFormat );
965  }
966  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
967  bool toBePrinted() const override { return this->nEntries() > 0; }
968  friend void reset( Counter& c ) { c.reset(); }
969  friend void mergeAndReset( Counter& c, Counter& o ) { c.mergeAndReset( o ); }
970  friend void to_json( nlohmann::json& j, Counter const& c ) {
971  j = { { "type", c.typeString }, { "empty", c.nEntries() == 0 }, { "nEntries", c.nEntries() } };
972  }
973  static Counter fromJSON( const nlohmann::json& j ) {
975  }
976  };
977 
982  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
983  struct AveragingCounter : BufferableCounter<Atomicity, AveragingAccumulator, Arithmetic> {
984  inline static const std::string typeString{ std::string{ "counter:AveragingCounter:" } +
985  typeid( Arithmetic ).name() };
987  template <typename OWNER>
988  AveragingCounter( OWNER* o, std::string const& name )
989  : BufferableCounter<Atomicity, AveragingAccumulator, Arithmetic>( o, name, *this ) {}
991 
992  template <typename stream>
993  stream& printImpl( stream& o, bool tableFormat ) const {
994  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |" : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g|" );
995  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean();
996  }
997 
998  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
999  return printImpl( o, tableFormat );
1000  }
1001  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1002 
1003  bool toBePrinted() const override { return this->nEntries() > 0; }
1004  friend void reset( AveragingCounter& c ) { return c.reset(); }
1005  friend void mergeAndReset( AveragingCounter& c, AveragingCounter& o ) { c.mergeAndReset( o ); }
1006  friend void to_json( nlohmann::json& j, AveragingCounter const& c ) {
1007  j = { { "type", c.typeString },
1008  { "empty", c.nEntries() == 0 },
1009  { "nEntries", c.nEntries() },
1010  { "sum", c.sum() },
1011  { "mean", c.mean() } };
1012  }
1014  return AveragingAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { "nEntries", "sum" } );
1015  }
1016  };
1017  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1019 
1024  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1025  struct SigmaCounter : BufferableCounter<Atomicity, SigmaAccumulator, Arithmetic> {
1026  inline static const std::string typeString{ std::string{ "counter:SigmaCounter:" } + typeid( Arithmetic ).name() };
1028  template <typename OWNER>
1029  SigmaCounter( OWNER* o, std::string const& name )
1030  : BufferableCounter<Atomicity, SigmaAccumulator, Arithmetic>( o, name, *this ) {}
1032 
1033  template <typename stream>
1034  stream& printImpl( stream& o, bool tableFormat ) const {
1035  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |"
1036  : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g| +- %|-#10.5g|" );
1037  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean() % this->standard_deviation();
1038  }
1039 
1040  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1041  return printImpl( o, tableFormat );
1042  }
1043  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1044  bool toBePrinted() const override { return this->nEntries() > 0; }
1045  friend void reset( SigmaCounter& c ) { c.reset(); }
1046  friend void mergeAndReset( SigmaCounter& c, SigmaCounter& o ) { c.mergeAndReset( o ); }
1047  friend void to_json( nlohmann::json& j, SigmaCounter const& c ) {
1048  j = { { "type", c.typeString },
1049  { "empty", c.nEntries() == 0 },
1050  { "nEntries", c.nEntries() },
1051  { "sum", c.sum() },
1052  { "mean", c.mean() },
1053  { "sum2", c.sum2() },
1054  { "standard_deviation", c.standard_deviation() } };
1055  }
1057  return SigmaAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { { "nEntries", "sum" }, "sum2" } );
1058  }
1059  };
1060 
1065  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1066  struct StatCounter : BufferableCounter<Atomicity, StatAccumulator, Arithmetic> {
1067  inline static const std::string typeString{ std::string{ "counter:StatCounter:" } + typeid( Arithmetic ).name() };
1069  template <typename OWNER>
1070  StatCounter( OWNER* o, std::string const& name )
1071  : BufferableCounter<Atomicity, StatAccumulator, Arithmetic>( o, name, *this ) {}
1073 
1074  template <typename stream>
1075  stream& printImpl( stream& o, bool tableFormat ) const {
1076  auto fmt = ( tableFormat ? "|%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |"
1077  : "#=%|-7lu| Sum=%|-11.5g| Mean=%|#10.4g| +- %|-#10.5g| Min/Max=%|#10.4g|/%|-#10.4g|" );
1078  return o << boost::format{ fmt } % this->nEntries() % this->sum() % this->mean() % this->standard_deviation() %
1079  this->min() % this->max();
1080  }
1081 
1082  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1083  return printImpl( o, tableFormat );
1084  }
1085  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1086  bool toBePrinted() const override { return this->nEntries() > 0; }
1087  friend void reset( StatCounter& c ) { c.reset(); }
1088  friend void mergeAndReset( StatCounter& c, StatCounter& o ) { c.mergeAndReset( o ); }
1089  friend void to_json( nlohmann::json& j, StatCounter const& c ) {
1090  j = { { "type", c.typeString },
1091  { "empty", c.nEntries() == 0 },
1092  { "nEntries", c.nEntries() },
1093  { "sum", c.sum() },
1094  { "mean", c.mean() },
1095  { "sum2", c.sum2() },
1096  { "standard_deviation", c.standard_deviation() },
1097  { "min", c.min() },
1098  { "max", c.max() } };
1099  }
1102  j, { { { "nEntries", "sum" }, "sum2" }, "min", "max" } );
1103  }
1104  };
1105 
1110  template <typename Arithmetic = double, atomicity Atomicity = atomicity::full>
1111  struct BinomialCounter : BufferableCounter<Atomicity, BinomialAccumulator, Arithmetic> {
1112  inline static const std::string typeString{ std::string{ "counter:BinomialCounter:" } +
1113  typeid( Arithmetic ).name() };
1115  template <typename OWNER>
1116  BinomialCounter( OWNER* o, std::string const& name )
1117  : BufferableCounter<Atomicity, BinomialAccumulator, Arithmetic>( o, name, *this ) {}
1118 
1119  template <typename stream>
1120  stream& printImpl( stream& o, bool tableFormat ) const {
1121  auto fmt = ( tableFormat ? "|%|10d| |%|11.5g| |(%|#9.7g| +- %|-#8.7g|)%% |"
1122  : "#=%|-7lu| Sum=%|-11.5g| Eff=|(%|#9.7g| +- %|-#8.6g|)%%|" );
1123  return o << boost::format{ fmt } % this->nEntries() % this->nTrueEntries() % ( this->efficiency() * 100 ) %
1124  ( this->efficiencyErr() * 100 );
1125  }
1126 
1127  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
1128  return printImpl( o, tableFormat );
1129  }
1130  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
1131 
1132  template <typename stream>
1133  stream& printImpl( stream& o, std::string_view tag ) const {
1134  // override default print to add a '*' in from of the name
1135  o << boost::format{ " |*%|-48.48s|%|50t|" } % ( std::string{ "\"" }.append( tag ).append( "\"" ) );
1136  return print( o, true );
1137  }
1139  std::ostream& print( std::ostream& o, std::string_view tag ) const override { return printImpl( o, tag ); }
1140  MsgStream& print( MsgStream& o, std::string_view tag ) const override { return printImpl( o, tag ); }
1141  bool toBePrinted() const override { return this->nEntries() > 0; }
1142  friend void reset( BinomialCounter& c ) { c.reset(); }
1143  friend void mergeAndReset( BinomialCounter& c, BinomialCounter& o ) { c.mergeAndReset( o ); }
1144  friend void to_json( nlohmann::json& j, BinomialCounter const& c ) {
1145  j = { { "type", c.typeString },
1146  { "empty", c.nEntries() == 0 },
1147  { "nEntries", c.nTrueEntries() + c.nFalseEntries() },
1148  { "nTrueEntries", c.nTrueEntries() },
1149  { "nFalseEntries", c.nFalseEntries() },
1150  { "efficiency", c.efficiency() },
1151  { "efficiencyErr", c.efficiencyErr() } };
1152  }
1154  return BinomialAccumulator<Atomicity, Arithmetic>::extractJSONData( j, { "nTrueEntries", "nFalseEntries" } );
1155  }
1156  };
1157 
1158  namespace details::MsgCounter {
1159  template <atomicity Atomicity>
1160  struct Handler : Adder<unsigned long, Atomicity> {
1162  static void merge( typename Base::InternalType& orig, bool b ) {
1163  if ( b ) Base::merge( orig, 1 );
1164  }
1165  };
1166  // note that Arithmetic type is unused in this case but needs to be there in case
1167  // we want to create AccumulatorSets with this Accumulator
1168  template <atomicity Atomicity, typename Arithmetic = double>
1170  } // namespace details::MsgCounter
1171 
1172  template <MSG::Level level, atomicity Atomicity = atomicity::full>
1174  public:
1175  inline static const std::string typeString{ "counter:MsgCounter" };
1176  template <typename OWNER>
1177  MsgCounter( OWNER* o, std::string const& ms, unsigned long nMax = 10 )
1178  : m_monitoringHub{ &o->serviceLocator()->monitoringHub() }, logger( o ), msg( ms ), max( nMax ) {
1179  m_monitoringHub->registerEntity( o->name(), ms, typeString, *this );
1180  }
1181  template <typename OWNER>
1182  MsgCounter( OWNER* o, std::string const& ms, int nMax ) : MsgCounter( o, ms, static_cast<unsigned long>( nMax ) ) {}
1184  ( *this ) += true;
1185  return *this;
1186  }
1187  MsgCounter& operator+=( const bool by ) {
1189  if ( by ) log();
1190  return *this;
1191  }
1192  MsgCounter( MsgCounter const& ) = delete;
1193  MsgCounter& operator=( MsgCounter const& ) = delete;
1195  if ( m_monitoringHub ) m_monitoringHub->removeEntity( *this );
1196  }
1197  template <typename stream>
1198  stream& printImpl( stream& o, bool tableFormat ) const {
1199  return o << boost::format{ tableFormat ? "|%|10d| |" : "#=%|-7lu|" } % this->value();
1200  }
1202  std::ostream& print( std::ostream& os, bool tableFormat ) const override { return printImpl( os, tableFormat ); }
1203  MsgStream& print( MsgStream& os, bool tableFormat ) const override { return printImpl( os, tableFormat ); }
1204  bool toBePrinted() const override { return this->value() > 0; }
1205  friend void reset( MsgCounter& c ) { c.reset(); }
1206  friend void mergeAndReset( MsgCounter& c, MsgCounter& o ) { c.mergeAndReset( o ); }
1207  friend void to_json( nlohmann::json& j, MsgCounter const& c ) {
1208  j = { { "type", c.typeString }, { "empty", c.value() == 0 },
1209  { "nEntries", c.value() }, { "level", level },
1210  { "max", c.max }, { "msg", c.msg } };
1211  }
1213  return { j.at( "msg" ).get<std::string>(), j.at( "max" ).get<unsigned long>(),
1214  j.at( "nEntries" ).get<unsigned long>() };
1215  }
1216 
1217  private:
1218  MsgCounter( std::string const& ms, unsigned long nMax, unsigned long count )
1219  : details::MsgCounter::MsgAccumulator<Atomicity>{ count }, msg( ms ), max( nMax ) {}
1220 
1222  const CommonMessagingBase* logger{ nullptr };
1224  unsigned long max;
1225  void log() {
1226  if ( this->value() <= max && logger ) {
1227  if ( this->value() == max ) {
1228  logger->msgStream( level ) << "Suppressing message: " << std::quoted( msg, '\'' ) << endmsg;
1229  } else {
1230  logger->msgStream( level ) << msg << endmsg;
1231  }
1232  }
1233  }
1234  };
1235 
1241  template <typename Counter, typename Container, typename Fun>
1242  void accumulate( Counter& counter, const Container& container, Fun f = Identity{} ) {
1243  auto b = counter.buffer();
1244  for ( const auto& elem : container ) b += f( elem );
1245  }
1246 
1247 } // namespace Gaudi::Accumulators
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(std::string const &ms, unsigned long nMax, unsigned long count)
Definition: Accumulators.h:1218
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:872
Gaudi::Accumulators::PrintableCounter::printImpl
stream & printImpl(stream &s, std::string_view tag) const
Definition: Accumulators.h:878
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:482
Gaudi::Accumulators::BinomialCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1112
Gaudi::Accumulators::AccumulatorSet::extractJSONData
static InternalType extractJSONData(const nlohmann::json &j, const JSONStringEntriesType &entries)
Definition: Accumulators.h:562
std::make_tuple
T make_tuple(T... args)
Gaudi::Accumulators::MsgCounter::logger
const CommonMessagingBase * logger
Definition: Accumulators.h:1222
Gaudi::Accumulators::MsgCounter::mergeAndReset
friend void mergeAndReset(MsgCounter &c, MsgCounter &o)
Definition: Accumulators.h:1206
Gaudi::Accumulators::StatCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1075
Gaudi::Accumulators::CountAccumulator::operator++
CountAccumulator & operator++()
Definition: Accumulators.h:612
Gaudi::Accumulators::MsgCounter::log
void log()
Definition: Accumulators.h:1225
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:850
std::string
STL class.
Gaudi::Accumulators::Buffer::push
void push()
Definition: Accumulators.h:859
Gaudi::Accumulators::TrueAccumulator
TrueAccumulator.
Definition: Accumulators.h:679
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:1139
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:542
Gaudi::Accumulators::SigmaCounter::reset
friend void reset(SigmaCounter &c)
Definition: Accumulators.h:1045
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:521
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(MsgCounter const &)=delete
Gaudi::Accumulators::MsgCounter::m_monitoringHub
Monitoring::Hub * m_monitoringHub
Definition: Accumulators.h:1221
std::move
T move(T... args)
Gaudi::Accumulators::SigmaCounter
A counter aiming at computing average and sum2 / variance / standard deviation.
Definition: Accumulators.h:1025
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:549
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:890
Gaudi::Accumulators::BufferableCounter::operator=
BufferableCounter & operator=(BufferableCounter const &)=delete
MonitoringHub.h
Gaudi::Accumulators::GenericAccumulator::GenericAccumulator
GenericAccumulator(InnerType in)
Definition: Accumulators.h:513
Gaudi::Accumulators::StatCounter::mergeAndReset
friend void mergeAndReset(StatCounter &c, StatCounter &o)
Definition: Accumulators.h:1088
Gaudi::Accumulators::GenericAccumulator::rawValue
auto rawValue() const
Definition: Accumulators.h:514
Gaudi::Accumulators::AccumulatorSet
AccumulatorSet is an Accumulator that holds a set of Accumulators templated by same Arithmetic and At...
Definition: Accumulators.h:531
Gaudi::Accumulators::SumAccumulator
SumAccumulator.
Definition: Accumulators.h:629
Gaudi::Accumulators::BufferableCounter::buffer
BufferType buffer()
Definition: Accumulators.h:918
Gaudi::Accumulators::Counter
A basic integral counter;.
Definition: Accumulators.h:943
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(OWNER *o, std::string const &ms, unsigned long nMax=10)
Definition: Accumulators.h:1177
Gaudi::Accumulators::AveragingCounter::AveragingCounter
AveragingCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:988
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:1100
Gaudi::Accumulators::MsgCounter::print
MsgStream & print(MsgStream &os, bool tableFormat) const override
Definition: Accumulators.h:1203
Gaudi::Accumulators::SigmaCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1040
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:892
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter()=default
Gaudi::Accumulators::details::MsgCounter::Handler
Definition: Accumulators.h:1160
Gaudi::Accumulators::BinomialCounter::to_json
friend void to_json(nlohmann::json &j, BinomialCounter const &c)
Definition: Accumulators.h:1144
Gaudi::Accumulators::MsgCounter::msg
std::string msg
Definition: Accumulators.h:1223
Gaudi::Accumulators::IntegralAccumulator
IntegralAccumulator.
Definition: Accumulators.h:640
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:1141
Gaudi::Accumulators::AveragingCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:998
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:495
Gaudi::Accumulators::SquareAccumulator
SquareAccumulator.
Definition: Accumulators.h:663
std::chrono::duration
Gaudi::Accumulators::MsgCounter::reset
friend void reset(MsgCounter &c)
Definition: Accumulators.h:1205
Gaudi::Accumulators::GenericAccumulator::reset
void reset()
Definition: Accumulators.h:502
Gaudi::Accumulators::Counter::fromJSON
static Counter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:973
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:1183
Gaudi::Accumulators::MsgCounter::~MsgCounter
~MsgCounter()
Definition: Accumulators.h:1194
CommonMessagingBase
Definition: CommonMessaging.h:68
Gaudi::Accumulators::MinAccumulator
MinAccumulator.
Definition: Accumulators.h:597
Gaudi::Accumulators::AveragingCounter
A counter aiming at computing sum and average.
Definition: Accumulators.h:983
Gaudi::Accumulators::PrintableCounter::PrintableCounter
PrintableCounter()=default
Gaudi::Accumulators::AccumulatorSet::reset
void reset()
Definition: Accumulators.h:547
Gaudi::Accumulators::Buffer::Buffer
Buffer(const Buffer &)=delete
Gaudi::Accumulators::Counter::mergeAndReset
friend void mergeAndReset(Counter &c, Counter &o)
Definition: Accumulators.h:969
Gaudi::Accumulators::BinomialCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:1130
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:540
Gaudi::Accumulators::BinomialCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1127
std::tuple
Gaudi::Accumulators::MinAccumulator::min
Arithmetic min() const
Definition: Accumulators.h:600
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:886
Gaudi::Accumulators::SigmaAccumulatorBase::meanErr
auto meanErr() const
Definition: Accumulators.h:815
class
#define class
Definition: HistogramPersistencySvc.cpp:54
Gaudi::Accumulators::BinomialAccumulator::operator+=
BinomialAccumulator & operator+=(binomial_t b)
Definition: Accumulators.h:734
Gaudi::Accumulators::BinomialCounter::BinomialCounter
BinomialCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1116
Gaudi::Accumulators::AccumulatorSet::operator+
void operator+(AccumulatorSet< Arithmetic, Ato, InputType, Bases... > &&other)
Definition: Accumulators.h:553
Gaudi::Accumulators::MsgCounter::operator=
MsgCounter & operator=(MsgCounter const &)=delete
Gaudi::Accumulators::Counter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:957
Gaudi::Accumulators::TrueTo1
helper functor for the TrueAccumulator
Definition: Accumulators.h:669
Gaudi::Accumulators::MsgCounter::MsgCounter
MsgCounter(OWNER *o, std::string const &ms, int nMax)
Definition: Accumulators.h:1182
Gaudi::Accumulators::AveragingAccumulatorBase
AveragingAccumulatorBase.
Definition: Accumulators.h:752
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:851
Gaudi::Accumulators::SigmaCounter::SigmaCounter
SigmaCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1029
Gaudi::Accumulators::BinomialAccumulator::binomial_t
Definition: Accumulators.h:730
std::sqrt
T sqrt(T... args)
Gaudi::Accumulators::Counter::operator+=
Counter & operator+=(const Arithmetic v)
Definition: Accumulators.h:950
Gaudi::Accumulators::BufferableCounter::BufferableCounter
BufferableCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:917
Gaudi::Accumulators::AccumulatorSet::extractJSONDataHelper
static InternalType extractJSONDataHelper(const nlohmann::json &j, typename Bases< Atomicity, Arithmetic >::JSONStringEntriesType... entries)
Definition: Accumulators.h:573
Gaudi::Accumulators::Square
A Square functor.
Definition: Accumulators.h:293
Gaudi::Accumulators::Counter::operator++
Counter & operator++()
Definition: Accumulators.h:949
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:1187
Gaudi::Accumulators::Counter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:966
Gaudi::Accumulators::GenericAccumulator::operator+=
GenericAccumulator operator+=(const InputType by)
Definition: Accumulators.h:484
Gaudi::Accumulators::StatCounter::StatCounter
StatCounter(OWNER *o, std::string const &name)
Definition: Accumulators.h:1070
Gaudi::Accumulators::StatCounter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:1082
bug_34121.t
t
Definition: bug_34121.py:31
Gaudi::Accumulators::BinomialAccumulator
BinomialAccumulator.
Definition: Accumulators.h:706
Gaudi::Accumulators::BinomialAccumulator::eff
auto eff() const
Definition: Accumulators.h:716
Gaudi::Accumulators::IntegralAccumulator::nEntries
Arithmetic nEntries() const
Definition: Accumulators.h:654
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:645
Gaudi::Accumulators::AveragingCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:993
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:616
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:795
details
Definition: AnyDataWrapper.h:19
std::ratio
Gaudi::Accumulators::BinomialAccumulator::efficiencyErr
auto efficiencyErr() const
Definition: Accumulators.h:719
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:1085
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:968
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:1133
Gaudi::Accumulators::AccumulatorSet::InternalType
std::tuple< typename Bases< Atomicity, Arithmetic >::InternalType... > InternalType
Definition: Accumulators.h:535
Gaudi::Accumulators::AveragingAccumulatorBase::mean
auto mean() const
Definition: Accumulators.h:759
Gaudi::Accumulators::Buffer::Buffer
Buffer(prime_type &p)
Definition: Accumulators.h:855
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:858
Gaudi::Accumulators::StatCounter::reset
friend void reset(StatCounter &c)
Definition: Accumulators.h:1087
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:491
Gaudi::Accumulators::GenericAccumulator< double, double, Atomicity, Identity, Identity, Maximum< double, Atomicity > >::GenericAccumulator
friend class GenericAccumulator
Definition: Accumulators.h:473
Gaudi::Accumulators::Counter::typeString
static const std::string typeString
Definition: Accumulators.h:944
Gaudi::Accumulators::AccumulatorSet::value
OutputType value() const
Definition: Accumulators.h:546
Gaudi::Accumulators::GenericAccumulator< bool, unsigned long, Atomicity, TrueTo1 >::OutputType
std::decay_t< std::result_of_t< Identity(unsigned long)> > OutputType
Definition: Accumulators.h:480
Gaudi::Accumulators::GenericAccumulator::operator=
GenericAccumulator & operator=(const GenericAccumulator &other)
Definition: Accumulators.h:497
Gaudi::Accumulators::details::MsgCounter::MsgAccumulator
GenericAccumulator< bool, unsigned long, Atomicity, Identity, Identity, Handler< Atomicity > > MsgAccumulator
Definition: Accumulators.h:1169
Gaudi::Accumulators::BinomialCounter
A counter dealing with binomial data.
Definition: Accumulators.h:1111
Gaudi::Accumulators::details::MsgCounter::Handler::merge
static void merge(typename Base::InternalType &orig, bool b)
Definition: Accumulators.h:1162
Gaudi::Accumulators::Buffer::~Buffer
~Buffer()
Definition: Accumulators.h:862
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:568
Gaudi::Accumulators::BinomialAccumulator::binomial_t::nPass
unsigned long nPass
Definition: Accumulators.h:731
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:504
Gaudi::Accumulators::MsgCounter::print
std::ostream & print(std::ostream &os, bool tableFormat) const override
prints the counter to a stream
Definition: Accumulators.h:1202
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:1173
std::atomic< Arithmetic >
Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, CountAcc< Atomicity, Arithmetic >::InputType, CountAcc, SumAcc >::InputType
CountAcc< Atomicity, Arithmetic >::InputType InputType
Definition: Accumulators.h:533
Gaudi::Accumulators::FalseAccumulator::nFalseEntries
unsigned long nFalseEntries() const
Definition: Accumulators.h:697
Gaudi::Accumulators::BinomialAccumulator::efficiency
auto efficiency() const
Definition: Accumulators.h:711
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:929
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:1143
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:501
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:515
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:1086
Gaudi::Accumulators::BufferableCounter
An empty ancester of all counters that provides a buffer method that returns a buffer on itself Also ...
Definition: Accumulators.h:911
Gaudi::Accumulators::StatCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1067
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:1047
Gaudi::Accumulators::BinomialAccumulator::effErr
auto effErr() const
Definition: Accumulators.h:728
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:1198
Gaudi::Accumulators::Buffer::Buffer
Buffer()=delete
Gaudi::Accumulators::SigmaCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1026
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:585
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
Gaudi::Accumulators::MsgCounter::max
unsigned long max
Definition: Accumulators.h:1224
Gaudi::Accumulators::SigmaAccumulatorBase::rms
Arithmetic rms() const
Definition: Accumulators.h:810
Gaudi::Accumulators::CountAccumulator
CountAccumulator.
Definition: Accumulators.h:610
Gaudi::Accumulators::AccumulatorSet::AccumulatorSet
AccumulatorSet(const InternalType &t)
Definition: Accumulators.h:558
Gaudi::Accumulators::AveragingCounter::to_json
friend void to_json(nlohmann::json &j, AveragingCounter const &c)
Definition: Accumulators.h:1006
Gaudi::Accumulators::PrintableCounter::print
virtual MsgStream & print(MsgStream &o, std::string_view tag) const
Definition: Accumulators.h:887
gaudirun.args
args
Definition: gaudirun.py:336
std::chrono::operator<<
std::ostream & operator<<(std::ostream &os, const duration< Rep, Period > &d)
stream operator for std::chrono::duration including unit
Definition: ChronoIO.h:68
Gaudi::Accumulators::GenericAccumulator::extractJSONData
static InnerType extractJSONData(const nlohmann::json &j, const JSONStringEntriesType &entries)
Definition: Accumulators.h:516
Gaudi::Accumulators::MsgCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1204
Gaudi::Accumulators::FalseAccumulator
FalseAccumulator.
Definition: Accumulators.h:695
Gaudi::Accumulators::MaxAccumulator::max
Arithmetic max() const
Definition: Accumulators.h:588
Gaudi::Accumulators::SigmaAccumulatorBase::standard_deviation
auto standard_deviation() const
Definition: Accumulators.h:802
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:685
Gaudi::Accumulators::BinomialCounter::fromJSON
static BinomialCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1153
detected.h
Gaudi::Accumulators::AccumulatorSet::reset
void reset(const InternalType &t)
Definition: Accumulators.h:559
Gaudi::Accumulators::SigmaAccumulatorBase
SigmaAccumulatorBase.
Definition: Accumulators.h:781
Gaudi::Accumulators::Buffer
Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-sa...
Definition: Accumulators.h:849
Gaudi::Accumulators::CountAccumulator::nEntries
unsigned long nEntries() const
Definition: Accumulators.h:621
Gaudi::Accumulators::GenericAccumulator::operator+
void operator+(GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &&other)
Definition: Accumulators.h:508
Gaudi::Accumulators::SigmaCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1034
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:1003
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:655
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:496
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:1066
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:1001
Gaudi::Accumulators::BinomialAccumulator::nEntries
unsigned long nEntries() const
Definition: Accumulators.h:708
Gaudi::Accumulators::BinomialCounter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Accumulators.h:1120
plotSpeedupsPyRoot.counter
counter
Definition: plotSpeedupsPyRoot.py:175
Gaudi::Accumulators::SigmaCounter::fromJSON
static SigmaCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1056
Gaudi::Accumulators::SigmaAccumulatorBase::biased_sample_variance
auto biased_sample_variance() const
Definition: Accumulators.h:788
Gaudi::Accumulators::TrueAccumulator::nTrueEntries
unsigned long nTrueEntries() const
Definition: Accumulators.h:681
Gaudi::Accumulators::BinomialCounter::reset
friend void reset(BinomialCounter &c)
Definition: Accumulators.h:1142
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:686
Gaudi::Accumulators::Counter::Counter
Counter(OWNER *o, std::string const &name)
Definition: Accumulators.h:947
Gaudi::Accumulators::atomicity::none
@ none
Gaudi::Accumulators::IntegralAccumulator::operator++
IntegralAccumulator operator++(int)
Definition: Accumulators.h:649
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:670
Gaudi::Accumulators::MsgCounter::typeString
static const std::string typeString
Definition: Accumulators.h:1175
Gaudi::Accumulators::BinomialCounter::print
MsgStream & print(MsgStream &o, std::string_view tag) const override
Definition: Accumulators.h:1140
Gaudi::Accumulators::AveragingCounter::mergeAndReset
friend void mergeAndReset(AveragingCounter &c, AveragingCounter &o)
Definition: Accumulators.h:1005
Gaudi::Accumulators::SigmaCounter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:1044
Gaudi::Accumulators::StatCounter::to_json
friend void to_json(nlohmann::json &j, StatCounter const &c)
Definition: Accumulators.h:1089
Gaudi::Accumulators::SumAccumulator::sum
Arithmetic sum() const
Definition: Accumulators.h:631
Gaudi::Accumulators::MsgCounter::fromJSON
static MsgCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1212
Gaudi::Accumulators::AveragingCounter::fromJSON
static AveragingCounter fromJSON(const nlohmann::json &j)
Definition: Accumulators.h:1013
Gaudi::Accumulators::Counter::toBePrinted
bool toBePrinted() const override
hint whether we should print that counter or not.
Definition: Accumulators.h:967
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:1242
std::numeric_limits
Gaudi::operator+
decltype(auto) operator+(const T &v, const Property< TP, V, H > &p)
implemantation of (value + property)
Definition: Property.h:441
Gaudi::Accumulators::AveragingCounter::typeString
static const std::string typeString
Definition: Accumulators.h:984
Gaudi::Accumulators::Counter::to_json
friend void to_json(nlohmann::json &j, Counter const &c)
Definition: Accumulators.h:970
Gaudi::Accumulators::operator<<
std::ostream & operator<<(std::ostream &s, const PrintableCounter &counter)
external printout operator to a stream type
Definition: Accumulators.h:902
Gaudi::Accumulators::SigmaCounter::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Accumulators.h:1043
Gaudi::Accumulators::MsgCounter::to_json
friend void to_json(nlohmann::json &j, MsgCounter const &c)
Definition: Accumulators.h:1207
Gaudi::Accumulators::SigmaCounter::mergeAndReset
friend void mergeAndReset(SigmaCounter &c, SigmaCounter &o)
Definition: Accumulators.h:1046
Gaudi::Accumulators::BufferableCounter::~BufferableCounter
~BufferableCounter()
Definition: Accumulators.h:921
MsgStream.h
Gaudi::Accumulators::AveragingCounter::reset
friend void reset(AveragingCounter &c)
Definition: Accumulators.h:1004
Gaudi::Accumulators::Counter::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Accumulators.h:963
Gaudi::Accumulators::BinomialAccumulator::binomial_t::nTotal
unsigned long nTotal
Definition: Accumulators.h:732
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:665
std::chrono