CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

npstat::HistoND< Numeric, Axis > Class Template Reference

#include <HistoND.h>

List of all members.

Public Types

typedef Axis axis_type
typedef Numeric value_type

Public Member Functions

template<typename Acc >
void accumulateBinsInBox (const BoxND< double > &box, Acc *acc) const
const std::string & accumulatedDataLabel () const
template<class Point >
void allBinCenters (std::vector< Point > *centers) const
const std::vector< Axis > & axes () const
const Axis & axis (const unsigned i) const
void binBox (unsigned long binNumber, BoxND< double > *box) const
void binCenter (unsigned long binNumber, double *coords, unsigned lenCoords) const
const ArrayND< Numeric > & binContents () const
double binVolume (unsigned long binNumber=0) const
BoxND< double > boundingBox () const
void clear ()
void clearBinContents ()
void clearOverflows ()
const Numeric & closestBin (const double *coords, unsigned coordLength) const
unsigned dim () const
template<typename Num2 , class Functor >
void dispatch (const double *coords, unsigned coordLength, Num2 &weight, Functor &f)
const Numeric & examine (const double *coords, unsigned coordLength) const
template<typename Num2 >
void fill (const double *coords, unsigned coordLength, const Num2 &weight)
template<typename Num2 >
void fillC (const double *coords, unsigned coordLength, const Num2 &weight)
unsigned long getModCount () const
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const char *title=0, const char *accumulatedDataLabel=0)
template<typename Num2 , class Functor >
 HistoND (const HistoND< Num2, Axis > &h, const Functor &f, const char *title=0, const char *accumulatedDataLabel=0)
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const unsigned *indices, unsigned nIndices, const char *title=0)
 HistoND (const Axis &xAxis, const char *title=0, const char *accumulatedDataLabel=0)
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const Axis &newAxis, unsigned newAxisNumber, const char *title=0)
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const char *title=0, const char *accumulatedDataLabel=0)
 HistoND (const HistoND &)
 HistoND (const Axis &xAxis, const Axis &yAxis, const char *title=0, const char *accumulatedDataLabel=0)
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis, const char *title=0, const char *accumulatedDataLabel=0)
 HistoND (const std::vector< Axis > &axes, const char *title=0, const char *accumulatedDataLabel=0)
 HistoND (const ArrayShape &shape, const BoxND< double > &boundingBox, const char *title=0, const char *accumulatedDataLabel=0)
