CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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=0, const char *accumulatedDataLabel=0)
 
 HistoND (const Axis &xAxis, const char *title=0, const char *accumulatedDataLabel=0)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const char *title=0, const char *accumulatedDataLabel=0)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const char *title=0, const char *accumulatedDataLabel=0)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const char *title=0, const char *accumulatedDataLabel=0)
 
 HistoND (const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis, const char *title=0, const char *accumulatedDataLabel=0)
 
 HistoND (const ArrayShape &shape, const BoxND< double > &boundingBox, const char *title=0, const char *accumulatedDataLabel=0)
 
template<typename Num2 , class Functor >
 HistoND (const HistoND< Num2, Axis > &h, const Functor &f, const char *title=0, const char *accumulatedDataLabel=0)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const unsigned *indices, unsigned nIndices, const char *title=0)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, const Axis &newAxis, unsigned newAxisNumber, const char *title=0)
 
template<typename Num2 >
 HistoND (const HistoND< Num2, Axis > &h, RebinType rType, const unsigned *newBinCounts, unsigned lenNewBinCounts, const double *shifts=0, const char *title=0)
 
 HistoND (const HistoND &)
 
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 ()
 
 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>
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 22 of file HistoAxis.h.

Member Typedef Documentation

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

Definition at line 49 of file HistoND.h.

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

Definition at line 48 of file HistoND.h.

Member Enumeration Documentation

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

Definition at line 51 of file HistoND.h.

Constructor & Destructor Documentation

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

Main constructor for arbitrary-dimensional histograms

Definition at line 1220 of file HistoND.h.

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

1222  : title_(title ? title : ""),
1224  data_(Private::makeHistoShape(axesIn)),
1225  overflow_(ArrayShape(axesIn.size(), 3U)),
1226  axes_(axesIn),
1227  weightBuf_(axesIn.size()),
1228  indexBuf_(2U*axesIn.size()),
1229  modCount_(0UL),
1230  dim_(axesIn.size())
1231  {
1232  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1234  "In npstat::HistoND constructor: requested histogram "
1235  "dimensionality is not supported (too large)");
1236  clear();
1237  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)
explicit

Convenience constructor for 1-d histograms

Definition at line 1240 of file HistoND.h.

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

1242  : title_(title ? title : ""),
1245  overflow_(ArrayShape(1U, 3U)),
1246  weightBuf_(1U),
1247  indexBuf_(2U*1U),
1248  modCount_(0UL),
1249  dim_(1U)
1250  {
1251  axes_.reserve(dim_);
1252  axes_.push_back(xAxis);
1253  clear();
1254  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 2-d histograms

Definition at line 1257 of file HistoND.h.

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

1259  : title_(title ? title : ""),
1261  data_(Private::makeHistoShape(xAxis, yAxis)),
1262  overflow_(ArrayShape(2U, 3U)),
1263  weightBuf_(2U),
1264  indexBuf_(2U*2U),
1265  modCount_(0UL),
1266  dim_(2U)
1267  {
1268  axes_.reserve(dim_);
1269  axes_.push_back(xAxis);
1270  axes_.push_back(yAxis);
1271  clear();
1272  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 3-d histograms

Definition at line 1275 of file HistoND.h.

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

1278  : title_(title ? title : ""),
1280  data_(Private::makeHistoShape(xAxis, yAxis, zAxis)),
1281  overflow_(ArrayShape(3U, 3U)),
1282  weightBuf_(3U),
1283  indexBuf_(2U*3U),
1284  modCount_(0UL),
1285  dim_(3U)
1286  {
1287  axes_.reserve(dim_);
1288  axes_.push_back(xAxis);
1289  axes_.push_back(yAxis);
1290  axes_.push_back(zAxis);
1291  clear();
1292  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple zAxis
Definition: MetAnalyzer.py:56
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 4-d histograms

Definition at line 1295 of file HistoND.h.

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

1298  : title_(title ? title : ""),
1300  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis)),
1301  overflow_(ArrayShape(4U, 3U)),
1302  weightBuf_(4U),
1303  indexBuf_(2U*4U),
1304  modCount_(0UL),
1305  dim_(4U)
1306  {
1307  axes_.reserve(dim_);
1308  axes_.push_back(xAxis);
1309  axes_.push_back(yAxis);
1310  axes_.push_back(zAxis);
1311  axes_.push_back(tAxis);
1312  clear();
1313  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple zAxis
Definition: MetAnalyzer.py:56
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const Axis &  vAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 5-d histograms

Definition at line 1316 of file HistoND.h.

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

1320  : title_(title ? title : ""),
1322  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
1323  overflow_(ArrayShape(5U, 3U)),
1324  weightBuf_(5U),
1325  indexBuf_(2U*5U),
1326  modCount_(0UL),
1327  dim_(5U)
1328  {
1329  axes_.reserve(dim_);
1330  axes_.push_back(xAxis);
1331  axes_.push_back(yAxis);
1332  axes_.push_back(zAxis);
1333  axes_.push_back(tAxis);
1334  axes_.push_back(vAxis);
1335  clear();
1336  }
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:925
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple zAxis
Definition: MetAnalyzer.py:56
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const ArrayShape shape,
const BoxND< double > &  boundingBox,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

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

Definition at line 1339 of file HistoND.h.

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

1342  : title_(title ? title : ""),
1344  data_(shape),
1345  overflow_(ArrayShape(shape.size(), 3U)),
1346  weightBuf_(shape.size()),
1347  indexBuf_(2U*shape.size()),
1348  modCount_(0UL),
1349  dim_(shape.size())
1350  {
1351  if (boundingBox.size() != dim_) throw npstat::NpstatInvalidArgument(
1352  "In npstat::HistoND constructor: "
1353  "incompatible bounding box dimensionality");
1354  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1356  "In npstat::HistoND constructor: requested histogram "
1357  "dimensionality is not supported (too large)");
1358  axes_.reserve(dim_);
1359  for (unsigned i=0; i<dim_; ++i)
1360  axes_.push_back(Axis(shape[i],
1361  boundingBox[i].min(),
1362  boundingBox[i].max()));
1363  clear();
1364  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
BoxND< double > boundingBox() const
Definition: HistoND.h:1512
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Functor &  f,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

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

Definition at line 1368 of file HistoND.h.

1371  : title_(title ? title : ""),
1373  data_(r.data_, f),
1374  overflow_(r.overflow_, f),
1375  axes_(r.axes_),
1376  weightBuf_(r.dim_),
1377  indexBuf_(2U*r.dim_),
1378  fillCount_(r.fillCount_),
1379  overCount_(r.overCount_),
1380  modCount_(0UL),
1381  dim_(r.dim_)
1382  {
1383  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const unsigned *  indices,
unsigned  nIndices,
const char *  title = 0 
)

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

Definition at line 1387 of file HistoND.h.

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

1390  : title_(title ? title : ""),
1391  accumulatedDataLabel_(h.accumulatedDataLabel_),
1392  data_(Private::shapeOfASlice(h.axes_, indices, nIndices)),
1393  overflow_(ArrayShape(data_.rank(), 3U)),
1394  axes_(Private::axesOfASlice(h.axes_, indices, nIndices)),
1395  weightBuf_(data_.rank()),
1396  indexBuf_(2U*data_.rank()),
1397  modCount_(0UL),
1398  dim_(data_.rank())
1399  {
1400  clear();
1401  }
unsigned dim_
Definition: HistoND.h:869
unsigned rank() const
Definition: ArrayND.h:240
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axesOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1013
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayShape shapeOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1048
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Axis &  newAxis,
unsigned  newAxisNumber,
const char *  title = 0 
)

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

Definition at line 1405 of file HistoND.h.

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

1408  : title_(title ? title : ""),
1409  accumulatedDataLabel_(h.accumulatedDataLabel_),
1410  data_(Private::shapeWithExtraAxis(h.axes_, newAxis, newAxisNumber)),
1411  overflow_(data_.rank(), 3U),
1412  axes_(Private::addAxis(h.axes_, newAxis, newAxisNumber)),
1413  weightBuf_(data_.rank()),
1414  indexBuf_(2U*data_.rank()),
1415  modCount_(0UL),
1416  dim_(data_.rank())
1417  {
1418  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1420  "In npstat::HistoND constructor: requested histogram "
1421  "dimensionality is not supported (too large)");
1422  clear();
1423  }
unsigned dim_
Definition: HistoND.h:869
unsigned rank() const
Definition: ArrayND.h:240
void clear()
Definition: HistoND.h:1212
unsigned long modCount_
Definition: HistoND.h:868
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > addAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1088
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
ArrayShape shapeWithExtraAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1111
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 = 0,
const char *  title = 0 
)

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

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

