The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators/StaticHistogram.h>

Inheritance diagram for Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >:
Collaboration diagram for Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >:

Public Types

using AxisTupleType = std::tuple<AxisTypes...>
using NumberDimensions = std::integral_constant<unsigned int, ND>
using Parent = BufferableCounter<Atomicity, Accumulator, Arithmetic, NumberDimensions, AxisTupleType>
using AccumulatorType = Accumulator<Atomicity, Arithmetic, NumberDimensions, AxisTupleType>
using AxisTupleArithmeticType = typename AccumulatorType::AxisTupleArithmeticType
using AxisArithmeticType = typename std::tuple_element<0, AxisTupleType>::type::ArithmeticType
 for backward compatibility with previous implementation, should not be used FIXME
Public Types inherited from Gaudi::Accumulators::BufferableCounter< Atomicity, Accumulator, Arithmetic, std::integral_constant< unsigned int, ND >, std::tuple< AxisTypes... > >
using BufferType

Public Member Functions

template<typename OWNER>
 HistogramingCounterBase (OWNER *owner, std::string const &name, std::string const &title, AxisTupleType axis)
 This constructor takes the axis as a tuple.
template<typename OWNER>
 HistogramingCounterBase (OWNER *owner, std::string const &name, std::string const &title, AxisTypes... allAxis)
 This constructor takes the axis one by one, when ND >= 2. If ND = 1, the other one can be used.
template<typename stream>
stream & printImpl (stream &o, bool) const
std::ostream & print (std::ostream &o, bool tableFormat=false) const override
 prints the counter to a stream
MsgStream & print (MsgStream &o, bool tableFormat=false) const override
virtual void to_json (nlohmann::json &j) const
std::string const & title () const
Public Member Functions inherited from Gaudi::Accumulators::BufferableCounter< Atomicity, Accumulator, Arithmetic, std::integral_constant< unsigned int, ND >, std::tuple< AxisTypes... > >
 BufferableCounter ()=default
BufferType buffer ()
BufferableCounter & operator= (BufferableCounter const &)=delete
 ~BufferableCounter ()
Public Member Functions inherited from Gaudi::Accumulators::PrintableCounter
 PrintableCounter ()=default
virtual ~PrintableCounter ()=default
 destructor
template<typename stream>
stream & printImpl (stream &s, std::string_view tag) const
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
virtual MsgStream & print (MsgStream &o, std::string_view tag) const
virtual bool toBePrinted () const
 hint whether we should print that counter or not.
std::string toString () const
 get a string representation

Static Public Attributes

static const std::string typeString { std::string{ Type } + ':' + typeid( Arithmetic ).name() }
Static Public Attributes inherited from Gaudi::Accumulators::BufferableCounter< Atomicity, Accumulator, Arithmetic, std::integral_constant< unsigned int, ND >, std::tuple< AxisTypes... > >
static const std::string typeString

Protected Attributes

std::string const m_title

Friends

void reset (HistogramingCounterBase &c)
void mergeAndReset (HistogramingCounterBase &h, HistogramingCounterBase &o)
void to_json (nlohmann::json &j, HistogramingCounterBase const &h)

Detailed Description

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
class Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >

Definition at line 674 of file StaticHistogram.h.

Member Typedef Documentation

◆ AccumulatorType

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::AccumulatorType = Accumulator<Atomicity, Arithmetic, NumberDimensions, AxisTupleType>

Definition at line 681 of file StaticHistogram.h.

◆ AxisArithmeticType

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::AxisArithmeticType = typename std::tuple_element<0, AxisTupleType>::type::ArithmeticType

for backward compatibility with previous implementation, should not be used FIXME

Definition at line 684 of file StaticHistogram.h.

◆ AxisTupleArithmeticType

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::AxisTupleArithmeticType = typename AccumulatorType::AxisTupleArithmeticType

Definition at line 682 of file StaticHistogram.h.

◆ AxisTupleType

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::AxisTupleType = std::tuple<AxisTypes...>