void incrModCount ()
double integral () const
bool isSameData (const HistoND &) const
bool isUniformlyBinned () const
unsigned long nBins () const
unsigned long nFillsInRange () const
unsigned long nFillsOver () const
unsigned long nFillsTotal () const
bool operator!= (const HistoND &) const
template<typename Num2 >
HistoNDoperator*= (const Num2 &r)
template<typename Num2 >
HistoNDoperator+= (const HistoND< Num2, Axis > &r)
template<typename Num2 >
HistoNDoperator-= (const HistoND< Num2, Axis > &r)
template<typename Num2 >
HistoNDoperator/= (const Num2 &r)
HistoNDoperator= (const HistoND &)
bool operator== (const HistoND &) const
const ArrayND< Numeric > & overflows () const
void recalculateNFillsFromData ()
void setAccumulatedDataLabel (const char *newlabel)
void setAxisLabel (const unsigned axisNum, const char *newlabel)
template<typename Num2 >
void setBinContents (const Num2 *data, unsigned long dataLength, bool clearOverflows=true)
template<typename Num2 >
void setBinsToConst (const Num2 &value)
template<typename Num2 >
void setOverflows (const Num2 *data, unsigned long dataLength)
template<typename Num2 >
void setOverflowsToConst (const Num2 &value)
void setTitle (const char *newtitle)
const std::string & title () const
HistoND transpose (unsigned axisNum1, unsigned axisNum2) const
double volume () const
template<typename Num2 >
void fill (const Num2 &weight)
template<typename Num2 >
void fill (double x0, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, double x5, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, double x5, double x6, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, const Num2 &weight)
template<typename Num2 >
void fill (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, const Num2 &weight)
template<typename Num2 , class Functor >
void dispatch (Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, double x5, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, double x5, double x6, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, Num2 &weight, Functor &f)
template<typename Num2 , class Functor >
void dispatch (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, Num2 &weight, Functor &f)
const Numeric & examine () const
const Numeric & examine (double x0) const
const Numeric & examine (double x0, double x1) const
const Numeric & examine (double x0, double x1, double x2) const
const Numeric & examine (double x0, double x1, double x2, double x3) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4, double x5) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4, double x5, double x6) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8) const
const Numeric & examine (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9) const
const Numeric & closestBin () const
const Numeric & closestBin (double x0) const
const Numeric & closestBin (double x0, double x1) const
const Numeric & closestBin (double x0, double x1, double x2) const
const Numeric & closestBin (double x0, double x1, double x2, double x3) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4, double x5) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4, double x5, double x6) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8) const
const Numeric & closestBin (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9) const
template<typename Num2 >
void fillC (const Num2 &weight)
template<typename Num2 >
void fillC (double x0, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, double x5, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, double x5, double x6, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, const Num2 &weight)
template<typename Num2 >
void fillC (double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, const Num2 &weight)
template<typename Num2 >
void setBin (const unsigned *index, unsigned indexLen, const Num2 &v)
template<typename Num2 >
void setBin (const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, const Num2 &v)
template<typename Num2 >
void setBin (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9, const Num2 &v)
template<typename Num2 >
void setLinearBin (const unsigned long index, const Num2 &v)
template<typename Num2 >
void setBinAt (const unsigned *index, unsigned indexLen, const Num2 &v)
template<typename Num2 >
void setBinAt (const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, const Num2 &v)
template<typename Num2 >
void setBinAt (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9, const Num2 &v)
template<typename Num2 >
void setLinearBinAt (const unsigned long index, const Num2 &v)
void setNFillsTotal (const unsigned long i)
void setNFillsOver (const unsigned long i)
template<typename Num2 >
void scaleBinContents (const Num2 *data, unsigned long dataLength)
template<typename Num2 >
void scaleOverflows (const Num2 *data, unsigned long dataLength)
template<typename Num2 >
void addToBinContents (const Num2 &weight)
template<typename Num2 >
void addToOverflows (const Num2 &weight)
template<typename Num2 >
void addToBinContents (const Num2 *data, unsigned long dataLength)
template<typename Num2 >
void addToOverflows (const Num2 *data, unsigned long dataLength)
template<typename Num2 , typename Num3 >
void addToProjection (HistoND< Num2, Axis > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
template<typename Num2 , typename Num3 >
void addToProjection (HistoND< Num2, Axis > *projection, AbsVisitor< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
gs::ClassId classId () const
bool write (std::ostream &of) const

Static Public Member Functions

static const char * classname ()
static HistoNDread (const gs::ClassId &id, std::istream &in)
static unsigned version ()

Private Member Functions

template<typename Acc >
void accumulateBinsLoop (unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction) const
template<typename Num2 >
void fillPreservingCentroid (const Num2 &weight)
 HistoND ()
 HistoND (const HistoND &r, unsigned ax1, unsigned ax2)

Private Attributes

std::string accumulatedDataLabel_
std::vector< Axis > axes_
ArrayND< Numeric > data_
unsigned dim_
unsigned long fillCount_
std::vector< unsigned > indexBuf_
unsigned long modCount_
unsigned long overCount_
ArrayND< Numeric > overflow_
std::string title_
std::vector< double > weightBuf_

Friends

class HistoND

Detailed Description

template<typename Numeric, class Axis = HistoAxis>
class npstat::HistoND< Numeric, Axis >

(Almost) arbitrary-dimensional histogram with binning determined by the second template parameter (typically HistoAxis or NUHistoAxis). The dimensionality must not exceed CHAR_BIT*sizeof(unsigned long)-1 which is normally 31/63 on 32/64-bit systems.

The template parameter class (Numeric) must be such that it can be used as the template parameter of ArrayND class. For a typical usage pattern, Numeric should also support operator += between itself and the weights with which the histogram is filled (see, however, the description of the "dispatch" method which is not subject to this recommendation).

If the "fillC" method is used to accumulate the data then the weights must support multiplication by a double, and then it must be possible to use the "+=" operator to add such a product to Numeric.

Note that there are no methods which would allow the user to examine the bin contents of the histogram using bin numbers. This is intentional: almost always such examinations are performed in a loop over indices, and it is more efficient to grab a reference to the underlying array using the "binContents()" method and then examine that array directly.

Definition at line 43 of file HistoND.h.


Member Typedef Documentation

template<typename Numeric, class Axis = HistoAxis>
typedef Axis npstat::HistoND< Numeric, Axis >::axis_type

Definition at line 49 of file HistoND.h.

template<typename Numeric, class Axis = HistoAxis>
typedef Numeric npstat::HistoND< Numeric, Axis >::value_type

Definition at line 48 of file HistoND.h.


Constructor & Destructor Documentation

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const std::vector< Axis > &  axes,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Main constructor for arbitrary-dimensional histograms

Definition at line 1165 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(axesIn)),
          overflow_(ArrayShape(axesIn.size(), 3U)),
          axes_(axesIn),
          weightBuf_(axesIn.size()),
          indexBuf_(2U*axesIn.size()),
          modCount_(0UL),
          dim_(axesIn.size())
    {
        if (dim_ >= CHAR_BIT*sizeof(unsigned long))
            throw npstat::NpstatInvalidArgument(
                "In npstat::HistoND constructor: requested histogram "
                "dimensionality is not supported (too large)");
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 1-d histograms

Definition at line 1185 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(xAxis)),
          overflow_(ArrayShape(1U, 3U)),
          weightBuf_(1U),
          indexBuf_(2U*1U),
          modCount_(0UL),
          dim_(1U)
    {
        axes_.reserve(dim_);
        axes_.push_back(xAxis);
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 2-d histograms

Definition at line 1202 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(xAxis, yAxis)),
          overflow_(ArrayShape(2U, 3U)),
          weightBuf_(2U),
          indexBuf_(2U*2U),
          modCount_(0UL),
          dim_(2U)
    {
        axes_.reserve(dim_);
        axes_.push_back(xAxis);
        axes_.push_back(yAxis);
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 3-d histograms

Definition at line 1220 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(xAxis, yAxis, zAxis)),
          overflow_(ArrayShape(3U, 3U)),
          weightBuf_(3U),
          indexBuf_(2U*3U),
          modCount_(0UL),
          dim_(3U)
    {
        axes_.reserve(dim_);
        axes_.push_back(xAxis);
        axes_.push_back(yAxis);
        axes_.push_back(zAxis);
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 4-d histograms

Definition at line 1240 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis)),
          overflow_(ArrayShape(4U, 3U)),
          weightBuf_(4U),
          indexBuf_(2U*4U),
          modCount_(0UL),
          dim_(4U)
    {
        axes_.reserve(dim_);
        axes_.push_back(xAxis);
        axes_.push_back(yAxis);
        axes_.push_back(zAxis);
        axes_.push_back(tAxis);
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const Axis &  vAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 5-d histograms

Definition at line 1261 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
          overflow_(ArrayShape(5U, 3U)),
          weightBuf_(5U),
          indexBuf_(2U*5U),
          modCount_(0UL),
          dim_(5U)
    {
        axes_.reserve(dim_);
        axes_.push_back(xAxis);
        axes_.push_back(yAxis);
        axes_.push_back(zAxis);
        axes_.push_back(tAxis);
        axes_.push_back(vAxis);
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const ArrayShape shape,
const BoxND< double > &  boundingBox,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Simple constructor for uniformly binned histograms without axis labels. Sequence size returned by the size() method of both "shape" and "boundingBox" arguments must be the same.

Definition at line 1284 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::clear(), npstat::HistoND< Numeric, Axis >::dim_, i, max(), and min.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(shape),
          overflow_(ArrayShape(shape.size(), 3U)),
          weightBuf_(shape.size()),
          indexBuf_(2U*shape.size()),
          modCount_(0UL),
          dim_(shape.size())
    {
        if (boundingBox.size() != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND constructor: "
            "incompatible bounding box dimensionality");
        if (dim_ >= CHAR_BIT*sizeof(unsigned long))
            throw npstat::NpstatInvalidArgument(
                "In npstat::HistoND constructor: requested histogram "
                "dimensionality is not supported (too large)");
        axes_.reserve(dim_);
        for (unsigned i=0; i<dim_; ++i)
            axes_.push_back(Axis(shape[i],
                                 boundingBox[i].min(),
                                 boundingBox[i].max()));
        clear();
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Functor &  f,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Converting constructor. The functor will be applied to all bins of the argument histogram to fill the bins of the constructed histogram. If the title and data label are not provided, they will be cleared.

Definition at line 1313 of file HistoND.h.

        : title_(title ? title : ""),
          accumulatedDataLabel_(label ? label : ""),
          data_(r.data_, f),
          overflow_(r.overflow_, f),
          axes_(r.axes_),
          weightBuf_(r.dim_),
          indexBuf_(2U*r.dim_),
          fillCount_(r.fillCount_),
          overCount_(r.overCount_),
          modCount_(0UL),
          dim_(r.dim_)
    {
    }
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const unsigned *  indices,
unsigned  nIndices,
const char *  title = 0 
)

A slicing constructor. The new histogram will be created by slicing another histogram. See the description of the slicing constructor in the "ArrayND" class for the meaning of arguments "indices" and "nIndices". The data of the newly created histogram is cleared.

Definition at line 1332 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::clear().

        : title_(title ? title : ""),
          accumulatedDataLabel_(h.accumulatedDataLabel_),
          data_(Private::shapeOfASlice(h.axes_, indices, nIndices)),
          overflow_(ArrayShape(data_.rank(), 3U)),
          axes_(Private::axesOfASlice(h.axes_, indices, nIndices)),
          weightBuf_(data_.rank()),
          indexBuf_(2U*data_.rank()),
          modCount_(0UL),
          dim_(data_.rank())
    {
        clear();
    }
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Axis &  newAxis,
unsigned  newAxisNumber,
const char *  title = 0 
)

A constructor that inserts a new axis into a histogram (as if the argument histogram was a slice of the new histogram). The "newAxisNumber" argument specifies the number of the new axis in the axis sequence of the constructed histogram. If the "newAxisNumber" exceeds the number of axes of the argument histogram, the new axis will become last. The data of the newly created histogram is cleared.

Definition at line 1350 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::clear(), and npstat::HistoND< Numeric, Axis >::dim_.

        : title_(title ? title : ""),
          accumulatedDataLabel_(h.accumulatedDataLabel_),
          data_(Private::shapeWithExtraAxis(h.axes_, newAxis, newAxisNumber)),
          overflow_(data_.rank(), 3U),
          axes_(Private::addAxis(h.axes_, newAxis, newAxisNumber)),
          weightBuf_(data_.rank()),
          indexBuf_(2U*data_.rank()),
          modCount_(0UL),
          dim_(data_.rank())
    {
        if (dim_ >= CHAR_BIT*sizeof(unsigned long))
            throw npstat::NpstatInvalidArgument(
                "In npstat::HistoND constructor: requested histogram "
                "dimensionality is not supported (too large)");
        clear();
    }
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r)

Copy constructor

Definition at line 3261 of file HistoND.h.

        : title_(r.title_),
          accumulatedDataLabel_(r.accumulatedDataLabel_),
          data_(r.data_),
          overflow_(r.overflow_),
          axes_(r.axes_),
          weightBuf_(r.weightBuf_),
          indexBuf_(r.indexBuf_),
          fillCount_(r.fillCount_),
          overCount_(r.overCount_),
          modCount_(0UL),
          dim_(r.dim_)
    {
    }
