yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
YODA::BinnedEstimate< AxisT > Class Template Reference

Forward declaration. More...

#include <BinnedEstimate.h>

Inheritance diagram for YODA::BinnedEstimate< AxisT >:
YODA::EstimateStorage< AxisT... > YODA::BinnedStorage< Estimate, AxisT... > YODA::AnalysisObject

Public Types

using EstimateT = BinnedEstimate< AxisT... >
 
using BaseT = EstimateStorage< AxisT... >
 
using BinType = typename BaseT::BinT
 
using Ptr = std::shared_ptr< EstimateT >
 
- Public Types inherited from YODA::EstimateStorage< AxisT... >
using BinType = BinT
 
- Public Types inherited from YODA::BinnedStorage< Estimate, AxisT... >
using BinningType = BinningT
 
using BinType = BinT
 
using BinDimension = std::integral_constant< size_t, sizeof...(AxisT)>
 
- Public Types inherited from YODA::AnalysisObject
typedef std::map< std::string, std::string > Annotations
 Collection type for annotations, as a string-string map.
 

Public Member Functions

 BinnedEstimate (const EstimateT &)=default
 
 BinnedEstimate (EstimateT &&)=default
 
BinnedEstimateoperator= (const EstimateT &)=default
 
BinnedEstimateoperator= (EstimateT &&)=default
 
 BinnedEstimate (const BaseT &other)
 Copy constructor (needed for clone functions).
 
 BinnedEstimate (const EstimateT &other, const std::string &path)
 
 BinnedEstimate (BaseT &&other)
 Move constructor.
 
 BinnedEstimate (EstimateT &&other, const std::string &path)
 
- Public Member Functions inherited from YODA::EstimateStorage< AxisT... >
 EstimateStorage (const std::string &path="", const std::string &title="")
 Nullary constructor for unique pointers etc.
 
 EstimateStorage (std::vector< AxisT > &&... binsEdges, const std::string &path="", const std::string &title="")
 Constructor giving explicit bin edges as rvalue reference.
 
 EstimateStorage (const std::vector< AxisT > &... binsEdges, const std::string &path="", const std::string &title="")
 Constructor giving explicit bin edges as lvalue reference.
 
 EstimateStorage (std::initializer_list< AxisT > &&... binsEdges, const std::string &path="", const std::string &title="")
 Constructor giving explicit bin edges as initializer list.
 
 EstimateStorage (const std::vector< size_t > &nBins, const std::vector< std::pair< EdgeT, EdgeT > > &limitsLowUp, const std::string &path="", const std::string &title="")
 Constructor giving range and number of bins.
 
 EstimateStorage (const BinningT &binning, const std::string &path="", const std::string &title="")
 Constructor given a binning type.
 
 EstimateStorage (BinningT &&binning, const std::string &path="", const std::string &title="")
 Constructor given an rvalue BinningT.
 
 EstimateStorage (const ScatterND< sizeof...(AxisT)+1 > &s, const std::string &path="", const std::string &title="")
 Constructor given a scatter.
 
 EstimateStorage (const EstimateStorage &other, const std::string &path="")
 Copy constructor.
 
 EstimateStorage (EstimateStorage &&other, const std::string &path="")
 Move constructor.
 
EstimateStorage clone () const noexcept
 Make a copy on the stack.
 
EstimateStoragenewclone () const noexcept
 Make a copy on the heap.
 
void scale (const double scalefactor) noexcept
 Rescale as if all fill weights had been different by factor scalefactor.
 
void rebinBy (unsigned int n, size_t begin=1, size_t end=UINT_MAX)
 Merge every group of n bins, from start to end inclusive.
 
void rebin (unsigned int n, size_t begin=1, size_t end=UINT_MAX)
 Overloaded alias for rebinBy.
 
void rebin (const std::vector< typename BinningT::template getAxisT< axisN >::EdgeT > &newedges)
 Overloaded alias for rebinTo.
 
void rebinTo (const std::vector< typename BinningT::template getAxisT< axisN >::EdgeT > &newedges)
 Rebin to the given list of bin edges.
 
void reset () noexcept
 Reset the EstimateStorage.
 
EstimateStorageoperator= (const EstimateStorage &est) noexcept
 Copy assignment.
 
EstimateStorageoperator= (EstimateStorage &&est) noexcept
 Move assignment.
 
EstimateStorageadd (const EstimateStorage &est, const std::string &pat_uncorr="^stat|^uncor")
 Add two EstimateStorages.
 
EstimateStorageadd (EstimateStorage &&est, const std::string &pat_uncorr="^stat|^uncor")
 Add two (rvalue) EstimateStorages.
 
EstimateStorageoperator+= (const EstimateStorage &est)
 
EstimateStorageoperator+= (EstimateStorage &&est)
 
