CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
npstat::HistoND< Numeric, Axis > Class Template Reference

#include <HistoAxis.h>

Public Types

typedef Axis axis_type
 
enum  RebinType { SAMPLE = 0, SUM, AVERAGE }
 
typedef Numeric value_type
 

Public Member Functions

template<typename Acc >
void accumulateBinsInBox (const BoxND< double > &box, Acc *acc, bool calculateAverage=false) const
 
const std::string & accumulatedDataLabel () const
 
template<typename Num2 >
void addToBinContents (const Num2 &weight)
 
template<typename Num2 >
void addToBinContents (const Num2 *data, unsigned long dataLength)
 
template<typename Num2 >
void addToOverflows (const Num2 &weight)
 
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
 
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
 
gs::ClassId classId () const
 
void clear ()
 
void clearBinContents ()
 
void clearOverflows ()
 
const Numeric & closestBin () const
 
const Numeric & closestBin (const double *coords, unsigned coordLength) 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
 
unsigned dim () const
 
template<typename Num2 , class Functor >
void dispatch (const double *coords, unsigned coordLength, 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)
 
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, 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, 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, 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, Num2 &weight, Functor &f)
 
template<typename Num2 , class Functor >
void dispatch (double x0, Num2 &weight, Functor &f)
 
template<typename Num2 , class Functor >
void dispatch (Num2 &weight, Functor &f)
 
const Numeric & examine () const
 
const Numeric & examine (const double *coords, unsigned coordLength) 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
 
template<typename Num2 >
void fill (const double *coords, unsigned coordLength, const Num2 &weight)
 
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 >
void fillC (const double *coords, unsigned coordLength, const Num2 &weight)
 
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)
 
unsigned long getModCount () const
 
 HistoND (const ArrayShape &shape, const BoxND< double > &boundingBox, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const Axis &xAxis, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
 HistoND (const HistoND &)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const Axis &newAxis, unsigned newAxisNumber, const char *title=nullptr)
 
template<typename Num2 , class Functor >
 HistoND (const HistoND< Num2, Axis > &h, const Functor &f, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const unsigned *indices, unsigned nIndices, const char *title=nullptr)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, RebinType rType, const unsigned *newBinCounts, unsigned lenNewBinCounts, const double *shifts=nullptr, const char *title=nullptr)
 
 HistoND (const std::vector< Axis > &axes, const char *title=nullptr, const char *accumulatedDataLabel=nullptr)
 
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 >
HistoND< Numeric, Axis > & operator*= (const Num2 &r)
 
template<typename Num2 >
HistoNDoperator+= (const HistoND< Num2, Axis > &r)
 
template<typename Num2 >
HistoND< Numeric, Axis > & operator+= (const HistoND< Num2, Axis > &r)
 
template<typename Num2 >
HistoNDoperator-= (const HistoND< Num2, Axis > &r)
 
template<typename Num2 >
HistoND< Numeric, Axis > & operator-= (const HistoND< Num2, Axis > &r)
 
template<typename Num2 >
HistoNDoperator/= (const Num2 &r)
 
template<typename Num2 >
HistoND< Numeric, Axis > & operator/= (const Num2 &r)
 
HistoNDoperator= (const HistoND &)
 
bool operator== (const HistoND &) const
 
const ArrayND< Numeric > & overflows () const
 
void recalculateNFillsFromData ()
 
template<typename Num2 >
void scaleBinContents (const Num2 *data, unsigned long dataLength)
 
template<typename Num2 >
void scaleOverflows (const Num2 *data, unsigned long dataLength)
 
void setAccumulatedDataLabel (const char *newlabel)
 
void setAxisLabel (const unsigned axisNum, const char *newlabel)
 
template<typename Num2 >
void setBin (const Num2 &v)
 
template<typename Num2 >
void setBin (const unsigned *index, unsigned indexLen, 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 setBinAt (const Num2 &v)
 
template<typename Num2 >
void setBinAt (const unsigned *index, unsigned indexLen, 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 setBinContents (const Num2 *data, unsigned long dataLength, bool clearOverflows=true)
 
template<typename Num2 >
void setBinsToConst (const Num2 &value)
 
template<typename Num2 >
void setLinearBin (const unsigned long index, const Num2 &v)
 
template<typename Num2 >
void setLinearBinAt (const unsigned long index, const Num2 &v)
 
void setNFillsOver (const unsigned long i)
 
void setNFillsTotal (const unsigned long i)
 
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
 
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, long double *wsum) const
 
template<typename Num2 >
void fillPreservingCentroid (const Num2 &weight)
 
 HistoND ()=delete
 
 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

template<typename Num2 , class Axis2 >
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 23 of file HistoAxis.h.

Member Typedef Documentation

◆ axis_type

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

Definition at line 49 of file HistoND.h.

◆ value_type

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

Definition at line 48 of file HistoND.h.

Member Enumeration Documentation

◆ RebinType

template<typename Numeric, class Axis = HistoAxis>
enum npstat::HistoND::RebinType
Enumerator
SAMPLE 
SUM 
AVERAGE 

Definition at line 51 of file HistoND.h.

51 { SAMPLE = 0, SUM, AVERAGE };

Constructor & Destructor Documentation

◆ HistoND() [1/14]

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

Main constructor for arbitrary-dimensional histograms

Definition at line 1268 of file HistoND.h.

1269  : title_(title ? title : ""),
1271  data_(Private::makeHistoShape(axesIn)),
1272  overflow_(ArrayShape(axesIn.size(), 3U)),
1273  axes_(axesIn),
1274  weightBuf_(axesIn.size()),
1275  indexBuf_(2U * axesIn.size()),
1276  modCount_(0UL),
1277  dim_(axesIn.size()) {
1278  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1280  "In npstat::HistoND constructor: requested histogram "
1281  "dimensionality is not supported (too large)");
1282  clear();
1283  }

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

◆ HistoND() [2/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const char *  title = nullptr,
const char *  accumulatedDataLabel = nullptr 
)
explicit

Convenience constructor for 1-d histograms

Definition at line 1286 of file HistoND.h.

1287  : title_(title ? title : ""),
1290  overflow_(ArrayShape(1U, 3U)),
1291  weightBuf_(1U),
1292  indexBuf_(2U * 1U),
1293  modCount_(0UL),
1294  dim_(1U) {
1295  axes_.reserve(dim_);
1296  axes_.push_back(xAxis);
1297  clear();
1298  }

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

◆ HistoND() [3/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const char *  title = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

Convenience constructor for 2-d histograms

Definition at line 1301 of file HistoND.h.

1302  : title_(title ? title : ""),
1305  overflow_(ArrayShape(2U, 3U)),
1306  weightBuf_(2U),
1307  indexBuf_(2U * 2U),
1308  modCount_(0UL),
1309  dim_(2U) {
1310  axes_.reserve(dim_);
1311  axes_.push_back(xAxis);
1312  axes_.push_back(yAxis);
1313  clear();
1314  }

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

◆ HistoND() [4/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const char *  title = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

Convenience constructor for 3-d histograms

Definition at line 1317 of file HistoND.h.

1319  : title_(title ? title : ""),
1322  overflow_(ArrayShape(3U, 3U)),
1323  weightBuf_(3U),
1324  indexBuf_(2U * 3U),
1325  modCount_(0UL),
1326  dim_(3U) {
1327  axes_.reserve(dim_);
1328  axes_.push_back(xAxis);
1329  axes_.push_back(yAxis);
1330  axes_.push_back(zAxis);
1331  clear();
1332  }

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

◆ HistoND() [5/14]

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 = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

Convenience constructor for 4-d histograms

Definition at line 1335 of file HistoND.h.

1337  : title_(title ? title : ""),
1340  overflow_(ArrayShape(4U, 3U)),
1341  weightBuf_(4U),
1342  indexBuf_(2U * 4U),
1343  modCount_(0UL),
1344  dim_(4U) {
1345  axes_.reserve(dim_);
1346  axes_.push_back(xAxis);
1347  axes_.push_back(yAxis);
1348  axes_.push_back(zAxis);
1349  axes_.push_back(tAxis);
1350  clear();
1351  }

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

◆ HistoND() [6/14]

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 = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

Convenience constructor for 5-d histograms

Definition at line 1354 of file HistoND.h.

1361  : title_(title ? title : ""),
1363  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
1364  overflow_(ArrayShape(5U, 3U)),
1365  weightBuf_(5U),
1366  indexBuf_(2U * 5U),
1367  modCount_(0UL),
1368  dim_(5U) {
1369  axes_.reserve(dim_);
1370  axes_.push_back(xAxis);
1371  axes_.push_back(yAxis);
1372  axes_.push_back(zAxis);
1373  axes_.push_back(tAxis);
1374  axes_.push_back(vAxis);
1375  clear();
1376  }

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

◆ HistoND() [7/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const ArrayShape shape,
const BoxND< double > &  boundingBox,
const char *  title = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

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 1379 of file HistoND.h.

1383  : title_(title ? title : ""),
1385  data_(shape),
1386  overflow_(ArrayShape(shape.size(), 3U)),
1387  weightBuf_(shape.size()),
1388  indexBuf_(2U * shape.size()),
1389  modCount_(0UL),
1390  dim_(shape.size()) {
1391  if (boundingBox.size() != dim_)
1393  "In npstat::HistoND constructor: "
1394  "incompatible bounding box dimensionality");
1395  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1397  "In npstat::HistoND constructor: requested histogram "
1398  "dimensionality is not supported (too large)");
1399  axes_.reserve(dim_);
1400  for (unsigned i = 0; i < dim_; ++i)
1401  axes_.push_back(Axis(shape[i], boundingBox[i].min(), boundingBox[i].max()));
1402  clear();
1403  }

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

◆ HistoND() [8/14]

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 = nullptr,
const char *  accumulatedDataLabel = nullptr 
)

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 1407 of file HistoND.h.

1408  : title_(title ? title : ""),
1410  data_(r.data_, f),
1411  overflow_(r.overflow_, f),
1412  axes_(r.axes_),
1413  weightBuf_(r.dim_),
1414  indexBuf_(2U * r.dim_),
1415  fillCount_(r.fillCount_),
1416  overCount_(r.overCount_),
1417  modCount_(0UL),
1418  dim_(r.dim_) {}

◆ HistoND() [9/14]

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 = nullptr 
)

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 1422 of file HistoND.h.

1426  : title_(title ? title : ""),
1427  accumulatedDataLabel_(h.accumulatedDataLabel_),
1428  data_(Private::shapeOfASlice(h.axes_, indices, nIndices)),
1430  axes_(Private::axesOfASlice(h.axes_, indices, nIndices)),
1431  weightBuf_(data_.rank()),
1432  indexBuf_(2U * data_.rank()),
1433  modCount_(0UL),
1434  dim_(data_.rank()) {
1435  clear();
1436  }

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