template<typename Numeric, class Axis = HistoAxis>
npstat::HistoND< Numeric, Axis >::HistoND ( ) [private]
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r,
unsigned  ax1,
unsigned  ax2 
) [private]

Definition at line 3242 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, and swap().

        : title_(r.title_),
          accumulatedDataLabel_(r.accumulatedDataLabel_),
          data_(r.data_.transpose(ax1, ax2)),
          overflow_(r.overflow_.transpose(ax1, ax2)),
          axes_(r.axes_),
          weightBuf_(r.weightBuf_),
          indexBuf_(r.indexBuf_),
          fillCount_(r.fillCount_),
          overCount_(r.overCount_),
          modCount_(0UL),
          dim_(r.dim_)
    {
        std::swap(axes_[ax1], axes_[ax2]);
    }

Member Function Documentation

template<typename Numeric , class Axis >
template<typename Acc >
void npstat::HistoND< Numeric, Axis >::accumulateBinsInBox ( const BoxND< double > &  box,
Acc *  acc 
) const

Add contents of all bins inside the given box to the accumulator. Note that Numeric type must support multiplication by a double in order for this function to work (it calculates the overlap fraction of each bin with the box and multiplies bin content by that fraction for subsequent accumulation). The operation Acc += Numeric must be defined.

Definition at line 1123 of file HistoND.h.

References i.

    {
        if (box.size() != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::accumulateBinsInBox: "
            "incompatible box dimensionality");
        assert(accumulator);
        if (dim_)
        {
            for (unsigned i=0; i<dim_; ++i)
                indexBuf_[i] = 0U;
            accumulateBinsLoop(0U, box, &indexBuf_[0], accumulator, 1.0);
        }
        else
            *accumulator += 1.0*data_();
    }
template<typename Numeric , class Axis >
template<typename Acc >
void npstat::HistoND< Numeric, Axis >::accumulateBinsLoop ( unsigned  level,
const BoxND< double > &  box,
unsigned *  idx,
Acc *  accumulator,
double  overlapFraction 
) const [private]

Definition at line 1098 of file HistoND.h.

References i, testEve_cfg::level, and pileupCalc::nbins.

    {
        const Interval<double>& boxSide(box[level]);
        const Axis& axis(axes_[level]);
        const unsigned nbins = axis.nBins();
        const bool lastLevel = level == dim_ - 1U;
        for (unsigned i=0; i<nbins; ++i)
        {
            const double over = overlapFraction*
                axis.binInterval(i).overlapFraction(boxSide);
            if (over > 0.0)
            {
                idx[level] = i;
                if (lastLevel)
                    *accumulator += over*data_.value(idx, dim_);
                else
                    accumulateBinsLoop(level+1U, box, idx, accumulator, over);
            }
        }
    }
template<typename Numeric, class Axis = HistoAxis>
const std::string& npstat::HistoND< Numeric, Axis >::accumulatedDataLabel ( ) const [inline]

Label associated with accumulated data

Definition at line 135 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::accumulatedDataLabel_.

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToBinContents ( const Num2 *  data,
unsigned long  dataLength 
)

In-place addition of an array. Equivalent to calling the "fill" function once for every bin with the weight taken from the corresponding array element.

Definition at line 3339 of file HistoND.h.