EstimateStoragesubtract (const EstimateStorage &est, const std::string &pat_uncorr="^stat|^uncor")
 Subtract one EstimateStorages from another one.
 
EstimateStoragesubtract (EstimateStorage &&est, const std::string &pat_uncorr="^stat|^uncor")
 Subtract one (rvalue) EstimateStorages from another one.
 
EstimateStorageoperator-= (const EstimateStorage &est)
 
EstimateStorageoperator-= (EstimateStorage &&est)
 
size_t dim () const noexcept
 Total dimension of the object (number of axes + estimate)
 
std::vector< E > edges (const bool includeOverflows=false) const noexcept
 Templated version to get edges of axis N by value. +-inf edges are included.
 
std::enable_if_t< std::is_floating_point< E >::value, std::vector< E > > widths (const bool includeOverflows=false) const noexcept
 Templated version to get bin widths of axis N by value.
 
std::enable_if_t< std::is_floating_point< E >::value, E > min () const noexcept
 Get the lowest non-overflow edge of the axis.
 
std::enable_if_t< std::is_floating_point< E >::value, E > max () const noexcept
 Get the highest non-overflow edge of the axis.
 
std::vector< double > vals (const bool includeOverflows=false, const bool includeMaskedBins=false) const
 Get list of central values.
 
std::vector< std::string > sources () const
 Get list of error sources.
 
double areaUnderCurve (const bool includeBinVol=true, const bool includeOverflows=false, const bool includeMaskedBins=false) const
 Calculate the volume underneath the EstimateStorage.
 
double auc (const bool includeBinVol=true, const bool includeOverflows=false, const bool includeMaskedBins=false) const
 Convenient alias for areaUnderCurve()
 
std::vector< std::vector< double > > covarianceMatrix (const bool ignoreOffDiagonalTerms=false, const bool includeOverflows=false, const bool includeMaskedBins=false) const
 Construct a covariance matrix from the error breakdown.
 
auto mkScatter (const std::string &path="", const bool includeOverflows=false, const bool includeMaskedBins=false) const
 Produce a ScatterND from a EstimateStorage.
 
auto mkEstimates (const std::string &path="", const bool includeOverflows=false) const
 Split into vector of BinnedEstimates along axisN.
 
AnalysisObjectmkInert (const std::string &path="", const std::string &source="") const noexcept
 Method returns clone of the estimate with streamlined error source.
 
size_t lengthContent (bool fixed_length=false) const noexcept
 Length of serialized content vector for MPI reduce operations.
 
std::vector< double > serializeContent (bool fixed_length=false) const noexcept
 Content serialisation for MPI reduce operations.
 
void deserializeContent (const std::vector< double > &data)
 Content deserialisation for MPI reduce operations.
 
- Public Member Functions inherited from YODA::BinnedStorage< Estimate, AxisT... >
 BinnedStorage ()
 Nullary constructor for unique pointers etc.
 
 BinnedStorage (const BinningT &binning)
 Constructs BinnedStorage from Binning.
 
 BinnedStorage (BinningT &&binning)
 Constructs BinnedStorage from Binning. Rvalue.
 
 BinnedStorage (const std::vector< AxisT > &... edges)
 Constructs binning from an adapter and vectors of axes' edges.
 
 BinnedStorage (std::vector< AxisT > &&... edges)
 Constructs binning from an adapter and Rvalue vectors of axes' edges.
 
 BinnedStorage (std::initializer_list< AxisT > &&... edges)
 Constructs binning from an adapter and Rvalue initializer lists of axes' edges.
 
 BinnedStorage (const Axis< AxisT > &... axes)
 Constructs binning from an adapter and a sequence of axes.
 
 BinnedStorage (Axis< AxisT > &&... axes)
 Constructs binning from an adapter and a sequence of Rvalue axes.
 
 BinnedStorage (const BinnedStorage &other)
 Copy constructor.
 
 BinnedStorage (BinnedStorage &&other)
 Move constructor.
 
size_t dim () const noexcept
 Total dimension of the object ( = number of axes + content)
 
BinTbin (size_t idx) noexcept
 Returns reference to the bin at idx.
 
const BinTbin (size_t idx) const noexcept
 Returns Bin at idx.
 
BinTbin (const std::array< size_t, sizeof...(AxisT)> &idxLocal) noexcept
 Bin access using local bin indices.
 
const BinTbin (const std::array< size_t, sizeof...(AxisT)> &idxLocal) const noexcept
 Bin access using local bin indices.
 
BinTbinAt (typename BinningT::EdgeTypesTuple &&coords) noexcept
 Returns reference to the bin at coordinates.
 
const BinTbinAt (typename BinningT::EdgeTypesTuple &&coords) const noexcept
 Returns reference to the bin at coordinates (const version).
 
