BinnedEstimate.h
Go to the documentation of this file.
23 std::pair<double, double> nullifyIfDisc(const BinT& /* b */, const double /* val */, std::false_type, const double null = 0.0) {
30 std::pair<double, double> nullifyIfDisc(const BinT& b, const double val, std::true_type, const double /* null */ = 0.0) {
101 EstimateStorage(std::vector<AxisT>&&... binsEdges, const std::string& path = "", const std::string& title = "")
102 : BaseT(Axis<AxisT>(std::move(binsEdges))...), AnalysisObject(mkTypeString<AxisT...>(), path, title) { }
109 EstimateStorage(const std::vector<AxisT>&... binsEdges, const std::string& path = "", const std::string& title = "")
117 EstimateStorage(std::initializer_list<AxisT>&&... binsEdges, const std::string& path = "", const std::string& title = "")
118 : BaseT(Axis<AxisT>(std::move(binsEdges))...), AnalysisObject(mkTypeString<AxisT...>(), path, title) { }
139 EstimateStorage(const ScatterND<sizeof...(AxisT)+1>& s, const std::string& path = "", const std::string& title = "")
147 AnalysisObject(mkTypeString<AxisT...>(), path!=""? path : other.path(), other, other.title()) { }
152 EstimateStorage(EstimateStorage&& other, const std::string& path = "") : BaseT(std::move(other)),
153 AnalysisObject(mkTypeString<AxisT...>(), path!=""? path : other.path(), other, other.title()) { }
175 void _renderYODA_aux(std::ostream& os, const int width, std::index_sequence<Is...>) const noexcept {
195 const int errwidth = std::max(int(std::to_string(labels.size()).size()+7), width); // "errDn(" + src + ")"
650 template<size_t axisN, typename = std::enable_if_t< (axisN < sizeof...(AxisT) && sizeof...(AxisT)>=2) >>
747 return BinningT({((void)Is, Axis<AxisT>(nBins[Is], limitsLowUp[Is].first, limitsLowUp[Is].second))...});
826 BinnedEstimate(std::vector<AxisT>&& edges, const std::string& path="", const std::string& title="")
829 BinnedEstimate(const std::vector<AxisT>& edges, const std::string& path="", const std::string& title="")
839 BinnedEstimate(size_t nbins, double lower, double upper, const std::string& path = "", const std::string& title = "")
1012 template <typename EdgeT = double, typename = enable_if_all_CAxisT<EdgeT, AxisT1, AxisT2, AxisT3>>
AnalysisObject is the base class for histograms and scatters. Definition AnalysisObject.h:21 virtual AnalysisObject & operator=(const AnalysisObject &ao) noexcept Default copy assignment operator. Definition AnalysisObject.h:61 void setAnnotation(const std::string &name, const T &value) Add or set an annotation by name (templated for remaining types) Definition AnalysisObject.h:166 std::vector< std::string > annotations() const Definition AnalysisObject.h:107 void rmAnnotation(const std::string &name) Delete an annotation by name. Definition AnalysisObject.h:198 const std::string & annotation(const std::string &name) const Get an annotation by name (as a string) Definition AnalysisObject.h:122 bool hasAnnotation(const std::string &name) const Check if an annotation is defined. Definition AnalysisObject.h:116 Specialisation of the BinnedEstimate for a 3D BinnedEstimate. Definition BinnedEstimate.h:978 BinnedEstimate(const EstimateT &)=default BinType & binAt(const AxisT1 xCoord, const AxisT2 yCoord, const AxisT3 zCoord) noexcept Bin access using coordinates. Definition BinnedEstimate.h:1051 const BinType & bin(const size_t index) const noexcept Bin access using global index (const version) Definition BinnedEstimate.h:1036 BinnedEstimate(const EstimateT &other, const std::string &path) Definition BinnedEstimate.h:999 typename BaseT::BinT BinType Definition BinnedEstimate.h:982 std::shared_ptr< EstimateT > Ptr Definition BinnedEstimate.h:983 BinType & bin(const size_t index) noexcept Bin access using global index. Definition BinnedEstimate.h:1031 void maskBinAt(const AxisT1 xCoord, const AxisT2 yCoord, const AxisT3 zCoord, const bool status=true) noexcept Mask/Unmask bin at given set of coordinates. Definition BinnedEstimate.h:1066 BinnedEstimate(size_t nbinsX, double lowerX, double upperX, size_t nbinsY, double lowerY, double upperY, size_t nbinsZ, double lowerZ, double upperZ, const std::string &path="", const std::string &title="") Constructor with auto-setup of evenly spaced axes. Definition BinnedEstimate.h:1013 const BinType & bin(const size_t localX, const size_t localY, const size_t localZ) const noexcept Bin access using local indices. Definition BinnedEstimate.h:1046 BinnedEstimate(EstimateT &&)=default BinnedEstimate(const BaseT &other) Copy constructor (needed for clone functions). Definition BinnedEstimate.h:997 const BinType & binAt(const AxisT1 xCoord, const AxisT2 yCoord, const AxisT3 zCoord) const noexcept Bin access using coordinates (const version) Definition BinnedEstimate.h:1056 BinnedEstimate(EstimateT &&other, const std::string &path) Definition BinnedEstimate.h:1004 size_t indexAt(const AxisT1 xCoord, const AxisT2 yCoord, const AxisT3 zCoord) const noexcept Find bin index for given coordinates. Definition BinnedEstimate.h:1061 BinType & bin(const size_t localX, const size_t localY, const size_t localZ) noexcept Bin access using local indices. Definition BinnedEstimate.h:1041 Specialisation of the BinnedEstimate for a 2D BinnedEstimate. Definition BinnedEstimate.h:871 BinType & bin(const size_t index) noexcept Bin access using global index. Definition BinnedEstimate.h:930 BinType & bin(const size_t localX, const size_t localY) noexcept Bin access using local indices. Definition BinnedEstimate.h:940 BinnedEstimate(EstimateT &&other, const std::string &path) Definition BinnedEstimate.h:897 const BinType & binAt(const AxisT1 xCoord, const AxisT2 yCoord) const noexcept Bin access using coordinates (const version) Definition BinnedEstimate.h:955 BinnedEstimate(const EstimateT &other, const std::string &path) Definition BinnedEstimate.h:892 BinnedEstimate(EstimateT &&)=default BinnedEstimate(const BaseT &other) Copy constructor (needed for clone functions). Definition BinnedEstimate.h:890 const BinType & bin(const size_t index) const noexcept Bin access using global index (const version) Definition BinnedEstimate.h:935 BinnedEstimate(const std::vector< AxisT1 > &xEdges, const std::vector< AxisT2 > &yEdges, const std::string &path="", const std::string &title="") Definition BinnedEstimate.h:903 std::shared_ptr< EstimateT > Ptr Definition BinnedEstimate.h:876 BinType & binAt(const AxisT1 xCoord, const AxisT2 yCoord) noexcept Bin access using coordinates. Definition BinnedEstimate.h:950 size_t indexAt(const AxisT1 xCoord, const AxisT2 yCoord) const noexcept Find bin index for given coordinates. Definition BinnedEstimate.h:960 BinnedEstimate(const EstimateT &)=default BinnedEstimate(std::vector< AxisT1 > &&xEdges, std::vector< AxisT2 > &&yEdges, const std::string &path="", const std::string &title="") Definition BinnedEstimate.h:899 const BinType & bin(const size_t localX, const size_t localY) const noexcept Bin access using local indices (const version) Definition BinnedEstimate.h:945 typename BaseT::BinT BinType Definition BinnedEstimate.h:875 void maskBinAt(const AxisT1 xCoord, const AxisT2 yCoord, const bool status=true) noexcept Mask/Unmask bin at given set of coordinates. Definition BinnedEstimate.h:965 BinnedEstimate(size_t nbinsX, double lowerX, double upperX, size_t nbinsY, double lowerY, double upperY, const std::string &path="", const std::string &title="") Constructor with auto-setup of evenly spaced axes. Definition BinnedEstimate.h:914 Specialisation of the BinnedEstimate for a 1D histogram. Definition BinnedEstimate.h:797 BinnedEstimate(EstimateT &&)=default size_t indexAt(const AxisT xCoord) const noexcept Find bin index for given coordinates. Definition BinnedEstimate.h:853 BinnedEstimate(const BaseT &other) Copy constructor (needed for clone functions). Definition BinnedEstimate.h:816 BinnedEstimate(std::vector< AxisT > &&edges, const std::string &path="", const std::string &title="") Definition BinnedEstimate.h:826 BinnedEstimate(const std::vector< AxisT > &edges, const std::string &path="", const std::string &title="") Definition BinnedEstimate.h:829 void maskBinAt(const AxisT xCoord, const bool status=true) noexcept Mask/Unmask bin at given set of coordinates. Definition BinnedEstimate.h:858 BinnedEstimate(size_t nbins, double lower, double upper, const std::string &path="", const std::string &title="") Constructor with auto-setup of evenly spaced axes. Definition BinnedEstimate.h:839 BinnedEstimate(const EstimateT &)=default BinnedEstimate(const EstimateT &other, const std::string &path) Definition BinnedEstimate.h:818 BinnedEstimate(EstimateT &&other, const std::string &path) Definition BinnedEstimate.h:823 BinnedEstimate(EstimateT &&)=default BinnedEstimate(const BaseT &other) Copy constructor (needed for clone functions). Definition BinnedEstimate.h:781 BinnedEstimate & operator=(const EstimateT &)=default BinnedEstimate(const EstimateT &)=default BinnedEstimate(const EstimateT &other, const std::string &path) Definition BinnedEstimate.h:783 BinnedEstimate(EstimateT &&other, const std::string &path) Definition BinnedEstimate.h:788 BinnedStorage, stores the bins and coordinates access to them. Definition BinnedStorage.h:114 void maskBin(const size_t indexToMask, const bool status=true) noexcept Mask a bin at a given index. Definition BinnedStorage.h:361 void maskBins(const std::vector< size_t > &indicesToMask, const bool status=true) noexcept Mask a range of bins. Definition BinnedStorage.h:356 size_t numBinsAt(const size_t axisN, const bool includeOverflows=false) const noexcept Number of bins in the BinnedStorage. Definition BinnedStorage.h:339 size_t numBins(const bool includeOverflows=false, const bool includeMaskedBins=false) const noexcept Number of bins in the BinnedStorage. Definition BinnedStorage.h:331 Binning< std::decay_t< decltype(std::declval< Axis< AxisT > >())>... > BinningT Convenience alias to be used in constructor. Definition BinnedStorage.h:118 BinnedStorage & operator=(const BinnedStorage &other) noexcept Copy assignment. Definition BinnedStorage.h:481 Bin< sizeof...(AxisT), Estimate, BinningT > BinT Definition BinnedStorage.h:119 BinsVecWrapper< BinsVecT > bins(const bool includeOverflows=false, const bool includeMaskedBins=false) noexcept Returns bins vector wrapper, which skips masked elements when iterated over. Definition BinnedStorage.h:298 const BinningT & binning() const noexcept Returns dimension underlying binning object reference. Definition BinnedStorage.h:321 std::vector< size_t > maskedBins() const noexcept Definition BinnedStorage.h:379 BinT & binAt(typename BinningT::EdgeTypesTuple &&coords) noexcept Returns reference to the bin at coordinates. Definition BinnedStorage.h:220 EstimateStorage convenience class based on BinnedStorage. Definition BinnedEstimate.h:77 void scale(const double scalefactor) noexcept Rescale as if all fill weights had been different by factor scalefactor. Definition BinnedEstimate.h:249 std::enable_if_t< std::is_floating_point< E >::value, E > min() const noexcept Get the lowest non-overflow edge of the axis. Definition BinnedEstimate.h:457 std::vector< double > vals(const bool includeOverflows=false, const bool includeMaskedBins=false) const Get list of central values. Definition BinnedEstimate.h:476 EstimateStorage & operator+=(const EstimateStorage &est) Definition BinnedEstimate.h:358 std::vector< double > serializeContent(bool fixed_length=false) const noexcept Content serialisation for MPI reduce operations. Definition BinnedEstimate.h:699 EstimateStorage(EstimateStorage &&other, const std::string &path="") Move constructor. Definition BinnedEstimate.h:152 EstimateStorage(const std::string &path="", const std::string &title="") Nullary constructor for unique pointers etc. Definition BinnedEstimate.h:93 void rebinTo(const std::vector< typename BinningT::template getAxisT< axisN >::EdgeT > &newedges) Rebin to the given list of bin edges. Definition BinnedEstimate.h:288 EstimateStorage(std::vector< AxisT > &&... binsEdges, const std::string &path="", const std::string &title="") Constructor giving explicit bin edges as rvalue reference. Definition BinnedEstimate.h:101 EstimateStorage & add(const EstimateStorage &est, const std::string &pat_uncorr="^stat|^uncor") Add two EstimateStorages. Definition BinnedEstimate.h:346 EstimateStorage & add(EstimateStorage &&est, const std::string &pat_uncorr="^stat|^uncor") Add two (rvalue) EstimateStorages. Definition BinnedEstimate.h:366 auto mkScatter(const std::string &path="", const std::string &pat_match="", const bool includeOverflows=false, const bool includeMaskedBins=false) const Produce a ScatterND from a EstimateStorage. Definition BinnedEstimate.h:586 EstimateStorage & operator-=(const EstimateStorage &est) Definition BinnedEstimate.h:399 double auc(const bool includeBinVol=true, const bool includeOverflows=false, const bool includeMaskedBins=false) const Convenient alias for areaUnderCurve() Definition BinnedEstimate.h:520 EstimateStorage(std::initializer_list< AxisT > &&... binsEdges, const std::string &path="", const std::string &title="") Constructor giving explicit bin edges as initializer list. Definition BinnedEstimate.h:117 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. Definition BinnedEstimate.h:122 EstimateStorage(const ScatterND< sizeof...(AxisT)+1 > &s, const std::string &path="", const std::string &title="") Constructor given a scatter. Definition BinnedEstimate.h:139 AnalysisObject * mkInert(const std::string &path="", const std::string &source="") const noexcept Method returns clone of the estimate with streamlined error source. Definition BinnedEstimate.h:671 void rebin(unsigned int n, size_t begin=1, size_t end=UINT_MAX) Overloaded alias for rebinBy. Definition BinnedEstimate.h:282 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. Definition BinnedEstimate.h:266 double areaUnderCurve(const bool includeBinVol=true, const bool includeOverflows=false, const bool includeMaskedBins=false) const Calculate the volume underneath the EstimateStorage. Definition BinnedEstimate.h:507 void rebin(const std::vector< typename BinningT::template getAxisT< axisN >::EdgeT > &newedges) Overloaded alias for rebinTo. Definition BinnedEstimate.h:315 EstimateStorage(const std::vector< AxisT > &... binsEdges, const std::string &path="", const std::string &title="") Constructor giving explicit bin edges as lvalue reference. Definition BinnedEstimate.h:109 std::vector< std::vector< double > > covarianceMatrix(const bool ignoreOffDiagonalTerms=false, const bool includeOverflows=false, const bool includeMaskedBins=false, const std::string &pat_uncorr="^stat|^uncor") const Construct a covariance matrix from the error breakdown. Definition BinnedEstimate.h:529 EstimateStorage(const EstimateStorage &other, const std::string &path="") Copy constructor. Definition BinnedEstimate.h:146 EstimateStorage & subtract(EstimateStorage &&est, const std::string &pat_uncorr="^stat|^uncor") Subtract one (rvalue) EstimateStorages from another one. Definition BinnedEstimate.h:404 std::enable_if_t< std::is_floating_point< E >::value, E > max() const noexcept Get the highest non-overflow edge of the axis. Definition BinnedEstimate.h:465 EstimateStorage(BinningT &&binning, const std::string &path="", const std::string &title="") Constructor given an rvalue BinningT. Definition BinnedEstimate.h:134 EstimateStorage & subtract(const EstimateStorage &est, const std::string &pat_uncorr="^stat|^uncor") Subtract one EstimateStorages from another one. Definition BinnedEstimate.h:387 EstimateStorage & operator=(const EstimateStorage &est) noexcept Copy assignment. Definition BinnedEstimate.h:325 size_t dim() const noexcept Total dimension of the object (number of axes + estimate) Definition BinnedEstimate.h:427 auto mkEstimates(const std::string &path="", const bool includeOverflows=false) const Split into vector of BinnedEstimates along axisN. Definition BinnedEstimate.h:651 std::vector< E > edges(const bool includeOverflows=false) const noexcept Templated version to get edges of axis N by value. +-inf edges are included. Definition BinnedEstimate.h:437 size_t lengthContent(bool fixed_length=false) const noexcept Length of serialized content vector for MPI reduce operations. Definition BinnedEstimate.h:691 EstimateStorage(const BinningT &binning, const std::string &path="", const std::string &title="") Constructor given a binning type. Definition BinnedEstimate.h:130 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. Definition BinnedEstimate.h:449 void deserializeContent(const std::vector< double > &data) Content deserialisation for MPI reduce operations. Definition BinnedEstimate.h:714 Definition Point.h:545 A generic data type which is just a collection of n-dim data points with errors. Definition Scatter.h:154 Definition Transformation.h:31 Error for problems introduced outside YODA, to put it nicely. Definition Exceptions.h:100 std::string mkTypeString() Helper function to construct the BinnedDbn and BinnedEstimate type names. Definition BinningUtils.h:65 void transform(BinnedEstimate< AxisT... > &est, const Trf< 1 > &fn) Definition BinnedEstimate.h:1206 std::enable_if_t< all_CAxes< EdgeT... >::value > enable_if_all_CAxisT Checks if all edge types are continuous. Definition BinningUtils.h:22 typename std::conjunction< std::is_floating_point< EdgeT >... > all_CAxes Definition BinningUtils.h:18 BinnedDbn< DbnN, AxisT... > operator+(BinnedDbn< DbnN, AxisT... > first, BinnedDbn< DbnN, AxisT... > &&second) Add two BinnedDbn objects. Definition BinnedDbn.h:1060 BinnedEstimate< AxisT... > operator/(const BinnedDbn< DbnN, AxisT... > &numer, const BinnedDbn< DbnN, AxisT... > &denom) Definition BinnedDbn.h:1133 BinnedEstimate< AxisT... > efficiency(const BinnedDbn< DbnN, AxisT... > &accepted, const BinnedDbn< DbnN, AxisT... > &total) Calculate a binned efficiency ratio of two BinnedDbn objects. Definition BinnedDbn.h:1162 typename EstimateMaker< std::make_index_sequence< N > >::type EstimateND Definition BinnedEstimate.h:1245 BinnedEstimate< AxisT... > asymm(const BinnedDbn< DbnN, AxisT... > &a, const BinnedDbn< DbnN, AxisT... > &b) Calculate the asymmetry (a-b)/(a+b) of two BinnedDbn objects. Definition BinnedDbn.h:1201 BinnedEstimate< AxisT... > add(const BinnedDbn< DbnN, AxisT... > &dbn, const BinnedEstimate< AxisT... > &est) Calculate the addition of a BinnedDbn with a BinnedEstimate. Definition BinnedDbn.h:1270 BinnedEstimate< AxisT... > subtract(const BinnedDbn< DbnN, AxisT... > &dbn, const BinnedEstimate< AxisT... > &est) Calculate the subtraction of a BinnedEstimate from a BinnedDbn. Definition BinnedDbn.h:1302 BinnedDbn< DbnN, AxisT... > operator-(BinnedDbn< DbnN, AxisT... > first, BinnedDbn< DbnN, AxisT... > &&second) Subtract one BinnedDbn object from another. Definition BinnedDbn.h:1076 BinnedEstimate< AxisT... > divide(const BinnedDbn< DbnN, AxisT... > &numer, const BinnedDbn< DbnN, AxisT... > &denom) Divide two BinnedDbn objects. Definition BinnedDbn.h:1092 CRTP mixin introducing convenience aliases along Y axis. Definition BinnedUtils.h:109 CRTP mixin introducing convenience aliases along Z axis. Definition BinnedUtils.h:198 Generated on Mon Oct 28 2024 13:47:23 for YODA - Yet more Objects for Data Analysis by 1.9.8 |