1431  : title_(title ? title : h.title_.c_str()),
1432  accumulatedDataLabel_(h.accumulatedDataLabel_),
1433  data_(newBinCounts, lenNewBinCounts),
1434  overflow_(h.overflow_),
1435  axes_(Private::rebinAxes(h.axes_, newBinCounts, lenNewBinCounts)),
1436  weightBuf_(h.dim_),
1437  indexBuf_(2U*h.dim_),
1438  fillCount_(h.fillCount_),
1439  overCount_(h.overCount_),
1440  modCount_(0UL),
1441  dim_(h.dim_)
1442  {
1443  const unsigned long newBins = data_.length();
1444  const Axis* ax = &axes_[0];
1445  unsigned* ubuf = &indexBuf_[0];
1446 
1447  // Fill out the bins of the new histogram
1448  if (rType == SAMPLE)
1449  {
1450  double* buf = &weightBuf_[0];
1451  for (unsigned long ibin=0; ibin<newBins; ++ibin)
1452  {
1453  data_.convertLinearIndex(ibin, ubuf, dim_);
1454  if (shifts)
1455  for (unsigned i=0; i<dim_; ++i)
1456  buf[i] = ax[i].binCenter(ubuf[i]) + shifts[i];
1457  else
1458  for (unsigned i=0; i<dim_; ++i)
1459  buf[i] = ax[i].binCenter(ubuf[i]);
1460  data_.linearValue(ibin) = h.examine(buf, dim_);
1461  }
1462  }
1463  else
1464  {
1465  const Numeric zero = Numeric();
1466  BoxND<double> binLimits(dim_);
1467  for (unsigned long ibin=0; ibin<newBins; ++ibin)
1468  {
1469  data_.convertLinearIndex(ibin, ubuf, dim_);
1470  for (unsigned i=0; i<dim_; ++i)
1471  binLimits[i] = ax[i].binInterval(ubuf[i]);
1472  Numeric& thisBin(data_.linearValue(ibin));
1473  thisBin = zero;
1474  h.accumulateBinsInBox(binLimits, &thisBin, rType == AVERAGE);
1475  }
1476  }
1477  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3234
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1526
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3321
unsigned long length() const
Definition: ArrayND.h:231
const std::string & title() const
Definition: HistoND.h:160
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > rebinAxes(const std::vector< Axis > &axes, const unsigned *newBins, const unsigned lenNewBins)
Definition: HistoND.h:996
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r)

Copy constructor

Definition at line 3370 of file HistoND.h.

3371  : title_(r.title_),
3372  accumulatedDataLabel_(r.accumulatedDataLabel_),
3373  data_(r.data_),
3374  overflow_(r.overflow_),
3375  axes_(r.axes_),
3376  weightBuf_(r.weightBuf_),
3377  indexBuf_(r.indexBuf_),
3378  fillCount_(r.fillCount_),
3379  overCount_(r.overCount_),
3380  modCount_(0UL),
3381  dim_(r.dim_)
3382  {
3383  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
npstat::HistoND< Numeric, Axis >::HistoND ( )
private
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r,
unsigned  ax1,
unsigned  ax2 
)
private

Definition at line 3351 of file HistoND.h.

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

3354  : title_(r.title_),
3355  accumulatedDataLabel_(r.accumulatedDataLabel_),
3356  data_(r.data_.transpose(ax1, ax2)),
3357  overflow_(r.overflow_.transpose(ax1, ax2)),
3358  axes_(r.axes_),
3359  weightBuf_(r.weightBuf_),
3360  indexBuf_(r.indexBuf_),
3361  fillCount_(r.fillCount_),
3362  overCount_(r.overCount_),
3363  modCount_(0UL),
3364  dim_(r.dim_)
3365  {
3366  std::swap(axes_[ax1], axes_[ax2]);
3367  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862

Member Function Documentation

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

References assert(), i, and dttmaxenums::L.

1177  {
1178  if (box.size() != dim_) throw npstat::NpstatInvalidArgument(
1179  "In npstat::HistoND::accumulateBinsInBox: "
1180  "incompatible box dimensionality");
1181  assert(accumulator);
1182  if (dim_)
1183  {
1184  long double wsum = 0.0L;
1185  for (unsigned i=0; i<dim_; ++i)
1186  indexBuf_[i] = 0U;
1187  accumulateBinsLoop(0U, box, &indexBuf_[0], accumulator, 1.0, &wsum);
1188  if (calculateAverage && wsum > 0.0L)
1189  *accumulator *= static_cast<double>(1.0L/wsum);
1190  }
1191  else
1192  *accumulator += 1.0*data_();
1193  }
int i
Definition: DBlmapReader.cc:9
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
Definition: HistoND.h:1144
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
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 1144 of file HistoND.h.

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

1148  {
1149  const Interval<double>& boxSide(box[level]);
1150  const Axis& axis(axes_[level]);
1151  const unsigned nbins = axis.nBins();
1152  const bool lastLevel = level == dim_ - 1U;
1153  for (unsigned i=0; i<nbins; ++i)
1154  {
1155  const double over = overlapFraction*
1156  axis.binInterval(i).overlapFraction(boxSide);
1157  if (over > 0.0)
1158  {
1159  idx[level] = i;
1160  if (lastLevel)
1161  {
1162  *accumulator += over*data_.value(idx, dim_);
1163  *wsum += over;
1164  }
1165  else
1166  accumulateBinsLoop(level+1U, box, idx, accumulator,
1167  over, wsum);
1168  }
1169  }
1170  }
int i
Definition: DBlmapReader.cc:9
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction, long double *wsum) const
Definition: HistoND.h:1144
unsigned dim_
Definition: HistoND.h:869
const Axis & axis(const unsigned i) const
Definition: HistoND.h:176
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:863
tuple level
Definition: testEve_cfg.py:34
template<typename Numeric, class Axis>
const std::string& npstat::HistoND< Numeric, Axis >::accumulatedDataLabel ( ) const
inline

Label associated with accumulated data

Definition at line 163 of file HistoND.h.

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

164  {return accumulatedDataLabel_;}
std::string accumulatedDataLabel_
Definition: HistoND.h:860
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 3423 of file HistoND.h.

References data, and i.

3424  {
3425  const unsigned long nDat = data_.length();
3426  Numeric* data = const_cast<Numeric*>(data_.data());
3427  for (unsigned long i=0; i<nDat; ++i)
3428  data[i] += weight;
3429  fillCount_ += nDat;
3430  ++modCount_;
3431  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:861
const Numeric * data() const
Definition: ArrayND.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 3448 of file HistoND.h.

References assert(), and i.

3450  {
3451  if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
3452  "In npstat::HistoND::addToBinContents: incompatible data length");
3453  assert(data);
3454  Numeric* dat = const_cast<Numeric*>(data_.data());
3455  for (unsigned long i=0; i<dataLength; ++i)
3456  dat[i] += data[i];
3457  fillCount_ += dataLength;
3458  ++modCount_;
3459  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:861
const Numeric * data() const
Definition: ArrayND.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 &  weight)

Definition at line 3435 of file HistoND.h.

References data, and i.

3436  {
3437  const unsigned long nOver = overflow_.length();
3438  Numeric* data = const_cast<Numeric*>(overflow_.data());
3439  for (unsigned long i=0; i<nOver; ++i)
3440  data[i] += weight;
3441  overCount_ += nOver;
3442  fillCount_ += nOver;
3443  ++modCount_;
3444  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
unsigned long length() const
Definition: ArrayND.h:231
const Numeric * data() const
Definition: ArrayND.h:234
unsigned long overCount_
Definition: HistoND.h:867
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 *  data,
unsigned long  dataLength 
)

Definition at line 3463 of file HistoND.h.

References assert(), and i.

3465  {
3466  if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
3467  "In npstat::HistoND::addToOverflows: incompatible data length");
3468  assert(data);
3469  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3470  for (unsigned long i=0; i<dataLength; ++i)
3471  dat[i] += data[i];
3472  overCount_ += dataLength;
3473  fillCount_ += dataLength;
3474  ++modCount_;
3475  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
unsigned long length() const
Definition: ArrayND.h:231
const Numeric * data() const
Definition: ArrayND.h:234
unsigned long overCount_
Definition: HistoND.h:867
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 3538 of file HistoND.h.

References assert().

3543  {
3544  assert(projection);
3545  data_.addToProjection(&projection->data_, projector,
3546  projectedIndices, nProjectedIndices);
3547  projection->fillCount_ += projection->nBins();
3548  projection->modCount_++;
3549  }
assert(m_qm.get())
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:2169
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 3553 of file HistoND.h.

References assert().

3558  {
3559  assert(projection);
3560  data_.addToProjection(&projection->data_, projector,
3561  projectedIndices, nProjectedIndices);
3562  projection->fillCount_ += projection->nBins();
3563  projection->modCount_++;
3564  }
assert(m_qm.get())
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:2169
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 1545 of file HistoND.h.

References assert(), create_public_lumi_plots::ax, and i.

