ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe::Histogram< T, Axes > Class Template Reference

#include <acts/blob/master/thirdparty/dfelibs/dfe/dfe_histogram.hpp>

+ Collaboration diagram for dfe::Histogram< T, Axes >:

Public Types

using Data = dfe::histogram_impl::NArray< T, sizeof...(Axes)>
 
using Index = typename Data::Index
 

Public Member Functions

 Histogram (Axes &&...axes)
 
constexpr const Index & size () const
 Get the number of bins along all axes.
 
const T & value (Index idx) const
 Get the current entry value in the given bin.
 
void fill (typename Axes::Value...values, T weight=static_cast< T >(1))
 

Private Member Functions

template<std::size_t... Is>
constexpr Index index (std::index_sequence< Is...>, typename Axes::Value...values) const
 

Private Attributes

Data m_data
 
std::tuple< Axes...> m_axes
 

Detailed Description

template<typename T, typename... Axes>
class dfe::Histogram< T, Axes >

A generic histogram with configurable axes.

Template Parameters
TThe type of the data stored per bin
AxesTypes must provide ::Value, .nbins() and .index(...)

Definition at line 154 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 154 of file dfe_histogram.hpp

Member Typedef Documentation

template<typename T , typename... Axes>
using dfe::Histogram< T, Axes >::Data = dfe::histogram_impl::NArray<T, sizeof...(Axes)>

Definition at line 156 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 156 of file dfe_histogram.hpp

template<typename T , typename... Axes>
using dfe::Histogram< T, Axes >::Index = typename Data::Index

Definition at line 157 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 157 of file dfe_histogram.hpp

Constructor & Destructor Documentation

template<typename T , typename... Axes>
dfe::Histogram< T, Axes >::Histogram ( Axes &&...  axes)
inline

Definition at line 323 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 323 of file dfe_histogram.hpp

Member Function Documentation

template<typename T , typename... Axes>
void dfe::Histogram< T, Axes >::fill ( typename Axes::Value...  values,
T  weight = static_cast<T>(1) 
)
inline

Fill an entry into the histogram.

Parameters
values
weightAssociated weight, the default of 1 just counts entries.

Definition at line 169 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 169 of file dfe_histogram.hpp

References dfe::Histogram< T, Axes >::index(), dfe::Histogram< T, Axes >::m_data, and weight.

+ Here is the call graph for this function:

template<typename T , typename... Axes>
template<std::size_t... Is>
constexpr Index dfe::Histogram< T, Axes >::index ( std::index_sequence< Is...>  ,
typename Axes::Value...  values 
) const
inlineprivate

Definition at line 176 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 176 of file dfe_histogram.hpp

References dfe::Histogram< T, Axes >::m_axes.

Referenced by dfe::Histogram< T, Axes >::fill().

+ Here is the caller graph for this function:

template<typename T , typename... Axes>
constexpr const Index& dfe::Histogram< T, Axes >::size ( ) const
inline

Get the number of bins along all axes.

Definition at line 162 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 162 of file dfe_histogram.hpp

References dfe::Histogram< T, Axes >::m_data.

template<typename T , typename... Axes>
const T& dfe::Histogram< T, Axes >::value ( Index  idx) const
inline

Get the current entry value in the given bin.

Definition at line 164 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 164 of file dfe_histogram.hpp

References dfe::Histogram< T, Axes >::m_data.

Member Data Documentation

template<typename T , typename... Axes>
std::tuple<Axes...> dfe::Histogram< T, Axes >::m_axes
private

Definition at line 182 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 182 of file dfe_histogram.hpp

Referenced by dfe::Histogram< T, Axes >::index().

template<typename T , typename... Axes>
Data dfe::Histogram< T, Axes >::m_data
private

Definition at line 181 of file dfe_histogram.hpp.

View newest version in sPHENIX GitHub at line 181 of file dfe_histogram.hpp

Referenced by dfe::Histogram< T, Axes >::fill(), dfe::Histogram< T, Axes >::size(), and dfe::Histogram< T, Axes >::value().


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