References i.

    {
        if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::addToBinContents: incompatible data length");
        assert(data);
        Numeric* dat = const_cast<Numeric*>(data_.data());
        for (unsigned long i=0; i<dataLength; ++i)
            dat[i] += data[i];
        fillCount_ += dataLength;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToBinContents ( const Num2 &  weight)

In-place addition of a scalar to all bins. Equivalent to calling the "fill" function with the same weight once for every bin.

Definition at line 3314 of file HistoND.h.

References data, and i.

    {
        const unsigned long nDat = data_.length();
        Numeric* data = const_cast<Numeric*>(data_.data());
        for (unsigned long i=0; i<nDat; ++i)
            data[i] += weight;
        fillCount_ += nDat;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 &  weight)

Definition at line 3326 of file HistoND.h.

References data, and i.

    {
        const unsigned long nOver = overflow_.length();
        Numeric* data = const_cast<Numeric*>(overflow_.data());
        for (unsigned long i=0; i<nOver; ++i)
            data[i] += weight;
        overCount_ += nOver;
        fillCount_ += nOver;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 *  data,
unsigned long  dataLength 
)

Definition at line 3354 of file HistoND.h.

References i.

    {
        if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::addToOverflows: incompatible data length");
        assert(data);
        Numeric* dat = const_cast<Numeric*>(overflow_.data());
        for (unsigned long i=0; i<dataLength; ++i)
            dat[i] += data[i];
        overCount_ += dataLength;
        fillCount_ += dataLength;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , typename Num3 >
void npstat::HistoND< Numeric, Axis >::addToProjection ( HistoND< Num2, Axis > *  projection,
AbsArrayProjector< Numeric, Num3 > &  projector,
const unsigned *  projectedIndices,
unsigned  nProjectedIndices 
) const [inline]

Code for projecting one histogram onto another. For now, this is done for bin contents only, not for overflows. The projection should be created in advance from this histogram with the aid of the slicing constructor. The indices used in that constructor should be provided here as well.

Note that you might want to recalculate the number of fills from data after performing all projections needed.

Definition at line 3429 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::fillCount_, npstat::HistoND< Numeric, Axis >::modCount_, and npstat::HistoND< Numeric, Axis >::nBins().

    {
        assert(projection);
        data_.addToProjection(&projection->data_, projector,
                              projectedIndices, nProjectedIndices);
        projection->fillCount_ += projection->nBins();
        projection->modCount_++;
    }
template<typename Numeric , class Axis >
template<typename Num2 , typename Num3 >
void npstat::HistoND< Numeric, Axis >::addToProjection ( HistoND< Num2, Axis > *  projection,
AbsVisitor< Numeric, Num3 > &  projector,
const unsigned *  projectedIndices,
unsigned  nProjectedIndices 
) const [inline]

Definition at line 3444 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::fillCount_, npstat::HistoND< Numeric, Axis >::modCount_, and npstat::HistoND< Numeric, Axis >::nBins().

    {
        assert(projection);
        data_.addToProjection(&projection->data_, projector,
                              projectedIndices, nProjectedIndices);
        projection->fillCount_ += projection->nBins();
        projection->modCount_++;
    }
template<typename Numeric , class Axis >
template<class Point >
void npstat::HistoND< Numeric, Axis >::allBinCenters ( std::vector< Point > *  centers) const

Convenience function which fills out a vector of bin centers in the same order as the linear order of binContents(). The class "Point" must have a subscript operator, default constructor, copy constructor, and the size() method (use, for example, std::array).

Definition at line 1436 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

    {
        assert(centers);
        centers->clear();
        const unsigned long len = data_.length();
        centers->reserve(len);
        unsigned* ibuf = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        Point center;
        if (center.size() < dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::allBinCenters: "
            "incompatible point dimensionality (too small)");
        typename Point::value_type* cdat = &center[0];

        for (unsigned long i=0; i<len; ++i)
        {
            data_.convertLinearIndex(i, ibuf, dim_);
            for (unsigned idim=0; idim<dim_; ++idim)
                cdat[idim] = ax[idim].binCenter(ibuf[idim]);
            centers->push_back(center);
        }
    }
template<typename Numeric, class Axis = HistoAxis>
const std::vector<Axis>& npstat::HistoND< Numeric, Axis >::axes ( ) const [inline]

Inspect histogram axes

Definition at line 145 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_.

Referenced by npstat::interpolateHistoND().

{return axes_;}
template<typename Numeric, class Axis = HistoAxis>
const Axis& npstat::HistoND< Numeric, Axis >::axis ( const unsigned  i) const [inline]

Inspect a histogram axis for the given dimension

Definition at line 148 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_.

Referenced by npstat::interpolateHistoND().

            {return axes_.at(i);}
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::binBox ( unsigned long  binNumber,
BoxND< double > *  box 
) const

Bounding box for the given bin

Definition at line 1461 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

    {
        assert(box);
        box->clear();
        if (dim_)
        {
            box->reserve(dim_);
            data_.convertLinearIndex(binNumber, &indexBuf_[0], dim_);
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                box->push_back(ax[i].binInterval(indexBuf_[i]));
        }
    }
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::binCenter ( unsigned long  binNumber,
double *  coords,
unsigned  lenCoords 
) const

Position of the bin center. Length of the "coords" array (filled on return) should be equal to the dimensionality of the histogram.

Definition at line 1417 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

    {
        if (dim_ != lenCoords) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::binCenter: "
            "incompatible input point dimensionality");
        if (dim_)
        {
            assert(coords);
            data_.convertLinearIndex(binNumber, &indexBuf_[0], dim_);
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                coords[i] = ax[i].binCenter(indexBuf_[i]);
        }
    }
template<typename Numeric, class Axis = HistoAxis>
const ArrayND<Numeric>& npstat::HistoND< Numeric, Axis >::binContents ( ) const [inline]

Retrive a reference to the array of bin contents

Definition at line 139 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_.

Referenced by npstat::interpolateHistoND(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table().

{return data_;}
template<typename Numeric , class Axis >
double npstat::HistoND< Numeric, Axis >::binVolume ( unsigned long  binNumber = 0) const

This method returns width/area/volume/etc. of a single bin. 1.0 is returned for a dimensionless histogram.

Definition at line 1504 of file HistoND.h.

References create_public_lumi_plots::ax, i, and findQualityFiles::v.

    {
        double v = 1.0;
        if (dim_)
        {
            data_.convertLinearIndex(binNumber, &indexBuf_[0], dim_);
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                v *= ax[i].binWidth(indexBuf_[i]);
        }
        return v;
    }
template<typename Numeric , class Axis >
BoxND< double > npstat::HistoND< Numeric, Axis >::boundingBox ( ) const

Bounding box for the whole histogram

Definition at line 1403 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

    {
        BoxND<double> box;
        if (dim_)
        {
            box.reserve(dim_);
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                box.push_back(ax[i].interval());
        }
        return box;
    }
template<typename Numeric, class Axis = HistoAxis>
gs::ClassId npstat::HistoND< Numeric, Axis >::classId ( ) const [inline]

Method related to "geners" I/O

Definition at line 808 of file HistoND.h.

Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::write().

{return gs::ClassId(*this);}
template<typename Numeric , class Axis >
const char * npstat::HistoND< Numeric, Axis >::classname ( ) [static]

Definition at line 3458 of file HistoND.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

    {
        static const std::string myClass(gs::template_class_name<Numeric,Axis>(
                                             "npstat::HistoND"));
        return myClass.c_str();
    }
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clear ( void  ) [inline]

Clear the histogram contents (both bins and overflows)

Definition at line 1157 of file HistoND.h.

Referenced by npstat::HistoND< Numeric, Axis >::HistoND().

template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearBinContents ( ) [inline]

This method clears the bin contents but not overflows

Definition at line 1141 of file HistoND.h.

    {
        data_.clear();
        fillCount_ = 0UL;
        ++modCount_;
    }
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearOverflows ( ) [inline]

This method clears overflows but not the bin contents

Definition at line 1149 of file HistoND.h.

    {
        overflow_.clear();
        overCount_ = 0UL;
        ++modCount_;
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( const double *  coords,
unsigned  coordLength 
) const

The "closestBin" functions are similar to the "examine" functions but always return a valid bin and never overflow. This can be useful for implementing lookup tables with constant extrapolation outside of the histogram range.

Definition at line 1623 of file HistoND.h.

References create_public_lumi_plots::ax, i, and customizeTrackingMonitorSeedNumber::idx.

    {
        if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::closestBin: "
            "incompatible input point dimensionality");
        if (coordLength)
        {
            assert(coords);
            unsigned* idx = &indexBuf_[0];
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                idx[i] = ax[i].closestValidBin(coords[i]);
            return data_.value(idx, dim_);
        }
        else
            return data_();
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( ) const [inline]

Convenience "closestBin" method for histograms of corresponding dimensionality

Definition at line 1740 of file HistoND.h.

References npstat::Private::h_badargs().

    {
        if (dim_) Private::h_badargs("closestBin");
        return data_();
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0) const [inline]

Definition at line 1808 of file HistoND.h.

References npstat::Private::h_badargs().

    {
        if (dim_ != 1U) Private::h_badargs("closestBin");
        const unsigned i0 = axes_[0].closestValidBin(x0);
        return data_(i0);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1 
) const

Definition at line 1889 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 2U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        return data_(i0, i1);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2 
) const

Definition at line 1978 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 3U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        return data_(i0, i1, i2);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2077 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 4U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        return data_(i0, i1, i2, i3);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4 
) const

Definition at line 2182 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 5U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        return data_(i0, i1, i2, i3, i4);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5 
) const

Definition at line 2302 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 6U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        const unsigned i5 = ax[5].closestValidBin(x5);
        return data_(i0, i1, i2, i3, i4, i5);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6 
) const

Definition at line 2427 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 7U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        const unsigned i5 = ax[5].closestValidBin(x5);
        const unsigned i6 = ax[6].closestValidBin(x6);
        return data_(i0, i1, i2, i3, i4, i5, i6);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7 
) const

Definition at line 2562 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 8U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        const unsigned i5 = ax[5].closestValidBin(x5);
        const unsigned i6 = ax[6].closestValidBin(x6);
        const unsigned i7 = ax[7].closestValidBin(x7);
        return data_(i0, i1, i2, i3, i4, i5, i6, i7);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8 
) const

Definition at line 2703 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 9U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        const unsigned i5 = ax[5].closestValidBin(x5);
        const unsigned i6 = ax[6].closestValidBin(x6);
        const unsigned i7 = ax[7].closestValidBin(x7);
        const unsigned i8 = ax[8].closestValidBin(x8);
        return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9 
) const

Definition at line 2854 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 10U) Private::h_badargs("closestBin");
        const Axis* ax = &axes_[0];
        const unsigned i0 = ax[0].closestValidBin(x0);
        const unsigned i1 = ax[1].closestValidBin(x1);
        const unsigned i2 = ax[2].closestValidBin(x2);
        const unsigned i3 = ax[3].closestValidBin(x3);
        const unsigned i4 = ax[4].closestValidBin(x4);
        const unsigned i5 = ax[5].closestValidBin(x5);
        const unsigned i6 = ax[6].closestValidBin(x6);
        const unsigned i7 = ax[7].closestValidBin(x7);
        const unsigned i8 = ax[8].closestValidBin(x8);
        const unsigned i9 = ax[9].closestValidBin(x9);
        return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
    }
template<typename Numeric, class Axis = HistoAxis>
unsigned npstat::HistoND< Numeric, Axis >::dim ( ) const [inline]
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( const double *  coords,
unsigned  coordLength,
Num2 &  weight,
Functor &  f 
)

Location-based dispatch method. The provided binary functor will be called with the approprite histogram bin value as the first argument and the weight as the second (functor return value is ignored). This allows for a very general use of the histogram binning functionality. For example, with a proper functor, the histogram bins can be filled with pointers to an arbitrary class (this is the only way to use classes which do not have default constructors as bin contents) and the functor can be used to dispatch class methods. Depending on the exact nature of the functor, multiple things might be modified as the result of this call: the bin value, the weight, and the functor internal state.

Definition at line 1566 of file HistoND.h.

References create_public_lumi_plots::ax, f, i, customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::dispatch: "
            "incompatible input point dimensionality");
        if (coordLength)
        {
            assert(coords);
            unsigned* idx = &indexBuf_[0];
            unsigned* over = idx + dim_;
            const Axis* ax = &axes_[0];
            unsigned overflown = 0U;
            for (unsigned i=0; i<dim_; ++i)
            {
                over[i] = ax[i].overflowIndex(coords[i], idx + i);
                overflown |= (over[i] - 1U);
            }
            if (overflown)
                f(overflow_.value(over, dim_), w);
            else
                f(data_.value(idx, dim_), w);
        }
        else
            f(data_(), w);
         ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( Num2 &  weight,
Functor &  f 
) [inline]