1547  {
1548  assert(centers);
1549  centers->clear();
1550  const unsigned long len = data_.length();
1551  centers->reserve(len);
1552  unsigned* ibuf = &indexBuf_[0];
1553  const Axis* ax = &axes_[0];
1554  Point center;
1555  if (center.size() < dim_) throw npstat::NpstatInvalidArgument(
1556  "In npstat::HistoND::allBinCenters: "
1557  "incompatible point dimensionality (too small)");
1558  typename Point::value_type* cdat = &center[0];
1559 
1560  for (unsigned long i=0; i<len; ++i)
1561  {
1562  data_.convertLinearIndex(i, ibuf, dim_);
1563  for (unsigned idim=0; idim<dim_; ++idim)
1564  cdat[idim] = ax[idim].binCenter(ibuf[idim]);
1565  centers->push_back(center);
1566  }
1567  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3234
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1526
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:861
math::XYZPoint Point
Container::value_type value_type
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
const std::vector<Axis>& npstat::HistoND< Numeric, Axis >::axes ( ) const
inline

Inspect histogram axes

Definition at line 173 of file HistoND.h.

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

Referenced by npstat::interpolateHistoND().

173 {return axes_;}
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
const Axis& npstat::HistoND< Numeric, Axis >::axis ( const unsigned  i) const
inline

Inspect a histogram axis for the given dimension

Definition at line 176 of file HistoND.h.

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

Referenced by npstat::interpolateHistoND().

177  {return axes_.at(i);}
int i
Definition: DBlmapReader.cc:9
std::vector< Axis > axes_
Definition: HistoND.h:863
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 1570 of file HistoND.h.

References assert(), create_public_lumi_plots::ax, and i.

1572  {
1573  assert(box);
1574  box->clear();
1575  if (dim_)
1576  {
1577  box->reserve(dim_);
1579  const Axis* ax = &axes_[0];
1580  for (unsigned i=0; i<dim_; ++i)
1581  box->push_back(ax[i].binInterval(indexBuf_[i]));
1582  }
1583  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3234
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
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 1526 of file HistoND.h.

References assert(), create_public_lumi_plots::ax, and i.

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

1529  {
1530  if (dim_ != lenCoords) throw npstat::NpstatInvalidArgument(
1531  "In npstat::HistoND::binCenter: "
1532  "incompatible input point dimensionality");
1533  if (dim_)
1534  {
1535  assert(coords);
1537  const Axis* ax = &axes_[0];
1538  for (unsigned i=0; i<dim_; ++i)
1539  coords[i] = ax[i].binCenter(indexBuf_[i]);
1540  }
1541  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3234
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1526
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
const ArrayND<Numeric>& npstat::HistoND< Numeric, Axis >::binContents ( ) const
inline

Retrive a reference to the array of bin contents

Definition at line 167 of file HistoND.h.

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

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

167 {return data_;}
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 1613 of file HistoND.h.

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

1615  {
1616  double v = 1.0;
1617  if (dim_)
1618  {
1620  const Axis* ax = &axes_[0];
1621  for (unsigned i=0; i<dim_; ++i)
1622  v *= ax[i].binWidth(indexBuf_[i]);
1623  }
1624  return v;
1625  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3234
unsigned dim_
Definition: HistoND.h:869
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric , class Axis >
BoxND< double > npstat::HistoND< Numeric, Axis >::boundingBox ( ) const

Bounding box for the whole histogram

Definition at line 1512 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

1513  {
1514  BoxND<double> box;
1515  if (dim_)
1516  {
1517  box.reserve(dim_);
1518  const Axis* ax = &axes_[0];
1519  for (unsigned i=0; i<dim_; ++i)
1520  box.push_back(ax[i].interval());
1521  }
1522  return box;
1523  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
gs::ClassId npstat::HistoND< Numeric, Axis >::classId ( ) const
inline

Method related to "geners" I/O

Definition at line 837 of file HistoND.h.

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

Definition at line 3567 of file HistoND.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Clear the histogram contents (both bins and overflows)

Definition at line 1212 of file HistoND.h.

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

1213  {
1214  clearBinContents();
1215  clearOverflows();
1216  ++modCount_;
1217  }
unsigned long modCount_
Definition: HistoND.h:868
void clearOverflows()
Definition: HistoND.h:1204
void clearBinContents()
Definition: HistoND.h:1196
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearBinContents ( )
inline

This method clears the bin contents but not overflows

Definition at line 1196 of file HistoND.h.

1197  {
1198  data_.clear();
1199  fillCount_ = 0UL;
1200  ++modCount_;
1201  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
ArrayND & clear()
Definition: ArrayND.h:4777
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearOverflows ( )
inline

This method clears overflows but not the bin contents

Definition at line 1204 of file HistoND.h.

1205  {
1206  overflow_.clear();
1207  overCount_ = 0UL;
1208  ++modCount_;
1209  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND & clear()
Definition: ArrayND.h:4777
unsigned long overCount_
Definition: HistoND.h:867
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1732 of file HistoND.h.

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

1734  {
1735  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1736  "In npstat::HistoND::closestBin: "
1737  "incompatible input point dimensionality");
1738  if (coordLength)
1739  {
1740  assert(coords);
1741  unsigned* idx = &indexBuf_[0];
1742  const Axis* ax = &axes_[0];
1743  for (unsigned i=0; i<dim_; ++i)
1744  idx[i] = ax[i].closestValidBin(coords[i]);
1745  return data_.value(idx, dim_);
1746  }
1747  else
1748  return data_();
1749  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:863
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 1849 of file HistoND.h.

References npstat::Private::h_badargs().

1850  {
1851  if (dim_) Private::h_badargs("closestBin");
1852  return data_();
1853  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0) const
inline

Definition at line 1917 of file HistoND.h.

References npstat::Private::h_badargs().

1918  {
1919  if (dim_ != 1U) Private::h_badargs("closestBin");
1920  const unsigned i0 = axes_[0].closestValidBin(x0);
1921  return data_(i0);
1922  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1 
) const

Definition at line 1998 of file HistoND.h.

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

2000  {
2001  if (dim_ != 2U) Private::h_badargs("closestBin");
2002  const Axis* ax = &axes_[0];
2003  const unsigned i0 = ax[0].closestValidBin(x0);
2004  const unsigned i1 = ax[1].closestValidBin(x1);
2005  return data_(i0, i1);
2006  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2 
) const

Definition at line 2087 of file HistoND.h.

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

2090  {
2091  if (dim_ != 3U) Private::h_badargs("closestBin");
2092  const Axis* ax = &axes_[0];
2093  const unsigned i0 = ax[0].closestValidBin(x0);
2094  const unsigned i1 = ax[1].closestValidBin(x1);
2095  const unsigned i2 = ax[2].closestValidBin(x2);
2096  return data_(i0, i1, i2);
2097  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2186 of file HistoND.h.

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

2190  {
2191  if (dim_ != 4U) Private::h_badargs("closestBin");
2192  const Axis* ax = &axes_[0];
2193  const unsigned i0 = ax[0].closestValidBin(x0);
2194  const unsigned i1 = ax[1].closestValidBin(x1);
2195  const unsigned i2 = ax[2].closestValidBin(x2);
2196  const unsigned i3 = ax[3].closestValidBin(x3);
2197  return data_(i0, i1, i2, i3);
2198  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2291 of file HistoND.h.

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

2296  {
2297  if (dim_ != 5U) Private::h_badargs("closestBin");
2298  const Axis* ax = &axes_[0];
2299  const unsigned i0 = ax[0].closestValidBin(x0);
2300  const unsigned i1 = ax[1].closestValidBin(x1);
2301  const unsigned i2 = ax[2].closestValidBin(x2);
2302  const unsigned i3 = ax[3].closestValidBin(x3);
2303  const unsigned i4 = ax[4].closestValidBin(x4);
2304  return data_(i0, i1, i2, i3, i4);
2305  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2411 of file HistoND.h.

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

2417  {
2418  if (dim_ != 6U) Private::h_badargs("closestBin");
2419  const Axis* ax = &axes_[0];
2420  const unsigned i0 = ax[0].closestValidBin(x0);
2421  const unsigned i1 = ax[1].closestValidBin(x1);
2422  const unsigned i2 = ax[2].closestValidBin(x2);
2423  const unsigned i3 = ax[3].closestValidBin(x3);
2424  const unsigned i4 = ax[4].closestValidBin(x4);
2425  const unsigned i5 = ax[5].closestValidBin(x5);
2426  return data_(i0, i1, i2, i3, i4, i5);
2427  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2536 of file HistoND.h.

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

2543  {
2544  if (dim_ != 7U) Private::h_badargs("closestBin");
2545  const Axis* ax = &axes_[0];
2546  const unsigned i0 = ax[0].closestValidBin(x0);
2547  const unsigned i1 = ax[1].closestValidBin(x1);
2548  const unsigned i2 = ax[2].closestValidBin(x2);
2549  const unsigned i3 = ax[3].closestValidBin(x3);
2550  const unsigned i4 = ax[4].closestValidBin(x4);
2551  const unsigned i5 = ax[5].closestValidBin(x5);
2552  const unsigned i6 = ax[6].closestValidBin(x6);
2553  return data_(i0, i1, i2, i3, i4, i5, i6);
2554  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2671 of file HistoND.h.

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

2679  {
2680  if (dim_ != 8U) Private::h_badargs("closestBin");
2681  const Axis* ax = &axes_[0];
2682  const unsigned i0 = ax[0].closestValidBin(x0);
2683  const unsigned i1 = ax[1].closestValidBin(x1);
2684  const unsigned i2 = ax[2].closestValidBin(x2);
2685  const unsigned i3 = ax[3].closestValidBin(x3);
2686  const unsigned i4 = ax[4].closestValidBin(x4);
2687  const unsigned i5 = ax[5].closestValidBin(x5);
2688  const unsigned i6 = ax[6].closestValidBin(x6);
2689  const unsigned i7 = ax[7].closestValidBin(x7);
2690  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2691  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2812 of file HistoND.h.

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

2821  {
2822  if (dim_ != 9U) Private::h_badargs("closestBin");
2823  const Axis* ax = &axes_[0];
2824  const unsigned i0 = ax[0].closestValidBin(x0);
2825  const unsigned i1 = ax[1].closestValidBin(x1);
2826  const unsigned i2 = ax[2].closestValidBin(x2);
2827  const unsigned i3 = ax[3].closestValidBin(x3);
2828  const unsigned i4 = ax[4].closestValidBin(x4);
2829  const unsigned i5 = ax[5].closestValidBin(x5);
2830  const unsigned i6 = ax[6].closestValidBin(x6);
2831  const unsigned i7 = ax[7].closestValidBin(x7);
2832  const unsigned i8 = ax[8].closestValidBin(x8);
2833  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2834  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2963 of file HistoND.h.

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

2973  {
2974  if (dim_ != 10U) Private::h_badargs("closestBin");
2975  const Axis* ax = &axes_[0];
2976  const unsigned i0 = ax[0].closestValidBin(x0);
2977  const unsigned i1 = ax[1].closestValidBin(x1);
2978  const unsigned i2 = ax[2].closestValidBin(x2);
2979  const unsigned i3 = ax[3].closestValidBin(x3);
2980  const unsigned i4 = ax[4].closestValidBin(x4);
2981  const unsigned i5 = ax[5].closestValidBin(x5);
2982  const unsigned i6 = ax[6].closestValidBin(x6);
2983  const unsigned i7 = ax[7].closestValidBin(x7);
2984  const unsigned i8 = ax[8].closestValidBin(x8);
2985  const unsigned i9 = ax[9].closestValidBin(x9);
2986  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2987  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
unsigned npstat::HistoND< Numeric, Axis >::dim ( ) const
inline

Histogram dimensionality

Definition at line 157 of file HistoND.h.

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

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

157 {return dim_;}
unsigned dim_
Definition: HistoND.h:869
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 1675 of file HistoND.h.

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

1677  {
1678  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1679  "In npstat::HistoND::dispatch: "
1680  "incompatible input point dimensionality");
1681  if (coordLength)
1682  {
1683  assert(coords);
1684  unsigned* idx = &indexBuf_[0];
1685  unsigned* over = idx + dim_;
1686  const Axis* ax = &axes_[0];
1687  unsigned overflown = 0U;
1688  for (unsigned i=0; i<dim_; ++i)
1689  {
1690  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1691  overflown |= (over[i] - 1U);
1692  }
1693  if (overflown)
1694  f(overflow_.value(over, dim_), w);
1695  else
1696  f(data_.value(idx, dim_), w);
1697  }
1698  else
1699  f(data_(), w);
1700  ++modCount_;
1701  }
int i
Definition: DBlmapReader.cc:9
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1825 of file HistoND.h.

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

1826  {
1827  if (dim_) Private::h_badargs("dispatch");
1828  f(data_(), w);
1829  ++modCount_;
1830  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
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 1874 of file HistoND.h.

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

1875  {
1876  if (dim_ != 1U) Private::h_badargs("dispatch");
1877  unsigned i0 = 0;
1878  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1879  if (ov0 == 1U)
1880  f(data_(i0), w);
1881  else
1882  f(overflow_(ov0), w);
1883  ++modCount_;
1884  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1946 of file HistoND.h.

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

1948  {
1949  if (dim_ != 2U) Private::h_badargs("dispatch");
1950  unsigned i0 = 0, i1 = 0;
1951  const Axis* ax = &axes_[0];
1952  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1953  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1954  if (o0 == 1U && o1 == 1U)
1955  f(data_(i0, i1), w);
1956  else
1957  f(overflow_(o0, o1), w);
1958  ++modCount_;
1959  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2031 of file HistoND.h.

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

2033  {
2034  if (dim_ != 3U) Private::h_badargs("dispatch");
2035  unsigned i0 = 0, i1 = 0, i2 = 0;
2036  const Axis* ax = &axes_[0];
2037  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2038  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2039  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2040  if (o0 == 1U && o1 == 1U && o2 == 1U)
2041  f(data_(i0, i1, i2), w);
2042  else
2043  f(overflow_(o0, o1, o2), w);
2044  ++modCount_;
2045  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2124 of file HistoND.h.

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

2127  {
2128  if (dim_ != 4U) Private::h_badargs("dispatch");
2129  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2130  const Axis* ax = &axes_[0];
2131  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2132  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2133  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2134  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2135  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2136  f(data_(i0, i1, i2, i3), w);
2137  else
2138  f(overflow_(o0, o1, o2, o3), w);
2139  ++modCount_;
2140  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2226 of file HistoND.h.

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

2229  {
2230  if (dim_ != 5U) Private::h_badargs("dispatch");
2231  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2232  const Axis* ax = &axes_[0];
2233  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2234  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2235  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2236  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2237  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2238  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2239  f(data_(i0, i1, i2, i3, i4), w);
2240  else
2241  f(overflow_(o0, o1, o2, o3, o4), w);
2242  ++modCount_;
2243  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2336 of file HistoND.h.

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

2340  {
2341  if (dim_ != 6U) Private::h_badargs("dispatch");
2342  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2343  const Axis* ax = &axes_[0];
2344  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2345  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2346  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2347  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2348  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2349  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2350  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2351  o3 == 1U && o4 == 1U && o5 == 1U)
2352  f(data_(i0, i1, i2, i3, i4, i5), w);
2353  else
2354  f(overflow_(o0, o1, o2, o3, o4, o5), w);
2355  ++modCount_;
2356  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2459 of file HistoND.h.

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

2463  {
2464  if (dim_ != 7U) Private::h_badargs("dispatch");
2465  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2466  const Axis* ax = &axes_[0];
2467  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2468  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2469  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2470  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2471  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2472  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2473  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2474  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2475  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2476  f(data_(i0, i1, i2, i3, i4, i5, i6), w);
2477  else
2478  f(overflow_(o0, o1, o2, o3, o4, o5, o6), w);
2479  ++modCount_;
2480  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2588 of file HistoND.h.

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

2593  {
2594  if (dim_ != 8U) Private::h_badargs("dispatch");
2595  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
2596  const Axis* ax = &axes_[0];
2597  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2598  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2599  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2600  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2601  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2602  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2603  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2604  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2605  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2606  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2607  f(data_(i0, i1, i2, i3, i4, i5, i6, i7), w);
2608  else
2609  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7), w);
2610  ++modCount_;
2611  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2726 of file HistoND.h.

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

2731  {
2732  if (dim_ != 9U) Private::h_badargs("dispatch");
2733  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0;
2734  const Axis* ax = &axes_[0];
2735  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2736  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2737  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2738  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2739  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2740  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2741  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2742  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2743  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2744  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2745  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2746  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8), w);
2747  else
2748  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8), w);
2749  ++modCount_;
2750  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2871 of file HistoND.h.

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

2877  {
2878  if (dim_ != 10U) 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 &&
2892  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && 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  }
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1704 of file HistoND.h.

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

1706  {
1707  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1708  "In npstat::HistoND::examine: "
1709  "incompatible input point dimensionality");
1710  if (coordLength)
1711  {
1712  assert(coords);
1713  unsigned* idx = &indexBuf_[0];
1714  unsigned* over = idx + dim_;
1715  const Axis* ax = &axes_[0];
1716  unsigned overflown = 0U;
1717  for (unsigned i=0; i<dim_; ++i)
1718  {
1719  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1720  overflown |= (over[i] - 1U);
1721  }
1722  if (overflown)
1723  return overflow_.value(over, dim_);
1724  else
1725  return data_.value(idx, dim_);
1726  }
1727  else
1728  return data_();
1729  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
assert(m_qm.get())
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1842 of file HistoND.h.

References npstat::Private::h_badargs().

1843  {
1844  if (dim_) Private::h_badargs("examine");
1845  return data_();
1846  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0) const
inline

Definition at line 1905 of file HistoND.h.

References npstat::Private::h_badargs().

1906  {
1907  if (dim_ != 1U) Private::h_badargs("examine");
1908  unsigned i0 = 0;
1909  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1910  if (ov0 == 1U)
1911  return data_(i0);
1912  else
1913  return overflow_(ov0);
1914  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1 
) const

Definition at line 1983 of file HistoND.h.

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

1985  {
1986  if (dim_ != 2U) Private::h_badargs("examine");
1987  unsigned i0 = 0, i1 = 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  if (o0 == 1U && o1 == 1U)
1992  return data_(i0, i1);
1993  else
1994  return overflow_(o0, o1);
1995  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2 
) const

Definition at line 2070 of file HistoND.h.

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

2073  {
2074  if (dim_ != 3U) Private::h_badargs("examine");
2075  unsigned i0 = 0, i1 = 0, i2 = 0;
2076  const Axis* ax = &axes_[0];
2077  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2078  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2079  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2080  if (o0 == 1U && o1 == 1U && o2 == 1U)
2081  return data_(i0, i1, i2);
2082  else
2083  return overflow_(o0, o1, o2);
2084  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2167 of file HistoND.h.

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

2171  {
2172  if (dim_ != 4U) Private::h_badargs("examine");
2173  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2174  const Axis* ax = &axes_[0];
2175  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2176  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2177  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2178  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2179  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2180  return data_(i0, i1, i2, i3);
2181  else
2182  return overflow_(o0, o1, o2, o3);
2183  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2271 of file HistoND.h.

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

2275  {
2276  if (dim_ != 5U) Private::h_badargs("examine");
2277  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2278  const Axis* ax = &axes_[0];
2279  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2280  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2281  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2282  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2283  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2284  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2285  return data_(i0, i1, i2, i3, i4);
2286  else
2287  return overflow_(o0, o1, o2, o3, o4);
2288  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2387 of file HistoND.h.

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

2393  {
2394  if (dim_ != 6U) Private::h_badargs("examine");
2395  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2396  const Axis* ax = &axes_[0];
2397  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2398  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2399  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2400  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2401  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2402  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2403  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2404  o3 == 1U && o4 == 1U && o5 == 1U)
2405  return data_(i0, i1, i2, i3, i4, i5);
2406  else
2407  return overflow_(o0, o1, o2, o3, o4, o5);
2408  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2512 of file HistoND.h.

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

2517  {
2518  if (dim_ != 7U) Private::h_badargs("examine");
2519  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2520  const Axis* ax = &axes_[0];
2521  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2522  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2523  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2524  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2525  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2526  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2527  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2528  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2529  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2530  return data_(i0, i1, i2, i3, i4, i5, i6);
2531  else
2532  return overflow_(o0, o1, o2, o3, o4, o5, o6);
2533  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2645 of file HistoND.h.

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

2651  {
2652  if (dim_ != 8U) Private::h_badargs("examine");
2653  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
2654  const Axis* ax = &axes_[0];
2655  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2656  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2657  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2658  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2659  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2660  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2661  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2662  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2663  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2664  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2665  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2666  else
2667  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7);
2668  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2785 of file HistoND.h.

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

2791  {
2792  if (dim_ != 9U) Private::h_badargs("examine");
2793  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0;
2794  const Axis* ax = &axes_[0];
2795  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2796  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2797  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2798  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2799  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2800  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2801  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2802  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2803  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2804  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2805  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2806  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2807  else
2808  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8);
2809  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2934 of file HistoND.h.

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

2941  {
2942  if (dim_ != 10U) Private::h_badargs("examine");
2943  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0;
2944  const Axis* ax = &axes_[0];
2945  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2946  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2947  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2948  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2949  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2950  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2951  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2952  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2953  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2954  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2955  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2956  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2957  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2958  else
2959  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9);
2960  }
unsigned dim_
Definition: HistoND.h:869
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1642 of file HistoND.h.

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

1644  {
1645  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1646  "In npstat::HistoND::fill: "
1647  "incompatible input point dimensionality");
1648  if (coordLength)
1649  {
1650  assert(coords);
1651  unsigned* idx = &indexBuf_[0];
1652  unsigned* over = idx + dim_;
1653  const Axis* ax = &axes_[0];
1654  unsigned overflown = 0U;
1655  for (unsigned i=0; i<dim_; ++i)
1656  {
1657  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1658  overflown |= (over[i] - 1U);
1659  }
1660  if (overflown)
1661  {
1662  overflow_.value(over, dim_) += w;
1663  ++overCount_;
1664  }
1665  else
1666  data_.value(idx, dim_) += w;
1667  }
1668  else
1669  data_() += w;
1670  ++fillCount_; ++modCount_;
1671  }
int i
Definition: DBlmapReader.cc:9
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1816 of file HistoND.h.

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

1817  {
1818  if (dim_) Private::h_badargs("fill");
1819  data_() += w;
1820  ++fillCount_; ++modCount_;
1821  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
const Num2 &  weight 
)

Definition at line 1857 of file HistoND.h.

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

1858  {
1859  if (dim_ != 1U) Private::h_badargs("fill");
1860  unsigned i0 = 0;
1861  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1862  if (ov0 == 1U)
1863  data_(i0) += w;
1864  else
1865  {
1866  overflow_(ov0) += w;
1867  ++overCount_;
1868  }
1869  ++fillCount_; ++modCount_;
1870  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1926 of file HistoND.h.

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

1928  {
1929  if (dim_ != 2U) Private::h_badargs("fill");
1930  unsigned i0 = 0, i1 = 0;
1931  const Axis* ax = &axes_[0];
1932  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1933  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1934  if (o0 == 1U && o1 == 1U)
1935  data_(i0, i1) += w;
1936  else
1937  {
1938  overflow_(o0, o1) += w;
1939  ++overCount_;
1940  }
1941  ++fillCount_; ++modCount_;
1942  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2010 of file HistoND.h.

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

2012  {
2013  if (dim_ != 3U) Private::h_badargs("fill");
2014  unsigned i0 = 0, i1 = 0, i2 = 0;
2015  const Axis* ax = &axes_[0];
2016  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2017  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2018  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2019  if (o0 == 1U && o1 == 1U && o2 == 1U)
2020  data_(i0, i1, i2) += w;
2021  else
2022  {
2023  overflow_(o0, o1, o2) += w;
2024  ++overCount_;
2025  }
2026  ++fillCount_; ++modCount_;
2027  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2101 of file HistoND.h.

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

2104  {
2105  if (dim_ != 4U) Private::h_badargs("fill");
2106  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0;
2107  const Axis* ax = &axes_[0];
2108  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2109  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2110  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2111  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2112  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2113  data_(i0, i1, i2, i3) += w;
2114  else
2115  {
2116  overflow_(o0, o1, o2, o3) += w;
2117  ++overCount_;
2118  }
2119  ++fillCount_; ++modCount_;
2120  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2202 of file HistoND.h.

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

2205  {
2206  if (dim_ != 5U) Private::h_badargs("fill");
2207  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0;
2208  const Axis* ax = &axes_[0];
2209  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2210  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2211  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2212  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2213  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2214  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2215  data_(i0, i1, i2, i3, i4) += w;
2216  else
2217  {
2218  overflow_(o0, o1, o2, o3, o4) += w;
2219  ++overCount_;
2220  }
2221  ++fillCount_; ++modCount_;
2222  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2309 of file HistoND.h.

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

2313  {
2314  if (dim_ != 6U) Private::h_badargs("fill");
2315  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0;
2316  const Axis* ax = &axes_[0];
2317  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2318  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2319  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2320  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2321  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2322  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2323  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2324  o3 == 1U && o4 == 1U && o5 == 1U)
2325  data_(i0, i1, i2, i3, i4, i5) += w;
2326  else
2327  {
2328  overflow_(o0, o1, o2, o3, o4, o5) += w;
2329  ++overCount_;
2330  }
2331  ++fillCount_; ++modCount_;
2332  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2431 of file HistoND.h.

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

2435  {
2436  if (dim_ != 7U) Private::h_badargs("fill");
2437  unsigned i0 = 0, i1 = 0, i2 = 0, i3 = 0, i4 = 0, i5 = 0, i6 = 0;
2438  const Axis* ax = &axes_[0];
2439  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2440  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2441  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2442  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2443  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2444  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2445  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2446  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2447  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2448  data_(i0, i1, i2, i3, i4, i5, i6) += w;
2449  else
2450  {
2451  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2452  ++overCount_;
2453  }
2454  ++fillCount_; ++modCount_;
2455  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2558 of file HistoND.h.

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

2563  {
2564  if (dim_ != 8U) Private::h_badargs("fill");
2565  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
2566  const Axis* ax = &axes_[0];
2567  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2568  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2569  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2570  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2571  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2572  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2573  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2574  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2575  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2576  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2577  data_(i0, i1, i2, i3, i4, i5, i6, i7) += w;
2578  else
2579  {
2580  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2581  ++overCount_;
2582  }
2583  ++fillCount_; ++modCount_;
2584  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2695 of file HistoND.h.

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

2700  {
2701  if (dim_ != 9U) Private::h_badargs("fill");
2702  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0;
2703  const Axis* ax = &axes_[0];
2704  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2705  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2706  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2707  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2708  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2709  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2710  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2711  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2712  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2713  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2714  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2715  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) += w;
2716  else
2717  {
2718  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2719  ++overCount_;
2720  }
2721  ++fillCount_; ++modCount_;
2722  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2838 of file HistoND.h.

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

2844  {
2845  if (dim_ != 10U) Private::h_badargs("fill");
2846  unsigned i0=0, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0;
2847  const Axis* ax = &axes_[0];
2848  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2849  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2850  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2851  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2852  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2853  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2854  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2855  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2856  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2857  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2858  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2859  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2860  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) += w;
2861  else
2862  {
2863  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2864  ++overCount_;
2865  }
2866  ++fillCount_; ++modCount_;
2867  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1782 of file HistoND.h.

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

1784  {
1785  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1786  "In npstat::HistoND::fillC: "
1787  "incompatible input point dimensionality");
1788  if (coordLength)
1789  {
1790  assert(coords);
1791  double* wg = &weightBuf_[0];
1792  unsigned* idx = &indexBuf_[0];
1793  unsigned* over = idx + dim_;
1794  const Axis* ax = &axes_[0];
1795  unsigned overflown = 0U;
1796  for (unsigned i=0; i<dim_; ++i)
1797  {
1798  over[i] = ax[i].overflowIndexWeighted(coords[i], idx+i, wg+i);
1799  overflown |= (over[i] - 1U);
1800  }
1801  if (overflown)
1802  {
1803  overflow_.value(over, dim_) += w;
1804  ++overCount_;
1805  }
1806  else
1808  }
1809  else
1810  data_() += w;
1811  ++fillCount_; ++modCount_;
1812  }
int i
Definition: DBlmapReader.cc:9
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1834 of file HistoND.h.

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

1835  {
1836  if (dim_) Private::h_badargs("fillC");
1837  data_() += w;
1838  ++fillCount_; ++modCount_;
1839  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
const Num2 &  weight 
)

Definition at line 1888 of file HistoND.h.

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

1889  {
1890  if (dim_ != 1U) Private::h_badargs("fillC");
1891  double* wg = &weightBuf_[0];
1892  unsigned* idx = &indexBuf_[0];
1893  const unsigned ov0 = axes_[0].overflowIndexWeighted(x0, idx, wg);
1894  if (ov0 == 1U)
1896  else
1897  {
1898  overflow_(ov0) += w;
1899  ++overCount_;
1900  }
1901  ++fillCount_; ++modCount_;
1902  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1963 of file HistoND.h.

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

1965  {
1966  if (dim_ != 2U) Private::h_badargs("fillC");
1967  double* wg = &weightBuf_[0];
1968  unsigned* idx = &indexBuf_[0];
1969  const Axis* ax = &axes_[0];
1970  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
1971  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
1972  if (o0 == 1U && o1 == 1U)
1974  else
1975  {
1976  overflow_(o0, o1) += w;
1977  ++overCount_;
1978  }
1979  ++fillCount_; ++modCount_;
1980  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2049 of file HistoND.h.

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

2051  {
2052  if (dim_ != 3U) Private::h_badargs("fillC");
2053  double* wg = &weightBuf_[0];
2054  unsigned* idx = &indexBuf_[0];
2055  const Axis* ax = &axes_[0];
2056  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2057  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2058  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2059  if (o0 == 1U && o1 == 1U && o2 == 1U)
2061  else
2062  {
2063  overflow_(o0, o1, o2) += w;
2064  ++overCount_;
2065  }
2066  ++fillCount_; ++modCount_;
2067  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2144 of file HistoND.h.

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

2147  {
2148  if (dim_ != 4U) Private::h_badargs("fillC");
2149  double* wg = &weightBuf_[0];
2150  unsigned* idx = &indexBuf_[0];
2151  const Axis* ax = &axes_[0];
2152  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2153  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2154  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2155  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2156  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2158  else
2159  {
2160  overflow_(o0, o1, o2, o3) += w;
2161  ++overCount_;
2162  }
2163  ++fillCount_; ++modCount_;
2164  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2247 of file HistoND.h.

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

2250  {
2251  if (dim_ != 5U) Private::h_badargs("fillC");
2252  double* wg = &weightBuf_[0];
2253  unsigned* idx = &indexBuf_[0];
2254  const Axis* ax = &axes_[0];
2255  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2256  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2257  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2258  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2259  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2260  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2262  else
2263  {
2264  overflow_(o0, o1, o2, o3, o4) += w;
2265  ++overCount_;
2266  }
2267  ++fillCount_; ++modCount_;
2268  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2360 of file HistoND.h.

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

2364  {
2365  if (dim_ != 6U) Private::h_badargs("fillC");
2366  double* wg = &weightBuf_[0];
2367  unsigned* idx = &indexBuf_[0];
2368  const Axis* ax = &axes_[0];
2369  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2370  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2371  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2372  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2373  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2374  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2375  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2376  o3 == 1U && o4 == 1U && o5 == 1U)
2378  else
2379  {
2380  overflow_(o0, o1, o2, o3, o4, o5) += w;
2381  ++overCount_;
2382  }
2383  ++fillCount_; ++modCount_;
2384  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2484 of file HistoND.h.

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

2488  {
2489  if (dim_ != 7U) Private::h_badargs("fillC");
2490  double* wg = &weightBuf_[0];
2491  unsigned* idx = &indexBuf_[0];
2492  const Axis* ax = &axes_[0];
2493  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2494  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2495  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2496  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2497  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2498  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2499  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2500  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2501  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2503  else
2504  {
2505  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2506  ++overCount_;
2507  }
2508  ++fillCount_; ++modCount_;
2509  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2615 of file HistoND.h.

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

2620  {
2621  if (dim_ != 8U) Private::h_badargs("fillC");
2622  double* wg = &weightBuf_[0];
2623  unsigned* idx = &indexBuf_[0];
2624  const Axis* ax = &axes_[0];
2625  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2626  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2627  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2628  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2629  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2630  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2631  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2632  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2633  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2634  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2636  else
2637  {
2638  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2639  ++overCount_;
2640  }
2641  ++fillCount_; ++modCount_;
2642  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 2754 of file HistoND.h.

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

2759  {
2760  if (dim_ != 9U) Private::h_badargs("fillC");
2761  double* wg = &weightBuf_[0];
2762  unsigned* idx = &indexBuf_[0];
2763  const Axis* ax = &axes_[0];
2764  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2765  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2766  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2767  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2768  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2769  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2770  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2771  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2772  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
2773  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2774  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2776  else
2777  {
2778  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2779  ++overCount_;
2780  }
2781  ++fillCount_; ++modCount_;
2782  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 create_public_lumi_plots::ax, npstat::Private::h_badargs(), customizeTrackingMonitorSeedNumber::idx, and w.

2907  {
2908  if (dim_ != 10U) Private::h_badargs("fillC");
2909  double* wg = &weightBuf_[0];
2910  unsigned* idx = &indexBuf_[0];
2911  const Axis* ax = &axes_[0];
2912  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2913  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2914  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2915  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2916  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2917  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2918  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2919  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2920  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
2921  const unsigned o9 = ax[9].overflowIndexWeighted(x9, idx+9, wg+9);
2922  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2923  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2925  else
2926  {
2927  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2928  ++overCount_;
2929  }
2930  ++fillCount_; ++modCount_;
2931  }
const double w
Definition: UKUtility.cc:23
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
void h_badargs(const char *method)
Definition: HistoND.h:1133
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1753
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillPreservingCentroid ( const Num2 &  weight)
private

Definition at line 1753 of file HistoND.h.

References i, w, and create_public_pileup_plots::weights.

1754  {
1755  const double* weights = &weightBuf_[0];
1756  const unsigned* cell = &indexBuf_[0];
1757  const unsigned long* strides = data_.strides();
1758  const unsigned long maxcycle = 1UL << dim_;
1759  for (unsigned long icycle=0; icycle<maxcycle; ++icycle)
1760  {
1761  double w = 1.0;
1762  unsigned long icell = 0UL;
1763  for (unsigned i=0; i<dim_; ++i)
1764  {
1765  if (icycle & (1UL << i))
1766  {
1767  w *= (1.0 - weights[i]);
1768  icell += strides[i]*(cell[i] + 1U);
1769  }
1770  else
1771  {
1772  w *= weights[i];
1773  icell += strides[i]*cell[i];
1774  }
1775  }
1776  data_.linearValue(icell) += (value * w);
1777  }
1778  }
int i
Definition: DBlmapReader.cc:9
const double w
Definition: UKUtility.cc:23
unsigned dim_
Definition: HistoND.h:869
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:861
std::vector< double > weightBuf_
Definition: HistoND.h:864
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
const unsigned long * strides() const
Definition: ArrayND.h:261
template<typename Numeric, class Axis>
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 826 of file HistoND.h.

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

826 {return modCount_;}
unsigned long modCount_
Definition: HistoND.h:868
template<typename Numeric, class Axis>
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 833 of file HistoND.h.

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

833 {++modCount_;}
unsigned long modCount_
Definition: HistoND.h:868
template<typename Numeric , class Axis >
double npstat::HistoND< Numeric, Axis >::integral ( ) const

Integral of the histogram

Definition at line 1489 of file HistoND.h.

References data, and i.

1490  {
1491  typedef typename PreciseType<Numeric>::type Precise;
1492 
1493  if (dim_ == 0U)
1494  return 0.0;
1495  if (isUniformlyBinned())
1496  {
1497  Precise sum = data_.template sum<Precise>();
1498  return static_cast<double>(sum)*binVolume();
1499  }
1500  else
1501  {
1502  Precise sum = Precise();
1503  const Numeric* data = data_.data();
1504  const unsigned long len = data_.length();
1505  for (unsigned long i=0; i<len; ++i)
1506  sum += data[i]*binVolume(i);
1507  return static_cast<double>(sum);
1508  }
1509  }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
unsigned long length() const
Definition: ArrayND.h:231
double binVolume(unsigned long binNumber=0) const
Definition: HistoND.h:1613
ArrayND< Numeric > data_
Definition: HistoND.h:861
const Numeric * data() const
Definition: ArrayND.h:234
bool isUniformlyBinned() const
Definition: HistoND.h:1480
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 1586 of file HistoND.h.

1587  {
1588  return dim_ == r.dim_ &&
1589  overflow_ == r.overflow_ &&
1590  data_ == r.data_;
1591  }
unsigned dim_
Definition: HistoND.h:869
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 1480 of file HistoND.h.

References i.

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

1481  {
1482  for (unsigned i=0; i<dim_; ++i)
1483  if (!axes_[i].isUniform())
1484  return false;
1485  return true;
1486  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric, class Axis>
unsigned long npstat::HistoND< Numeric, Axis >::nBins ( ) const
inline

Total number of bins

Definition at line 180 of file HistoND.h.

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

180 {return data_.length();}
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric, class Axis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsInRange ( ) const
inline

Total number of fills which fell inside the histogram range

Definition at line 186 of file HistoND.h.

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

187  {return fillCount_ - overCount_;}
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long overCount_
Definition: HistoND.h:867
template<typename Numeric, class Axis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsOver ( ) const
inline

Total number of fills which fell outside the histogram range

Definition at line 190 of file HistoND.h.

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

190 {return overCount_;}
unsigned long overCount_
Definition: HistoND.h:867
template<typename Numeric, class Axis>
unsigned long npstat::HistoND< Numeric, Axis >::nFillsTotal ( ) const
inline

Total number of fills performed

Definition at line 183 of file HistoND.h.

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

183 {return fillCount_;}
unsigned long fillCount_
Definition: HistoND.h:866
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 1607 of file HistoND.h.

References alignCSCRings::r.

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

In-place multiplication by a scalar (scaling)

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

Definition at line 3331 of file HistoND.h.

References alignCSCRings::r.

3332  {
3333  data_ *= r;
3334  overflow_ *= r;
3335  ++modCount_;
3336  return *this;
3337  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
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.

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

Definition at line 3297 of file HistoND.h.

3299  {
3300  data_ += r.data_;
3301  overflow_ += r.overflow_;
3302  fillCount_ += r.fillCount_;
3303  overCount_ += r.overCount_;
3304  ++modCount_;
3305  return *this;
3306  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
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".

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

Definition at line 3310 of file HistoND.h.

3312  {
3313  data_ -= r.data_;
3314  overflow_ -= r.overflow_;
3315 
3316  // Subtraction does not make much sense for fill counts.
3317  // We will assume that what we want should be equivalent
3318  // to the in-place multiplication of the other histogram
3319  // by -1 and then adding.
3320  //
3321  fillCount_ += r.fillCount_;
3322  overCount_ += r.overCount_;
3323 
3324  ++modCount_;
3325  return *this;
3326  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
template<typename Num2 >
HistoND& npstat::HistoND< Numeric, Axis >::operator/= ( const Num2 &  r)

In-place division by a scalar

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

Definition at line 3342 of file HistoND.h.

References alignCSCRings::r.

3343  {
3344  data_ /= r;
3345  overflow_ /= r;
3346  ++modCount_;
3347  return *this;
3348  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 3386 of file HistoND.h.

3387  {
3388  if (&r != this)
3389  {
3390  title_ = r.title_;
3391  accumulatedDataLabel_ = r.accumulatedDataLabel_;
3392  data_.uninitialize();
3393  data_ = r.data_;
3395  overflow_ = r.overflow_;
3396  axes_ = r.axes_;
3397  weightBuf_ = r.weightBuf_;
3398  indexBuf_ = r.indexBuf_;
3399  fillCount_ = r.fillCount_;
3400  overCount_ = r.overCount_;
3401  dim_ = r.dim_;
3402  ++modCount_;
3403  }
3404  return *this;
3405  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
unsigned long modCount_
Definition: HistoND.h:868
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
ArrayND & uninitialize()
Definition: ArrayND.h:4783
std::vector< double > weightBuf_
Definition: HistoND.h:864
unsigned long overCount_
Definition: HistoND.h:867
std::vector< unsigned > indexBuf_
Definition: HistoND.h:865
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator== ( const HistoND< Numeric, Axis > &  r) const
inline

Comparison for equality

Definition at line 1594 of file HistoND.h.

1595  {
1596  return dim_ == r.dim_ &&
1597  fillCount_ == r.fillCount_ &&
1598  overCount_ == r.overCount_ &&
1599  title_ == r.title_ &&
1600  accumulatedDataLabel_ == r.accumulatedDataLabel_ &&
1601  axes_ == r.axes_ &&
1602  overflow_ == r.overflow_ &&
1603  data_ == r.data_;
1604  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned dim_
Definition: HistoND.h:869
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
const ArrayND<Numeric>& npstat::HistoND< Numeric, Axis >::overflows ( ) const
inline

Retrive a reference to the array of overflows

Definition at line 170 of file HistoND.h.

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

170 {return overflow_;}
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric , class Axis >
HistoND< Numeric, Axis > * npstat::HistoND< Numeric, Axis >::read ( const gs::ClassId &  id,
std::istream &  in 
)
static

Definition at line 3590 of file HistoND.h.

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

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

3592  {
3593  static const gs::ClassId current(
3594  gs::ClassId::makeId<HistoND<Numeric,Axis> >());
3595  current.ensureSameId(id);
3596 
3598  gs::read_pod(in, &title);
3599 
3601  gs::read_pod(in, &accumulatedDataLabel);
3602 
3603  unsigned long fillCount = 0, overCount = 0;
3604  gs::read_pod(in, &fillCount);
3605  gs::read_pod(in, &overCount);
3606  if (in.fail()) throw gs::IOReadFailure(
3607  "In npstat::HistoND::read: input stream failure");
3608 
3609  std::vector<Axis> axes;
3610  gs::read_heap_obj_vector_as_placed(in, &axes);
3611  gs::ClassId ida(in, 1);
3612  ArrayND<Numeric> data, over;
3613  ArrayND<Numeric>::restore(ida, in, &data);
3614  ArrayND<Numeric>::restore(ida, in, &over);
3615  CPP11_auto_ptr<HistoND<Numeric,Axis> > result(
3616  new HistoND<Numeric,Axis>(axes, title.c_str(),
3617  accumulatedDataLabel.c_str()));
3618  result->data_ = data;
3619  result->overflow_ = over;
3620  result->fillCount_ = fillCount;
3621  result->overCount_ = overCount;
3622  return result.release();
3623  }
const std::string & accumulatedDataLabel() const
Definition: HistoND.h:163
const std::string & title() const
Definition: HistoND.h:160
tuple result
Definition: query.py:137
const std::vector< Axis > & axes() const
Definition: HistoND.h:173
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:6052
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 3527 of file HistoND.h.

3528  {
3529  const long double nOver = overflow_.template sum<long double>();
3530  const long double nData = data_.template sum<long double>();
3531  overCount_ = static_cast<unsigned long>(nOver);
3532  fillCount_ = static_cast<unsigned long>(nData + nOver);
3533  ++modCount_;
3534  }
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
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 3479 of file HistoND.h.

References assert(), and i.

3481  {
3482  if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
3483  "In npstat::HistoND::scaleBinContents: incompatible data length");
3484  assert(data);
3485  Numeric* dat = const_cast<Numeric*>(data_.data());
3486  for (unsigned long i=0; i<dataLength; ++i)
3487  dat[i] *= data[i];
3488  ++modCount_;
3489  }
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:861
const Numeric * data() const
Definition: ArrayND.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::scaleOverflows ( const Num2 *  data,
unsigned long  dataLength 
)

Definition at line 3493 of file HistoND.h.

References assert(), and i.

3495  {
3496  if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
3497  "In npstat::HistoND::scaleOverflows: incompatible data length");
3498  assert(data);
3499  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3500  for (unsigned long i=0; i<dataLength; ++i)
3501  dat[i] *= data[i];
3502  ++modCount_;
3503  }
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:868
assert(m_qm.get())
unsigned long length() const
Definition: ArrayND.h:231
const Numeric * data() const
Definition: ArrayND.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
void npstat::HistoND< Numeric, Axis >::setAccumulatedDataLabel ( const char *  newlabel)
inline

Modify the label associated with accumulated data

Definition at line 203 of file HistoND.h.

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

204  {accumulatedDataLabel_ = newlabel ? newlabel : ""; ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:868
std::string accumulatedDataLabel_
Definition: HistoND.h:860
template<typename Numeric, class Axis>
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 207 of file HistoND.h.

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

208  {axes_.at(axisNum).setLabel(newlabel); ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:868
std::vector< Axis > axes_
Definition: HistoND.h:863
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 2991 of file HistoND.h.

References findQualityFiles::v.

2994  {
2995  data_.value(index, indexLen) = v;
2996  ++modCount_;
2997  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3281
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const Num2 &  v)
inline

Definition at line 3011 of file HistoND.h.

References findQualityFiles::v.

3012  {
3013  data_() = v;
3014  ++modCount_;
3015  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
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.

3029  {
3030  data_(i0) = v;
3031  ++modCount_;
3032  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 3045 of file HistoND.h.

References findQualityFiles::v.

3048  {
3049  data_(i0, i1) = v;
3050  ++modCount_;
3051  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
)
inline

Definition at line 3065 of file HistoND.h.

References findQualityFiles::v.

3069  {
3070  data_(i0, i1, i2) = v;
3071  ++modCount_;
3072  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
)
inline

Definition at line 3076 of file HistoND.h.

References findQualityFiles::v.

3081  {
3082  data_(i0, i1, i2, i3) = v;
3083  ++modCount_;
3084  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
)
inline

Definition at line 3088 of file HistoND.h.

References findQualityFiles::v.

3094  {
3095  data_(i0, i1, i2, i3, i4) = v;
3096  ++modCount_;
3097  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
)
inline

Definition at line 3101 of file HistoND.h.

References findQualityFiles::v.

3108  {
3109  data_(i0, i1, i2, i3, i4, i5) = v;
3110  ++modCount_;
3111  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
)
inline

Definition at line 3115 of file HistoND.h.

References findQualityFiles::v.

3123  {
3124  data_(i0, i1, i2, i3, i4, i5, i6) = v;
3125  ++modCount_;
3126  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
)
inline

Definition at line 3130 of file HistoND.h.

References findQualityFiles::v.

3139  {
3140  data_(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3141  ++modCount_;
3142  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
)
inline

Definition at line 3146 of file HistoND.h.

References findQualityFiles::v.

3156  {
3157  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3158  ++modCount_;
3159  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
)
inline

Definition at line 3163 of file HistoND.h.

References findQualityFiles::v.

3174  {
3175  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3176  ++modCount_;
3177  }
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 3001 of file HistoND.h.

References findQualityFiles::v.

3004  {
3005  data_.valueAt(index, indexLen) = v;
3006  ++modCount_;
3007  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & valueAt(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3431
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const Num2 &  v)
inline

Definition at line 3019 of file HistoND.h.

References findQualityFiles::v.

3020  {
3021  data_.at() = v;
3022  ++modCount_;
3023  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
const Num2 &  v 
)
inline

Definition at line 3036 of file HistoND.h.

References findQualityFiles::v.

3038  {
3039  data_.at(i0) = v;
3040  ++modCount_;
3041  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 3055 of file HistoND.h.

References findQualityFiles::v.

3058  {
3059  data_.at(i0, i1) = v;
3060  ++modCount_;
3061  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
)
inline

Definition at line 3181 of file HistoND.h.

References findQualityFiles::v.

3185  {
3186  data_.at(i0, i1, i2) = v;
3187  ++modCount_;
3188  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
)
inline

Definition at line 3192 of file HistoND.h.

References findQualityFiles::v.

3197  {
3198  data_.at(i0, i1, i2, i3) = v;
3199  ++modCount_;
3200  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
)
inline

Definition at line 3204 of file HistoND.h.

References findQualityFiles::v.

3210  {
3211  data_.at(i0, i1, i2, i3, i4) = v;
3212  ++modCount_;
3213  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
)
inline

Definition at line 3217 of file HistoND.h.

References findQualityFiles::v.

3224  {
3225  data_.at(i0, i1, i2, i3, i4, i5) = v;
3226  ++modCount_;
3227  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
)
inline

Definition at line 3231 of file HistoND.h.

References findQualityFiles::v.

3239  {
3240  data_.at(i0, i1, i2, i3, i4, i5, i6) = v;
3241  ++modCount_;
3242  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
)
inline

Definition at line 3246 of file HistoND.h.

References findQualityFiles::v.

3255  {
3256  data_.at(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3257  ++modCount_;
3258  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
)
inline

Definition at line 3262 of file HistoND.h.

References findQualityFiles::v.

3272  {
3273  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3274  ++modCount_;
3275  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
)
inline

Definition at line 3279 of file HistoND.h.

References findQualityFiles::v.

3290  {
3291  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3292  ++modCount_;
3293  }
unsigned long modCount_
Definition: HistoND.h:868
Numeric & at()
Definition: ArrayND.h:3503
ArrayND< Numeric > data_
Definition: HistoND.h:861
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 3507 of file HistoND.h.

3510  {
3511  data_.setData(data, dataLength);
3512  if (clearOverflowsNow)
3513  clearOverflows();
3514  ++modCount_;
3515  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:868
ArrayND< Numeric > data_
Definition: HistoND.h:861
void clearOverflows()
Definition: HistoND.h:1204
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
template<typename Numeric, class Axis>
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 703 of file HistoND.h.

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

unsigned long modCount_
Definition: HistoND.h:868
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4766
ArrayND< Numeric > data_
Definition: HistoND.h:861
template<typename Numeric, class Axis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBin ( const unsigned long  index,
const Num2 &  v 
)
inline
template<typename Numeric, class Axis>
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setLinearBinAt ( const unsigned long  index,
const Num2 &  v 
)
inline
template<typename Numeric, class Axis>
void npstat::HistoND< Numeric, Axis >::setNFillsOver ( const unsigned long  i)
inline

Definition at line 729 of file HistoND.h.

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

730  {overCount_ = i; ++modCount_;}
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:868
unsigned long overCount_
Definition: HistoND.h:867
template<typename Numeric, class Axis>
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 727 of file HistoND.h.

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

728  {fillCount_ = i; ++modCount_;}
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:866
unsigned long modCount_
Definition: HistoND.h:868
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 3519 of file HistoND.h.

3521  {
3522  overflow_.setData(data, dataLength);
3523  ++modCount_;
3524  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:868
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
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 711 of file HistoND.h.

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

unsigned long modCount_
Definition: HistoND.h:868
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4766
ArrayND< Numeric > overflow_
Definition: HistoND.h:862
template<typename Numeric, class Axis>
void npstat::HistoND< Numeric, Axis >::setTitle ( const char *  newtitle)
inline

Modify the histogram title

Definition at line 199 of file HistoND.h.

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

200  {title_ = newtitle ? newtitle : ""; ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:868
std::string title_
Definition: HistoND.h:859
template<typename Numeric, class Axis>
const std::string& npstat::HistoND< Numeric, Axis >::title ( ) const
inline
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 3408 of file HistoND.h.

3410  {
3411  if (axisNum1 >= dim_ || axisNum2 >= dim_)
3412  throw npstat::NpstatOutOfRange("In npstat::HistoND::transpose: "
3413  "axis number is out of range");
3414  if (axisNum1 == axisNum2)
3415  // Just make a copy
3416  return *this;
3417  else
3418  return HistoND(*this, axisNum1, axisNum2);
3419  }
unsigned dim_
Definition: HistoND.h:869
template<typename Numeric, class Axis>
static unsigned npstat::HistoND< Numeric, Axis >::version ( )
inlinestatic

Definition at line 842 of file HistoND.h.

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

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

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

Definition at line 1628 of file HistoND.h.

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

1629  {
1630  double v = 1.0;
1631  if (dim_)
1632  {
1633  const Axis* ax = &axes_[0];
1634  for (unsigned i=0; i<dim_; ++i)
1635  v *= (ax[i].max() - ax[i].min());
1636  }
1637  return v;
1638  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:869
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< Axis > axes_
Definition: HistoND.h:863
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::write ( std::ostream &  of) const

Definition at line 3575 of file HistoND.h.

3576  {
3577  gs::write_pod(of, title_);
3578  gs::write_pod(of, accumulatedDataLabel_);
3579  gs::write_pod(of, fillCount_);
3580  gs::write_pod(of, overCount_);
3581 
3582  return !of.fail() &&
3583  gs::write_obj_vector(of, axes_) &&
3584  data_.classId().write(of) &&
3585  data_.write(of) &&
3586  overflow_.write(of);
3587  }
unsigned long fillCount_
Definition: HistoND.h:866
bool write(std::ostream &of) const
Definition: ArrayND.h:6041
std::string title_
Definition: HistoND.h:859
std::string accumulatedDataLabel_
Definition: HistoND.h:860
gs::ClassId classId() const
Definition: ArrayND.h:1039
ArrayND< Numeric > data_
Definition: HistoND.h:861
unsigned long overCount_
Definition: HistoND.h:867
std::vector< Axis > axes_
Definition: HistoND.h:863
ArrayND< Numeric > overflow_
Definition: HistoND.h:862

Friends And Related Function Documentation

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

Definition at line 45 of file HistoND.h.

Member Data Documentation

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

Definition at line 865 of file HistoND.h.

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

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

Definition at line 864 of file HistoND.h.

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