Definition at line 678 of file StaticHistogram.h.

◆ NumberDimensions

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::NumberDimensions = std::integral_constant<unsigned int, ND>

Definition at line 679 of file StaticHistogram.h.

◆ Parent

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
using Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::Parent = BufferableCounter<Atomicity, Accumulator, Arithmetic, NumberDimensions, AxisTupleType>

Definition at line 680 of file StaticHistogram.h.

Constructor & Destructor Documentation

◆ HistogramingCounterBase() [1/2]

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
template<typename OWNER>
Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::HistogramingCounterBase ( OWNER * owner,
std::string const & name,
std::string const & title,
AxisTupleType axis )
inline

◆ HistogramingCounterBase() [2/2]

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
template<typename OWNER>
Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::HistogramingCounterBase ( OWNER * owner,
std::string const & name,
std::string const & title,
AxisTypes... allAxis )
inline

This constructor takes the axis one by one, when ND >= 2. If ND = 1, the other one can be used.

Definition at line 694 of file StaticHistogram.h.

HistogramingCounterBase(OWNER *owner, std::string const &name, std::string const &title, AxisTupleType axis)
This constructor takes the axis as a tuple.

Member Function Documentation

◆ print() [1/2]

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
MsgStream & Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::print ( MsgStream & o,
bool tableFormat = false ) const
inlineoverridevirtual

◆ print() [2/2]

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
std::ostream & Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::print ( std::ostream & o,
bool tableFormat = false ) const
inlineoverridevirtual

prints the counter to a stream

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 703 of file StaticHistogram.h.

703 {
704 return printImpl( o, tableFormat );
705 }

◆ printImpl()

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
template<typename stream>
stream & Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::printImpl ( stream & o,
bool  ) const
inline

Definition at line 698 of file StaticHistogram.h.

698 {
699 o << ND << "D Histogram with config ";
700 std::apply( [&o]( auto&&... args ) { ( ( o << args << "\n" ), ... ); }, this->axis() );
701 return o;
702 }

◆ title()

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
std::string const & Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::title ( ) const
inline

Definition at line 728 of file StaticHistogram.h.

728{ return m_title; }

◆ to_json()

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
virtual void Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::to_json ( nlohmann::json & j) const
inlinevirtual

Definition at line 710 of file StaticHistogram.h.

710 {
711 // get all bin values and compute total nbEntries
713 bins.reserve( this->totNBins() );
714 unsigned long totNEntries{ 0 };
715 for ( unsigned int i = 0; i < this->totNBins(); i++ ) {
716 bins.push_back( this->binValue( i ) );
717 totNEntries += this->nEntries( i );
718 }
719 // build json
720 j = { { "type", std::string( Type ) + ":" + typeid( Arithmetic ).name() },
721 { "title", m_title },
722 { "dimension", ND },
723 { "empty", totNEntries == 0 },
724 { "nEntries", totNEntries },
725 { "axis", this->axis() },
726 { "bins", bins } };
727 }

◆ mergeAndReset

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
void mergeAndReset ( HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > > & h,
HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > > & o )
friend

Definition at line 708 of file StaticHistogram.h.

708{ h.mergeAndReset( o ); }

◆ reset

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
void reset ( HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > > & c)
friend

Definition at line 707 of file StaticHistogram.h.

707{ c.reset(); }

◆ to_json

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
void to_json ( nlohmann::json & j,
HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > > const & h )
friend

Definition at line 709 of file StaticHistogram.h.

709{ h.to_json( j ); }

Member Data Documentation

◆ m_title

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
std::string const Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::m_title
protected

Definition at line 731 of file StaticHistogram.h.

◆ typeString

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename, typename > typename Accumulator, typename... AxisTypes>
const std::string Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, std::tuple< AxisTypes... > >::typeString { std::string{ Type } + ':' + typeid( Arithmetic ).name() }
inlinestatic

Definition at line 685 of file StaticHistogram.h.

685{ std::string{ Type } + ':' + typeid( Arithmetic ).name() };

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