void set (typename BinningT::EdgeTypesTuple &&coords, Estimate &&content) noexcept
 Sets the bin corresponding to coords with an rvalue content.
 
void set (typename BinningT::EdgeTypesTuple &&coords, const Estimate &content) noexcept
 Sets the bin corresponding to coords with content.
 
void set (const size_t binIdx, Estimate &&content) noexcept
 Sets the bin corresponding to binIndex with an rvalue content.
 
void set (const size_t binIdx, const Estimate &content) noexcept
 Sets the bin corresponding to binIndex with content.
 
std::vector< size_t > calcIndicesToSkip (const bool includeOverflows, const bool includeMaskedBins) const noexcept
 Calculates indices of bins which are marked or located in the overflow.
 
BinsVecWrapper< BinsVecTbins (const bool includeOverflows=false, const bool includeMaskedBins=false) noexcept
 Returns bins vector wrapper, which skips masked elements when iterated over.
 
const BinsVecWrapper< const BinsVecTbins (const bool includeOverflows=false, const bool includeMaskedBins=false) const noexcept
 Const version.
 
const BinningTbinning () const noexcept
 Returns dimension underlying binning object reference.
 
size_t binDim () const noexcept
 Returns dimension of binning.
 
size_t numBins (const bool includeOverflows=false, const bool includeMaskedBins=false) const noexcept
 Number of bins in the BinnedStorage.
 
size_t numBinsAt (const size_t axisN, const bool includeOverflows=false) const noexcept
 Number of bins in the BinnedStorage.
 
void reset () noexcept
 Reset the BinnedStorage.
 
void clearBins () noexcept
 Deletes all bins and creates empty new ones.
 
void maskBins (const std::vector< size_t > &indicesToMask, const bool status=true) noexcept
 Mask a range of bins.
 
void maskBin (const size_t indexToMask, const bool status=true) noexcept
 Mask a bin at a given index.
 
void maskSlice (const size_t dim, const size_t idx, const bool status=true)
 Mask a slice of the binning at local bin index idx along axis dimesnion dim.
 
void maskBinAt (typename BinningT::EdgeTypesTuple &&coords, const bool status=true) noexcept
 Mask a bin at a given set of corrdinates.
 
bool isMasked (const size_t binIndex) const noexcept
 
std::vector< size_t > maskedBins () const noexcept
 
bool isVisible (const size_t binIndex) const noexcept
 
auto mergeBins (std::decay_t< decltype(AxisNs, std::declval< std::pair< size_t, size_t > >())>... mergeRanges) noexcept -> std::enable_if_t< MetaUtils::is_detected_v< MetaUtils::operatorTraits::addition_assignment_t, Estimate >, RetT >
 Merge bins from A to B at G axis.
 
auto mkBinnedSlices (Func &&how2add, const bool includeOverflows=false) const
 Split this BinnedStorage into a vector of BinnedStorages along axisN.
 
BinnedStorageoperator= (const BinnedStorage &other) noexcept
 Copy assignment.
 
BinnedStorageoperator= (BinnedStorage &&other) noexcept
 Move assignment.
 
bool operator== (const BinnedStorage &other) const noexcept
 Compares BinnedStorages for equality, e.g. dimensions of underlying binnings and all axes edges are equal.
 
bool operator!= (const BinnedStorage &other) const noexcept
 Compares BinnedStorages for inequality.
 
- Public Member Functions inherited from YODA::AnalysisObject
 AnalysisObject ()
 Default constructor.
 
 AnalysisObject (const std::string &type, const std::string &path, const std::string &title="")
 Constructor giving a type, a path and an optional title.
 
 AnalysisObject (const std::string &type, const std::string &path, const AnalysisObject &ao, const std::string &title="")
 Constructor giving a type, a path, another AO to copy annotation from, and an optional title.
 
virtual ~AnalysisObject ()
 Default destructor.
 
virtual AnalysisObjectoperator= (const AnalysisObject &ao) noexcept
 Default copy assignment operator.
 
std::vector< std::string > annotations () const
 
bool hasAnnotation (const std::string &name) const
 Check if an annotation is defined.
 
const std::string & annotation (const std::string &name) const
 Get an annotation by name (as a string)
 
const std::string & annotation (const std::string &name, const std::string &defaultreturn) const
 Get an annotation by name (as a string) with a default in case the annotation is not found.
 
template<typename T >
const T annotation (const std::string &name) const
 Get an annotation by name (copied to another type)
 
template<typename T >
const T annotation (const std::string &name, const T &defaultreturn) const
 Get an annotation by name (copied to another type) with a default in case the annotation is not found.
 
template<typename T >
void setAnnotation (const std::string &name, const T &value)
 Add or set an annotation by name (templated for remaining types)
 