◆ HistoND() [10/14]

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 = nullptr 
)

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 1440 of file HistoND.h.

1444  : title_(title ? title : ""),
1445  accumulatedDataLabel_(h.accumulatedDataLabel_),
1446  data_(Private::shapeWithExtraAxis(h.axes_, newAxis, newAxisNumber)),
1447  overflow_(data_.rank(), 3U),
1448  axes_(Private::addAxis(h.axes_, newAxis, newAxisNumber)),
1449  weightBuf_(data_.rank()),
1450  indexBuf_(2U * data_.rank()),
1451  modCount_(0UL),
1452  dim_(data_.rank()) {
1453  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1455  "In npstat::HistoND constructor: requested histogram "
1456  "dimensionality is not supported (too large)");
1457  clear();
1458  }

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

◆ HistoND() [11/14]

template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
RebinType  rType,
const unsigned *  newBinCounts,
unsigned  lenNewBinCounts,
const double *  shifts = nullptr,
const char *  title = nullptr 
)

Create a rebinned histogram with the same axis coverage. Note that not all such operations will be meaningful if the bin contents do not belong to one of the floating point types. The "newBinCounts" argument specifies the new number of bins along each axis. The length of this array (provided by the "lenNewBinCounts" argument) should be equal to the input histogram dimensionality.

The "shifts" argument can be meaningfully specified with the "rType" argument set to "SAMPLE". These shifts will be added to the bin centers of the created histogram when the bin contents are looked up in the input histogram. This can be useful in case the bin center lookup without shifts would fall exactly on the bin edge. Naturally, the length of the "shifts" array should be equal to the input histogram dimensionality.

Definition at line 1462 of file HistoND.h.

1468  : title_(title ? title : h.title_.c_str()),
1469  accumulatedDataLabel_(h.accumulatedDataLabel_),
1470  data_(newBinCounts, lenNewBinCounts),
1471  overflow_(h.overflow_),
1472  axes_(Private::rebinAxes(h.axes_, newBinCounts, lenNewBinCounts)),
1473  weightBuf_(h.dim_),
1474  indexBuf_(2U * h.dim_),
1475  fillCount_(h.fillCount_),
1476  overCount_(h.overCount_),
1477  modCount_(0UL),
1478  dim_(h.dim_) {
1479  const unsigned long newBins = data_.length();
1480  const Axis* ax = &axes_[0];
1481  unsigned* ubuf = &indexBuf_[0];
1482 
1483  // Fill out the bins of the new histogram
1484  if (rType == SAMPLE) {
1485  double* buf = &weightBuf_[0];
1486  for (unsigned long ibin = 0; ibin < newBins; ++ibin) {
1487  data_.convertLinearIndex(ibin, ubuf, dim_);
1488  if (shifts)
1489  for (unsigned i = 0; i < dim_; ++i)
1490  buf[i] = ax[i].binCenter(ubuf[i]) + shifts[i];
1491  else
1492  for (unsigned i = 0; i < dim_; ++i)
1493  buf[i] = ax[i].binCenter(ubuf[i]);
1494  data_.linearValue(ibin) = h.examine(buf, dim_);
1495  }
1496  } else {
1497  const Numeric zero = Numeric();
1498  BoxND<double> binLimits(dim_);
1499  for (unsigned long ibin = 0; ibin < newBins; ++ibin) {
1500  data_.convertLinearIndex(ibin, ubuf, dim_);
1501  for (unsigned i = 0; i < dim_; ++i)
1502  binLimits[i] = ax[i].binInterval(ubuf[i]);
1503  Numeric& thisBin(data_.linearValue(ibin));
1504  thisBin = zero;
1505  h.accumulateBinsInBox(binLimits, &thisBin, rType == AVERAGE);
1506  }
1507  }
1508  }

References npstat::HistoND< Numeric, Axis >::AVERAGE, npstat::HistoND< Numeric, Axis >::axes_, npstat::HistoND< Numeric, Axis >::binCenter(), visDQMUpload::buf, npstat::ArrayND< Numeric, StackLen, StackDim >::convertLinearIndex(), npstat::HistoND< Numeric, Axis >::data_, npstat::HistoND< Numeric, Axis >::dim_, mps_fire::i, npstat::HistoND< Numeric, Axis >::indexBuf_, npstat::ArrayND< Numeric, StackLen, StackDim >::length(), npstat::ArrayND< Numeric, StackLen, StackDim >::linearValue(), npstat::HistoND< Numeric, Axis >::SAMPLE, npstat::HistoND< Numeric, Axis >::weightBuf_, and SiPixelPI::zero.

◆ HistoND() [12/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r)

Copy constructor

Definition at line 3312 of file HistoND.h.

3313  : title_(r.title_),
3314  accumulatedDataLabel_(r.accumulatedDataLabel_),
3315  data_(r.data_),
3316  overflow_(r.overflow_),
3317  axes_(r.axes_),
3318  weightBuf_(r.weightBuf_),
3319  indexBuf_(r.indexBuf_),
3320  fillCount_(r.fillCount_),
3321  overCount_(r.overCount_),
3322  modCount_(0UL),
3323  dim_(r.dim_) {}

◆ HistoND() [13/14]

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

◆ HistoND() [14/14]

template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r,
unsigned  ax1,
unsigned  ax2 
)
private

Definition at line 3296 of file HistoND.h.

3297  : title_(r.title_),
3298  accumulatedDataLabel_(r.accumulatedDataLabel_),
3299  data_(r.data_.transpose(ax1, ax2)),
3300  overflow_(r.overflow_.transpose(ax1, ax2)),
3301  axes_(r.axes_),
3302  weightBuf_(r.weightBuf_),
3303  indexBuf_(r.indexBuf_),
3304  fillCount_(r.fillCount_),
3305  overCount_(r.overCount_),
3306  modCount_(0UL),
3307  dim_(r.dim_) {
3308  std::swap(axes_[ax1], axes_[ax2]);
3309  }

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

Member Function Documentation

◆ accumulateBinsInBox()

template<typename Numeric , class Axis >
template<typename Acc >
void npstat::HistoND< Numeric, Axis >::accumulateBinsInBox ( const BoxND< double > &  box,
Acc *  acc,
bool  calculateAverage = false 
) 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 1227 of file HistoND.h.

1229  {
1230  if (box.size() != dim_)
1232  "In npstat::HistoND::accumulateBinsInBox: "
1233  "incompatible box dimensionality");
1235  if (dim_) {
1236  long double wsum = 0.0L;
1237  for (unsigned i = 0; i < dim_; ++i)
1238  indexBuf_[i] = 0U;
1239  accumulateBinsLoop(0U, box, &indexBuf_[0], accumulator, 1.0, &wsum);
1240  if (calculateAverage && wsum > 0.0L)
1241  *accumulator *= static_cast<double>(1.0L / wsum);
1242  } else
1243  *accumulator += 1.0 * data_();
1244  }

References mixOne_premix_on_sim_cfi::accumulator, cms::cuda::assert(), mps_fire::i, dttmaxenums::L, and mitigatedMETSequence_cff::U.

◆ accumulateBinsLoop()

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,
long double *  wsum 
) const
private

Definition at line 1202 of file HistoND.h.

1207  {
1208  const Interval<double>& boxSide(box[level]);
1209  const Axis& axis(axes_[level]);
1210  const unsigned nbins = axis.nBins();
1211  const bool lastLevel = level == dim_ - 1U;
1212  for (unsigned i = 0; i < nbins; ++i) {
1213  const double over = overlapFraction * axis.binInterval(i).overlapFraction(boxSide);
1214  if (over > 0.0) {
1215  idx[level] = i;
1216  if (lastLevel) {
1217  *accumulator += over * data_.value(idx, dim_);
1218  *wsum += over;
1219  } else
1220  accumulateBinsLoop(level + 1U, box, idx, accumulator, over, wsum);
1221  }
1222  }
1223  }

References mixOne_premix_on_sim_cfi::accumulator, mps_fire::i, heavyIonCSV_trainingSettings::idx, personalPlayback::level, LaserClient_cfi::nbins, and mitigatedMETSequence_cff::U.

◆ accumulatedDataLabel()

template<typename Numeric, class Axis = HistoAxis>
const std::string& npstat::HistoND< Numeric, Axis >::accumulatedDataLabel ( ) const
inline

Label associated with accumulated data

Definition at line 176 of file HistoND.h.

176 { return accumulatedDataLabel_; }

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

◆ addToBinContents() [1/2]

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 3360 of file HistoND.h.

3360  {
3361  const unsigned long nDat = data_.length();
3362  Numeric* data = const_cast<Numeric*>(data_.data());
3363  for (unsigned long i = 0; i < nDat; ++i)
3364  data[i] += weight;
3365  fillCount_ += nDat;
3366  ++modCount_;
3367  }

References data, and mps_fire::i.

◆ addToBinContents() [2/2]

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 3383 of file HistoND.h.

3383  {
3384  if (dataLength != data_.length())
3385  throw npstat::NpstatInvalidArgument("In npstat::HistoND::addToBinContents: incompatible data length");
3386  assert(data);
3387  Numeric* dat = const_cast<Numeric*>(data_.data());
3388  for (unsigned long i = 0; i < dataLength; ++i)
3389  dat[i] += data[i];
3390  fillCount_ += dataLength;
3391  ++modCount_;
3392  }

References cms::cuda::assert(), data, and mps_fire::i.

◆ addToOverflows() [1/2]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 &  weight)

Definition at line 3371 of file HistoND.h.

3371  {
3372  const unsigned long nOver = overflow_.length();
3373  Numeric* data = const_cast<Numeric*>(overflow_.data());
3374  for (unsigned long i = 0; i < nOver; ++i)
3375  data[i] += weight;
3376  overCount_ += nOver;
3377  fillCount_ += nOver;
3378  ++modCount_;
3379  }

References data, and mps_fire::i.

◆ addToOverflows() [2/2]

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

Definition at line 3396 of file HistoND.h.

3396  {
3397  if (dataLength != overflow_.length())
3398  throw npstat::NpstatInvalidArgument("In npstat::HistoND::addToOverflows: incompatible data length");
3399  assert(data);
3400  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3401  for (unsigned long i = 0; i < dataLength; ++i)
3402  dat[i] += data[i];
3403  overCount_ += dataLength;
3404  fillCount_ += dataLength;
3405  ++modCount_;
3406  }

References cms::cuda::assert(), data, and mps_fire::i.