Convenience "dispatch" method for histograms of corresponding dimensionality

Definition at line 1716 of file HistoND.h.

References f, and npstat::Private::h_badargs().

    {
        if (dim_) Private::h_badargs("dispatch");
        f(data_(), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
Num2 &  weight,
Functor &  f 
)

Definition at line 1765 of file HistoND.h.

References f, and npstat::Private::h_badargs().

    {
        if (dim_ != 1U) Private::h_badargs("dispatch");
        unsigned i0;
        const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
        if (ov0 == 1U)
            f(data_(i0), w);
        else
            f(overflow_(ov0), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
Num2 &  weight,
Functor &  f 
)

Definition at line 1837 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 2U) Private::h_badargs("dispatch");
        unsigned i0, i1;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        if (o0 == 1U && o1 == 1U)
            f(data_(i0, i1), w);
        else
            f(overflow_(o0, o1), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
Num2 &  weight,
Functor &  f 
)

Definition at line 1922 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 3U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        if (o0 == 1U && o1 == 1U && o2 == 1U)
            f(data_(i0, i1, i2), w);
        else
            f(overflow_(o0, o1, o2), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
Num2 &  weight,
Functor &  f 
)

Definition at line 2015 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 4U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
            f(data_(i0, i1, i2, i3), w);
        else
            f(overflow_(o0, o1, o2, o3), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
Num2 &  weight,
Functor &  f 
)

Definition at line 2117 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 5U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
            f(data_(i0, i1, i2, i3, i4), w);
        else
            f(overflow_(o0, o1, o2, o3, o4), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
Num2 &  weight,
Functor &  f 
)

Definition at line 2227 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 6U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4, i5;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U)
            f(data_(i0, i1, i2, i3, i4, i5), w);
        else
            f(overflow_(o0, o1, o2, o3, o4, o5), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
Num2 &  weight,
Functor &  f 
)

Definition at line 2350 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 7U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4, i5, i6;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
            f(data_(i0, i1, i2, i3, i4, i5, i6), w);
        else
            f(overflow_(o0, o1, o2, o3, o4, o5, o6), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
Num2 &  weight,
Functor &  f 
)

Definition at line 2479 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 8U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
            o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
            f(data_(i0, i1, i2, i3, i4, i5, i6, i7), w);
        else
            f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
Num2 &  weight,
Functor &  f 
)

Definition at line 2617 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 9U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
            f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8), w);
        else
            f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
Num2 &  weight,
Functor &  f 
)

Definition at line 2762 of file HistoND.h.

References create_public_lumi_plots::ax, f, and npstat::Private::h_badargs().

    {
        if (dim_ != 10U) Private::h_badargs("dispatch");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        const unsigned o9 = ax[9].overflowIndex(x9, &i9);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
            f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9), w);
        else
            f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9), w);
        ++modCount_;
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9 
) const

Definition at line 2825 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 10U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        const unsigned o9 = ax[9].overflowIndex(x9, &i9);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
            return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
        else
            return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8 
) const

Definition at line 2676 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 9U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
            return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
        else
            return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( const double *  coords,
unsigned  coordLength 
) const

The "examine" functions allow the user to access bin contents when bins are addressed by their coordinates. Use "binContents()" to access the data by bin numbers. Overflow bins will be accessed if the given coordinates fall outside the histogram range.

Definition at line 1595 of file HistoND.h.

References create_public_lumi_plots::ax, i, and customizeTrackingMonitorSeedNumber::idx.

    {
        if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::examine: "
            "incompatible input point dimensionality");
        if (coordLength)
        {
            assert(coords);
            unsigned* idx = &indexBuf_[0];
            unsigned* over = idx + dim_;
            const Axis* ax = &axes_[0];
            unsigned overflown = 0U;
            for (unsigned i=0; i<dim_; ++i)
            {
                over[i] = ax[i].overflowIndex(coords[i], idx + i);
                overflown |= (over[i] - 1U);
            }
            if (overflown)
                return overflow_.value(over, dim_);
            else
                return data_.value(idx, dim_);
        }
        else
            return data_();
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( ) const [inline]

Convenience "examine" method for histograms of corresponding dimensionality

Definition at line 1733 of file HistoND.h.

References npstat::Private::h_badargs().

    {
        if (dim_) Private::h_badargs("examine");
        return data_();
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0) const [inline]

Definition at line 1796 of file HistoND.h.

References npstat::Private::h_badargs().

    {
        if (dim_ != 1U) Private::h_badargs("examine");
        unsigned i0;
        const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
        if (ov0 == 1U)
            return data_(i0);
        else
            return overflow_(ov0);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1 
) const

Definition at line 1874 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 2U) Private::h_badargs("examine");
        unsigned i0, i1;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        if (o0 == 1U && o1 == 1U)
            return data_(i0, i1);
        else
            return overflow_(o0, o1);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2 
) const

Definition at line 1961 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 3U) Private::h_badargs("examine");
        unsigned i0, i1, i2;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        if (o0 == 1U && o1 == 1U && o2 == 1U)
            return data_(i0, i1, i2);
        else
            return overflow_(o0, o1, o2);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2058 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 4U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
            return data_(i0, i1, i2, i3);
        else
            return overflow_(o0, o1, o2, o3);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4 
) const

Definition at line 2162 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 5U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
            return data_(i0, i1, i2, i3, i4);
        else
            return overflow_(o0, o1, o2, o3, o4);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5 
) const

Definition at line 2278 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 6U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4, i5;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U)
            return data_(i0, i1, i2, i3, i4, i5);
        else
            return overflow_(o0, o1, o2, o3, o4, o5);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6 
) const

Definition at line 2403 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 7U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4, i5, i6;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
            return data_(i0, i1, i2, i3, i4, i5, i6);
        else
            return overflow_(o0, o1, o2, o3, o4, o5, o6);
    }
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7 
) const

Definition at line 2536 of file HistoND.h.

References create_public_lumi_plots::ax, and npstat::Private::h_badargs().

    {
        if (dim_ != 8U) Private::h_badargs("examine");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
            o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
            return data_(i0, i1, i2, i3, i4, i5, i6, i7);
        else
            return overflow_(o0, o1, o2, o3, o4, o5, o6, o7);
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
const Num2 &  weight 
)

Definition at line 1901 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 3U) Private::h_badargs("fill");
        unsigned i0, i1, i2;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        if (o0 == 1U && o1 == 1U && o2 == 1U)
            data_(i0, i1, i2) += w;
        else
        {
            overflow_(o0, o1, o2) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
const Num2 &  weight 
)

Definition at line 1992 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 4U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
            data_(i0, i1, i2, i3) += w;
        else
        {
            overflow_(o0, o1, o2, o3) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
const Num2 &  weight 
)

Definition at line 1748 of file HistoND.h.

References npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 1U) Private::h_badargs("fill");
        unsigned i0;
        const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
        if (ov0 == 1U)
            data_(i0) += w;
        else
        {
            overflow_(ov0) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1817 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 2U) Private::h_badargs("fill");
        unsigned i0, i1;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        if (o0 == 1U && o1 == 1U)
            data_(i0, i1) += w;
        else
        {
            overflow_(o0, o1) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
const Num2 &  weight 
)

Definition at line 2093 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 5U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
            data_(i0, i1, i2, i3, i4) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
const Num2 &  weight 
)

Definition at line 2200 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 6U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4, i5;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U)
            data_(i0, i1, i2, i3, i4, i5) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
const Num2 &  weight 
)

Definition at line 2322 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 7U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4, i5, i6;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
            data_(i0, i1, i2, i3, i4, i5, i6) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
const Num2 &  weight 
)