void setAnnotations (const Annotations &anns)
 Set all annotations at once.
 
template<typename T >
void addAnnotation (const std::string &name, const T &value)
 Add or set an annotation by name.
 
void rmAnnotation (const std::string &name)
 Delete an annotation by name.
 
void clearAnnotations ()
 Delete an annotation by name.
 
const std::string title () const
 Get the AO title.
 
void setTitle (const std::string &title)
 Set the AO title.
 
const std::string path () const
 Get the AO path.
 
void setPath (const std::string &path)
 
const std::string name () const
 
virtual std::string type () const
 Get name of the analysis object type.
 
size_t lengthMeta (const bool skipPath=true, const bool skipTitle=true) const noexcept
 Length of serialized meta-data vector for MPI reduce operations.
 
std::vector< std::string > serializeMeta (const bool skipPath=true, const bool skipTitle=true) const noexcept
 Mate-data serialisation for MPI reduce operations.
 
virtual void deserializeMeta (const std::vector< std::string > &data, const bool resetPath=false, const bool resetTitle=false)
 Mate-data deserialisation for MPI reduce operations.
 

Additional Inherited Members

- Protected Types inherited from YODA::EstimateStorage< AxisT... >
using BaseT = BinnedStorage< Estimate, AxisT... >
 
using BinningT = typename BaseT::BinningT
 
using BinT = typename BaseT::BinT
 
- Protected Types inherited from YODA::BinnedStorage< Estimate, AxisT... >
using BinningT = Binning< std::decay_t< decltype(std::declval< Axis< AxisT > >())>... >
 Convenience alias to be used in constructor.
 
using BinT = Bin< sizeof...(AxisT), Estimate, BinningT >
 
using BinsVecT = std::vector< BinT >
 
using BaseT = BinnedStorage< Estimate, AxisT... >
 
- Protected Member Functions inherited from YODA::BinnedStorage< Estimate, AxisT... >
void fillBins () noexcept
 Fills bins with wrapped BinContent objects.
 
void fillBins (const BinsVecT &bins) noexcept
 
void fillBins (BinsVecT &&bins) noexcept
 

Detailed Description

template<typename... AxisT>
class YODA::BinnedEstimate< AxisT >

Forward declaration.

User-facing BinnedEstimate class in arbitrary dimensions.

Definition at line 758 of file BinnedEstimate.h.

Member Typedef Documentation

◆ BaseT

template<typename... AxisT>
using YODA::BinnedEstimate< AxisT >::BaseT = EstimateStorage<AxisT...>

Definition at line 761 of file BinnedEstimate.h.

◆ BinType

template<typename... AxisT>
using YODA::BinnedEstimate< AxisT >::BinType = typename BaseT::BinT

Definition at line 762 of file BinnedEstimate.h.

◆ EstimateT

template<typename... AxisT>
using YODA::BinnedEstimate< AxisT >::EstimateT = BinnedEstimate<AxisT...>

Definition at line 760 of file BinnedEstimate.h.

◆ Ptr

template<typename... AxisT>
using YODA::BinnedEstimate< AxisT >::Ptr = std::shared_ptr<EstimateT>

Definition at line 763 of file BinnedEstimate.h.

Constructor & Destructor Documentation

◆ BinnedEstimate() [1/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( const EstimateT )
default

◆ BinnedEstimate() [2/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( EstimateT &&  )
default

◆ BinnedEstimate() [3/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( const BaseT other)
inline

Copy constructor (needed for clone functions).

Note
Compiler won't generate this constructor automatically.

Definition at line 777 of file BinnedEstimate.h.

777: BaseT(other) {}
EstimateStorage< AxisT... > BaseT

◆ BinnedEstimate() [4/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( const EstimateT other,
const std::string &  path 
)
inline

Definition at line 779 of file BinnedEstimate.h.

779: BaseT(other, path) {}
const std::string path() const
Get the AO path.

◆ BinnedEstimate() [5/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( BaseT &&  other)
inline

Move constructor.

Definition at line 782 of file BinnedEstimate.h.

782: BaseT(std::move(other)) {}

◆ BinnedEstimate() [6/6]

template<typename... AxisT>
YODA::BinnedEstimate< AxisT >::BinnedEstimate ( EstimateT &&  other,
const std::string &  path 
)
inline

Definition at line 784 of file BinnedEstimate.h.

784: BaseT(std::move(other), path) {}

Member Function Documentation

◆ operator=() [1/2]

template<typename... AxisT>
BinnedEstimate & YODA::BinnedEstimate< AxisT >::operator= ( const EstimateT )
default

◆ operator=() [2/2]

template<typename... AxisT>
BinnedEstimate & YODA::BinnedEstimate< AxisT >::operator= ( EstimateT &&  )
default

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