◆ addToProjection() [1/2]

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 3461 of file HistoND.h.

3464  {
3465  assert(projection);
3466  data_.addToProjection(&projection->data_, projector, projectedIndices, nProjectedIndices);
3467  projection->fillCount_ += projection->nBins();
3468  projection->modCount_++;
3469  }

References cms::cuda::assert().

◆ addToProjection() [2/2]

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 3473 of file HistoND.h.

3476  {
3477  assert(projection);
3478  data_.addToProjection(&projection->data_, projector, projectedIndices, nProjectedIndices);
3479  projection->fillCount_ += projection->nBins();
3480  projection->modCount_++;
3481  }

References cms::cuda::assert().

◆ allBinCenters()

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 1568 of file HistoND.h.

1568  {
1569  assert(centers);
1570  centers->clear();
1571  const unsigned long len = data_.length();
1572  centers->reserve(len);
1573  unsigned* ibuf = &indexBuf_[0];
1574  const Axis* ax = &axes_[0];
1575  Point center;
1576  if (center.size() < dim_)
1578  "In npstat::HistoND::allBinCenters: "
1579  "incompatible point dimensionality (too small)");
1580  typename Point::value_type* cdat = &center[0];
1581 
1582  for (unsigned long i = 0; i < len; ++i) {
1583  data_.convertLinearIndex(i, ibuf, dim_);
1584  for (unsigned idim = 0; idim < dim_; ++idim)
1585  cdat[idim] = ax[idim].binCenter(ibuf[idim]);
1586  centers->push_back(center);
1587  }
1588  }

References cms::cuda::assert(), and mps_fire::i.

◆ axes()

template<typename Numeric, class Axis = HistoAxis>
const std::vector<Axis>& npstat::HistoND< Numeric, Axis >::axes ( ) const
inline

Inspect histogram axes

Definition at line 185 of file HistoND.h.

185 { return axes_; }

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

◆ axis()

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 188 of file HistoND.h.

188 { return axes_.at(i); }

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

◆ binBox()

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 1591 of file HistoND.h.

1591  {
1592  assert(box);
1593  box->clear();
1594  if (dim_) {
1595  box->reserve(dim_);
1597  const Axis* ax = &axes_[0];
1598  for (unsigned i = 0; i < dim_; ++i)
1599  box->push_back(ax[i].binInterval(indexBuf_[i]));
1600  }
1601  }

References cms::cuda::assert(), plotT0FromHistos::binNumber(), and mps_fire::i.

◆ binCenter()

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 1550 of file HistoND.h.

1552  {
1553  if (dim_ != lenCoords)
1555  "In npstat::HistoND::binCenter: "
1556  "incompatible input point dimensionality");
1557  if (dim_) {
1558  assert(coords);
1560  const Axis* ax = &axes_[0];
1561  for (unsigned i = 0; i < dim_; ++i)
1562  coords[i] = ax[i].binCenter(indexBuf_[i]);
1563  }
1564  }

References cms::cuda::assert(), plotT0FromHistos::binNumber(), and mps_fire::i.

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

◆ binContents()

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 179 of file HistoND.h.

179 { return data_; }

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

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

◆ binVolume()

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 1621 of file HistoND.h.

1621  {
1622  double v = 1.0;
1623  if (dim_) {
1625  const Axis* ax = &axes_[0];
1626  for (unsigned i = 0; i < dim_; ++i)
1627  v *= ax[i].binWidth(indexBuf_[i]);
1628  }
1629  return v;
1630  }

References plotT0FromHistos::binNumber(), mps_fire::i, and findQualityFiles::v.

◆ boundingBox()

template<typename Numeric , class Axis >
BoxND< double > npstat::HistoND< Numeric, Axis >::boundingBox ( ) const

Bounding box for the whole histogram

Definition at line 1538 of file HistoND.h.

1538  {
1539  BoxND<double> box;
1540  if (dim_) {
1541  box.reserve(dim_);
1542  const Axis* ax = &axes_[0];
1543  for (unsigned i = 0; i < dim_; ++i)
1544  box.push_back(ax[i].interval());
1545  }
1546  return box;
1547  }

References mps_fire::i.

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

◆ classId()

template<typename Numeric, class Axis = HistoAxis>
gs::ClassId npstat::HistoND< Numeric, Axis >::classId ( ) const
inline

Method related to "geners" I/O

Definition at line 921 of file HistoND.h.

921 { return gs::ClassId(*this); }

◆ classname()

template<typename Numeric , class Axis >
const char * npstat::HistoND< Numeric, Axis >::classname ( )
static

Definition at line 3484 of file HistoND.h.

3484  {
3485  static const std::string myClass(gs::template_class_name<Numeric, Axis>("npstat::HistoND"));
3486  return myClass.c_str();
3487  }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ clear()

template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clear ( void  )
inline

Clear the histogram contents (both bins and overflows)

Definition at line 1261 of file HistoND.h.

1261  {
1262  clearBinContents();
1263  clearOverflows();
1264  ++modCount_;
1265  }

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

◆ clearBinContents()

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

This method clears the bin contents but not overflows

Definition at line 1247 of file HistoND.h.

1247  {
1248  data_.clear();
1249  fillCount_ = 0UL;
1250  ++modCount_;
1251  }

◆ clearOverflows()

template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearOverflows ( )
inline

This method clears overflows but not the bin contents

Definition at line 1254 of file HistoND.h.

1254  {
1255  overflow_.clear();
1256  overCount_ = 0UL;
1257  ++modCount_;
1258  }

◆ closestBin() [1/12]

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 1827 of file HistoND.h.

1827  {
1828  if (dim_)
1829  Private::h_badargs("closestBin");
1830  return data_();
1831  }

References npstat::Private::h_badargs().

◆ closestBin() [2/12]

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 1722 of file HistoND.h.

1722  {
1723  if (coordLength != dim_)
1725  "In npstat::HistoND::closestBin: "
1726  "incompatible input point dimensionality");
1727  if (coordLength) {
1728  assert(coords);
1729  unsigned* idx = &indexBuf_[0];
1730  const Axis* ax = &axes_[0];
1731  for (unsigned i = 0; i < dim_; ++i)
1732  idx[i] = ax[i].closestValidBin(coords[i]);
1733  return data_.value(idx, dim_);
1734  } else
1735  return data_();
1736  }

References cms::cuda::assert(), mps_fire::i, and heavyIonCSV_trainingSettings::idx.

◆ closestBin() [3/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0) const
inline

Definition at line 1895 of file HistoND.h.

1895  {
1896  if (dim_ != 1U)
1897  Private::h_badargs("closestBin");
1898  const unsigned i0 = axes_[0].closestValidBin(x0);
1899  return data_(i0);
1900  }

References npstat::Private::h_badargs(), and mitigatedMETSequence_cff::U.

◆ closestBin() [4/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1 
) const

Definition at line 1972 of file HistoND.h.