Definition at line 2449 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 8U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
            o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
            data_(i0, i1, i2, i3, i4, i5, i6, i7) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
const Num2 &  weight 
)

Definition at line 2586 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 9U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
            data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
const Num2 &  weight 
)

Definition at line 2729 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), and w().

    {
        if (dim_ != 10U) Private::h_badargs("fill");
        unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndex(x0, &i0);
        const unsigned o1 = ax[1].overflowIndex(x1, &i1);
        const unsigned o2 = ax[2].overflowIndex(x2, &i2);
        const unsigned o3 = ax[3].overflowIndex(x3, &i3);
        const unsigned o4 = ax[4].overflowIndex(x4, &i4);
        const unsigned o5 = ax[5].overflowIndex(x5, &i5);
        const unsigned o6 = ax[6].overflowIndex(x6, &i6);
        const unsigned o7 = ax[7].overflowIndex(x7, &i7);
        const unsigned o8 = ax[8].overflowIndex(x8, &i8);
        const unsigned o9 = ax[9].overflowIndex(x9, &i9);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
            data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) += w;
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( const double *  coords,
unsigned  coordLength,
const Num2 &  weight 
)

Fill function for histograms of arbitrary dimensionality. The length of the "coords" array should be equal to the histogram dimensionality. The Numeric type must have the "+=" operator defined with the Num2 type on the right side.

Definition at line 1533 of file HistoND.h.

References create_public_lumi_plots::ax, i, customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::fill: "
            "incompatible input point dimensionality");
        if (coordLength)
        {
            assert(coords);
            unsigned* idx = &indexBuf_[0];
            unsigned* over = idx + dim_;
            const Axis* ax = &axes_[0];
            unsigned overflown = 0U;
            for (unsigned i=0; i<dim_; ++i)
            {
                over[i] = ax[i].overflowIndex(coords[i], idx + i);
                overflown |= (over[i] - 1U);
            }
            if (overflown)
            {
                overflow_.value(over, dim_) += w;
                ++overCount_;
            }
            else
                data_.value(idx, dim_) += w;
        }
        else
            data_() += w;
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( const Num2 &  weight) [inline]

Convenience "fill" method for histograms of corresponding dimensionality

Definition at line 1707 of file HistoND.h.

References npstat::Private::h_badargs(), and w().

    {
        if (dim_) Private::h_badargs("fill");
        data_() += w;
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
const Num2 &  weight 
)

Definition at line 2506 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 8U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
        const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
        const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
            o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
const Num2 &  weight 
)

Definition at line 2035 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 4U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( const double *  coords,
unsigned  coordLength,
const Num2 &  weight 
)

The "fillC" functions are similar to the "fill" methods but they preserve the centroid of the deposit. Note that, if the histogram dimensionality is high, "fillC" works significantly slower than the corresponding "fill". Also note that there must be at least 2 bins in each dimension in order for this function to work.

A word of caution. What is added to the bins is the input weight multiplied by another weight calculated using the bin proximity. If the input weight is just 1 (which happens quite often in practice), the product of the weights is normally less than 1. If the histogram template parameter is one of the integer types, operator += will convert this product to 0 before adding it to the bin! Therefore, it is best to use "fillC" only with floating point template parameters (float, double, etc).

Currently, the "fillC" methods work sensibly only in the case the binning is uniform (i.e., the second template parameter is HistoAxis rather than, let say, NUHistoAxis). They typically will not even compile if the binning is not uniform.

Definition at line 1673 of file HistoND.h.

References create_public_lumi_plots::ax, i, customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::fillC: "
            "incompatible input point dimensionality");
        if (coordLength)
        {
            assert(coords);
            double* wg = &weightBuf_[0];
            unsigned* idx = &indexBuf_[0];
            unsigned* over = idx + dim_;
            const Axis* ax = &axes_[0];
            unsigned overflown = 0U;
            for (unsigned i=0; i<dim_; ++i)
            {
                over[i] = ax[i].overflowIndexWeighted(coords[i], idx+i, wg+i);
                overflown |= (over[i] - 1U);
            }
            if (overflown)
            {
                overflow_.value(over, dim_) += w;
                ++overCount_;
            }
            else
                fillPreservingCentroid(w);
        }
        else
            data_() += w;
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( const Num2 &  weight) [inline]

Convenience "fillC" method for histograms of corresponding dimensionality

Definition at line 1725 of file HistoND.h.

References npstat::Private::h_badargs(), and w().

    {
        if (dim_) Private::h_badargs("fillC");
        data_() += w;
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
const Num2 &  weight 
)

Definition at line 1779 of file HistoND.h.

References npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 1U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const unsigned ov0 = axes_[0].overflowIndexWeighted(x0, idx, wg);
        if (ov0 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(ov0) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1854 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 2U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        if (o0 == 1U && o1 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
const Num2 &  weight 
)

Definition at line 1940 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 3U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        if (o0 == 1U && o1 == 1U && o2 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
const Num2 &  weight 
)

Definition at line 2138 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 5U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
const Num2 &  weight 
)

Definition at line 2251 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 6U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
const Num2 &  weight 
)

Definition at line 2375 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 7U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
        const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
        if (o0 == 1U && o1 == 1U && o2 == 1U &&
            o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
const Num2 &  weight 
)

Definition at line 2645 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 9U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
        const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
        const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
        const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
const Num2 &  weight 
)

Definition at line 2792 of file HistoND.h.

