yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
YODA::XAxisMixin< Derived, EdgeT > Struct Template Reference

CRTP mixin introducing convenience aliases along X axis. More...

#include <BinnedUtils.h>

Public Member Functions

Bin accessors
size_t numBinsX (const bool includeOverflows=false) const
 Number of bins along the X axis.
 
template<class T = EdgeT>
enable_if_CAxisT< T > xMin () const
 Low edge of first histo's axis.
 
template<class T = EdgeT>
enable_if_CAxisT< T > xMax () const
 High edge of first histo's axis.
 
std::vector< EdgeT > xEdges (const bool includeOverflows=false) const
 All bin edges on X axis. +-inf edges are included.
 
template<class T = EdgeT>
std::enable_if_t< std::is_floating_point< T >::value, std::vector< T > > xWidths (const bool includeOverflows=false) const
 All widths on X axis.
 
void rebinXBy (unsigned int n, size_t begin=1, size_t end=UINT_MAX)
 
void rebinXTo (const std::vector< double > &newedges)
 
void rebinX (unsigned int n, size_t begin=1, size_t end=UINT_MAX)
 
void rebinX (const std::vector< double > &newedges)
 

Detailed Description

template<class Derived, typename EdgeT = double>
struct YODA::XAxisMixin< Derived, EdgeT >

CRTP mixin introducing convenience aliases along X axis.

Definition at line 18 of file BinnedUtils.h.

Member Function Documentation

◆ numBinsX()

template<class Derived , typename EdgeT = double>
size_t YODA::XAxisMixin< Derived, EdgeT >::numBinsX ( const bool  includeOverflows = false) const
inline

Number of bins along the X axis.

Definition at line 24 of file BinnedUtils.h.

24 {
25 return static_cast<const Derived*>(this)->numBinsAt(0, includeOverflows);
26 }

◆ rebinX() [1/2]

template<class Derived , typename EdgeT = double>
void YODA::XAxisMixin< Derived, EdgeT >::rebinX ( const std::vector< double > &  newedges)
inline

Definition at line 62 of file BinnedUtils.h.

62 {
63 static_cast<Derived*>(this)->template rebinTo<0>(newedges);
64 }

◆ rebinX() [2/2]

template<class Derived , typename EdgeT = double>
void YODA::XAxisMixin< Derived, EdgeT >::rebinX ( unsigned int  n,
size_t  begin = 1,
size_t  end = UINT_MAX 
)
inline

Definition at line 58 of file BinnedUtils.h.

58 {
59 static_cast<Derived*>(this)->template rebinBy<0>(n, begin, end);
60 }

◆ rebinXBy()

template<class Derived , typename EdgeT = double>
void YODA::XAxisMixin< Derived, EdgeT >::rebinXBy ( unsigned int  n,
size_t  begin = 1,
size_t  end = UINT_MAX 
)
inline

Definition at line 50 of file BinnedUtils.h.

50 {
51 static_cast<Derived*>(this)->template rebinBy<0>(n, begin, end);
52 }

◆ rebinXTo()

template<class Derived , typename EdgeT = double>
void YODA::XAxisMixin< Derived, EdgeT >::rebinXTo ( const std::vector< double > &  newedges)
inline

Definition at line 54 of file BinnedUtils.h.

54 {
55 static_cast<Derived*>(this)->template rebinTo<0>(newedges);
56 }

◆ xEdges()

template<class Derived , typename EdgeT = double>
std::vector< EdgeT > YODA::XAxisMixin< Derived, EdgeT >::xEdges ( const bool  includeOverflows = false) const
inline

All bin edges on X axis. +-inf edges are included.

Definition at line 37 of file BinnedUtils.h.

37 {
38 return static_cast<const Derived*>(this)->template edges<0>(includeOverflows);
39 }

◆ xMax()

template<class Derived , typename EdgeT = double>
template<class T = EdgeT>
enable_if_CAxisT< T > YODA::XAxisMixin< Derived, EdgeT >::xMax ( ) const
inline

High edge of first histo's axis.

Definition at line 34 of file BinnedUtils.h.

34{ return static_cast<const Derived*>(this)->template max<0>(); }

◆ xMin()

template<class Derived , typename EdgeT = double>
template<class T = EdgeT>
enable_if_CAxisT< T > YODA::XAxisMixin< Derived, EdgeT >::xMin ( ) const
inline

Low edge of first histo's axis.

Definition at line 30 of file BinnedUtils.h.

30{ return static_cast<const Derived*>(this)->template min<0>(); }

◆ xWidths()

template<class Derived , typename EdgeT = double>
template<class T = EdgeT>
std::enable_if_t< std::is_floating_point< T >::value, std::vector< T > > YODA::XAxisMixin< Derived, EdgeT >::xWidths ( const bool  includeOverflows = false) const
inline

All widths on X axis.

Note
Only supported for continuous axes

Definition at line 46 of file BinnedUtils.h.

46 {
47 return static_cast<const Derived*>(this)->template widths<0>(includeOverflows);
48 }

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