1972  {
1973  if (dim_ != 2U)
1974  Private::h_badargs("closestBin");
1975  const Axis* ax = &axes_[0];
1976  const unsigned i0 = ax[0].closestValidBin(x0);
1977  const unsigned i1 = ax[1].closestValidBin(x1);
1978  return data_(i0, i1);
1979  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, mitigatedMETSequence_cff::U, and testProducerWithPsetDescEmpty_cfi::x1.

◆ closestBin() [5/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2 
) const

Definition at line 2055 of file HistoND.h.

2055  {
2056  if (dim_ != 3U)
2057  Private::h_badargs("closestBin");
2058  const Axis* ax = &axes_[0];
2059  const unsigned i0 = ax[0].closestValidBin(x0);
2060  const unsigned i1 = ax[1].closestValidBin(x1);
2061  const unsigned i2 = ax[2].closestValidBin(x2);
2062  return data_(i0, i1, i2);
2063  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [6/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2147 of file HistoND.h.

2150  {
2151  if (dim_ != 4U)
2152  Private::h_badargs("closestBin");
2153  const Axis* ax = &axes_[0];
2154  const unsigned i0 = ax[0].closestValidBin(x0);
2155  const unsigned i1 = ax[1].closestValidBin(x1);
2156  const unsigned i2 = ax[2].closestValidBin(x2);
2157  const unsigned i3 = ax[3].closestValidBin(x3);
2158  return data_(i0, i1, i2, i3);
2159  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [7/12]

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 2247 of file HistoND.h.

2248  {
2249  if (dim_ != 5U)
2250  Private::h_badargs("closestBin");
2251  const Axis* ax = &axes_[0];
2252  const unsigned i0 = ax[0].closestValidBin(x0);
2253  const unsigned i1 = ax[1].closestValidBin(x1);
2254  const unsigned i2 = ax[2].closestValidBin(x2);
2255  const unsigned i3 = ax[3].closestValidBin(x3);
2256  const unsigned i4 = ax[4].closestValidBin(x4);
2257  return data_(i0, i1, i2, i3, i4);
2258  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [8/12]

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 2366 of file HistoND.h.

2367  {
2368  if (dim_ != 6U)
2369  Private::h_badargs("closestBin");
2370  const Axis* ax = &axes_[0];
2371  const unsigned i0 = ax[0].closestValidBin(x0);
2372  const unsigned i1 = ax[1].closestValidBin(x1);
2373  const unsigned i2 = ax[2].closestValidBin(x2);
2374  const unsigned i3 = ax[3].closestValidBin(x3);
2375  const unsigned i4 = ax[4].closestValidBin(x4);
2376  const unsigned i5 = ax[5].closestValidBin(x5);
2377  return data_(i0, i1, i2, i3, i4, i5);
2378  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [9/12]

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 2498 of file HistoND.h.

2504  {
2505  if (dim_ != 7U)
2506  Private::h_badargs("closestBin");
2507  const Axis* ax = &axes_[0];
2508  const unsigned i0 = ax[0].closestValidBin(x0);
2509  const unsigned i1 = ax[1].closestValidBin(x1);
2510  const unsigned i2 = ax[2].closestValidBin(x2);
2511  const unsigned i3 = ax[3].closestValidBin(x3);
2512  const unsigned i4 = ax[4].closestValidBin(x4);
2513  const unsigned i5 = ax[5].closestValidBin(x5);
2514  const unsigned i6 = ax[6].closestValidBin(x6);
2515  return data_(i0, i1, i2, i3, i4, i5, i6);
2516  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [10/12]

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 2644 of file HistoND.h.

2651  {
2652  if (dim_ != 8U)
2653  Private::h_badargs("closestBin");
2654  const Axis* ax = &axes_[0];
2655  const unsigned i0 = ax[0].closestValidBin(x0);
2656  const unsigned i1 = ax[1].closestValidBin(x1);
2657  const unsigned i2 = ax[2].closestValidBin(x2);
2658  const unsigned i3 = ax[3].closestValidBin(x3);
2659  const unsigned i4 = ax[4].closestValidBin(x4);
2660  const unsigned i5 = ax[5].closestValidBin(x5);
2661  const unsigned i6 = ax[6].closestValidBin(x6);
2662  const unsigned i7 = ax[7].closestValidBin(x7);
2663  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2664  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [11/12]

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 2800 of file HistoND.h.

2808  {
2809  if (dim_ != 9U)
2810  Private::h_badargs("closestBin");
2811  const Axis* ax = &axes_[0];
2812  const unsigned i0 = ax[0].closestValidBin(x0);
2813  const unsigned i1 = ax[1].closestValidBin(x1);
2814  const unsigned i2 = ax[2].closestValidBin(x2);
2815  const unsigned i3 = ax[3].closestValidBin(x3);
2816  const unsigned i4 = ax[4].closestValidBin(x4);
2817  const unsigned i5 = ax[5].closestValidBin(x5);
2818  const unsigned i6 = ax[6].closestValidBin(x6);
2819  const unsigned i7 = ax[7].closestValidBin(x7);
2820  const unsigned i8 = ax[8].closestValidBin(x8);
2821  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2822  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ closestBin() [12/12]

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 2970 of file HistoND.h.

2979  {
2980  if (dim_ != 10U)
2981  Private::h_badargs("closestBin");
2982  const Axis* ax = &axes_[0];
2983  const unsigned i0 = ax[0].closestValidBin(x0);
2984  const unsigned i1 = ax[1].closestValidBin(x1);
2985  const unsigned i2 = ax[2].closestValidBin(x2);
2986  const unsigned i3 = ax[3].closestValidBin(x3);
2987  const unsigned i4 = ax[4].closestValidBin(x4);
2988  const unsigned i5 = ax[5].closestValidBin(x5);
2989  const unsigned i6 = ax[6].closestValidBin(x6);
2990  const unsigned i7 = ax[7].closestValidBin(x7);
2991  const unsigned i8 = ax[8].closestValidBin(x8);
2992  const unsigned i9 = ax[9].closestValidBin(x9);
2993  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2994  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dim()

template<typename Numeric, class Axis = HistoAxis>
unsigned npstat::HistoND< Numeric, Axis >::dim ( ) const
inline

Histogram dimensionality

Definition at line 170 of file HistoND.h.

170 { return dim_; }

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

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

◆ dispatch() [1/12]

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 1673 of file HistoND.h.

1673  {
1674  if (coordLength != dim_)
1676  "In npstat::HistoND::dispatch: "
1677  "incompatible input point dimensionality");
1678  if (coordLength) {
1679  assert(coords);
1680  unsigned* idx = &indexBuf_[0];
1681  unsigned* over = idx + dim_;
1682  const Axis* ax = &axes_[0];
1683  unsigned overflown = 0U;
1684  for (unsigned i = 0; i < dim_; ++i) {
1685  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1686  overflown |= (over[i] - 1U);
1687  }
1688  if (overflown)
1689  f(overflow_.value(over, dim_), w);
1690  else
1691  f(data_.value(idx, dim_), w);
1692  } else
1693  f(data_(), w);
1694  ++modCount_;
1695  }

References cms::cuda::assert(), f, mps_fire::i, heavyIonCSV_trainingSettings::idx, mitigatedMETSequence_cff::U, and w.

◆ dispatch() [2/12]

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 2864 of file HistoND.h.

2875  {
2876  if (dim_ != 10U)
2877  Private::h_badargs("dispatch");
2878  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0;
2879  const Axis* ax = &axes_[0];
2880  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2881  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2882  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2883  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2884  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2885  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2886  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2887  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2888  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2889  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2890  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2891  o9 == 1U)
2892  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9), w);
2893  else
2894  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9), w);
2895  ++modCount_;
2896  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [3/12]

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 2703 of file HistoND.h.

2713  {
2714  if (dim_ != 9U)
2715  Private::h_badargs("dispatch");
2716  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0;
2717  const Axis* ax = &axes_[0];
2718  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2719  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2720  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2721  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2722  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2723  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2724  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2725  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2726  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2727  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2728  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8), w);
2729  else
2730  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8), w);
2731  ++modCount_;
2732  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [4/12]

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 2553 of file HistoND.h.

2562  {
2563  if (dim_ != 8U)
2564  Private::h_badargs("dispatch");
2565  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0;
2566  const Axis* ax = &axes_[0];
2567  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2568  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2569  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2570  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2571  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2572  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2573  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2574  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2575  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2576  f(data_(i0, i1, i2, i3, i4, i5, i6, i7), w);
2577  else
2578  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7), w);
2579  ++modCount_;
2580  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [5/12]

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 2413 of file HistoND.h.

2421  {
2422  if (dim_ != 7U)
2423  Private::h_badargs("dispatch");
2424  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2425  const Axis* ax = &axes_[0];
2426  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2427  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2428  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2429  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2430  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2431  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2432  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2433  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2434  f(data_(i0, i1, i2, i3, i4, i5, i6), w);
2435  else
2436  f(overflow_(o0, o1, o2, o3, o4, o5, o6), w);
2437  ++modCount_;
2438  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [6/12]

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 2291 of file HistoND.h.

2298  {
2299  if (dim_ != 6U)
2300  Private::h_badargs("dispatch");
2301  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2302  const Axis* ax = &axes_[0];
2303  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2304  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2305  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2306  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2307  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2308  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2309  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2310  f(data_(i0, i1, i2, i3, i4, i5), w);
2311  else
2312  f(overflow_(o0, o1, o2, o3, o4, o5), w);
2313  ++modCount_;
2314  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [7/12]

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 2186 of file HistoND.h.

2187  {
2188  if (dim_ != 5U)
2189  Private::h_badargs("dispatch");
2190  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2191  const Axis* ax = &axes_[0];
2192  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2193  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2194  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2195  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2196  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2197  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2198  f(data_(i0, i1, i2, i3, i4), w);
2199  else
2200  f(overflow_(o0, o1, o2, o3, o4), w);
2201  ++modCount_;
2202  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [8/12]

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 2088 of file HistoND.h.

2089  {
2090  if (dim_ != 4U)
2091  Private::h_badargs("dispatch");
2092  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2093  const Axis* ax = &axes_[0];
2094  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2095  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2096  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2097  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2098  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2099  f(data_(i0, i1, i2, i3), w);
2100  else
2101  f(overflow_(o0, o1, o2, o3), w);
2102  ++modCount_;
2103  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [9/12]

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 2003 of file HistoND.h.

2003  {
2004  if (dim_ != 3U)
2005  Private::h_badargs("dispatch");
2006  unsigned i0 = 0, i1 = 0, i2 = 0;
2007  const Axis* ax = &axes_[0];
2008  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2009  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2010  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2011  if (o0 == 1U && o1 == 1U && o2 == 1U)
2012  f(data_(i0, i1, i2), w);
2013  else
2014  f(overflow_(o0, o1, o2), w);
2015  ++modCount_;
2016  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ dispatch() [10/12]

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 1923 of file HistoND.h.

1923  {
1924  if (dim_ != 2U)
1925  Private::h_badargs("dispatch");
1926  unsigned i0 = 0, i1 = 0;
1927  const Axis* ax = &axes_[0];
1928  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1929  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1930  if (o0 == 1U && o1 == 1U)
1931  f(data_(i0, i1), w);
1932  else
1933  f(overflow_(o0, o1), w);
1934  ++modCount_;
1935  }

References f, npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, and testProducerWithPsetDescEmpty_cfi::x1.

◆ dispatch() [11/12]

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 1852 of file HistoND.h.

1852  {
1853  if (dim_ != 1U)
1854  Private::h_badargs("dispatch");
1855  unsigned i0 = 0;
1856  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1857  if (ov0 == 1U)
1858  f(data_(i0), w);
1859  else
1860  f(overflow_(ov0), w);
1861  ++modCount_;
1862  }

References f, npstat::Private::h_badargs(), mitigatedMETSequence_cff::U, and w.

◆ dispatch() [12/12]

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 1802 of file HistoND.h.

1802  {
1803  if (dim_)
1804  Private::h_badargs("dispatch");
1805  f(data_(), w);
1806  ++modCount_;
1807  }

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

◆ examine() [1/12]

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 1820 of file HistoND.h.

1820  {
1821  if (dim_)
1822  Private::h_badargs("examine");
1823  return data_();
1824  }

References npstat::Private::h_badargs().

◆ examine() [2/12]

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 1698 of file HistoND.h.

1698  {
1699  if (coordLength != dim_)
1701  "In npstat::HistoND::examine: "
1702  "incompatible input point dimensionality");
1703  if (coordLength) {
1704  assert(coords);
1705  unsigned* idx = &indexBuf_[0];
1706  unsigned* over = idx + dim_;
1707  const Axis* ax = &axes_[0];
1708  unsigned overflown = 0U;
1709  for (unsigned i = 0; i < dim_; ++i) {
1710  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1711  overflown |= (over[i] - 1U);
1712  }
1713  if (overflown)
1714  return overflow_.value(over, dim_);
1715  else
1716  return data_.value(idx, dim_);
1717  } else
1718  return data_();
1719  }

References cms::cuda::assert(), mps_fire::i, heavyIonCSV_trainingSettings::idx, and mitigatedMETSequence_cff::U.

◆ examine() [3/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0) const
inline

Definition at line 1883 of file HistoND.h.

1883  {
1884  if (dim_ != 1U)
1885  Private::h_badargs("examine");
1886  unsigned i0 = 0;
1887  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1888  if (ov0 == 1U)
1889  return data_(i0);
1890  else
1891  return overflow_(ov0);
1892  }

References npstat::Private::h_badargs(), and mitigatedMETSequence_cff::U.

◆ examine() [4/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1 
) const

Definition at line 1958 of file HistoND.h.

1958  {
1959  if (dim_ != 2U)
1960  Private::h_badargs("examine");
1961  unsigned i0 = 0, i1 = 0;
1962  const Axis* ax = &axes_[0];
1963  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1964  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1965  if (o0 == 1U && o1 == 1U)
1966  return data_(i0, i1);
1967  else
1968  return overflow_(o0, o1);
1969  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, CastorDigiReco::o1, mitigatedMETSequence_cff::U, and testProducerWithPsetDescEmpty_cfi::x1.

◆ examine() [5/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2 
) const

Definition at line 2040 of file HistoND.h.

2040  {
2041  if (dim_ != 3U)
2042  Private::h_badargs("examine");
2043  unsigned i0 = 0, i1 = 0, i2 = 0;
2044  const Axis* ax = &axes_[0];
2045  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2046  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2047  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2048  if (o0 == 1U && o1 == 1U && o2 == 1U)
2049  return data_(i0, i1, i2);
2050  else
2051  return overflow_(o0, o1, o2);
2052  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [6/12]

template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2128 of file HistoND.h.

2131  {
2132  if (dim_ != 4U)
2133  Private::h_badargs("examine");
2134  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2135  const Axis* ax = &axes_[0];
2136  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2137  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2138  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2139  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2140  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2141  return data_(i0, i1, i2, i3);
2142  else
2143  return overflow_(o0, o1, o2, o3);
2144  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [7/12]

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 2229 of file HistoND.h.

2230  {
2231  if (dim_ != 5U)
2232  Private::h_badargs("examine");
2233  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2234  const Axis* ax = &axes_[0];
2235  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2236  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2237  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2238  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2239  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2240  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2241  return data_(i0, i1, i2, i3, i4);
2242  else
2243  return overflow_(o0, o1, o2, o3, o4);
2244  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [8/12]

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 2347 of file HistoND.h.

2348  {
2349  if (dim_ != 6U)
2350  Private::h_badargs("examine");
2351  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2352  const Axis* ax = &axes_[0];
2353  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2354  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2355  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2356  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2357  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2358  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2359  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2360  return data_(i0, i1, i2, i3, i4, i5);
2361  else
2362  return overflow_(o0, o1, o2, o3, o4, o5);
2363  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [9/12]

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 2473 of file HistoND.h.

2479  {
2480  if (dim_ != 7U)
2481  Private::h_badargs("examine");
2482  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2483  const Axis* ax = &axes_[0];
2484  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2485  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2486  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2487  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2488  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2489  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2490  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2491  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2492  return data_(i0, i1, i2, i3, i4, i5, i6);
2493  else
2494  return overflow_(o0, o1, o2, o3, o4, o5, o6);
2495  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [10/12]

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 2617 of file HistoND.h.

2624  {
2625  if (dim_ != 8U)
2626  Private::h_badargs("examine");
2627  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0;
2628  const Axis* ax = &axes_[0];
2629  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2630  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2631  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2632  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2633  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2634  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2635  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2636  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2637  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2638  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2639  else
2640  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7);
2641  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [11/12]

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 2771 of file HistoND.h.

2779  {
2780  if (dim_ != 9U)
2781  Private::h_badargs("examine");
2782  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0;
2783  const Axis* ax = &axes_[0];
2784  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2785  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2786  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2787  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2788  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2789  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2790  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2791  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2792  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2793  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2794  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2795  else
2796  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8);
2797  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ examine() [12/12]

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 2938 of file HistoND.h.

2947  {
2948  if (dim_ != 10U)
2949  Private::h_badargs("examine");
2950  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0;
2951  const Axis* ax = &axes_[0];
2952  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2953  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2954  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2955  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2956  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2957  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2958  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2959  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2960  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2961  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2962  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2963  o9 == 1U)
2964  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2965  else
2966  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9);
2967  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [1/12]

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 1645 of file HistoND.h.

1645  {
1646  if (coordLength != dim_)
1648  "In npstat::HistoND::fill: "
1649  "incompatible input point dimensionality");
1650  if (coordLength) {
1651  assert(coords);
1652  unsigned* idx = &indexBuf_[0];
1653  unsigned* over = idx + dim_;
1654  const Axis* ax = &axes_[0];
1655  unsigned overflown = 0U;
1656  for (unsigned i = 0; i < dim_; ++i) {
1657  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1658  overflown |= (over[i] - 1U);
1659  }
1660  if (overflown) {
1661  overflow_.value(over, dim_) += w;
1662  ++overCount_;
1663  } else
1664  data_.value(idx, dim_) += w;
1665  } else
1666  data_() += w;
1667  ++fillCount_;
1668  ++modCount_;
1669  }

References cms::cuda::assert(), mps_fire::i, heavyIonCSV_trainingSettings::idx, mitigatedMETSequence_cff::U, and w.

◆ fill() [2/12]

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 1792 of file HistoND.h.

1792  {
1793  if (dim_)
1794  Private::h_badargs("fill");
1795  data_() += w;
1796  ++fillCount_;
1797  ++modCount_;
1798  }

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

◆ fill() [3/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
const Num2 &  weight 
)

Definition at line 1835 of file HistoND.h.

1835  {
1836  if (dim_ != 1U)
1837  Private::h_badargs("fill");
1838  unsigned i0 = 0;
1839  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1840  if (ov0 == 1U)
1841  data_(i0) += w;
1842  else {
1843  overflow_(ov0) += w;
1844  ++overCount_;
1845  }
1846  ++fillCount_;
1847  ++modCount_;
1848  }

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

◆ fill() [4/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1904 of file HistoND.h.

1904  {
1905  if (dim_ != 2U)
1906  Private::h_badargs("fill");
1907  unsigned i0 = 0, i1 = 0;
1908  const Axis* ax = &axes_[0];
1909  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1910  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1911  if (o0 == 1U && o1 == 1U)
1912  data_(i0, i1) += w;
1913  else {
1914  overflow_(o0, o1) += w;
1915  ++overCount_;
1916  }
1917  ++fillCount_;
1918  ++modCount_;
1919  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, and testProducerWithPsetDescEmpty_cfi::x1.

◆ fill() [5/12]

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 1983 of file HistoND.h.

1983  {
1984  if (dim_ != 3U)
1985  Private::h_badargs("fill");
1986  unsigned i0 = 0, i1 = 0, i2 = 0;
1987  const Axis* ax = &axes_[0];
1988  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1989  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1990  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
1991  if (o0 == 1U && o1 == 1U && o2 == 1U)
1992  data_(i0, i1, i2) += w;
1993  else {
1994  overflow_(o0, o1, o2) += w;
1995  ++overCount_;
1996  }
1997  ++fillCount_;
1998  ++modCount_;
1999  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [6/12]

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 2067 of file HistoND.h.

2067  {
2068  if (dim_ != 4U)
2069  Private::h_badargs("fill");
2070  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2071  const Axis* ax = &axes_[0];
2072  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2073  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2074  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2075  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2076  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2077  data_(i0, i1, i2, i3) += w;
2078  else {
2079  overflow_(o0, o1, o2, o3) += w;
2080  ++overCount_;
2081  }
2082  ++fillCount_;
2083  ++modCount_;
2084  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [7/12]

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 2163 of file HistoND.h.

2164  {
2165  if (dim_ != 5U)
2166  Private::h_badargs("fill");
2167  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2168  const Axis* ax = &axes_[0];
2169  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2170  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2171  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2172  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2173  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2174  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2175  data_(i0, i1, i2, i3, i4) += w;
2176  else {
2177  overflow_(o0, o1, o2, o3, o4) += w;
2178  ++overCount_;
2179  }
2180  ++fillCount_;
2181  ++modCount_;
2182  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [8/12]

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 2262 of file HistoND.h.

2268  {
2269  if (dim_ != 6U)
2270  Private::h_badargs("fill");
2271  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2272  const Axis* ax = &axes_[0];
2273  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2274  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2275  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2276  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2277  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2278  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2279  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2280  data_(i0, i1, i2, i3, i4, i5) += w;
2281  else {
2282  overflow_(o0, o1, o2, o3, o4, o5) += w;
2283  ++overCount_;
2284  }
2285  ++fillCount_;
2286  ++modCount_;
2287  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [9/12]

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 2382 of file HistoND.h.

2389  {
2390  if (dim_ != 7U)
2391  Private::h_badargs("fill");
2392  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2393  const Axis* ax = &axes_[0];
2394  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2395  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2396  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2397  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2398  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2399  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2400  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2401  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2402  data_(i0, i1, i2, i3, i4, i5, i6) += w;
2403  else {
2404  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2405  ++overCount_;
2406  }
2407  ++fillCount_;
2408  ++modCount_;
2409  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [10/12]

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 2520 of file HistoND.h.

2528  {
2529  if (dim_ != 8U)
2530  Private::h_badargs("fill");
2531  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0;
2532  const Axis* ax = &axes_[0];
2533  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2534  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2535  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2536  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2537  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2538  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2539  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2540  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2541  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2542  data_(i0, i1, i2, i3, i4, i5, i6, i7) += w;
2543  else {
2544  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2545  ++overCount_;
2546  }
2547  ++fillCount_;
2548  ++modCount_;
2549  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [11/12]

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 2668 of file HistoND.h.

2677  {
2678  if (dim_ != 9U)
2679  Private::h_badargs("fill");
2680  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0;
2681  const Axis* ax = &axes_[0];
2682  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2683  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2684  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2685  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2686  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2687  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2688  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2689  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2690  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2691  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2692  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) += w;
2693  else {
2694  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2695  ++overCount_;
2696  }
2697  ++fillCount_;
2698  ++modCount_;
2699  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fill() [12/12]

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 2826 of file HistoND.h.

2836  {
2837  if (dim_ != 10U)
2838  Private::h_badargs("fill");
2839  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0;
2840  const Axis* ax = &axes_[0];
2841  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2842  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2843  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2844  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2845  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2846  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2847  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2848  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2849  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2850  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2851  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2852  o9 == 1U)
2853  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) += w;
2854  else {
2855  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2856  ++overCount_;
2857  }
2858  ++fillCount_;
2859  ++modCount_;
2860  }

References npstat::Private::h_badargs(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [1/12]

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 1763 of file HistoND.h.

1763  {
1764  if (coordLength != dim_)
1766  "In npstat::HistoND::fillC: "
1767  "incompatible input point dimensionality");
1768  if (coordLength) {
1769  assert(coords);
1770  double* wg = &weightBuf_[0];
1771  unsigned* idx = &indexBuf_[0];
1772  unsigned* over = idx + dim_;
1773  const Axis* ax = &axes_[0];
1774  unsigned overflown = 0U;
1775  for (unsigned i = 0; i < dim_; ++i) {
1776  over[i] = ax[i].overflowIndexWeighted(coords[i], idx + i, wg + i);
1777  overflown |= (over[i] - 1U);
1778  }
1779  if (overflown) {
1780  overflow_.value(over, dim_) += w;
1781  ++overCount_;
1782  } else
1784  } else
1785  data_() += w;
1786  ++fillCount_;
1787  ++modCount_;
1788  }

References cms::cuda::assert(), mps_fire::i, heavyIonCSV_trainingSettings::idx, mitigatedMETSequence_cff::U, and w.

◆ fillC() [2/12]

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 1811 of file HistoND.h.

1811  {
1812  if (dim_)
1813  Private::h_badargs("fillC");
1814  data_() += w;
1815  ++fillCount_;
1816  ++modCount_;
1817  }

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

◆ fillC() [3/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
const Num2 &  weight 
)

Definition at line 1866 of file HistoND.h.

1866  {
1867  if (dim_ != 1U)
1868  Private::h_badargs("fillC");
1869  double* wg = &weightBuf_[0];
1870  unsigned* idx = &indexBuf_[0];
1871  const unsigned ov0 = axes_[0].overflowIndexWeighted(x0, idx, wg);
1872  if (ov0 == 1U)
1874  else {
1875  overflow_(ov0) += w;
1876  ++overCount_;
1877  }
1878  ++fillCount_;
1879  ++modCount_;
1880  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, mitigatedMETSequence_cff::U, and w.

◆ fillC() [4/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1939 of file HistoND.h.

1939  {
1940  if (dim_ != 2U)
1941  Private::h_badargs("fillC");
1942  double* wg = &weightBuf_[0];
1943  unsigned* idx = &indexBuf_[0];
1944  const Axis* ax = &axes_[0];
1945  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
1946  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
1947  if (o0 == 1U && o1 == 1U)
1949  else {
1950  overflow_(o0, o1) += w;
1951  ++overCount_;
1952  }
1953  ++fillCount_;
1954  ++modCount_;
1955  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, and testProducerWithPsetDescEmpty_cfi::x1.

◆ fillC() [5/12]

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 2020 of file HistoND.h.

2020  {
2021  if (dim_ != 3U)
2022  Private::h_badargs("fillC");
2023  double* wg = &weightBuf_[0];
2024  unsigned* idx = &indexBuf_[0];
2025  const Axis* ax = &axes_[0];
2026  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2027  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2028  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2029  if (o0 == 1U && o1 == 1U && o2 == 1U)
2031  else {
2032  overflow_(o0, o1, o2) += w;
2033  ++overCount_;
2034  }
2035  ++fillCount_;
2036  ++modCount_;
2037  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [6/12]

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 2107 of file HistoND.h.

2107  {
2108  if (dim_ != 4U)
2109  Private::h_badargs("fillC");
2110  double* wg = &weightBuf_[0];
2111  unsigned* idx = &indexBuf_[0];
2112  const Axis* ax = &axes_[0];
2113  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2114  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2115  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2116  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2117  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2119  else {
2120  overflow_(o0, o1, o2, o3) += w;
2121  ++overCount_;
2122  }
2123  ++fillCount_;
2124  ++modCount_;
2125  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [7/12]

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 2206 of file HistoND.h.

2207  {
2208  if (dim_ != 5U)
2209  Private::h_badargs("fillC");
2210  double* wg = &weightBuf_[0];
2211  unsigned* idx = &indexBuf_[0];
2212  const Axis* ax = &axes_[0];
2213  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2214  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2215  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2216  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2217  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2218  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2220  else {
2221  overflow_(o0, o1, o2, o3, o4) += w;
2222  ++overCount_;
2223  }
2224  ++fillCount_;
2225  ++modCount_;
2226  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [8/12]

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 2318 of file HistoND.h.

2324  {
2325  if (dim_ != 6U)
2326  Private::h_badargs("fillC");
2327  double* wg = &weightBuf_[0];
2328  unsigned* idx = &indexBuf_[0];
2329  const Axis* ax = &axes_[0];
2330  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2331  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2332  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2333  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2334  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2335  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2336  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2338  else {
2339  overflow_(o0, o1, o2, o3, o4, o5) += w;
2340  ++overCount_;
2341  }
2342  ++fillCount_;
2343  ++modCount_;
2344  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [9/12]

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 2442 of file HistoND.h.

2449  {
2450  if (dim_ != 7U)
2451  Private::h_badargs("fillC");
2452  double* wg = &weightBuf_[0];
2453  unsigned* idx = &indexBuf_[0];
2454  const Axis* ax = &axes_[0];
2455  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2456  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2457  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2458  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2459  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2460  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2461  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2462  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2464  else {
2465  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2466  ++overCount_;
2467  }
2468  ++fillCount_;
2469  ++modCount_;
2470  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [10/12]

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 2584 of file HistoND.h.

2592  {
2593  if (dim_ != 8U)
2594  Private::h_badargs("fillC");
2595  double* wg = &weightBuf_[0];
2596  unsigned* idx = &indexBuf_[0];
2597  const Axis* ax = &axes_[0];
2598  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2599  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2600  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2601  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2602  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2603  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2604  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2605  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2606  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2608  else {
2609  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2610  ++overCount_;
2611  }
2612  ++fillCount_;
2613  ++modCount_;
2614  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [11/12]

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 2736 of file HistoND.h.

2745  {
2746  if (dim_ != 9U)
2747  Private::h_badargs("fillC");
2748  double* wg = &weightBuf_[0];
2749  unsigned* idx = &indexBuf_[0];
2750  const Axis* ax = &axes_[0];
2751  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2752  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2753  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2754  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2755  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2756  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2757  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2758  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2759  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx + 8, wg + 8);
2760  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2762  else {
2763  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2764  ++overCount_;
2765  }
2766  ++fillCount_;
2767  ++modCount_;
2768  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillC() [12/12]

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 2900 of file HistoND.h.

2910  {
2911  if (dim_ != 10U)
2912  Private::h_badargs("fillC");
2913  double* wg = &weightBuf_[0];
2914  unsigned* idx = &indexBuf_[0];
2915  const Axis* ax = &axes_[0];
2916  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2917  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2918  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2919  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2920  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2921  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2922  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2923  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2924  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx + 8, wg + 8);
2925  const unsigned o9 = ax[9].overflowIndexWeighted(x9, idx + 9, wg + 9);
2926  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2927  o9 == 1U)
2929  else {
2930  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2931  ++overCount_;
2932  }
2933  ++fillCount_;
2934  ++modCount_;
2935  }

References npstat::Private::h_badargs(), heavyIonCSV_trainingSettings::idx, CastorDigiReco::o1, mitigatedMETSequence_cff::U, w, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ fillPreservingCentroid()

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillPreservingCentroid ( const Num2 &  weight)
private

Definition at line 1740 of file HistoND.h.

1740  {
1741  const double* weights = &weightBuf_[0];
1742  const unsigned* cell = &indexBuf_[0];
1743  const unsigned long* strides = data_.strides();
1744  const unsigned long maxcycle = 1UL << dim_;
1745  for (unsigned long icycle = 0; icycle < maxcycle; ++icycle) {
1746  double w = 1.0;
1747  unsigned long icell = 0UL;
1748  for (unsigned i = 0; i < dim_; ++i) {
1749  if (icycle & (1UL << i)) {
1750  w *= (1.0 - weights[i]);
1751  icell += strides[i] * (cell[i] + 1U);
1752  } else {
1753  w *= weights[i];
1754  icell += strides[i] * cell[i];
1755  }
1756  }
1757  data_.linearValue(icell) += (value * w);
1758  }
1759  }

References mps_fire::i, mitigatedMETSequence_cff::U, w, and HLT_FULL_cff::weights.

◆ getModCount()

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 910 of file HistoND.h.

910 { return modCount_; }

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

◆ incrModCount()

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 917 of file HistoND.h.

917 { ++modCount_; }

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

◆ integral()

template<typename Numeric , class Axis >
double npstat::HistoND< Numeric, Axis >::integral ( ) const

Integral of the histogram

Definition at line 1519 of file HistoND.h.

1519  {
1520  typedef typename PreciseType<Numeric>::type Precise;
1521 
1522  if (dim_ == 0U)
1523  return 0.0;
1524  if (isUniformlyBinned()) {
1525  Precise sum = data_.template sum<Precise>();
1526  return static_cast<double>(sum) * binVolume();
1527  } else {
1528  Precise sum = Precise();
1529  const Numeric* data = data_.data();
1530  const unsigned long len = data_.length();
1531  for (unsigned long i = 0; i < len; ++i)
1532  sum += data[i] * binVolume(i);
1533  return static_cast<double>(sum);
1534  }
1535  }

References data, mps_fire::i, and mitigatedMETSequence_cff::U.

◆ isSameData()

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 1604 of file HistoND.h.

1604  {
1605  return dim_ == r.dim_ && overflow_ == r.overflow_ && data_ == r.data_;
1606  }

References alignCSCRings::r.

◆ isUniformlyBinned()

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 1511 of file HistoND.h.

1511  {
1512  for (unsigned i = 0; i < dim_; ++i)
1513  if (!axes_[i].isUniform())
1514  return false;
1515  return true;
1516  }

References mps_fire::i.

◆ nBins()

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nBins ( ) const
inline

Total number of bins

Definition at line 191 of file HistoND.h.

191 { return data_.length(); }

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

◆ nFillsInRange()

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 197 of file HistoND.h.

197 { return fillCount_ - overCount_; }

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

◆ nFillsOver()

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 200 of file HistoND.h.

200 { return overCount_; }

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

◆ nFillsTotal()

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsTotal ( ) const
inline

Total number of fills performed

Definition at line 194 of file HistoND.h.

194 { return fillCount_; }

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

◆ operator!=()

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 1616 of file HistoND.h.

1616  {
1617  return !(*this == r);
1618  }

References alignCSCRings::r.

◆ operator*=() [1/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND& npstat::HistoND< Numeric, Axis >::operator*= ( const Num2 &  r)

In-place multiplication by a scalar (scaling)

◆ operator*=() [2/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND<Numeric, Axis>& npstat::HistoND< Numeric, Axis >::operator*= ( const Num2 &  r)
inline

Definition at line 3279 of file HistoND.h.

3279  {
3280  data_ *= r;
3281  overflow_ *= r;
3282  ++modCount_;
3283  return *this;
3284  }

References alignCSCRings::r.

◆ operator+=() [1/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND& npstat::HistoND< Numeric, Axis >::operator+= ( const HistoND< Num2, Axis > &  r)

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

◆ operator+=() [2/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND<Numeric, Axis>& npstat::HistoND< Numeric, Axis >::operator+= ( const HistoND< Num2, Axis > &  r)
inline

Definition at line 3250 of file HistoND.h.

3250  {
3251  data_ += r.data_;
3252  overflow_ += r.overflow_;
3253  fillCount_ += r.fillCount_;
3254  overCount_ += r.overCount_;
3255  ++modCount_;
3256  return *this;
3257  }

References alignCSCRings::r.

◆ operator-=() [1/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND& npstat::HistoND< Numeric, Axis >::operator-= ( const HistoND< Num2, Axis > &  r)

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".

◆ operator-=() [2/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND<Numeric, Axis>& npstat::HistoND< Numeric, Axis >::operator-= ( const HistoND< Num2, Axis > &  r)
inline

Definition at line 3261 of file HistoND.h.

3261  {
3262  data_ -= r.data_;
3263  overflow_ -= r.overflow_;
3264 
3265  // Subtraction does not make much sense for fill counts.
3266  // We will assume that what we want should be equivalent
3267  // to the in-place multiplication of the other histogram
3268  // by -1 and then adding.
3269  //
3270  fillCount_ += r.fillCount_;
3271  overCount_ += r.overCount_;
3272 
3273  ++modCount_;
3274  return *this;
3275  }

References alignCSCRings::r.

◆ operator/=() [1/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND& npstat::HistoND< Numeric, Axis >::operator/= ( const Num2 &  r)

In-place division by a scalar

◆ operator/=() [2/2]

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
HistoND<Numeric, Axis>& npstat::HistoND< Numeric, Axis >::operator/= ( const Num2 &  r)
inline

Definition at line 3288 of file HistoND.h.

3288  {
3289  data_ /= r;
3290  overflow_ /= r;
3291  ++modCount_;
3292  return *this;
3293  }

References alignCSCRings::r.

◆ operator=()

template<typename Numeric , class Axis >
HistoND< Numeric, Axis > & npstat::HistoND< Numeric, Axis >::operator= ( const HistoND< Numeric, Axis > &  r)

Assignment operator. Works even when the binning of the two histograms is not compatible.

Definition at line 3326 of file HistoND.h.

3326  {
3327  if (&r != this) {
3328  title_ = r.title_;
3329  accumulatedDataLabel_ = r.accumulatedDataLabel_;
3330  data_.uninitialize();
3331  data_ = r.data_;
3333  overflow_ = r.overflow_;
3334  axes_ = r.axes_;
3335  weightBuf_ = r.weightBuf_;
3336  indexBuf_ = r.indexBuf_;
3337  fillCount_ = r.fillCount_;
3338  overCount_ = r.overCount_;
3339  dim_ = r.dim_;
3340  ++modCount_;
3341  }
3342  return *this;
3343  }

References alignCSCRings::r.

◆ operator==()

template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator== ( const HistoND< Numeric, Axis > &  r) const
inline

Comparison for equality

Definition at line 1609 of file HistoND.h.

1609  {
1610  return dim_ == r.dim_ && fillCount_ == r.fillCount_ && overCount_ == r.overCount_ && title_ == r.title_ &&
1611  accumulatedDataLabel_ == r.accumulatedDataLabel_ && axes_ == r.axes_ && overflow_ == r.overflow_ &&
1612  data_ == r.data_;
1613  }

References alignCSCRings::r.

◆ overflows()

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 182 of file HistoND.h.

182 { return overflow_; }

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

◆ read()

template<typename Numeric , class Axis >
HistoND< Numeric, Axis > * npstat::HistoND< Numeric, Axis >::read ( const gs::ClassId &  id,
std::istream &  in 
)
static

Definition at line 3501 of file HistoND.h.

3501  {
3502  static const gs::ClassId current(gs::ClassId::makeId<HistoND<Numeric, Axis> >());
3503  current.ensureSameId(id);
3504 
3506  gs::read_pod(in, &title);
3507 
3509  gs::read_pod(in, &accumulatedDataLabel);
3510 
3511  unsigned long fillCount = 0, overCount = 0;
3512  gs::read_pod(in, &fillCount);
3513  gs::read_pod(in, &overCount);
3514  if (in.fail())
3515  throw gs::IOReadFailure("In npstat::HistoND::read: input stream failure");
3516 
3517  std::vector<Axis> axes;
3518  gs::read_heap_obj_vector_as_placed(in, &axes);
3519  gs::ClassId ida(in, 1);
3520  ArrayND<Numeric> data, over;
3522  ArrayND<Numeric>::restore(ida, in, &over);
3523  CPP11_auto_ptr<HistoND<Numeric, Axis> > result(
3524  new HistoND<Numeric, Axis>(axes, title.c_str(), accumulatedDataLabel.c_str()));
3525  result->data_ = data;
3526  result->overflow_ = over;
3527  result->fillCount_ = fillCount;
3528  result->overCount_ = overCount;
3529  return result.release();
3530  }

References data, recoMuon::in, npstat::ArrayND< Numeric, StackLen, StackDim >::restore(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

◆ recalculateNFillsFromData()

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 3451 of file HistoND.h.

3451  {
3452  const long double nOver = overflow_.template sum<long double>();
3453  const long double nData = data_.template sum<long double>();
3454  overCount_ = static_cast<unsigned long>(nOver);
3455  fillCount_ = static_cast<unsigned long>(nData + nOver);
3456  ++modCount_;
3457  }

◆ scaleBinContents()

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 3410 of file HistoND.h.

3410  {
3411  if (dataLength != data_.length())
3412  throw npstat::NpstatInvalidArgument("In npstat::HistoND::scaleBinContents: incompatible data length");
3413  assert(data);
3414  Numeric* dat = const_cast<Numeric*>(data_.data());
3415  for (unsigned long i = 0; i < dataLength; ++i)
3416  dat[i] *= data[i];
3417  ++modCount_;
3418  }

References cms::cuda::assert(), data, and mps_fire::i.

◆ scaleOverflows()

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

Definition at line 3422 of file HistoND.h.

3422  {
3423  if (dataLength != overflow_.length())
3424  throw npstat::NpstatInvalidArgument("In npstat::HistoND::scaleOverflows: incompatible data length");
3425  assert(data);
3426  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3427  for (unsigned long i = 0; i < dataLength; ++i)
3428  dat[i] *= data[i];
3429  ++modCount_;
3430  }

References cms::cuda::assert(), data, and mps_fire::i.

◆ setAccumulatedDataLabel()

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 215 of file HistoND.h.

215  {
216  accumulatedDataLabel_ = newlabel ? newlabel : "";
217  ++modCount_;
218  }

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

◆ setAxisLabel()

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 221 of file HistoND.h.

221  {
222  axes_.at(axisNum).setLabel(newlabel);
223  ++modCount_;
224  }

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

◆ setBin() [1/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const Num2 &  v)
inline

Definition at line 3012 of file HistoND.h.

3012  {
3013  data_() = v;
3014  ++modCount_;
3015  }

References findQualityFiles::v.

◆ setBin() [2/12]

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 2998 of file HistoND.h.

2998  {
2999  data_.value(index, indexLen) = v;
3000  ++modCount_;
3001  }

References findQualityFiles::v.

◆ setBin() [3/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
const Num2 &  v 
)
inline

Definition at line 3026 of file HistoND.h.

3026  {
3027  data_(i0) = v;
3028  ++modCount_;
3029  }

References findQualityFiles::v.

◆ setBin() [4/12]

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 3040 of file HistoND.h.

3040  {
3041  data_(i0, i1) = v;
3042  ++modCount_;
3043  }

References testProducerWithPsetDescEmpty_cfi::i1, and findQualityFiles::v.

◆ setBin() [5/12]

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 3054 of file HistoND.h.

3054  {
3055  data_(i0, i1, i2) = v;
3056  ++modCount_;
3057  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and findQualityFiles::v.

◆ setBin() [6/12]

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

◆ setBin() [7/12]

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

◆ setBin() [8/12]

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 3077 of file HistoND.h.

3083  {
3084  data_(i0, i1, i2, i3, i4, i5) = v;
3085  ++modCount_;
3086  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBin() [9/12]

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 3090 of file HistoND.h.

3097  {
3098  data_(i0, i1, i2, i3, i4, i5, i6) = v;
3099  ++modCount_;
3100  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBin() [10/12]

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 3104 of file HistoND.h.

3112  {
3113  data_(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3114  ++modCount_;
3115  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBin() [11/12]

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 3119 of file HistoND.h.

3128  {
3129  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3130  ++modCount_;
3131  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBin() [12/12]

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 3135 of file HistoND.h.

3145  {
3146  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3147  ++modCount_;
3148  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinAt() [1/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const Num2 &  v)
inline

Definition at line 3019 of file HistoND.h.

3019  {
3020  data_.at() = v;
3021  ++modCount_;
3022  }

References findQualityFiles::v.

◆ setBinAt() [2/12]

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 3005 of file HistoND.h.

3005  {
3006  data_.valueAt(index, indexLen) = v;
3007  ++modCount_;
3008  }

References findQualityFiles::v.

◆ setBinAt() [3/12]

template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
const Num2 &  v 
)
inline

Definition at line 3033 of file HistoND.h.

3033  {
3034  data_.at(i0) = v;
3035  ++modCount_;
3036  }

References findQualityFiles::v.

◆ setBinAt() [4/12]

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 3047 of file HistoND.h.

3047  {
3048  data_.at(i0, i1) = v;
3049  ++modCount_;
3050  }

References testProducerWithPsetDescEmpty_cfi::i1, and findQualityFiles::v.

◆ setBinAt() [5/12]

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 3152 of file HistoND.h.

3152  {
3153  data_.at(i0, i1, i2) = v;
3154  ++modCount_;
3155  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and findQualityFiles::v.

◆ setBinAt() [6/12]

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

◆ setBinAt() [7/12]

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

◆ setBinAt() [8/12]

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 3175 of file HistoND.h.

3181  {
3182  data_.at(i0, i1, i2, i3, i4, i5) = v;
3183  ++modCount_;
3184  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinAt() [9/12]

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 3188 of file HistoND.h.

3195  {
3196  data_.at(i0, i1, i2, i3, i4, i5, i6) = v;
3197  ++modCount_;
3198  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinAt() [10/12]

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 3202 of file HistoND.h.

3210  {
3211  data_.at(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3212  ++modCount_;
3213  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinAt() [11/12]

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 3217 of file HistoND.h.

3226  {
3227  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3228  ++modCount_;
3229  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinAt() [12/12]

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 3233 of file HistoND.h.

3243  {
3244  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3245  ++modCount_;
3246  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and findQualityFiles::v.

◆ setBinContents()

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 3434 of file HistoND.h.

3436  {
3437  data_.setData(data, dataLength);
3438  if (clearOverflowsNow)
3439  clearOverflows();
3440  ++modCount_;
3441  }

References data.

◆ setBinsToConst()

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 780 of file HistoND.h.

780  {
782  ++modCount_;
783  }

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

◆ setLinearBin()

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBin ( const unsigned long  index,
const Num2 &  v 
)
inline

◆ setLinearBinAt()

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBinAt ( const unsigned long  index,
const Num2 &  v 
)
inline

◆ setNFillsOver()

template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setNFillsOver ( const unsigned long  i)
inline

Definition at line 812 of file HistoND.h.

812  {
813  overCount_ = i;
814  ++modCount_;
815  }

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

◆ setNFillsTotal()

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 808 of file HistoND.h.

808  {
809  fillCount_ = i;
810  ++modCount_;
811  }

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

◆ setOverflows()

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 3445 of file HistoND.h.

3445  {
3446  overflow_.setData(data, dataLength);
3447  ++modCount_;
3448  }

References data.

◆ setOverflowsToConst()

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 790 of file HistoND.h.

790  {
792  ++modCount_;
793  }

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

◆ setTitle()

template<typename Numeric, class Axis = HistoAxis>
void npstat::HistoND< Numeric, Axis >::setTitle ( const char *  newtitle)
inline

Modify the histogram title

Definition at line 209 of file HistoND.h.

209  {
210  title_ = newtitle ? newtitle : "";
211  ++modCount_;
212  }

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

◆ title()

template<typename Numeric, class Axis = HistoAxis>
const std::string& npstat::HistoND< Numeric, Axis >::title ( ) const
inline

Histogram title

Definition at line 173 of file HistoND.h.

173 { return title_; }

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

◆ transpose()

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 3346 of file HistoND.h.

3346  {
3347  if (axisNum1 >= dim_ || axisNum2 >= dim_)
3349  "In npstat::HistoND::transpose: "
3350  "axis number is out of range");
3351  if (axisNum1 == axisNum2)
3352  // Just make a copy
3353  return *this;
3354  else
3355  return HistoND(*this, axisNum1, axisNum2);
3356  }

◆ version()

template<typename Numeric, class Axis = HistoAxis>
static unsigned npstat::HistoND< Numeric, Axis >::version ( )
inlinestatic

Definition at line 926 of file HistoND.h.

926 { return 1; }

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

◆ volume()

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 1633 of file HistoND.h.

1633  {
1634  double v = 1.0;
1635  if (dim_) {
1636  const Axis* ax = &axes_[0];
1637  for (unsigned i = 0; i < dim_; ++i)
1638  v *= (ax[i].max() - ax[i].min());
1639  }
1640  return v;
1641  }

References mps_fire::i, SiStripPI::max, min(), and findQualityFiles::v.

◆ write()

template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::write ( std::ostream &  of) const

Definition at line 3490 of file HistoND.h.

3490  {
3491  gs::write_pod(of, title_);
3492  gs::write_pod(of, accumulatedDataLabel_);
3493  gs::write_pod(of, fillCount_);
3494  gs::write_pod(of, overCount_);
3495 
3496  return !of.fail() && gs::write_obj_vector(of, axes_) && data_.classId().write(of) && data_.write(of) &&
3497  overflow_.write(of);
3498  }

Friends And Related Function Documentation

◆ HistoND

template<typename Numeric, class Axis = HistoAxis>
template<typename Num2 , class Axis2 >
friend class HistoND
friend

Definition at line 45 of file HistoND.h.

Member Data Documentation

◆ accumulatedDataLabel_

template<typename Numeric, class Axis = HistoAxis>
std::string npstat::HistoND< Numeric, Axis >::accumulatedDataLabel_
private

◆ axes_

template<typename Numeric, class Axis = HistoAxis>
std::vector<Axis> npstat::HistoND< Numeric, Axis >::axes_
private

◆ data_

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

◆ dim_

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

◆ fillCount_

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::fillCount_
private

◆ indexBuf_

template<typename Numeric, class Axis = HistoAxis>
std::vector<unsigned> npstat::HistoND< Numeric, Axis >::indexBuf_
mutableprivate

Definition at line 952 of file HistoND.h.

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

◆ modCount_

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::modCount_
private

◆ overCount_

template<typename Numeric, class Axis = HistoAxis>
unsigned long npstat::HistoND< Numeric, Axis >::overCount_
private

◆ overflow_

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

◆ title_

template<typename Numeric, class Axis = HistoAxis>
std::string npstat::HistoND< Numeric, Axis >::title_
private

◆ weightBuf_

template<typename Numeric, class Axis = HistoAxis>
std::vector<double> npstat::HistoND< Numeric, Axis >::weightBuf_
mutableprivate

Definition at line 951 of file HistoND.h.

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

personalPlayback.level
level
Definition: personalPlayback.py:22
npstat::HistoND::fillPreservingCentroid
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1740
bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
npstat::HistoND::HistoND
HistoND()=delete
dttmaxenums::L
Definition: DTTMax.h:29
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
mps_fire.i
i
Definition: mps_fire.py:428
npstat::HistoND::data_
ArrayND< Numeric > data_
Definition: HistoND.h:948
npstat::ArrayND::write
bool write(std::ostream &of) const
Definition: ArrayND.h:5378
npstat::ArrayND::restore
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:5386
npstat::ArrayND::uninitialize
ArrayND & uninitialize()
Definition: ArrayND.h:4356
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
min
T min(T a, T b)
Definition: MathUtil.h:58
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
npstat::HistoND::weightBuf_
std::vector< double > weightBuf_
Definition: HistoND.h:951
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
npstat::HistoND::clearBinContents
void clearBinContents()
Definition: HistoND.h:1247
npstat::HistoND::overCount_
unsigned long overCount_
Definition: HistoND.h:954
cms::cuda::assert
assert(be >=bs)
npstat::HistoND::overflow_
ArrayND< Numeric > overflow_
Definition: HistoND.h:949
npstat::HistoND::boundingBox
BoxND< double > boundingBox() const
Definition: HistoND.h:1538
npstat::HistoND::AVERAGE
Definition: HistoND.h:51
npstat::HistoND::accumulateBinsLoop
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
Definition: HistoND.h:1202
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
npstat::ArrayND::rank
unsigned rank() const
Definition: ArrayND.h:242
findQualityFiles.v
v
Definition: findQualityFiles.py:179
npstat::Private::shapeWithExtraAxis
ArrayShape shapeWithExtraAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1174
npstat::PreciseType::type
PreciseTypeHelper< T, gs::IOIsNumber< T >::value >::type type
Definition: PreciseType.h:36
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
npstat::ArrayShape
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
npstat::ArrayND::constFill
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4342
npstat::HistoND::accumulatedDataLabel
const std::string & accumulatedDataLabel() const
Definition: HistoND.h:176
npstat::HistoND::SAMPLE
Definition: HistoND.h:51
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
npstat::ArrayND::data
const Numeric * data() const
Definition: ArrayND.h:236
w
const double w
Definition: UKUtility.cc:23
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99170
npstat::ArrayND::length
unsigned long length() const
Definition: ArrayND.h:233
npstat::ArrayND::value
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
HLT_FULL_cff.zAxis
zAxis
Definition: HLT_FULL_cff.py:46155
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
npstat::ArrayND::at
Numeric & at()
Definition: ArrayND.h:3268
h
CastorDigiReco.o1
o1
Definition: CastorDigiReco.py:84
npstat::NpstatInvalidArgument
Definition: NpstatException.h:38
npstat::HistoND::axes
const std::vector< Axis > & axes() const
Definition: HistoND.h:185
npstat::HistoND::title
const std::string & title() const
Definition: HistoND.h:173
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
npstat::HistoND::isUniformlyBinned
bool isUniformlyBinned() const
Definition: HistoND.h:1511
npstat::ArrayND::addToProjection
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:2129
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
npstat::ArrayND::classId
gs::ClassId classId() const
Definition: ArrayND.h:1039
HLT_FULL_cff.yAxis
yAxis
Definition: HLT_FULL_cff.py:46156
npstat::ArrayND::clear
ArrayND & clear()
Definition: ArrayND.h:4351
plotT0FromHistos.binNumber
def binNumber(station, sl)
Definition: plotT0FromHistos.py:6
recoMuon::in
Definition: RecoMuonEnumerators.h:6
npstat::HistoND::fillCount_
unsigned long fillCount_
Definition: HistoND.h:953
npstat::Private::h_badargs
void h_badargs(const char *method)
Definition: HistoND.h:1192
npstat::HistoND::clearOverflows
void clearOverflows()
Definition: HistoND.h:1254
npstat::HistoND::SUM
Definition: HistoND.h:51
value
Definition: value.py:1
npstat::HistoND::dim_
unsigned dim_
Definition: HistoND.h:956
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
npstat::ArrayND::valueAt
Numeric & valueAt(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3208
npstat::HistoND::clear
void clear()
Definition: HistoND.h:1261
npstat::ArrayND::convertLinearIndex
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
npstat::ArrayND::strides
const unsigned long * strides() const
Definition: ArrayND.h:263
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
npstat::Private::axesOfASlice
std::vector< Axis > axesOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1086
alignCSCRings.r
r
Definition: alignCSCRings.py:93
npstat::ArrayND::linearValueAt
Numeric & linearValueAt(unsigned long index)
Definition: ArrayND.h:3133
npstat::Private::makeHistoShape
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1010
mixOne_premix_on_sim_cfi.accumulator
accumulator
Definition: mixOne_premix_on_sim_cfi.py:167
npstat::NpstatOutOfRange
Definition: NpstatException.h:30
npstat::HistoND::binCenter
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1550
npstat::Private::addAxis
std::vector< Axis > addAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1155
npstat::HistoND::binVolume
double binVolume(unsigned long binNumber=0) const
Definition: HistoND.h:1621
npstat::HistoND::modCount_
unsigned long modCount_
Definition: HistoND.h:955
npstat::ArrayND::setData
ArrayND & setData(const Num2 *data, unsigned long dataLength)
HLT_FULL_cff.xAxis
xAxis
Definition: HLT_FULL_cff.py:46154
npstat::HistoND::accumulatedDataLabel_
std::string accumulatedDataLabel_
Definition: HistoND.h:947
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:311
npstat::Private::shapeOfASlice
ArrayShape shapeOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1118
npstat::ArrayND::linearValue
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3123
npstat::HistoND::axes_
std::vector< Axis > axes_
Definition: HistoND.h:950
label
const char * label
Definition: PFTauDecayModeTools.cc:11
npstat::HistoND::axis
const Axis & axis(const unsigned i) const
Definition: HistoND.h:188
weight
Definition: weight.py:1
npstat::HistoND::indexBuf_
std::vector< unsigned > indexBuf_
Definition: HistoND.h:952
npstat::Private::rebinAxes
std::vector< Axis > rebinAxes(const std::vector< Axis > &axes, const unsigned *newBins, const unsigned lenNewBins)
Definition: HistoND.h:1071
npstat::HistoND::title_
std::string title_
Definition: HistoND.h:946