References create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w().

    {
        if (dim_ != 10U) Private::h_badargs("fillC");
        double* wg = &weightBuf_[0];
        unsigned* idx = &indexBuf_[0];
        const Axis* ax = &axes_[0];
        const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
        const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
        const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
        const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
        const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
        const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
        const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
        const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
        const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
        const unsigned o9 = ax[9].overflowIndexWeighted(x9, idx+9, wg+9);
        if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
            o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
            fillPreservingCentroid(w);
        else
        {
            overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
            ++overCount_;
        }
        ++fillCount_; ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillPreservingCentroid ( const Num2 &  weight) [private]

Definition at line 1644 of file HistoND.h.

References i, w(), and create_public_pileup_plots::weights.

    {
        const double* weights = &weightBuf_[0];
        const unsigned* cell = &indexBuf_[0];
        const unsigned long* strides = data_.strides();
        const unsigned long maxcycle = 1UL << dim_;
        for (unsigned long icycle=0; icycle<maxcycle; ++icycle)
        {
            double w = 1.0;
            unsigned long icell = 0UL;
            for (unsigned i=0; i<dim_; ++i)
            {
                if (icycle & (1UL << i))
                {
                    w *= (1.0 - weights[i]);
                    icell += strides[i]*(cell[i] + 1U);
                }
                else
                {
                    w *= weights[i];
                    icell += strides[i]*cell[i];
                }
            }
            data_.linearValue(icell) += (value * w);
        }
    }
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::getModCount ( ) const [inline]

This method returns the number of modifications performed on the histogram since its creation. This number is always increasing during the lifetime of the histogram object. Its main property is as follows: if the method "getModCount" returns the same number twice, there should be no changes in the histogram object (so that a drawing program does not need to redraw the histogram image).

This number is pure transient, it is not serialized and does not participate in histogram comparisons for equality.

Definition at line 797 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::modCount_.

{return modCount_;}
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::incrModCount ( ) [inline]

Indicate that the histogram contents have changed. Should be used by any code which directly modifies histogram bins (after using const_cast on the relevant reference).

Definition at line 804 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::modCount_.

{++modCount_;}
template<typename Numeric , class Axis >
double npstat::HistoND< Numeric, Axis >::integral ( ) const

Integral of the histogram

Definition at line 1380 of file HistoND.h.

References data, and i.

    {
        typedef typename PreciseType<Numeric>::type Precise;

        if (dim_ == 0U)
            return 0.0;
        if (isUniformlyBinned())
        {
            Precise sum = data_.template sum<Precise>();
            return static_cast<double>(sum)*binVolume();
        }
        else
        {
            Precise sum = Precise();
            const Numeric* data = data_.data();
            const unsigned long len = data_.length();
            for (unsigned long i=0; i<len; ++i)
                sum += data[i]*binVolume(i);
            return static_cast<double>(sum);
        }
    }
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::isSameData ( const HistoND< Numeric, Axis > &  r) const [inline]

Check data for equality (both bin contents and overflows). Do not compare axes, labels, fill counts, etc.

Definition at line 1477 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::dim_, and npstat::HistoND< Numeric, Axis >::overflow_.

    {
        return dim_ == r.dim_ &&
               overflow_ == r.overflow_ &&
               data_ == r.data_;
    }
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::isUniformlyBinned ( ) const

This method returns "true" if the method isUniform() of each histogram axis returns "true"

Definition at line 1371 of file HistoND.h.

References i.

Referenced by npstat::Private::iHND_checkArgs(), npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::setInterpolationDegree(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor().

    {
        for (unsigned i=0; i<dim_; ++i)
            if (!axes_[i].isUniform())
                return false;
        return true;
    }
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nBins ( ) const [inline]
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsInRange ( ) const [inline]

Total number of fills which fell inside the histogram range

Definition at line 158 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::fillCount_, and npstat::HistoND< Numeric, Axis >::overCount_.

            {return fillCount_ - overCount_;}
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsOver ( ) const [inline]

Total number of fills which fell outside the histogram range

Definition at line 162 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::overCount_.

{return overCount_;}
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsTotal ( ) const [inline]

Total number of fills performed

Definition at line 155 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::fillCount_.

{return fillCount_;}
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator!= ( const HistoND< Numeric, Axis > &  r) const [inline]

Logical negation of operator==

Definition at line 1498 of file HistoND.h.

References alignCSCRings::r.

    {
        return !(*this == r);
    }
template<typename Numeric , class Axis >
template<typename Num2 >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator*= ( const Num2 &  r) [inline]

In-place multiplication by a scalar (scaling)

Definition at line 3222 of file HistoND.h.

References alignCSCRings::r.

    {
        data_ *= r;
        overflow_ *= r;
        ++modCount_;
        return *this;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator+= ( const HistoND< Num2, Axis > &  r) [inline]

Fill from another histogram. Compatibility of axis limits will not be checked, but compatibility of array shapes will be.

Definition at line 3188 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::fillCount_, npstat::HistoND< Numeric, Axis >::overCount_, and npstat::HistoND< Numeric, Axis >::overflow_.

    {
        data_ += r.data_;
        overflow_ += r.overflow_;
        fillCount_ += r.fillCount_;
        overCount_ += r.overCount_;
        ++modCount_;
        return *this;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator-= ( const HistoND< Num2, Axis > &  r) [inline]

Subtract contents of another histogram. Equivalent to multiplying the contents of the other histogram by -1 and then adding them. One of the consequences of this approach is that, for histograms "a" and "b", the sequence of operations "a += b; a -= b;" does not leave histogram "a" unchanged: although its bin contents will remain the same (up to round-off errors), the fill counts will increase by twice the fill counts of "b".

Definition at line 3201 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::fillCount_, npstat::HistoND< Numeric, Axis >::overCount_, and npstat::HistoND< Numeric, Axis >::overflow_.

    {
        data_ -= r.data_;
        overflow_ -= r.overflow_;

        // Subtraction does not make much sense for fill counts.
        // We will assume that what we want should be equivalent
        // to the in-place multiplication of the other histogram
        // by -1 and then adding.
        //
        fillCount_ += r.fillCount_;
        overCount_ += r.overCount_;

        ++modCount_;
        return *this;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator/= ( const Num2 &  r) [inline]

In-place division by a scalar

Definition at line 3233 of file HistoND.h.

References alignCSCRings::r.

    {
        data_ /= r;
        overflow_ /= r;
        ++modCount_;
        return *this;
    }
template<typename Numeric , class Axis >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator= ( const HistoND< Numeric, Axis > &  r)
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator== ( const HistoND< Numeric, Axis > &  r) const [inline]
template<typename Numeric, class Axis = HistoAxis>
const ArrayND<Numeric>& npstat::HistoND< Numeric, Axis >::overflows ( ) const [inline]

Retrive a reference to the array of overflows

Definition at line 142 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::overflow_.

{return overflow_;}
template<typename Numeric , class Axis >
HistoND< Numeric, Axis > * npstat::HistoND< Numeric, Axis >::read ( const gs::ClassId &  id,
std::istream &  in 
) [static]

Definition at line 3481 of file HistoND.h.

References cond::rpcobimon::current, data, npstat::ArrayND< Numeric, StackLen, StackDim >::restore(), query::result, AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

    {
        static const gs::ClassId current(
            gs::ClassId::makeId<HistoND<Numeric,Axis> >());
        current.ensureSameId(id);

        std::string title;
        gs::read_pod(in, &title);

        std::string accumulatedDataLabel;
        gs::read_pod(in, &accumulatedDataLabel);

        unsigned long fillCount = 0, overCount = 0;
        gs::read_pod(in, &fillCount);
        gs::read_pod(in, &overCount);
        if (in.fail()) throw gs::IOReadFailure(
            "In npstat::HistoND::read: input stream failure");

        std::vector<Axis> axes;
        gs::read_heap_obj_vector_as_placed(in, &axes);
        gs::ClassId ida(in, 1);
        ArrayND<Numeric> data, over;
        ArrayND<Numeric>::restore(ida, in, &data);
        ArrayND<Numeric>::restore(ida, in, &over);
        CPP11_auto_ptr<HistoND<Numeric,Axis> > result(
            new HistoND<Numeric,Axis>(axes, title.c_str(),
                                      accumulatedDataLabel.c_str()));
        result->data_ = data;
        result->overflow_ = over;
        result->fillCount_ = fillCount;
        result->overCount_ = overCount;
        return result.release();
    }
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::recalculateNFillsFromData ( ) [inline]

This member function instructs the histogram to recalculate the number of fills from data. It may be useful to call this function after "setBinContents" in case the contents are filled from another histogram.

Definition at line 3418 of file HistoND.h.

    {
        const long double nOver = overflow_.template sum<long double>();
        const long double nData = data_.template sum<long double>();
        overCount_ = static_cast<unsigned long>(nOver);
        fillCount_ = static_cast<unsigned long>(nData + nOver);
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::scaleBinContents ( const Num2 *  data,
unsigned long  dataLength 
)

Multiplication by a value which is different for every bin

Definition at line 3370 of file HistoND.h.

References i.

    {
        if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::scaleBinContents: incompatible data length");
        assert(data);
        Numeric* dat = const_cast<Numeric*>(data_.data());
        for (unsigned long i=0; i<dataLength; ++i)
            dat[i] *= data[i];
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::scaleOverflows ( const Num2 *  data,
unsigned long  dataLength 
)

Definition at line 3384 of file HistoND.h.

References i.

    {
        if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
            "In npstat::HistoND::scaleOverflows: incompatible data length");
        assert(data);
        Numeric* dat = const_cast<Numeric*>(overflow_.data());
        for (unsigned long i=0; i<dataLength; ++i)
            dat[i] *= data[i];
        ++modCount_;
    }
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setAccumulatedDataLabel ( const char *  newlabel) [inline]

Modify the label associated with accumulated data

Definition at line 175 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::accumulatedDataLabel_, and npstat::HistoND< Numeric, Axis >::modCount_.

            {accumulatedDataLabel_ = newlabel ? newlabel : ""; ++modCount_;}
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setAxisLabel ( const unsigned  axisNum,
const char *  newlabel 
) [inline]

Modify the label for the histogram axis with the given number

Definition at line 179 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::axes_, and npstat::HistoND< Numeric, Axis >::modCount_.

            {axes_.at(axisNum).setLabel(newlabel); ++modCount_;}
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
) [inline]

Definition at line 2992 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4, i5) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const Num2 &  v) [inline]

Definition at line 2902 of file HistoND.h.

References findQualityFiles::v.

    {
        data_() = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const unsigned *  index,
unsigned  indexLen,
const Num2 &  v 
) [inline]

Method to set contents of individual bins (no bounds checking)

Definition at line 2882 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.value(index, indexLen) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
const Num2 &  v 
) [inline]

Definition at line 2918 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
) [inline]

Definition at line 2956 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
) [inline]

