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

Static Public Member Functions

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

Private Member Functions

template<typename Acc >
void accumulateBinsLoop (unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
 
template<typename Num2 >
void fillPreservingCentroid (const Num2 &weight)
 
 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.

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

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

1270  : title_(title ? title : ""),
1272  data_(Private::makeHistoShape(axesIn)),
1273  overflow_(ArrayShape(axesIn.size(), 3U)),
1274  axes_(axesIn),
1275  weightBuf_(axesIn.size()),
1276  indexBuf_(2U * axesIn.size()),
1277  modCount_(0UL),
1278  dim_(axesIn.size()) {
1279  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1281  "In npstat::HistoND constructor: requested histogram "
1282  "dimensionality is not supported (too large)");
1283  clear();
1284  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1288  : title_(title ? title : ""),
1291  overflow_(ArrayShape(1U, 3U)),
1292  weightBuf_(1U),
1293  indexBuf_(2U * 1U),
1294  modCount_(0UL),
1295  dim_(1U) {
1296  axes_.reserve(dim_);
1297  axes_.push_back(xAxis);
1298  clear();
1299  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1303  : title_(title ? title : ""),
1306  overflow_(ArrayShape(2U, 3U)),
1307  weightBuf_(2U),
1308  indexBuf_(2U * 2U),
1309  modCount_(0UL),
1310  dim_(2U) {
1311  axes_.reserve(dim_);
1312  axes_.push_back(xAxis);
1313  axes_.push_back(yAxis);
1314  clear();
1315  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1320  : title_(title ? title : ""),
1323  overflow_(ArrayShape(3U, 3U)),
1324  weightBuf_(3U),
1325  indexBuf_(2U * 3U),
1326  modCount_(0UL),
1327  dim_(3U) {
1328  axes_.reserve(dim_);
1329  axes_.push_back(xAxis);
1330  axes_.push_back(yAxis);
1331  axes_.push_back(zAxis);
1332  clear();
1333  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1338  : title_(title ? title : ""),
1341  overflow_(ArrayShape(4U, 3U)),
1342  weightBuf_(4U),
1343  indexBuf_(2U * 4U),
1344  modCount_(0UL),
1345  dim_(4U) {
1346  axes_.reserve(dim_);
1347  axes_.push_back(xAxis);
1348  axes_.push_back(yAxis);
1349  axes_.push_back(zAxis);
1350  axes_.push_back(tAxis);
1351  clear();
1352  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1362  : title_(title ? title : ""),
1364  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
1365  overflow_(ArrayShape(5U, 3U)),
1366  weightBuf_(5U),
1367  indexBuf_(2U * 5U),
1368  modCount_(0UL),
1369  dim_(5U) {
1370  axes_.reserve(dim_);
1371  axes_.push_back(xAxis);
1372  axes_.push_back(yAxis);
1373  axes_.push_back(zAxis);
1374  axes_.push_back(tAxis);
1375  axes_.push_back(vAxis);
1376  clear();
1377  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:1011
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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, SiStripPI::min, and l1trig_cff::shape.

1384  : title_(title ? title : ""),
1386  data_(shape),
1387  overflow_(ArrayShape(shape.size(), 3U)),
1388  weightBuf_(shape.size()),
1389  indexBuf_(2U * shape.size()),
1390  modCount_(0UL),
1391  dim_(shape.size()) {
1392  if (boundingBox.size() != dim_)
1394  "In npstat::HistoND constructor: "
1395  "incompatible bounding box dimensionality");
1396  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1398  "In npstat::HistoND constructor: requested histogram "
1399  "dimensionality is not supported (too large)");
1400  axes_.reserve(dim_);
1401  for (unsigned i = 0; i < dim_; ++i)
1402  axes_.push_back(Axis(shape[i], boundingBox[i].min(), boundingBox[i].max()));
1403  clear();
1404  }
unsigned dim_
Definition: HistoND.h:957
BoxND< double > boundingBox() const
Definition: HistoND.h:1539
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

1409  : title_(title ? title : ""),
1411  data_(r.data_, f),
1412  overflow_(r.overflow_, f),
1413  axes_(r.axes_),
1414  weightBuf_(r.dim_),
1415  indexBuf_(2U * r.dim_),
1416  fillCount_(r.fillCount_),
1417  overCount_(r.overCount_),
1418  modCount_(0UL),
1419  dim_(r.dim_) {}
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
char const * label
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1427  : title_(title ? title : ""),
1428  accumulatedDataLabel_(h.accumulatedDataLabel_),
1429  data_(Private::shapeOfASlice(h.axes_, indices, nIndices)),
1431  axes_(Private::axesOfASlice(h.axes_, indices, nIndices)),
1432  weightBuf_(data_.rank()),
1433  indexBuf_(2U * data_.rank()),
1434  modCount_(0UL),
1435  dim_(data_.rank()) {
1436  clear();
1437  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axesOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1087
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayShape shapeOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1119
ArrayND< Numeric > overflow_
Definition: HistoND.h:950
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
unsigned rank() const
Definition: ArrayND.h:242

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

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

1445  : title_(title ? title : ""),
1446  accumulatedDataLabel_(h.accumulatedDataLabel_),
1447  data_(Private::shapeWithExtraAxis(h.axes_, newAxis, newAxisNumber)),
1448  overflow_(data_.rank(), 3U),
1449  axes_(Private::addAxis(h.axes_, newAxis, newAxisNumber)),
1450  weightBuf_(data_.rank()),
1451  indexBuf_(2U * data_.rank()),
1452  modCount_(0UL),
1453  dim_(data_.rank()) {
1454  if (dim_ >= CHAR_BIT * sizeof(unsigned long))
1456  "In npstat::HistoND constructor: requested histogram "
1457  "dimensionality is not supported (too large)");
1458  clear();
1459  }
unsigned dim_
Definition: HistoND.h:957
void clear()
Definition: HistoND.h:1262
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > addAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1156
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
unsigned rank() const
Definition: ArrayND.h:242
ArrayShape shapeWithExtraAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1175

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

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_, h, 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.

1469  : title_(title ? title : h.title_.c_str()),
1470  accumulatedDataLabel_(h.accumulatedDataLabel_),
1471  data_(newBinCounts, lenNewBinCounts),
1472  overflow_(h.overflow_),
1473  axes_(Private::rebinAxes(h.axes_, newBinCounts, lenNewBinCounts)),
1474  weightBuf_(h.dim_),
1475  indexBuf_(2U * h.dim_),
1476  fillCount_(h.fillCount_),
1477  overCount_(h.overCount_),
1478  modCount_(0UL),
1479  dim_(h.dim_) {
1480  const unsigned long newBins = data_.length();
1481  const Axis* ax = &axes_[0];
1482  unsigned* ubuf = &indexBuf_[0];
1483 
1484  // Fill out the bins of the new histogram
1485  if (rType == SAMPLE) {
1486  double* buf = &weightBuf_[0];
1487  for (unsigned long ibin = 0; ibin < newBins; ++ibin) {
1488  data_.convertLinearIndex(ibin, ubuf, dim_);
1489  if (shifts)
1490  for (unsigned i = 0; i < dim_; ++i)
1491  buf[i] = ax[i].binCenter(ubuf[i]) + shifts[i];
1492  else
1493  for (unsigned i = 0; i < dim_; ++i)
1494  buf[i] = ax[i].binCenter(ubuf[i]);
1495  data_.linearValue(ibin) = h.examine(buf, dim_);
1496  }
1497  } else {
1498  const Numeric zero = Numeric();
1499  BoxND<double> binLimits(dim_);
1500  for (unsigned long ibin = 0; ibin < newBins; ++ibin) {
1501  data_.convertLinearIndex(ibin, ubuf, dim_);
1502  for (unsigned i = 0; i < dim_; ++i)
1503  binLimits[i] = ax[i].binInterval(ubuf[i]);
1504  Numeric& thisBin(data_.linearValue(ibin));
1505  thisBin = zero;
1506  h.accumulateBinsInBox(binLimits, &thisBin, rType == AVERAGE);
1507  }
1508  }
1509  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
unsigned long modCount_
Definition: HistoND.h:956
const std::string & title() const
Definition: HistoND.h:176
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3123
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1551
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > rebinAxes(const std::vector< Axis > &axes, const unsigned *newBins, const unsigned lenNewBins)
Definition: HistoND.h:1072
unsigned long length() const
Definition: ArrayND.h:233
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ HistoND() [12/14]

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

Copy constructor

Definition at line 3313 of file HistoND.h.

3314  : title_(r.title_),
3315  accumulatedDataLabel_(r.accumulatedDataLabel_),
3316  data_(r.data_),
3317  overflow_(r.overflow_),
3318  axes_(r.axes_),
3319  weightBuf_(r.weightBuf_),
3320  indexBuf_(r.indexBuf_),
3321  fillCount_(r.fillCount_),
3322  overCount_(r.overCount_),
3323  modCount_(0UL),
3324  dim_(r.dim_) {}
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
unsigned long modCount_
Definition: HistoND.h:956
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ HistoND() [13/14]

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

Default constructor not implemented

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

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

3298  : title_(r.title_),
3299  accumulatedDataLabel_(r.accumulatedDataLabel_),
3300  data_(r.data_.transpose(ax1, ax2)),
3301  overflow_(r.overflow_.transpose(ax1, ax2)),
3302  axes_(r.axes_),
3303  weightBuf_(r.weightBuf_),
3304  indexBuf_(r.indexBuf_),
3305  fillCount_(r.fillCount_),
3306  overCount_(r.overCount_),
3307  modCount_(0UL),
3308  dim_(r.dim_) {
3309  std::swap(axes_[ax1], axes_[ax2]);
3310  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
unsigned long modCount_
Definition: HistoND.h:956
std::string title_
Definition: HistoND.h:947
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:112
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1230  {
1231  if (box.size() != dim_)
1233  "In npstat::HistoND::accumulateBinsInBox: "
1234  "incompatible box dimensionality");
1236  if (dim_) {
1237  long double wsum = 0.0L;
1238  for (unsigned i = 0; i < dim_; ++i)
1239  indexBuf_[i] = 0U;
1240  accumulateBinsLoop(0U, box, &indexBuf_[0], accumulator, 1.0, &wsum);
1241  if (calculateAverage && wsum > 0.0L)
1242  *accumulator *= static_cast<double>(1.0L / wsum);
1243  } else
1244  *accumulator += 1.0 * data_();
1245  }
unsigned dim_
Definition: HistoND.h:957
assert(be >=bs)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
Definition: HistoND.h:1203
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953

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

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

1208  {
1209  const Interval<double>& boxSide(box[level]);
1210  const Axis& axis(axes_[level]);
1211  const unsigned nbins = axis.nBins();
1212  const bool lastLevel = level == dim_ - 1U;
1213  for (unsigned i = 0; i < nbins; ++i) {
1214  const double over = overlapFraction * axis.binInterval(i).overlapFraction(boxSide);
1215  if (over > 0.0) {
1216  idx[level] = i;
1217  if (lastLevel) {
1218  *accumulator += over * data_.value(idx, dim_);
1219  *wsum += over;
1220  } else
1221  accumulateBinsLoop(level + 1U, box, idx, accumulator, over, wsum);
1222  }
1223  }
1224  }
unsigned dim_
Definition: HistoND.h:957
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
Definition: HistoND.h:1203
const Axis & axis(const unsigned i) const
Definition: HistoND.h:191
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

179 { return accumulatedDataLabel_; }
std::string accumulatedDataLabel_
Definition: HistoND.h:948

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

References data, and mps_fire::i.

3361  {
3362  const unsigned long nDat = data_.length();
3363  Numeric* data = const_cast<Numeric*>(data_.data());
3364  for (unsigned long i = 0; i < nDat; ++i)
3365  data[i] += weight;
3366  fillCount_ += nDat;
3367  ++modCount_;
3368  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
Definition: weight.py:1
const Numeric * data() const
Definition: ArrayND.h:236
ArrayND< Numeric > data_
Definition: HistoND.h:949
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233

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

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

3384  {
3385  if (dataLength != data_.length())
3386  throw npstat::NpstatInvalidArgument("In npstat::HistoND::addToBinContents: incompatible data length");
3387  assert(data);
3388  Numeric* dat = const_cast<Numeric*>(data_.data());
3389  for (unsigned long i = 0; i < dataLength; ++i)
3390  dat[i] += data[i];
3391  fillCount_ += dataLength;
3392  ++modCount_;
3393  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
const Numeric * data() const
Definition: ArrayND.h:236
ArrayND< Numeric > data_
Definition: HistoND.h:949
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233

◆ addToOverflows() [1/2]

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

Definition at line 3372 of file HistoND.h.

References data, and mps_fire::i.

3372  {
3373  const unsigned long nOver = overflow_.length();
3374  Numeric* data = const_cast<Numeric*>(overflow_.data());
3375  for (unsigned long i = 0; i < nOver; ++i)
3376  data[i] += weight;
3377  overCount_ += nOver;
3378  fillCount_ += nOver;
3379  ++modCount_;
3380  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
Definition: weight.py:1
const Numeric * data() const
Definition: ArrayND.h:236
unsigned long overCount_
Definition: HistoND.h:955
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

3397  {
3398  if (dataLength != overflow_.length())
3399  throw npstat::NpstatInvalidArgument("In npstat::HistoND::addToOverflows: incompatible data length");
3400  assert(data);
3401  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3402  for (unsigned long i = 0; i < dataLength; ++i)
3403  dat[i] += data[i];
3404  overCount_ += dataLength;
3405  fillCount_ += dataLength;
3406  ++modCount_;
3407  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
const Numeric * data() const
Definition: ArrayND.h:236
unsigned long overCount_
Definition: HistoND.h:955
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

References cms::cuda::assert().

3465  {
3466  assert(projection);
3467  data_.addToProjection(&projection->data_, projector, projectedIndices, nProjectedIndices);
3468  projection->fillCount_ += projection->nBins();
3469  projection->modCount_++;
3470  }
assert(be >=bs)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:2129

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

References cms::cuda::assert().

3477  {
3478  assert(projection);
3479  data_.addToProjection(&projection->data_, projector, projectedIndices, nProjectedIndices);
3480  projection->fillCount_ += projection->nBins();
3481  projection->modCount_++;
3482  }
assert(be >=bs)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:2129

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

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

1569  {
1570  assert(centers);
1571  centers->clear();
1572  const unsigned long len = data_.length();
1573  centers->reserve(len);
1574  unsigned* ibuf = &indexBuf_[0];
1575  const Axis* ax = &axes_[0];
1576  Point center;
1577  if (center.size() < dim_)
1579  "In npstat::HistoND::allBinCenters: "
1580  "incompatible point dimensionality (too small)");
1581  typename Point::value_type* cdat = &center[0];
1582 
1583  for (unsigned long i = 0; i < len; ++i) {
1584  data_.convertLinearIndex(i, ibuf, dim_);
1585  for (unsigned idim = 0; idim < dim_; ++idim)
1586  cdat[idim] = ax[idim].binCenter(ibuf[idim]);
1587  centers->push_back(center);
1588  }
1589  }
unsigned dim_
Definition: HistoND.h:957
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1551
assert(be >=bs)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
Structure Point Contains parameters of Gaussian fits to DMRs.
unsigned long length() const
Definition: ArrayND.h:233
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ axes()

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

Inspect histogram axes

Definition at line 188 of file HistoND.h.

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

188 { return axes_; }
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

191 { return axes_.at(i); }
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

1592  {
1593  assert(box);
1594  box->clear();
1595  if (dim_) {
1596  box->reserve(dim_);
1598  const Axis* ax = &axes_[0];
1599  for (unsigned i = 0; i < dim_; ++i)
1600  box->push_back(ax[i].binInterval(indexBuf_[i]));
1601  }
1602  }
unsigned dim_
Definition: HistoND.h:957
assert(be >=bs)
def binNumber(station, sl)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

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

1553  {
1554  if (dim_ != lenCoords)
1556  "In npstat::HistoND::binCenter: "
1557  "incompatible input point dimensionality");
1558  if (dim_) {
1559  assert(coords);
1561  const Axis* ax = &axes_[0];
1562  for (unsigned i = 0; i < dim_; ++i)
1563  coords[i] = ax[i].binCenter(indexBuf_[i]);
1564  }
1565  }
unsigned dim_
Definition: HistoND.h:957
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1551
assert(be >=bs)
def binNumber(station, sl)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

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

182 { return data_; }
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

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

1622  {
1623  double v = 1.0;
1624  if (dim_) {
1626  const Axis* ax = &axes_[0];
1627  for (unsigned i = 0; i < dim_; ++i)
1628  v *= ax[i].binWidth(indexBuf_[i]);
1629  }
1630  return v;
1631  }
unsigned dim_
Definition: HistoND.h:957
def binNumber(station, sl)
ArrayND< Numeric > data_
Definition: HistoND.h:949
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ boundingBox()

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

Bounding box for the whole histogram

Definition at line 1539 of file HistoND.h.

References mps_fire::i.

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

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

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

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

◆ classname()

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

Definition at line 3485 of file HistoND.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

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

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

1262  {
1263  clearBinContents();
1264  clearOverflows();
1265  ++modCount_;
1266  }
unsigned long modCount_
Definition: HistoND.h:956
void clearOverflows()
Definition: HistoND.h:1255
void clearBinContents()
Definition: HistoND.h:1248

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

1248  {
1249  data_.clear();
1250  fillCount_ = 0UL;
1251  ++modCount_;
1252  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
ArrayND & clear()
Definition: ArrayND.h:4351
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

1255  {
1256  overflow_.clear();
1257  overCount_ = 0UL;
1258  ++modCount_;
1259  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND & clear()
Definition: ArrayND.h:4351
unsigned long overCount_
Definition: HistoND.h:955
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ closestBin() [1/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 1723 of file HistoND.h.

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

1723  {
1724  if (coordLength != dim_)
1726  "In npstat::HistoND::closestBin: "
1727  "incompatible input point dimensionality");
1728  if (coordLength) {
1729  assert(coords);
1730  unsigned* idx = &indexBuf_[0];
1731  const Axis* ax = &axes_[0];
1732  for (unsigned i = 0; i < dim_; ++i)
1733  idx[i] = ax[i].closestValidBin(coords[i]);
1734  return data_.value(idx, dim_);
1735  } else
1736  return data_();
1737  }
unsigned dim_
Definition: HistoND.h:957
assert(be >=bs)
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ closestBin() [2/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 1828 of file HistoND.h.

References npstat::Private::h_badargs().

1828  {
1829  if (dim_)
1830  Private::h_badargs("closestBin");
1831  return data_();
1832  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ closestBin() [3/12]

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

Definition at line 1896 of file HistoND.h.

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

1896  {
1897  if (dim_ != 1U)
1898  Private::h_badargs("closestBin");
1899  const unsigned i0 = axes_[0].closestValidBin(x0);
1900  return data_(i0);
1901  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ closestBin() [4/12]

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

Definition at line 1973 of file HistoND.h.

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

1973  {
1974  if (dim_ != 2U)
1975  Private::h_badargs("closestBin");
1976  const Axis* ax = &axes_[0];
1977  const unsigned i0 = ax[0].closestValidBin(x0);
1978  const unsigned i1 = ax[1].closestValidBin(x1);
1979  return data_(i0, i1);
1980  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2056  {
2057  if (dim_ != 3U)
2058  Private::h_badargs("closestBin");
2059  const Axis* ax = &axes_[0];
2060  const unsigned i0 = ax[0].closestValidBin(x0);
2061  const unsigned i1 = ax[1].closestValidBin(x1);
2062  const unsigned i2 = ax[2].closestValidBin(x2);
2063  return data_(i0, i1, i2);
2064  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2151  {
2152  if (dim_ != 4U)
2153  Private::h_badargs("closestBin");
2154  const Axis* ax = &axes_[0];
2155  const unsigned i0 = ax[0].closestValidBin(x0);
2156  const unsigned i1 = ax[1].closestValidBin(x1);
2157  const unsigned i2 = ax[2].closestValidBin(x2);
2158  const unsigned i3 = ax[3].closestValidBin(x3);
2159  return data_(i0, i1, i2, i3);
2160  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2249  {
2250  if (dim_ != 5U)
2251  Private::h_badargs("closestBin");
2252  const Axis* ax = &axes_[0];
2253  const unsigned i0 = ax[0].closestValidBin(x0);
2254  const unsigned i1 = ax[1].closestValidBin(x1);
2255  const unsigned i2 = ax[2].closestValidBin(x2);
2256  const unsigned i3 = ax[3].closestValidBin(x3);
2257  const unsigned i4 = ax[4].closestValidBin(x4);
2258  return data_(i0, i1, i2, i3, i4);
2259  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2368  {
2369  if (dim_ != 6U)
2370  Private::h_badargs("closestBin");
2371  const Axis* ax = &axes_[0];
2372  const unsigned i0 = ax[0].closestValidBin(x0);
2373  const unsigned i1 = ax[1].closestValidBin(x1);
2374  const unsigned i2 = ax[2].closestValidBin(x2);
2375  const unsigned i3 = ax[3].closestValidBin(x3);
2376  const unsigned i4 = ax[4].closestValidBin(x4);
2377  const unsigned i5 = ax[5].closestValidBin(x5);
2378  return data_(i0, i1, i2, i3, i4, i5);
2379  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2505  {
2506  if (dim_ != 7U)
2507  Private::h_badargs("closestBin");
2508  const Axis* ax = &axes_[0];
2509  const unsigned i0 = ax[0].closestValidBin(x0);
2510  const unsigned i1 = ax[1].closestValidBin(x1);
2511  const unsigned i2 = ax[2].closestValidBin(x2);
2512  const unsigned i3 = ax[3].closestValidBin(x3);
2513  const unsigned i4 = ax[4].closestValidBin(x4);
2514  const unsigned i5 = ax[5].closestValidBin(x5);
2515  const unsigned i6 = ax[6].closestValidBin(x6);
2516  return data_(i0, i1, i2, i3, i4, i5, i6);
2517  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2652  {
2653  if (dim_ != 8U)
2654  Private::h_badargs("closestBin");
2655  const Axis* ax = &axes_[0];
2656  const unsigned i0 = ax[0].closestValidBin(x0);
2657  const unsigned i1 = ax[1].closestValidBin(x1);
2658  const unsigned i2 = ax[2].closestValidBin(x2);
2659  const unsigned i3 = ax[3].closestValidBin(x3);
2660  const unsigned i4 = ax[4].closestValidBin(x4);
2661  const unsigned i5 = ax[5].closestValidBin(x5);
2662  const unsigned i6 = ax[6].closestValidBin(x6);
2663  const unsigned i7 = ax[7].closestValidBin(x7);
2664  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2665  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

2809  {
2810  if (dim_ != 9U)
2811  Private::h_badargs("closestBin");
2812  const Axis* ax = &axes_[0];
2813  const unsigned i0 = ax[0].closestValidBin(x0);
2814  const unsigned i1 = ax[1].closestValidBin(x1);
2815  const unsigned i2 = ax[2].closestValidBin(x2);
2816  const unsigned i3 = ax[3].closestValidBin(x3);
2817  const unsigned i4 = ax[4].closestValidBin(x4);
2818  const unsigned i5 = ax[5].closestValidBin(x5);
2819  const unsigned i6 = ax[6].closestValidBin(x6);
2820  const unsigned i7 = ax[7].closestValidBin(x7);
2821  const unsigned i8 = ax[8].closestValidBin(x8);
2822  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2823  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951

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

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

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

◆ dim()

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

Histogram dimensionality

Definition at line 173 of file HistoND.h.

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

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

173 { return dim_; }
unsigned dim_
Definition: HistoND.h:957

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

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

1674  {
1675  if (coordLength != dim_)
1677  "In npstat::HistoND::dispatch: "
1678  "incompatible input point dimensionality");
1679  if (coordLength) {
1680  assert(coords);
1681  unsigned* idx = &indexBuf_[0];
1682  unsigned* over = idx + dim_;
1683  const Axis* ax = &axes_[0];
1684  unsigned overflown = 0U;
1685  for (unsigned i = 0; i < dim_; ++i) {
1686  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1687  overflown |= (over[i] - 1U);
1688  }
1689  if (overflown)
1690  f(overflow_.value(over, dim_), w);
1691  else
1692  f(data_.value(idx, dim_), w);
1693  } else
1694  f(data_(), w);
1695  ++modCount_;
1696  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ dispatch() [2/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 1803 of file HistoND.h.

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

1803  {
1804  if (dim_)
1805  Private::h_badargs("dispatch");
1806  f(data_(), w);
1807  ++modCount_;
1808  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]

◆ dispatch() [3/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 1853 of file HistoND.h.

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

1853  {
1854  if (dim_ != 1U)
1855  Private::h_badargs("dispatch");
1856  unsigned i0 = 0;
1857  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1858  if (ov0 == 1U)
1859  f(data_(i0), w);
1860  else
1861  f(overflow_(ov0), w);
1862  ++modCount_;
1863  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ dispatch() [4/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 1924 of file HistoND.h.

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

1924  {
1925  if (dim_ != 2U)
1926  Private::h_badargs("dispatch");
1927  unsigned i0 = 0, i1 = 0;
1928  const Axis* ax = &axes_[0];
1929  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1930  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1931  if (o0 == 1U && o1 == 1U)
1932  f(data_(i0, i1), w);
1933  else
1934  f(overflow_(o0, o1), w);
1935  ++modCount_;
1936  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ 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,
Num2 &  weight,
Functor &  f 
)

Definition at line 2004 of file HistoND.h.

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

2004  {
2005  if (dim_ != 3U)
2006  Private::h_badargs("dispatch");
2007  unsigned i0 = 0, i1 = 0, i2 = 0;
2008  const Axis* ax = &axes_[0];
2009  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2010  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2011  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2012  if (o0 == 1U && o1 == 1U && o2 == 1U)
2013  f(data_(i0, i1, i2), w);
2014  else
2015  f(overflow_(o0, o1, o2), w);
2016  ++modCount_;
2017  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ 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,
Num2 &  weight,
Functor &  f 
)

Definition at line 2089 of file HistoND.h.

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

2090  {
2091  if (dim_ != 4U)
2092  Private::h_badargs("dispatch");
2093  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2094  const Axis* ax = &axes_[0];
2095  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2096  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2097  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2098  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2099  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2100  f(data_(i0, i1, i2, i3), w);
2101  else
2102  f(overflow_(o0, o1, o2, o3), w);
2103  ++modCount_;
2104  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2188  {
2189  if (dim_ != 5U)
2190  Private::h_badargs("dispatch");
2191  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2192  const Axis* ax = &axes_[0];
2193  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2194  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2195  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2196  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2197  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2198  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2199  f(data_(i0, i1, i2, i3, i4), w);
2200  else
2201  f(overflow_(o0, o1, o2, o3, o4), w);
2202  ++modCount_;
2203  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ 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,
double  x4,
double  x5,
Num2 &  weight,
Functor &  f 
)

Definition at line 2292 of file HistoND.h.

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

2299  {
2300  if (dim_ != 6U)
2301  Private::h_badargs("dispatch");
2302  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2303  const Axis* ax = &axes_[0];
2304  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2305  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2306  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2307  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2308  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2309  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2310  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2311  f(data_(i0, i1, i2, i3, i4, i5), w);
2312  else
2313  f(overflow_(o0, o1, o2, o3, o4, o5), w);
2314  ++modCount_;
2315  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ 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,
double  x3,
double  x4,
double  x5,
double  x6,
Num2 &  weight,
Functor &  f 
)

Definition at line 2414 of file HistoND.h.

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

2422  {
2423  if (dim_ != 7U)
2424  Private::h_badargs("dispatch");
2425  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2426  const Axis* ax = &axes_[0];
2427  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2428  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2429  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2430  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2431  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2432  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2433  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2434  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2435  f(data_(i0, i1, i2, i3, i4, i5, i6), w);
2436  else
2437  f(overflow_(o0, o1, o2, o3, o4, o5, o6), w);
2438  ++modCount_;
2439  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ dispatch() [10/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 2554 of file HistoND.h.

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

2563  {
2564  if (dim_ != 8U)
2565  Private::h_badargs("dispatch");
2566  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0;
2567  const Axis* ax = &axes_[0];
2568  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2569  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2570  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2571  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2572  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2573  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2574  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2575  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2576  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2577  f(data_(i0, i1, i2, i3, i4, i5, i6, i7), w);
2578  else
2579  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7), w);
2580  ++modCount_;
2581  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ dispatch() [11/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 2704 of file HistoND.h.

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

2714  {
2715  if (dim_ != 9U)
2716  Private::h_badargs("dispatch");
2717  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0;
2718  const Axis* ax = &axes_[0];
2719  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2720  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2721  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2722  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2723  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2724  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2725  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2726  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2727  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2728  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2729  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8), w);
2730  else
2731  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8), w);
2732  ++modCount_;
2733  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ dispatch() [12/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 2865 of file HistoND.h.

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

2876  {
2877  if (dim_ != 10U)
2878  Private::h_badargs("dispatch");
2879  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0, i9 = 0;
2880  const Axis* ax = &axes_[0];
2881  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2882  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2883  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2884  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2885  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2886  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2887  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2888  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2889  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2890  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2891  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2892  o9 == 1U)
2893  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9), w);
2894  else
2895  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9), w);
2896  ++modCount_;
2897  }
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ examine() [1/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 1699 of file HistoND.h.

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

1699  {
1700  if (coordLength != dim_)
1702  "In npstat::HistoND::examine: "
1703  "incompatible input point dimensionality");
1704  if (coordLength) {
1705  assert(coords);
1706  unsigned* idx = &indexBuf_[0];
1707  unsigned* over = idx + dim_;
1708  const Axis* ax = &axes_[0];
1709  unsigned overflown = 0U;
1710  for (unsigned i = 0; i < dim_; ++i) {
1711  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1712  overflown |= (over[i] - 1U);
1713  }
1714  if (overflown)
1715  return overflow_.value(over, dim_);
1716  else
1717  return data_.value(idx, dim_);
1718  } else
1719  return data_();
1720  }
unsigned dim_
Definition: HistoND.h:957
assert(be >=bs)
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ examine() [2/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 1821 of file HistoND.h.

References npstat::Private::h_badargs().

1821  {
1822  if (dim_)
1823  Private::h_badargs("examine");
1824  return data_();
1825  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ examine() [3/12]

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

Definition at line 1884 of file HistoND.h.

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

1884  {
1885  if (dim_ != 1U)
1886  Private::h_badargs("examine");
1887  unsigned i0 = 0;
1888  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1889  if (ov0 == 1U)
1890  return data_(i0);
1891  else
1892  return overflow_(ov0);
1893  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ examine() [4/12]

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

Definition at line 1959 of file HistoND.h.

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

1959  {
1960  if (dim_ != 2U)
1961  Private::h_badargs("examine");
1962  unsigned i0 = 0, i1 = 0;
1963  const Axis* ax = &axes_[0];
1964  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1965  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1966  if (o0 == 1U && o1 == 1U)
1967  return data_(i0, i1);
1968  else
1969  return overflow_(o0, o1);
1970  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2041  {
2042  if (dim_ != 3U)
2043  Private::h_badargs("examine");
2044  unsigned i0 = 0, i1 = 0, i2 = 0;
2045  const Axis* ax = &axes_[0];
2046  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2047  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2048  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2049  if (o0 == 1U && o1 == 1U && o2 == 1U)
2050  return data_(i0, i1, i2);
2051  else
2052  return overflow_(o0, o1, o2);
2053  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2132  {
2133  if (dim_ != 4U)
2134  Private::h_badargs("examine");
2135  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2136  const Axis* ax = &axes_[0];
2137  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2138  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2139  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2140  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2141  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2142  return data_(i0, i1, i2, i3);
2143  else
2144  return overflow_(o0, o1, o2, o3);
2145  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2231  {
2232  if (dim_ != 5U)
2233  Private::h_badargs("examine");
2234  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2235  const Axis* ax = &axes_[0];
2236  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2237  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2238  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2239  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2240  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2241  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2242  return data_(i0, i1, i2, i3, i4);
2243  else
2244  return overflow_(o0, o1, o2, o3, o4);
2245  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2349  {
2350  if (dim_ != 6U)
2351  Private::h_badargs("examine");
2352  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2353  const Axis* ax = &axes_[0];
2354  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2355  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2356  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2357  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2358  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2359  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2360  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2361  return data_(i0, i1, i2, i3, i4, i5);
2362  else
2363  return overflow_(o0, o1, o2, o3, o4, o5);
2364  }
unsigned dim_
Definition: HistoND.h:957
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1646  {
1647  if (coordLength != dim_)
1649  "In npstat::HistoND::fill: "
1650  "incompatible input point dimensionality");
1651  if (coordLength) {
1652  assert(coords);
1653  unsigned* idx = &indexBuf_[0];
1654  unsigned* over = idx + dim_;
1655  const Axis* ax = &axes_[0];
1656  unsigned overflown = 0U;
1657  for (unsigned i = 0; i < dim_; ++i) {
1658  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1659  overflown |= (over[i] - 1U);
1660  }
1661  if (overflown) {
1662  overflow_.value(over, dim_) += w;
1663  ++overCount_;
1664  } else
1665  data_.value(idx, dim_) += w;
1666  } else
1667  data_() += w;
1668  ++fillCount_;
1669  ++modCount_;
1670  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1793  {
1794  if (dim_)
1795  Private::h_badargs("fill");
1796  data_() += w;
1797  ++fillCount_;
1798  ++modCount_;
1799  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

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

1836  {
1837  if (dim_ != 1U)
1838  Private::h_badargs("fill");
1839  unsigned i0 = 0;
1840  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1841  if (ov0 == 1U)
1842  data_(i0) += w;
1843  else {
1844  overflow_(ov0) += w;
1845  ++overCount_;
1846  }
1847  ++fillCount_;
1848  ++modCount_;
1849  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1905  {
1906  if (dim_ != 2U)
1907  Private::h_badargs("fill");
1908  unsigned i0 = 0, i1 = 0;
1909  const Axis* ax = &axes_[0];
1910  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1911  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1912  if (o0 == 1U && o1 == 1U)
1913  data_(i0, i1) += w;
1914  else {
1915  overflow_(o0, o1) += w;
1916  ++overCount_;
1917  }
1918  ++fillCount_;
1919  ++modCount_;
1920  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1984  {
1985  if (dim_ != 3U)
1986  Private::h_badargs("fill");
1987  unsigned i0 = 0, i1 = 0, i2 = 0;
1988  const Axis* ax = &axes_[0];
1989  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1990  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1991  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
1992  if (o0 == 1U && o1 == 1U && o2 == 1U)
1993  data_(i0, i1, i2) += w;
1994  else {
1995  overflow_(o0, o1, o2) += w;
1996  ++overCount_;
1997  }
1998  ++fillCount_;
1999  ++modCount_;
2000  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2068  {
2069  if (dim_ != 4U)
2070  Private::h_badargs("fill");
2071  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2072  const Axis* ax = &axes_[0];
2073  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2074  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2075  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2076  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2077  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2078  data_(i0, i1, i2, i3) += w;
2079  else {
2080  overflow_(o0, o1, o2, o3) += w;
2081  ++overCount_;
2082  }
2083  ++fillCount_;
2084  ++modCount_;
2085  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2165  {
2166  if (dim_ != 5U)
2167  Private::h_badargs("fill");
2168  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2169  const Axis* ax = &axes_[0];
2170  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2171  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2172  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2173  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2174  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2175  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2176  data_(i0, i1, i2, i3, i4) += w;
2177  else {
2178  overflow_(o0, o1, o2, o3, o4) += w;
2179  ++overCount_;
2180  }
2181  ++fillCount_;
2182  ++modCount_;
2183  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2269  {
2270  if (dim_ != 6U)
2271  Private::h_badargs("fill");
2272  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2273  const Axis* ax = &axes_[0];
2274  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2275  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2276  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2277  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2278  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2279  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2280  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2281  data_(i0, i1, i2, i3, i4, i5) += w;
2282  else {
2283  overflow_(o0, o1, o2, o3, o4, o5) += w;
2284  ++overCount_;
2285  }
2286  ++fillCount_;
2287  ++modCount_;
2288  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2390  {
2391  if (dim_ != 7U)
2392  Private::h_badargs("fill");
2393  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2394  const Axis* ax = &axes_[0];
2395  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2396  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2397  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2398  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2399  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2400  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2401  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2402  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2403  data_(i0, i1, i2, i3, i4, i5, i6) += w;
2404  else {
2405  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2406  ++overCount_;
2407  }
2408  ++fillCount_;
2409  ++modCount_;
2410  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2529  {
2530  if (dim_ != 8U)
2531  Private::h_badargs("fill");
2532  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0;
2533  const Axis* ax = &axes_[0];
2534  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2535  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2536  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2537  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2538  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2539  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2540  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2541  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2542  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2543  data_(i0, i1, i2, i3, i4, i5, i6, i7) += w;
2544  else {
2545  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2546  ++overCount_;
2547  }
2548  ++fillCount_;
2549  ++modCount_;
2550  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2678  {
2679  if (dim_ != 9U)
2680  Private::h_badargs("fill");
2681  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0, i7 = 0, i8 = 0;
2682  const Axis* ax = &axes_[0];
2683  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2684  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2685  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2686  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2687  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2688  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2689  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2690  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2691  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2692  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2693  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) += w;
2694  else {
2695  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2696  ++overCount_;
2697  }
2698  ++fillCount_;
2699  ++modCount_;
2700  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

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

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

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

1764  {
1765  if (coordLength != dim_)
1767  "In npstat::HistoND::fillC: "
1768  "incompatible input point dimensionality");
1769  if (coordLength) {
1770  assert(coords);
1771  double* wg = &weightBuf_[0];
1772  unsigned* idx = &indexBuf_[0];
1773  unsigned* over = idx + dim_;
1774  const Axis* ax = &axes_[0];
1775  unsigned overflown = 0U;
1776  for (unsigned i = 0; i < dim_; ++i) {
1777  over[i] = ax[i].overflowIndexWeighted(coords[i], idx + i, wg + i);
1778  overflown |= (over[i] - 1U);
1779  }
1780  if (overflown) {
1781  overflow_.value(over, dim_) += w;
1782  ++overCount_;
1783  } else
1785  } else
1786  data_() += w;
1787  ++fillCount_;
1788  ++modCount_;
1789  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1812  {
1813  if (dim_)
1814  Private::h_badargs("fillC");
1815  data_() += w;
1816  ++fillCount_;
1817  ++modCount_;
1818  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

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

1867  {
1868  if (dim_ != 1U)
1869  Private::h_badargs("fillC");
1870  double* wg = &weightBuf_[0];
1871  unsigned* idx = &indexBuf_[0];
1872  const unsigned ov0 = axes_[0].overflowIndexWeighted(x0, idx, wg);
1873  if (ov0 == 1U)
1875  else {
1876  overflow_(ov0) += w;
1877  ++overCount_;
1878  }
1879  ++fillCount_;
1880  ++modCount_;
1881  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

1940  {
1941  if (dim_ != 2U)
1942  Private::h_badargs("fillC");
1943  double* wg = &weightBuf_[0];
1944  unsigned* idx = &indexBuf_[0];
1945  const Axis* ax = &axes_[0];
1946  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
1947  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
1948  if (o0 == 1U && o1 == 1U)
1950  else {
1951  overflow_(o0, o1) += w;
1952  ++overCount_;
1953  }
1954  ++fillCount_;
1955  ++modCount_;
1956  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2021  {
2022  if (dim_ != 3U)
2023  Private::h_badargs("fillC");
2024  double* wg = &weightBuf_[0];
2025  unsigned* idx = &indexBuf_[0];
2026  const Axis* ax = &axes_[0];
2027  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2028  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2029  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2030  if (o0 == 1U && o1 == 1U && o2 == 1U)
2032  else {
2033  overflow_(o0, o1, o2) += w;
2034  ++overCount_;
2035  }
2036  ++fillCount_;
2037  ++modCount_;
2038  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2108  {
2109  if (dim_ != 4U)
2110  Private::h_badargs("fillC");
2111  double* wg = &weightBuf_[0];
2112  unsigned* idx = &indexBuf_[0];
2113  const Axis* ax = &axes_[0];
2114  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2115  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2116  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2117  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2118  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2120  else {
2121  overflow_(o0, o1, o2, o3) += w;
2122  ++overCount_;
2123  }
2124  ++fillCount_;
2125  ++modCount_;
2126  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2208  {
2209  if (dim_ != 5U)
2210  Private::h_badargs("fillC");
2211  double* wg = &weightBuf_[0];
2212  unsigned* idx = &indexBuf_[0];
2213  const Axis* ax = &axes_[0];
2214  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2215  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2216  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2217  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2218  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2219  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2221  else {
2222  overflow_(o0, o1, o2, o3, o4) += w;
2223  ++overCount_;
2224  }
2225  ++fillCount_;
2226  ++modCount_;
2227  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2325  {
2326  if (dim_ != 6U)
2327  Private::h_badargs("fillC");
2328  double* wg = &weightBuf_[0];
2329  unsigned* idx = &indexBuf_[0];
2330  const Axis* ax = &axes_[0];
2331  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2332  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2333  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2334  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2335  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2336  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2337  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U)
2339  else {
2340  overflow_(o0, o1, o2, o3, o4, o5) += w;
2341  ++overCount_;
2342  }
2343  ++fillCount_;
2344  ++modCount_;
2345  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2450  {
2451  if (dim_ != 7U)
2452  Private::h_badargs("fillC");
2453  double* wg = &weightBuf_[0];
2454  unsigned* idx = &indexBuf_[0];
2455  const Axis* ax = &axes_[0];
2456  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2457  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2458  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2459  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2460  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2461  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2462  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2463  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2465  else {
2466  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2467  ++overCount_;
2468  }
2469  ++fillCount_;
2470  ++modCount_;
2471  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2593  {
2594  if (dim_ != 8U)
2595  Private::h_badargs("fillC");
2596  double* wg = &weightBuf_[0];
2597  unsigned* idx = &indexBuf_[0];
2598  const Axis* ax = &axes_[0];
2599  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2600  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2601  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2602  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2603  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2604  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2605  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2606  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2607  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2609  else {
2610  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2611  ++overCount_;
2612  }
2613  ++fillCount_;
2614  ++modCount_;
2615  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2746  {
2747  if (dim_ != 9U)
2748  Private::h_badargs("fillC");
2749  double* wg = &weightBuf_[0];
2750  unsigned* idx = &indexBuf_[0];
2751  const Axis* ax = &axes_[0];
2752  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2753  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2754  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2755  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2756  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2757  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2758  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2759  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2760  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx + 8, wg + 8);
2761  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2763  else {
2764  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2765  ++overCount_;
2766  }
2767  ++fillCount_;
2768  ++modCount_;
2769  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

2911  {
2912  if (dim_ != 10U)
2913  Private::h_badargs("fillC");
2914  double* wg = &weightBuf_[0];
2915  unsigned* idx = &indexBuf_[0];
2916  const Axis* ax = &axes_[0];
2917  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx + 0, wg + 0);
2918  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx + 1, wg + 1);
2919  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx + 2, wg + 2);
2920  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx + 3, wg + 3);
2921  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx + 4, wg + 4);
2922  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx + 5, wg + 5);
2923  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx + 6, wg + 6);
2924  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx + 7, wg + 7);
2925  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx + 8, wg + 8);
2926  const unsigned o9 = ax[9].overflowIndexWeighted(x9, idx + 9, wg + 9);
2927  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U &&
2928  o9 == 1U)
2930  else {
2931  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2932  ++overCount_;
2933  }
2934  ++fillCount_;
2935  ++modCount_;
2936  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
T w() const
unsigned long modCount_
Definition: HistoND.h:956
void h_badargs(const char *method)
Definition: HistoND.h:1193
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1741
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ fillPreservingCentroid()

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

Definition at line 1741 of file HistoND.h.

References mps_fire::i, mitigatedMETSequence_cff::U, w(), and hltDeepSecondaryVertexTagInfosPFPuppi_cfi::weights.

1741  {
1742  const double* weights = &weightBuf_[0];
1743  const unsigned* cell = &indexBuf_[0];
1744  const unsigned long* strides = data_.strides();
1745  const unsigned long maxcycle = 1UL << dim_;
1746  for (unsigned long icycle = 0; icycle < maxcycle; ++icycle) {
1747  double w = 1.0;
1748  unsigned long icell = 0UL;
1749  for (unsigned i = 0; i < dim_; ++i) {
1750  if (icycle & (1UL << i)) {
1751  w *= (1.0 - weights[i]);
1752  icell += strides[i] * (cell[i] + 1U);
1753  } else {
1754  w *= weights[i];
1755  icell += strides[i] * cell[i];
1756  }
1757  }
1758  data_.linearValue(icell) += (value * w);
1759  }
1760  }
unsigned dim_
Definition: HistoND.h:957
T w() const
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3123
ArrayND< Numeric > data_
Definition: HistoND.h:949
Definition: value.py:1
std::vector< double > weightBuf_
Definition: HistoND.h:952
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
const unsigned long * strides() const
Definition: ArrayND.h:263

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

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

913 { return modCount_; }
unsigned long modCount_
Definition: HistoND.h:956

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

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

920 { ++modCount_; }
unsigned long modCount_
Definition: HistoND.h:956

◆ integral()

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

Integral of the histogram

Definition at line 1520 of file HistoND.h.

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

1520  {
1521  typedef typename PreciseType<Numeric>::type Precise;
1522 
1523  if (dim_ == 0U)
1524  return 0.0;
1525  if (isUniformlyBinned()) {
1526  Precise sum = data_.template sum<Precise>();
1527  return static_cast<double>(sum) * binVolume();
1528  } else {
1529  Precise sum = Precise();
1530  const Numeric* data = data_.data();
1531  const unsigned long len = data_.length();
1532  for (unsigned long i = 0; i < len; ++i)
1533  sum += data[i] * binVolume(i);
1534  return static_cast<double>(sum);
1535  }
1536  }
unsigned dim_
Definition: HistoND.h:957
const Numeric * data() const
Definition: ArrayND.h:236
double binVolume(unsigned long binNumber=0) const
Definition: HistoND.h:1622
ArrayND< Numeric > data_
Definition: HistoND.h:949
PreciseTypeHelper< T, gs::IOIsNumber< T >::value >::type type
Definition: PreciseType.h:36
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233
bool isUniformlyBinned() const
Definition: HistoND.h:1512

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

1605  {
1606  return dim_ == r.dim_ && overflow_ == r.overflow_ && data_ == r.data_;
1607  }
unsigned dim_
Definition: HistoND.h:957
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

References mps_fire::i.

1512  {
1513  for (unsigned i = 0; i < dim_; ++i)
1514  if (!axes_[i].isUniform())
1515  return false;
1516  return true;
1517  }
unsigned dim_
Definition: HistoND.h:957
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ nBins()

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

Total number of bins

Definition at line 194 of file HistoND.h.

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

194 { return data_.length(); }
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long length() const
Definition: ArrayND.h:233

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

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

200 { return fillCount_ - overCount_; }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long overCount_
Definition: HistoND.h:955

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

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

203 { return overCount_; }
unsigned long overCount_
Definition: HistoND.h:955

◆ nFillsTotal()

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

Total number of fills performed

Definition at line 197 of file HistoND.h.

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

197 { return fillCount_; }
unsigned long fillCount_
Definition: HistoND.h:954

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

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

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

3280  {
3281  data_ *= r;
3282  overflow_ *= r;
3283  ++modCount_;
3284  return *this;
3285  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

3251  {
3252  data_ += r.data_;
3253  overflow_ += r.overflow_;
3254  fillCount_ += r.fillCount_;
3255  overCount_ += r.overCount_;
3256  ++modCount_;
3257  return *this;
3258  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

3262  {
3263  data_ -= r.data_;
3264  overflow_ -= r.overflow_;
3265 
3266  // Subtraction does not make much sense for fill counts.
3267  // We will assume that what we want should be equivalent
3268  // to the in-place multiplication of the other histogram
3269  // by -1 and then adding.
3270  //
3271  fillCount_ += r.fillCount_;
3272  overCount_ += r.overCount_;
3273 
3274  ++modCount_;
3275  return *this;
3276  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

3289  {
3290  data_ /= r;
3291  overflow_ /= r;
3292  ++modCount_;
3293  return *this;
3294  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

3327  {
3328  if (&r != this) {
3329  title_ = r.title_;
3330  accumulatedDataLabel_ = r.accumulatedDataLabel_;
3331  data_.uninitialize();
3332  data_ = r.data_;
3334  overflow_ = r.overflow_;
3335  axes_ = r.axes_;
3336  weightBuf_ = r.weightBuf_;
3337  indexBuf_ = r.indexBuf_;
3338  fillCount_ = r.fillCount_;
3339  overCount_ = r.overCount_;
3340  dim_ = r.dim_;
3341  ++modCount_;
3342  }
3343  return *this;
3344  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
unsigned long modCount_
Definition: HistoND.h:956
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
ArrayND & uninitialize()
Definition: ArrayND.h:4356
std::vector< double > weightBuf_
Definition: HistoND.h:952
unsigned long overCount_
Definition: HistoND.h:955
std::vector< unsigned > indexBuf_
Definition: HistoND.h:953
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

1610  {
1611  return dim_ == r.dim_ && fillCount_ == r.fillCount_ && overCount_ == r.overCount_ && title_ == r.title_ &&
1612  accumulatedDataLabel_ == r.accumulatedDataLabel_ && axes_ == r.axes_ && overflow_ == r.overflow_ &&
1613  data_ == r.data_;
1614  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned dim_
Definition: HistoND.h:957
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

185 { return overflow_; }
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

3502  {
3503  static const gs::ClassId current(gs::ClassId::makeId<HistoND<Numeric, Axis> >());
3504  current.ensureSameId(id);
3505 
3507  gs::read_pod(in, &title);
3508 
3510  gs::read_pod(in, &accumulatedDataLabel);
3511 
3512  unsigned long fillCount = 0, overCount = 0;
3513  gs::read_pod(in, &fillCount);
3514  gs::read_pod(in, &overCount);
3515  if (in.fail())
3516  throw gs::IOReadFailure("In npstat::HistoND::read: input stream failure");
3517 
3518  std::vector<Axis> axes;
3519  gs::read_heap_obj_vector_as_placed(in, &axes);
3520  gs::ClassId ida(in, 1);
3521  ArrayND<Numeric> data, over;
3523  ArrayND<Numeric>::restore(ida, in, &over);
3524  std::unique_ptr<HistoND<Numeric, Axis> > result(
3525  new HistoND<Numeric, Axis>(axes, title.c_str(), accumulatedDataLabel.c_str()));
3526  result->data_ = data;
3527  result->overflow_ = over;
3528  result->fillCount_ = fillCount;
3529  result->overCount_ = overCount;
3530  return result.release();
3531  }
const std::string & title() const
Definition: HistoND.h:176
const std::vector< Axis > & axes() const
Definition: HistoND.h:188
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:5386
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const std::string & accumulatedDataLabel() const
Definition: HistoND.h:179

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

3452  {
3453  const long double nOver = overflow_.template sum<long double>();
3454  const long double nData = data_.template sum<long double>();
3455  overCount_ = static_cast<unsigned long>(nOver);
3456  fillCount_ = static_cast<unsigned long>(nData + nOver);
3457  ++modCount_;
3458  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

3411  {
3412  if (dataLength != data_.length())
3413  throw npstat::NpstatInvalidArgument("In npstat::HistoND::scaleBinContents: incompatible data length");
3414  assert(data);
3415  Numeric* dat = const_cast<Numeric*>(data_.data());
3416  for (unsigned long i = 0; i < dataLength; ++i)
3417  dat[i] *= data[i];
3418  ++modCount_;
3419  }
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
const Numeric * data() const
Definition: ArrayND.h:236
ArrayND< Numeric > data_
Definition: HistoND.h:949
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233

◆ scaleOverflows()

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

Definition at line 3423 of file HistoND.h.

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

3423  {
3424  if (dataLength != overflow_.length())
3425  throw npstat::NpstatInvalidArgument("In npstat::HistoND::scaleOverflows: incompatible data length");
3426  assert(data);
3427  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3428  for (unsigned long i = 0; i < dataLength; ++i)
3429  dat[i] *= data[i];
3430  ++modCount_;
3431  }
unsigned long modCount_
Definition: HistoND.h:956
assert(be >=bs)
const Numeric * data() const
Definition: ArrayND.h:236
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned long length() const
Definition: ArrayND.h:233
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

218  {
219  accumulatedDataLabel_ = newlabel ? newlabel : "";
220  ++modCount_;
221  }
unsigned long modCount_
Definition: HistoND.h:956
std::string accumulatedDataLabel_
Definition: HistoND.h:948

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

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

224  {
225  axes_.at(axisNum).setLabel(newlabel);
226  ++modCount_;
227  }
unsigned long modCount_
Definition: HistoND.h:956
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ setBin() [1/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 2999 of file HistoND.h.

References findQualityFiles::v.

2999  {
3000  data_.value(index, indexLen) = v;
3001  ++modCount_;
3002  }
unsigned long modCount_
Definition: HistoND.h:956
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3091
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ setBin() [2/12]

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

Definition at line 3013 of file HistoND.h.

References findQualityFiles::v.

3013  {
3014  data_() = v;
3015  ++modCount_;
3016  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

References findQualityFiles::v.

3027  {
3028  data_(i0) = v;
3029  ++modCount_;
3030  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

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

3041  {
3042  data_(i0, i1) = v;
3043  ++modCount_;
3044  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ setBinAt() [1/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 3006 of file HistoND.h.

References findQualityFiles::v.

3006  {
3007  data_.valueAt(index, indexLen) = v;
3008  ++modCount_;
3009  }
unsigned long modCount_
Definition: HistoND.h:956
Numeric & valueAt(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3208
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ setBinAt() [2/12]

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

Definition at line 3020 of file HistoND.h.

References findQualityFiles::v.

3020  {
3021  data_.at() = v;
3022  ++modCount_;
3023  }
unsigned long modCount_
Definition: HistoND.h:956
Numeric & at()
Definition: ArrayND.h:3268
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

References findQualityFiles::v.

3034  {
3035  data_.at(i0) = v;
3036  ++modCount_;
3037  }
unsigned long modCount_
Definition: HistoND.h:956
Numeric & at()
Definition: ArrayND.h:3268
ArrayND< Numeric > data_
Definition: HistoND.h:949

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

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

3048  {
3049  data_.at(i0, i1) = v;
3050  ++modCount_;
3051  }
unsigned long modCount_
Definition: HistoND.h:956
Numeric & at()
Definition: ArrayND.h:3268
ArrayND< Numeric > data_
Definition: HistoND.h:949

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

◆ 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

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

References data.

3437  {
3438  data_.setData(data, dataLength);
3439  if (clearOverflowsNow)
3440  clearOverflows();
3441  ++modCount_;
3442  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:956
ArrayND< Numeric > data_
Definition: HistoND.h:949
void clearOverflows()
Definition: HistoND.h:1255
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

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

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

783  {
785  ++modCount_;
786  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4342
ArrayND< Numeric > data_
Definition: HistoND.h:949
Definition: value.py:1

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

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

815  {
816  overCount_ = i;
817  ++modCount_;
818  }
unsigned long modCount_
Definition: HistoND.h:956
unsigned long overCount_
Definition: HistoND.h:955

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

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

811  {
812  fillCount_ = i;
813  ++modCount_;
814  }
unsigned long fillCount_
Definition: HistoND.h:954
unsigned long modCount_
Definition: HistoND.h:956

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

References data.

3446  {
3447  overflow_.setData(data, dataLength);
3448  ++modCount_;
3449  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:956
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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

793  {
795  ++modCount_;
796  }
unsigned long modCount_
Definition: HistoND.h:956
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4342
Definition: value.py:1
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

◆ setTitle()

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

Modify the histogram title

Definition at line 212 of file HistoND.h.

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

212  {
213  title_ = newtitle ? newtitle : "";
214  ++modCount_;
215  }
unsigned long modCount_
Definition: HistoND.h:956
std::string title_
Definition: HistoND.h:947

◆ title()

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

Histogram title

Definition at line 176 of file HistoND.h.

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

176 { return title_; }
std::string title_
Definition: HistoND.h:947

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

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

◆ version()

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

Definition at line 929 of file HistoND.h.

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

929 { return 1; }

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

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

1634  {
1635  double v = 1.0;
1636  if (dim_) {
1637  const Axis* ax = &axes_[0];
1638  for (unsigned i = 0; i < dim_; ++i)
1639  v *= (ax[i].max() - ax[i].min());
1640  }
1641  return v;
1642  }
unsigned dim_
Definition: HistoND.h:957
std::vector< Axis > axes_
Definition: HistoND.h:951

◆ write()

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

Definition at line 3491 of file HistoND.h.

References haddnano::of.

3491  {
3492  gs::write_pod(of, title_);
3493  gs::write_pod(of, accumulatedDataLabel_);
3494  gs::write_pod(of, fillCount_);
3495  gs::write_pod(of, overCount_);
3496 
3497  return !of.fail() && gs::write_obj_vector(of, axes_) && data_.classId().write(of) && data_.write(of) &&
3498  overflow_.write(of);
3499  }
bool write(std::ostream &of) const
Definition: ArrayND.h:5378
unsigned long fillCount_
Definition: HistoND.h:954
gs::ClassId classId() const
Definition: ArrayND.h:1039
std::string title_
Definition: HistoND.h:947
std::string accumulatedDataLabel_
Definition: HistoND.h:948
ArrayND< Numeric > data_
Definition: HistoND.h:949
unsigned long overCount_
Definition: HistoND.h:955
std::vector< Axis > axes_
Definition: HistoND.h:951
ArrayND< Numeric > overflow_
Definition: HistoND.h:950

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

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