Definition at line 2979 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
) [inline]

Definition at line 2967 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
) [inline]

Definition at line 3006 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4, i5, i6) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
) [inline]

Definition at line 3021 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4, i5, i6, i7) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
) [inline]

Definition at line 3037 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
const Num2 &  v 
) [inline]

Definition at line 2936 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
) [inline]

Definition at line 3054 of file HistoND.h.

References findQualityFiles::v.

    {
        data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
) [inline]

Definition at line 3137 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4, i5, i6, i7) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const Num2 &  v) [inline]

Definition at line 2910 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at() = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
) [inline]

Definition at line 3072 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
) [inline]

Definition at line 3170 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
) [inline]

Definition at line 3122 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4, i5, i6) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
) [inline]

Definition at line 3153 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
) [inline]

Definition at line 3083 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
const Num2 &  v 
) [inline]

Definition at line 2927 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
const Num2 &  v 
) [inline]

Definition at line 2946 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const unsigned *  index,
unsigned  indexLen,
const Num2 &  v 
) [inline]

Method to set contents of individual bins with bounds checking

Definition at line 2892 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.valueAt(index, indexLen) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
) [inline]

Definition at line 3095 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
) [inline]

Definition at line 3108 of file HistoND.h.

References findQualityFiles::v.

    {
        data_.at(i0, i1, i2, i3, i4, i5) = v;
        ++modCount_;
    }
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinContents ( const Num2 *  data,
unsigned long  dataLength,
bool  clearOverflows = true 
) [inline]

This method sets all bin contents in one fell swoop

Definition at line 3398 of file HistoND.h.

    {
        data_.setData(data, dataLength);
        if (clearOverflowsNow)
            clearOverflows();
        ++modCount_;
    }
template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinsToConst ( const Num2 &  value) [inline]

Setting bin contents to some constant value. The Num2 type should allow automatic conversion to Numeric.

Definition at line 675 of file HistoND.h.

References npstat::ArrayND< Numeric, StackLen, StackDim >::constFill(), npstat::HistoND< Numeric, Axis >::data_, and npstat::HistoND< Numeric, Axis >::modCount_.

            {data_.constFill(value); ++modCount_;}
template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBin ( const unsigned long  index,
const Num2 &  v 
) [inline]
template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBinAt ( const unsigned long  index,
const Num2 &  v 
) [inline]
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setNFillsOver ( const unsigned long  i) [inline]
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setNFillsTotal ( const unsigned long  i) [inline]

This method is intended for data format conversion programs only, not for typical histogramming use

Definition at line 699 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::fillCount_, i, and npstat::HistoND< Numeric, Axis >::modCount_.

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setOverflows ( const Num2 *  data,
unsigned long  dataLength 
) [inline]

This method sets all overflows in one fell swoop

Definition at line 3410 of file HistoND.h.

    {
        overflow_.setData(data, dataLength);
        ++modCount_;
    }
template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setOverflowsToConst ( const Num2 &  value) [inline]

Setting overflows to some constant value. The Num2 type should allow automatic conversion to Numeric.

Definition at line 683 of file HistoND.h.

References npstat::ArrayND< Numeric, StackLen, StackDim >::constFill(), npstat::HistoND< Numeric, Axis >::modCount_, and npstat::HistoND< Numeric, Axis >::overflow_.

            {overflow_.constFill(value); ++modCount_;}
template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setTitle ( const char *  newtitle) [inline]

Modify the histogram title

Definition at line 171 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::modCount_, and npstat::HistoND< Numeric, Axis >::title_.

            {title_ = newtitle ? newtitle : ""; ++modCount_;}
template<typename Numeric, class Axis = HistoAxis>
const std::string& npstat::HistoND< Numeric, Axis >::title ( ) const [inline]

Histogram title

Definition at line 132 of file HistoND.h.

References npstat::HistoND< Numeric, Axis >::title_.

{return title_;}
template<typename Numeric , class Axis >
HistoND< Numeric, Axis > npstat::HistoND< Numeric, Axis >::transpose ( unsigned  axisNum1,
unsigned  axisNum2 
) const

Transpose the histogram axes and bin contents

Definition at line 3299 of file HistoND.h.

    {
        if (axisNum1 >= dim_ || axisNum2 >= dim_)
            throw npstat::NpstatOutOfRange("In npstat::HistoND::transpose: "
                                    "axis number is out of range");
        if (axisNum1 == axisNum2)
            // Just make a copy
            return *this;
        else
            return HistoND(*this, axisNum1, axisNum2);
    }
template<typename Numeric, class Axis = HistoAxis>
static unsigned npstat::HistoND< Numeric, Axis >::version ( ) [inline, static]

Definition at line 813 of file HistoND.h.

{return 1;}
template<typename Numeric , class Axis >
double npstat::HistoND< Numeric, Axis >::volume ( void  ) const

Volume of the histogram bounding box (this direct call is faster than calling boundingBox().volume() ). This function returns 1.0 for 0-dim histogram, axis interval length for 1-d histogram, etc.

Definition at line 1519 of file HistoND.h.

References create_public_lumi_plots::ax, i, max(), min, and findQualityFiles::v.

    {
        double v = 1.0;
        if (dim_)
        {
            const Axis* ax = &axes_[0];
            for (unsigned i=0; i<dim_; ++i)
                v *= (ax[i].max() - ax[i].min());
        }
        return v;
    }
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::write ( std::ostream &  of) const

Definition at line 3466 of file HistoND.h.

Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::write().

    {
        gs::write_pod(of, title_);
        gs::write_pod(of, accumulatedDataLabel_);
        gs::write_pod(of, fillCount_);
        gs::write_pod(of, overCount_);

        return !of.fail() &&
            gs::write_obj_vector(of, axes_) && 
            data_.classId().write(of) &&
            data_.write(of) &&
            overflow_.write(of);
    }

Friends And Related Function Documentation

template<typename Numeric, class Axis = HistoAxis>
friend class HistoND [friend]

Definition at line 45 of file HistoND.h.


Member Data Documentation

template<typename Numeric, class Axis = HistoAxis>
std::string npstat::HistoND< Numeric, Axis >::accumulatedDataLabel_ [private]
template<typename Numeric, class Axis = HistoAxis>
std::vector<Axis> npstat::HistoND< Numeric, Axis >::axes_ [private]
template<typename Numeric, class Axis = HistoAxis>
ArrayND<Numeric> npstat::HistoND< Numeric, Axis >::data_ [private]
template<typename Numeric, class Axis = HistoAxis>
unsigned npstat::HistoND< Numeric, Axis >::dim_ [private]
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::fillCount_ [private]
template<typename Numeric, class Axis = HistoAxis>
std::vector<unsigned> npstat::HistoND< Numeric, Axis >::indexBuf_ [mutable, private]

Definition at line 836 of file HistoND.h.

Referenced by npstat::HistoND< Numeric, Axis >::operator=().

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::modCount_ [private]
template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::overCount_ [private]
template<typename Numeric, class Axis = HistoAxis>
ArrayND<Numeric> npstat::HistoND< Numeric, Axis >::overflow_ [private]
template<typename Numeric, class Axis = HistoAxis>
std::string npstat::HistoND< Numeric, Axis >::title_ [private]
template<typename Numeric, class Axis = HistoAxis>
std::vector<double> npstat::HistoND< Numeric, Axis >::weightBuf_ [mutable, private]

Definition at line 835 of file HistoND.h.

Referenced by npstat::HistoND< Numeric, Axis >::operator=().