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
 
typedef Numeric value_type
 

Public Member Functions

template<typename Acc >
void accumulateBinsInBox (const BoxND< double > &box, Acc *acc) const
 
const std::string & accumulatedDataLabel () const
 
template<class Point >
void allBinCenters (std::vector< Point > *centers) const
 
const std::vector< Axis > & axes () const
 
const Axis & axis (const unsigned i) const
 
void binBox (unsigned long binNumber, BoxND< double > *box) const
 
void binCenter (unsigned long binNumber, double *coords, unsigned lenCoords) const
 
const ArrayND< Numeric > & binContents () const
 
double binVolume (unsigned long binNumber=0) const
 
BoxND< double > boundingBox () const
 
void clear ()
 
void clearBinContents ()
 
void clearOverflows ()
 
const Numeric & closestBin (const double *coords, unsigned coordLength) const
 
unsigned dim () const
 
template<typename Num2 , class Functor >
void dispatch (const double *coords, unsigned coordLength, Num2 &weight, Functor &f)
 
const Numeric & examine (const double *coords, unsigned coordLength) const
 
template<typename Num2 >
void fill (const double *coords, unsigned coordLength, const Num2 &weight)
 
template<typename Num2 >
void fillC (const double *coords, unsigned coordLength, const Num2 &weight)
 
unsigned long getModCount () const
 
 HistoND (const 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)
 
 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) 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.

Constructor & Destructor Documentation

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

Main constructor for arbitrary-dimensional histograms

Definition at line 1165 of file HistoND.h.

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

1167  : title_(title ? title : ""),
1169  data_(Private::makeHistoShape(axesIn)),
1170  overflow_(ArrayShape(axesIn.size(), 3U)),
1171  axes_(axesIn),
1172  weightBuf_(axesIn.size()),
1173  indexBuf_(2U*axesIn.size()),
1174  modCount_(0UL),
1175  dim_(axesIn.size())
1176  {
1177  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1179  "In npstat::HistoND constructor: requested histogram "
1180  "dimensionality is not supported (too large)");
1181  clear();
1182  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 1-d histograms

Definition at line 1185 of file HistoND.h.

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

1187  : title_(title ? title : ""),
1190  overflow_(ArrayShape(1U, 3U)),
1191  weightBuf_(1U),
1192  indexBuf_(2U*1U),
1193  modCount_(0UL),
1194  dim_(1U)
1195  {
1196  axes_.reserve(dim_);
1197  axes_.push_back(xAxis);
1198  clear();
1199  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 2-d histograms

Definition at line 1202 of file HistoND.h.

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

1204  : title_(title ? title : ""),
1206  data_(Private::makeHistoShape(xAxis, yAxis)),
1207  overflow_(ArrayShape(2U, 3U)),
1208  weightBuf_(2U),
1209  indexBuf_(2U*2U),
1210  modCount_(0UL),
1211  dim_(2U)
1212  {
1213  axes_.reserve(dim_);
1214  axes_.push_back(xAxis);
1215  axes_.push_back(yAxis);
1216  clear();
1217  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 3-d histograms

Definition at line 1220 of file HistoND.h.

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

1223  : title_(title ? title : ""),
1225  data_(Private::makeHistoShape(xAxis, yAxis, zAxis)),
1226  overflow_(ArrayShape(3U, 3U)),
1227  weightBuf_(3U),
1228  indexBuf_(2U*3U),
1229  modCount_(0UL),
1230  dim_(3U)
1231  {
1232  axes_.reserve(dim_);
1233  axes_.push_back(xAxis);
1234  axes_.push_back(yAxis);
1235  axes_.push_back(zAxis);
1236  clear();
1237  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 4-d histograms

Definition at line 1240 of file HistoND.h.

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

1243  : title_(title ? title : ""),
1245  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis)),
1246  overflow_(ArrayShape(4U, 3U)),
1247  weightBuf_(4U),
1248  indexBuf_(2U*4U),
1249  modCount_(0UL),
1250  dim_(4U)
1251  {
1252  axes_.reserve(dim_);
1253  axes_.push_back(xAxis);
1254  axes_.push_back(yAxis);
1255  axes_.push_back(zAxis);
1256  axes_.push_back(tAxis);
1257  clear();
1258  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const Axis &  xAxis,
const Axis &  yAxis,
const Axis &  zAxis,
const Axis &  tAxis,
const Axis &  vAxis,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

Convenience constructor for 5-d histograms

Definition at line 1261 of file HistoND.h.

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

1265  : title_(title ? title : ""),
1267  data_(Private::makeHistoShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
1268  overflow_(ArrayShape(5U, 3U)),
1269  weightBuf_(5U),
1270  indexBuf_(2U*5U),
1271  modCount_(0UL),
1272  dim_(5U)
1273  {
1274  axes_.reserve(dim_);
1275  axes_.push_back(xAxis);
1276  axes_.push_back(yAxis);
1277  axes_.push_back(zAxis);
1278  axes_.push_back(tAxis);
1279  axes_.push_back(vAxis);
1280  clear();
1281  }
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayShape makeHistoShape(const std::vector< Axis > &axes)
Definition: HistoND.h:896
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const ArrayShape shape,
const BoxND< double > &  boundingBox,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

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

Definition at line 1284 of file HistoND.h.

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

1287  : title_(title ? title : ""),
1289  data_(shape),
1290  overflow_(ArrayShape(shape.size(), 3U)),
1291  weightBuf_(shape.size()),
1292  indexBuf_(2U*shape.size()),
1293  modCount_(0UL),
1294  dim_(shape.size())
1295  {
1296  if (boundingBox.size() != dim_) throw npstat::NpstatInvalidArgument(
1297  "In npstat::HistoND constructor: "
1298  "incompatible bounding box dimensionality");
1299  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1301  "In npstat::HistoND constructor: requested histogram "
1302  "dimensionality is not supported (too large)");
1303  axes_.reserve(dim_);
1304  for (unsigned i=0; i<dim_; ++i)
1305  axes_.push_back(Axis(shape[i],
1306  boundingBox[i].min(),
1307  boundingBox[i].max()));
1308  clear();
1309  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
const T & max(const T &a, const T &b)
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
BoxND< double > boundingBox() const
Definition: HistoND.h:1403
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Functor &  f,
const char *  title = 0,
const char *  accumulatedDataLabel = 0 
)

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

Definition at line 1313 of file HistoND.h.

1316  : title_(title ? title : ""),
1318  data_(r.data_, f),
1319  overflow_(r.overflow_, f),
1320  axes_(r.axes_),
1321  weightBuf_(r.dim_),
1322  indexBuf_(2U*r.dim_),
1323  fillCount_(r.fillCount_),
1324  overCount_(r.overCount_),
1325  modCount_(0UL),
1326  dim_(r.dim_)
1327  {
1328  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const unsigned *  indices,
unsigned  nIndices,
const char *  title = 0 
)

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

Definition at line 1332 of file HistoND.h.

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

1335  : title_(title ? title : ""),
1336  accumulatedDataLabel_(h.accumulatedDataLabel_),
1337  data_(Private::shapeOfASlice(h.axes_, indices, nIndices)),
1338  overflow_(ArrayShape(data_.rank(), 3U)),
1339  axes_(Private::axesOfASlice(h.axes_, indices, nIndices)),
1340  weightBuf_(data_.rank()),
1341  indexBuf_(2U*data_.rank()),
1342  modCount_(0UL),
1343  dim_(data_.rank())
1344  {
1345  clear();
1346  }
unsigned dim_
Definition: HistoND.h:840
unsigned rank() const
Definition: ArrayND.h:240
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
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< Axis > axesOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:967
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayShape shapeOfASlice(const std::vector< Axis > &axes, const unsigned *fixedIndices, const unsigned nFixedIndices)
Definition: HistoND.h:1002
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Num2, Axis > &  h,
const Axis &  newAxis,
unsigned  newAxisNumber,
const char *  title = 0 
)

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

Definition at line 1350 of file HistoND.h.

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

1353  : title_(title ? title : ""),
1354  accumulatedDataLabel_(h.accumulatedDataLabel_),
1355  data_(Private::shapeWithExtraAxis(h.axes_, newAxis, newAxisNumber)),
1356  overflow_(data_.rank(), 3U),
1357  axes_(Private::addAxis(h.axes_, newAxis, newAxisNumber)),
1358  weightBuf_(data_.rank()),
1359  indexBuf_(2U*data_.rank()),
1360  modCount_(0UL),
1361  dim_(data_.rank())
1362  {
1363  if (dim_ >= CHAR_BIT*sizeof(unsigned long))
1365  "In npstat::HistoND constructor: requested histogram "
1366  "dimensionality is not supported (too large)");
1367  clear();
1368  }
unsigned dim_
Definition: HistoND.h:840
unsigned rank() const
Definition: ArrayND.h:240
void clear()
Definition: HistoND.h:1157
unsigned long modCount_
Definition: HistoND.h:839
const std::string & title() const
Definition: HistoND.h:132
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
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< Axis > addAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1042
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
ArrayShape shapeWithExtraAxis(const std::vector< Axis > &axes, const Axis &newAxis, const unsigned newAxisNumber)
Definition: HistoND.h:1065
template<typename Numeric , class Axis >
npstat::HistoND< Numeric, Axis >::HistoND ( const HistoND< Numeric, Axis > &  r)

Copy constructor

Definition at line 3261 of file HistoND.h.

3262  : title_(r.title_),
3263  accumulatedDataLabel_(r.accumulatedDataLabel_),
3264  data_(r.data_),
3265  overflow_(r.overflow_),
3266  axes_(r.axes_),
3267  weightBuf_(r.weightBuf_),
3268  indexBuf_(r.indexBuf_),
3269  fillCount_(r.fillCount_),
3270  overCount_(r.overCount_),
3271  modCount_(0UL),
3272  dim_(r.dim_)
3273  {
3274  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 3242 of file HistoND.h.

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

3245  : title_(r.title_),
3246  accumulatedDataLabel_(r.accumulatedDataLabel_),
3247  data_(r.data_.transpose(ax1, ax2)),
3248  overflow_(r.overflow_.transpose(ax1, ax2)),
3249  axes_(r.axes_),
3250  weightBuf_(r.weightBuf_),
3251  indexBuf_(r.indexBuf_),
3252  fillCount_(r.fillCount_),
3253  overCount_(r.overCount_),
3254  modCount_(0UL),
3255  dim_(r.dim_)
3256  {
3257  std::swap(axes_[ax1], axes_[ax2]);
3258  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833

Member Function Documentation

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

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

Definition at line 1123 of file HistoND.h.

References i.

1125  {
1126  if (box.size() != dim_) throw npstat::NpstatInvalidArgument(
1127  "In npstat::HistoND::accumulateBinsInBox: "
1128  "incompatible box dimensionality");
1129  assert(accumulator);
1130  if (dim_)
1131  {
1132  for (unsigned i=0; i<dim_; ++i)
1133  indexBuf_[i] = 0U;
1134  accumulateBinsLoop(0U, box, &indexBuf_[0], accumulator, 1.0);
1135  }
1136  else
1137  *accumulator += 1.0*data_();
1138  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction) const
Definition: HistoND.h:1098
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
template<typename Numeric , class Axis >
template<typename Acc >
void npstat::HistoND< Numeric, Axis >::accumulateBinsLoop ( unsigned  level,
const BoxND< double > &  box,
unsigned *  idx,
Acc *  accumulator,
double  overlapFraction 
) const
private

Definition at line 1098 of file HistoND.h.

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

1101  {
1102  const Interval<double>& boxSide(box[level]);
1103  const Axis& axis(axes_[level]);
1104  const unsigned nbins = axis.nBins();
1105  const bool lastLevel = level == dim_ - 1U;
1106  for (unsigned i=0; i<nbins; ++i)
1107  {
1108  const double over = overlapFraction*
1109  axis.binInterval(i).overlapFraction(boxSide);
1110  if (over > 0.0)
1111  {
1112  idx[level] = i;
1113  if (lastLevel)
1114  *accumulator += over*data_.value(idx, dim_);
1115  else
1116  accumulateBinsLoop(level+1U, box, idx, accumulator, over);
1117  }
1118  }
1119  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
const Axis & axis(const unsigned i) const
Definition: HistoND.h:148
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
void accumulateBinsLoop(unsigned level, const BoxND< double > &box, unsigned *idx, Acc *accumulator, double overlapFraction) const
Definition: HistoND.h:1098
ArrayND< Numeric > data_
Definition: HistoND.h:832
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:834
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 135 of file HistoND.h.

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

136  {return accumulatedDataLabel_;}
std::string accumulatedDataLabel_
Definition: HistoND.h:831
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToBinContents ( const Num2 &  weight)

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

Definition at line 3314 of file HistoND.h.

References data, and i.

3315  {
3316  const unsigned long nDat = data_.length();
3317  Numeric* data = const_cast<Numeric*>(data_.data());
3318  for (unsigned long i=0; i<nDat; ++i)
3319  data[i] += weight;
3320  fillCount_ += nDat;
3321  ++modCount_;
3322  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:832
const Numeric * data() const
Definition: ArrayND.h:234
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int weight
Definition: histoStyle.py:50
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToBinContents ( const Num2 *  data,
unsigned long  dataLength 
)

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

Definition at line 3339 of file HistoND.h.

References i.

3341  {
3342  if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
3343  "In npstat::HistoND::addToBinContents: incompatible data length");
3344  assert(data);
3345  Numeric* dat = const_cast<Numeric*>(data_.data());
3346  for (unsigned long i=0; i<dataLength; ++i)
3347  dat[i] += data[i];
3348  fillCount_ += dataLength;
3349  ++modCount_;
3350  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:832
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 3326 of file HistoND.h.

References data, and i.

3327  {
3328  const unsigned long nOver = overflow_.length();
3329  Numeric* data = const_cast<Numeric*>(overflow_.data());
3330  for (unsigned long i=0; i<nOver; ++i)
3331  data[i] += weight;
3332  overCount_ += nOver;
3333  fillCount_ += nOver;
3334  ++modCount_;
3335  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
unsigned long length() const
Definition: ArrayND.h:231
const Numeric * data() const
Definition: ArrayND.h:234
unsigned long overCount_
Definition: HistoND.h:838
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
int weight
Definition: histoStyle.py:50
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::addToOverflows ( const Num2 *  data,
unsigned long  dataLength 
)

Definition at line 3354 of file HistoND.h.

References i.

3356  {
3357  if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
3358  "In npstat::HistoND::addToOverflows: incompatible data length");
3359  assert(data);
3360  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3361  for (unsigned long i=0; i<dataLength; ++i)
3362  dat[i] += data[i];
3363  overCount_ += dataLength;
3364  fillCount_ += dataLength;
3365  ++modCount_;
3366  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
unsigned long length() const
Definition: ArrayND.h:231
const Numeric * data() const
Definition: ArrayND.h:234
unsigned long overCount_
Definition: HistoND.h:838
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , typename Num3 >
void npstat::HistoND< Numeric, Axis >::addToProjection ( HistoND< Num2, Axis > *  projection,
AbsArrayProjector< Numeric, Num3 > &  projector,
const unsigned *  projectedIndices,
unsigned  nProjectedIndices 
) const
inline

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

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

Definition at line 3429 of file HistoND.h.

3434  {
3435  assert(projection);
3436  data_.addToProjection(&projection->data_, projector,
3437  projectedIndices, nProjectedIndices);
3438  projection->fillCount_ += projection->nBins();
3439  projection->modCount_++;
3440  }
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:1987
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 , typename Num3 >
void npstat::HistoND< Numeric, Axis >::addToProjection ( HistoND< Num2, Axis > *  projection,
AbsVisitor< Numeric, Num3 > &  projector,
const unsigned *  projectedIndices,
unsigned  nProjectedIndices 
) const
inline

Definition at line 3444 of file HistoND.h.

3449  {
3450  assert(projection);
3451  data_.addToProjection(&projection->data_, projector,
3452  projectedIndices, nProjectedIndices);
3453  projection->fillCount_ += projection->nBins();
3454  projection->modCount_++;
3455  }
void addToProjection(ArrayND< Num2, Len2, Dim2 > *projection, AbsArrayProjector< Numeric, Num3 > &projector, const unsigned *projectedIndices, unsigned nProjectedIndices) const
Definition: ArrayND.h:1987
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<class Point >
void npstat::HistoND< Numeric, Axis >::allBinCenters ( std::vector< Point > *  centers) const

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

Definition at line 1436 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

1438  {
1439  assert(centers);
1440  centers->clear();
1441  const unsigned long len = data_.length();
1442  centers->reserve(len);
1443  unsigned* ibuf = &indexBuf_[0];
1444  const Axis* ax = &axes_[0];
1445  Point center;
1446  if (center.size() < dim_) throw npstat::NpstatInvalidArgument(
1447  "In npstat::HistoND::allBinCenters: "
1448  "incompatible point dimensionality (too small)");
1449  typename Point::value_type* cdat = &center[0];
1450 
1451  for (unsigned long i=0; i<len; ++i)
1452  {
1453  data_.convertLinearIndex(i, ibuf, dim_);
1454  for (unsigned idim=0; idim<dim_; ++idim)
1455  cdat[idim] = ax[idim].binCenter(ibuf[idim]);
1456  centers->push_back(center);
1457  }
1458  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3052
unsigned dim_
Definition: HistoND.h:840
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1417
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:832
math::XYZPoint Point
Container::value_type value_type
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric, class Axis>
const std::vector<Axis>& npstat::HistoND< Numeric, Axis >::axes ( ) const
inline

Inspect histogram axes

Definition at line 145 of file HistoND.h.

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

Referenced by npstat::interpolateHistoND().

145 {return axes_;}
std::vector< Axis > axes_
Definition: HistoND.h:834
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 148 of file HistoND.h.

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

Referenced by npstat::interpolateHistoND().

149  {return axes_.at(i);}
int i
Definition: DBlmapReader.cc:9
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::binBox ( unsigned long  binNumber,
BoxND< double > *  box 
) const

Bounding box for the given bin

Definition at line 1461 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

1463  {
1464  assert(box);
1465  box->clear();
1466  if (dim_)
1467  {
1468  box->reserve(dim_);
1470  const Axis* ax = &axes_[0];
1471  for (unsigned i=0; i<dim_; ++i)
1472  box->push_back(ax[i].binInterval(indexBuf_[i]));
1473  }
1474  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3052
unsigned dim_
Definition: HistoND.h:840
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::binCenter ( unsigned long  binNumber,
double *  coords,
unsigned  lenCoords 
) const

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

Definition at line 1417 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

1420  {
1421  if (dim_ != lenCoords) throw npstat::NpstatInvalidArgument(
1422  "In npstat::HistoND::binCenter: "
1423  "incompatible input point dimensionality");
1424  if (dim_)
1425  {
1426  assert(coords);
1428  const Axis* ax = &axes_[0];
1429  for (unsigned i=0; i<dim_; ++i)
1430  coords[i] = ax[i].binCenter(indexBuf_[i]);
1431  }
1432  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3052
unsigned dim_
Definition: HistoND.h:840
void binCenter(unsigned long binNumber, double *coords, unsigned lenCoords) const
Definition: HistoND.h:1417
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
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 139 of file HistoND.h.

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

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

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

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

Definition at line 1504 of file HistoND.h.

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

1506  {
1507  double v = 1.0;
1508  if (dim_)
1509  {
1511  const Axis* ax = &axes_[0];
1512  for (unsigned i=0; i<dim_; ++i)
1513  v *= ax[i].binWidth(indexBuf_[i]);
1514  }
1515  return v;
1516  }
int i
Definition: DBlmapReader.cc:9
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3052
unsigned dim_
Definition: HistoND.h:840
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
BoxND< double > npstat::HistoND< Numeric, Axis >::boundingBox ( ) const

Bounding box for the whole histogram

Definition at line 1403 of file HistoND.h.

References create_public_lumi_plots::ax, and i.

1404  {
1405  BoxND<double> box;
1406  if (dim_)
1407  {
1408  box.reserve(dim_);
1409  const Axis* ax = &axes_[0];
1410  for (unsigned i=0; i<dim_; ++i)
1411  box.push_back(ax[i].interval());
1412  }
1413  return box;
1414  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric, class Axis>
gs::ClassId npstat::HistoND< Numeric, Axis >::classId ( ) const
inline

Method related to "geners" I/O

Definition at line 808 of file HistoND.h.

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

Definition at line 3458 of file HistoND.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Clear the histogram contents (both bins and overflows)

Definition at line 1157 of file HistoND.h.

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

1158  {
1159  clearBinContents();
1160  clearOverflows();
1161  ++modCount_;
1162  }
unsigned long modCount_
Definition: HistoND.h:839
void clearOverflows()
Definition: HistoND.h:1149
void clearBinContents()
Definition: HistoND.h:1141
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearBinContents ( )
inline

This method clears the bin contents but not overflows

Definition at line 1141 of file HistoND.h.

1142  {
1143  data_.clear();
1144  fillCount_ = 0UL;
1145  ++modCount_;
1146  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
ArrayND & clear()
Definition: ArrayND.h:4595
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
void npstat::HistoND< Numeric, Axis >::clearOverflows ( )
inline

This method clears overflows but not the bin contents

Definition at line 1149 of file HistoND.h.

1150  {
1151  overflow_.clear();
1152  overCount_ = 0UL;
1153  ++modCount_;
1154  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND & clear()
Definition: ArrayND.h:4595
unsigned long overCount_
Definition: HistoND.h:838
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( const double *  coords,
unsigned  coordLength 
) const

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

Definition at line 1623 of file HistoND.h.

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

1625  {
1626  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1627  "In npstat::HistoND::closestBin: "
1628  "incompatible input point dimensionality");
1629  if (coordLength)
1630  {
1631  assert(coords);
1632  unsigned* idx = &indexBuf_[0];
1633  const Axis* ax = &axes_[0];
1634  for (unsigned i=0; i<dim_; ++i)
1635  idx[i] = ax[i].closestValidBin(coords[i]);
1636  return data_.value(idx, dim_);
1637  }
1638  else
1639  return data_();
1640  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( ) const
inline

Convenience "closestBin" method for histograms of corresponding dimensionality

Definition at line 1740 of file HistoND.h.

References npstat::Private::h_badargs().

1741  {
1742  if (dim_) Private::h_badargs("closestBin");
1743  return data_();
1744  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0) const
inline

Definition at line 1808 of file HistoND.h.

References npstat::Private::h_badargs().

1809  {
1810  if (dim_ != 1U) Private::h_badargs("closestBin");
1811  const unsigned i0 = axes_[0].closestValidBin(x0);
1812  return data_(i0);
1813  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1 
) const

Definition at line 1889 of file HistoND.h.

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

1891  {
1892  if (dim_ != 2U) Private::h_badargs("closestBin");
1893  const Axis* ax = &axes_[0];
1894  const unsigned i0 = ax[0].closestValidBin(x0);
1895  const unsigned i1 = ax[1].closestValidBin(x1);
1896  return data_(i0, i1);
1897  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2 
) const

Definition at line 1978 of file HistoND.h.

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

1981  {
1982  if (dim_ != 3U) Private::h_badargs("closestBin");
1983  const Axis* ax = &axes_[0];
1984  const unsigned i0 = ax[0].closestValidBin(x0);
1985  const unsigned i1 = ax[1].closestValidBin(x1);
1986  const unsigned i2 = ax[2].closestValidBin(x2);
1987  return data_(i0, i1, i2);
1988  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2077 of file HistoND.h.

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

2081  {
2082  if (dim_ != 4U) Private::h_badargs("closestBin");
2083  const Axis* ax = &axes_[0];
2084  const unsigned i0 = ax[0].closestValidBin(x0);
2085  const unsigned i1 = ax[1].closestValidBin(x1);
2086  const unsigned i2 = ax[2].closestValidBin(x2);
2087  const unsigned i3 = ax[3].closestValidBin(x3);
2088  return data_(i0, i1, i2, i3);
2089  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4 
) const

Definition at line 2182 of file HistoND.h.

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

2187  {
2188  if (dim_ != 5U) Private::h_badargs("closestBin");
2189  const Axis* ax = &axes_[0];
2190  const unsigned i0 = ax[0].closestValidBin(x0);
2191  const unsigned i1 = ax[1].closestValidBin(x1);
2192  const unsigned i2 = ax[2].closestValidBin(x2);
2193  const unsigned i3 = ax[3].closestValidBin(x3);
2194  const unsigned i4 = ax[4].closestValidBin(x4);
2195  return data_(i0, i1, i2, i3, i4);
2196  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5 
) const

Definition at line 2302 of file HistoND.h.

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

2308  {
2309  if (dim_ != 6U) Private::h_badargs("closestBin");
2310  const Axis* ax = &axes_[0];
2311  const unsigned i0 = ax[0].closestValidBin(x0);
2312  const unsigned i1 = ax[1].closestValidBin(x1);
2313  const unsigned i2 = ax[2].closestValidBin(x2);
2314  const unsigned i3 = ax[3].closestValidBin(x3);
2315  const unsigned i4 = ax[4].closestValidBin(x4);
2316  const unsigned i5 = ax[5].closestValidBin(x5);
2317  return data_(i0, i1, i2, i3, i4, i5);
2318  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6 
) const

Definition at line 2427 of file HistoND.h.

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

2434  {
2435  if (dim_ != 7U) Private::h_badargs("closestBin");
2436  const Axis* ax = &axes_[0];
2437  const unsigned i0 = ax[0].closestValidBin(x0);
2438  const unsigned i1 = ax[1].closestValidBin(x1);
2439  const unsigned i2 = ax[2].closestValidBin(x2);
2440  const unsigned i3 = ax[3].closestValidBin(x3);
2441  const unsigned i4 = ax[4].closestValidBin(x4);
2442  const unsigned i5 = ax[5].closestValidBin(x5);
2443  const unsigned i6 = ax[6].closestValidBin(x6);
2444  return data_(i0, i1, i2, i3, i4, i5, i6);
2445  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7 
) const

Definition at line 2562 of file HistoND.h.

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

2570  {
2571  if (dim_ != 8U) Private::h_badargs("closestBin");
2572  const Axis* ax = &axes_[0];
2573  const unsigned i0 = ax[0].closestValidBin(x0);
2574  const unsigned i1 = ax[1].closestValidBin(x1);
2575  const unsigned i2 = ax[2].closestValidBin(x2);
2576  const unsigned i3 = ax[3].closestValidBin(x3);
2577  const unsigned i4 = ax[4].closestValidBin(x4);
2578  const unsigned i5 = ax[5].closestValidBin(x5);
2579  const unsigned i6 = ax[6].closestValidBin(x6);
2580  const unsigned i7 = ax[7].closestValidBin(x7);
2581  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2582  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8 
) const

Definition at line 2703 of file HistoND.h.

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

2712  {
2713  if (dim_ != 9U) Private::h_badargs("closestBin");
2714  const Axis* ax = &axes_[0];
2715  const unsigned i0 = ax[0].closestValidBin(x0);
2716  const unsigned i1 = ax[1].closestValidBin(x1);
2717  const unsigned i2 = ax[2].closestValidBin(x2);
2718  const unsigned i3 = ax[3].closestValidBin(x3);
2719  const unsigned i4 = ax[4].closestValidBin(x4);
2720  const unsigned i5 = ax[5].closestValidBin(x5);
2721  const unsigned i6 = ax[6].closestValidBin(x6);
2722  const unsigned i7 = ax[7].closestValidBin(x7);
2723  const unsigned i8 = ax[8].closestValidBin(x8);
2724  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2725  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::closestBin ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9 
) const

Definition at line 2854 of file HistoND.h.

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

2864  {
2865  if (dim_ != 10U) Private::h_badargs("closestBin");
2866  const Axis* ax = &axes_[0];
2867  const unsigned i0 = ax[0].closestValidBin(x0);
2868  const unsigned i1 = ax[1].closestValidBin(x1);
2869  const unsigned i2 = ax[2].closestValidBin(x2);
2870  const unsigned i3 = ax[3].closestValidBin(x3);
2871  const unsigned i4 = ax[4].closestValidBin(x4);
2872  const unsigned i5 = ax[5].closestValidBin(x5);
2873  const unsigned i6 = ax[6].closestValidBin(x6);
2874  const unsigned i7 = ax[7].closestValidBin(x7);
2875  const unsigned i8 = ax[8].closestValidBin(x8);
2876  const unsigned i9 = ax[9].closestValidBin(x9);
2877  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2878  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric, class Axis>
unsigned npstat::HistoND< Numeric, Axis >::dim ( ) const
inline

Histogram dimensionality

Definition at line 129 of file HistoND.h.

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

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

129 {return dim_;}
unsigned dim_
Definition: HistoND.h:840
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( const double *  coords,
unsigned  coordLength,
Num2 &  weight,
Functor &  f 
)

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

Definition at line 1566 of file HistoND.h.

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

1568  {
1569  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1570  "In npstat::HistoND::dispatch: "
1571  "incompatible input point dimensionality");
1572  if (coordLength)
1573  {
1574  assert(coords);
1575  unsigned* idx = &indexBuf_[0];
1576  unsigned* over = idx + dim_;
1577  const Axis* ax = &axes_[0];
1578  unsigned overflown = 0U;
1579  for (unsigned i=0; i<dim_; ++i)
1580  {
1581  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1582  overflown |= (over[i] - 1U);
1583  }
1584  if (overflown)
1585  f(overflow_.value(over, dim_), w);
1586  else
1587  f(data_.value(idx, dim_), w);
1588  }
1589  else
1590  f(data_(), w);
1591  ++modCount_;
1592  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( Num2 &  weight,
Functor &  f 
)
inline

Convenience "dispatch" method for histograms of corresponding dimensionality

Definition at line 1716 of file HistoND.h.

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

1717  {
1718  if (dim_) Private::h_badargs("dispatch");
1719  f(data_(), w);
1720  ++modCount_;
1721  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
T w() const
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
Num2 &  weight,
Functor &  f 
)

Definition at line 1765 of file HistoND.h.

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

1766  {
1767  if (dim_ != 1U) Private::h_badargs("dispatch");
1768  unsigned i0;
1769  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1770  if (ov0 == 1U)
1771  f(data_(i0), w);
1772  else
1773  f(overflow_(ov0), w);
1774  ++modCount_;
1775  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
Num2 &  weight,
Functor &  f 
)

Definition at line 1837 of file HistoND.h.

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

1839  {
1840  if (dim_ != 2U) Private::h_badargs("dispatch");
1841  unsigned i0, i1;
1842  const Axis* ax = &axes_[0];
1843  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1844  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1845  if (o0 == 1U && o1 == 1U)
1846  f(data_(i0, i1), w);
1847  else
1848  f(overflow_(o0, o1), w);
1849  ++modCount_;
1850  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
Num2 &  weight,
Functor &  f 
)

Definition at line 1922 of file HistoND.h.

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

1924  {
1925  if (dim_ != 3U) Private::h_badargs("dispatch");
1926  unsigned i0, i1, i2;
1927  const Axis* ax = &axes_[0];
1928  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1929  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1930  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
1931  if (o0 == 1U && o1 == 1U && o2 == 1U)
1932  f(data_(i0, i1, i2), w);
1933  else
1934  f(overflow_(o0, o1, o2), w);
1935  ++modCount_;
1936  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
Num2 &  weight,
Functor &  f 
)

Definition at line 2015 of file HistoND.h.

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

2018  {
2019  if (dim_ != 4U) Private::h_badargs("dispatch");
2020  unsigned i0, i1, i2, i3;
2021  const Axis* ax = &axes_[0];
2022  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2023  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2024  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2025  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2026  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2027  f(data_(i0, i1, i2, i3), w);
2028  else
2029  f(overflow_(o0, o1, o2, o3), w);
2030  ++modCount_;
2031  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
Num2 &  weight,
Functor &  f 
)

Definition at line 2117 of file HistoND.h.

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

2120  {
2121  if (dim_ != 5U) Private::h_badargs("dispatch");
2122  unsigned i0, i1, i2, i3, i4;
2123  const Axis* ax = &axes_[0];
2124  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2125  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2126  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2127  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2128  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2129  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2130  f(data_(i0, i1, i2, i3, i4), w);
2131  else
2132  f(overflow_(o0, o1, o2, o3, o4), w);
2133  ++modCount_;
2134  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
Num2 &  weight,
Functor &  f 
)

Definition at line 2227 of file HistoND.h.

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

2231  {
2232  if (dim_ != 6U) Private::h_badargs("dispatch");
2233  unsigned i0, i1, i2, i3, i4, i5;
2234  const Axis* ax = &axes_[0];
2235  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2236  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2237  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2238  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2239  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2240  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2241  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2242  o3 == 1U && o4 == 1U && o5 == 1U)
2243  f(data_(i0, i1, i2, i3, i4, i5), w);
2244  else
2245  f(overflow_(o0, o1, o2, o3, o4, o5), w);
2246  ++modCount_;
2247  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
Num2 &  weight,
Functor &  f 
)

Definition at line 2350 of file HistoND.h.

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

2354  {
2355  if (dim_ != 7U) Private::h_badargs("dispatch");
2356  unsigned i0, i1, i2, i3, i4, i5, i6;
2357  const Axis* ax = &axes_[0];
2358  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2359  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2360  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2361  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2362  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2363  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2364  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2365  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2366  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2367  f(data_(i0, i1, i2, i3, i4, i5, i6), w);
2368  else
2369  f(overflow_(o0, o1, o2, o3, o4, o5, o6), w);
2370  ++modCount_;
2371  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
Num2 &  weight,
Functor &  f 
)

Definition at line 2479 of file HistoND.h.

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

2484  {
2485  if (dim_ != 8U) Private::h_badargs("dispatch");
2486  unsigned i0, i1, i2, i3, i4, i5, i6, i7;
2487  const Axis* ax = &axes_[0];
2488  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2489  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2490  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2491  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2492  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2493  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2494  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2495  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2496  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2497  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2498  f(data_(i0, i1, i2, i3, i4, i5, i6, i7), w);
2499  else
2500  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7), w);
2501  ++modCount_;
2502  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
Num2 &  weight,
Functor &  f 
)

Definition at line 2617 of file HistoND.h.

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

2622  {
2623  if (dim_ != 9U) Private::h_badargs("dispatch");
2624  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
2625  const Axis* ax = &axes_[0];
2626  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2627  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2628  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2629  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2630  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2631  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2632  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2633  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2634  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2635  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2636  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2637  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8), w);
2638  else
2639  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8), w);
2640  ++modCount_;
2641  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 , class Functor >
void npstat::HistoND< Numeric, Axis >::dispatch ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
Num2 &  weight,
Functor &  f 
)

Definition at line 2762 of file HistoND.h.

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

2768  {
2769  if (dim_ != 10U) Private::h_badargs("dispatch");
2770  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
2771  const Axis* ax = &axes_[0];
2772  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2773  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2774  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2775  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2776  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2777  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2778  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2779  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2780  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2781  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2782  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2783  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2784  f(data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9), w);
2785  else
2786  f(overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9), w);
2787  ++modCount_;
2788  }
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
double f[11][100]
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( const double *  coords,
unsigned  coordLength 
) const

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

Definition at line 1595 of file HistoND.h.

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

1597  {
1598  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1599  "In npstat::HistoND::examine: "
1600  "incompatible input point dimensionality");
1601  if (coordLength)
1602  {
1603  assert(coords);
1604  unsigned* idx = &indexBuf_[0];
1605  unsigned* over = idx + dim_;
1606  const Axis* ax = &axes_[0];
1607  unsigned overflown = 0U;
1608  for (unsigned i=0; i<dim_; ++i)
1609  {
1610  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1611  overflown |= (over[i] - 1U);
1612  }
1613  if (overflown)
1614  return overflow_.value(over, dim_);
1615  else
1616  return data_.value(idx, dim_);
1617  }
1618  else
1619  return data_();
1620  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( ) const
inline

Convenience "examine" method for histograms of corresponding dimensionality

Definition at line 1733 of file HistoND.h.

References npstat::Private::h_badargs().

1734  {
1735  if (dim_) Private::h_badargs("examine");
1736  return data_();
1737  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0) const
inline

Definition at line 1796 of file HistoND.h.

References npstat::Private::h_badargs().

1797  {
1798  if (dim_ != 1U) Private::h_badargs("examine");
1799  unsigned i0;
1800  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1801  if (ov0 == 1U)
1802  return data_(i0);
1803  else
1804  return overflow_(ov0);
1805  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1 
) const

Definition at line 1874 of file HistoND.h.

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

1876  {
1877  if (dim_ != 2U) Private::h_badargs("examine");
1878  unsigned i0, i1;
1879  const Axis* ax = &axes_[0];
1880  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1881  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1882  if (o0 == 1U && o1 == 1U)
1883  return data_(i0, i1);
1884  else
1885  return overflow_(o0, o1);
1886  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2 
) const

Definition at line 1961 of file HistoND.h.

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

1964  {
1965  if (dim_ != 3U) Private::h_badargs("examine");
1966  unsigned i0, i1, i2;
1967  const Axis* ax = &axes_[0];
1968  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1969  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1970  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
1971  if (o0 == 1U && o1 == 1U && o2 == 1U)
1972  return data_(i0, i1, i2);
1973  else
1974  return overflow_(o0, o1, o2);
1975  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3 
) const

Definition at line 2058 of file HistoND.h.

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

2062  {
2063  if (dim_ != 4U) Private::h_badargs("examine");
2064  unsigned i0, i1, i2, i3;
2065  const Axis* ax = &axes_[0];
2066  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2067  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2068  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2069  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2070  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2071  return data_(i0, i1, i2, i3);
2072  else
2073  return overflow_(o0, o1, o2, o3);
2074  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4 
) const

Definition at line 2162 of file HistoND.h.

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

2166  {
2167  if (dim_ != 5U) Private::h_badargs("examine");
2168  unsigned i0, i1, i2, i3, i4;
2169  const Axis* ax = &axes_[0];
2170  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2171  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2172  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2173  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2174  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2175  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2176  return data_(i0, i1, i2, i3, i4);
2177  else
2178  return overflow_(o0, o1, o2, o3, o4);
2179  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5 
) const

Definition at line 2278 of file HistoND.h.

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

2284  {
2285  if (dim_ != 6U) Private::h_badargs("examine");
2286  unsigned i0, i1, i2, i3, i4, i5;
2287  const Axis* ax = &axes_[0];
2288  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2289  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2290  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2291  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2292  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2293  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2294  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2295  o3 == 1U && o4 == 1U && o5 == 1U)
2296  return data_(i0, i1, i2, i3, i4, i5);
2297  else
2298  return overflow_(o0, o1, o2, o3, o4, o5);
2299  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6 
) const

Definition at line 2403 of file HistoND.h.

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

2408  {
2409  if (dim_ != 7U) Private::h_badargs("examine");
2410  unsigned i0, i1, i2, i3, i4, i5, i6;
2411  const Axis* ax = &axes_[0];
2412  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2413  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2414  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2415  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2416  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2417  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2418  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2419  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2420  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2421  return data_(i0, i1, i2, i3, i4, i5, i6);
2422  else
2423  return overflow_(o0, o1, o2, o3, o4, o5, o6);
2424  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7 
) const

Definition at line 2536 of file HistoND.h.

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

2542  {
2543  if (dim_ != 8U) Private::h_badargs("examine");
2544  unsigned i0, i1, i2, i3, i4, i5, i6, i7;
2545  const Axis* ax = &axes_[0];
2546  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2547  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2548  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2549  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2550  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2551  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2552  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2553  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2554  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2555  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2556  return data_(i0, i1, i2, i3, i4, i5, i6, i7);
2557  else
2558  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7);
2559  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8 
) const

Definition at line 2676 of file HistoND.h.

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

2682  {
2683  if (dim_ != 9U) Private::h_badargs("examine");
2684  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
2685  const Axis* ax = &axes_[0];
2686  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2687  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2688  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2689  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2690  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2691  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2692  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2693  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2694  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2695  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2696  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2697  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8);
2698  else
2699  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8);
2700  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
const Numeric & npstat::HistoND< Numeric, Axis >::examine ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9 
) const

Definition at line 2825 of file HistoND.h.

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

2832  {
2833  if (dim_ != 10U) Private::h_badargs("examine");
2834  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
2835  const Axis* ax = &axes_[0];
2836  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2837  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2838  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2839  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2840  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2841  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2842  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2843  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2844  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2845  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2846  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2847  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2848  return data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);
2849  else
2850  return overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9);
2851  }
unsigned dim_
Definition: HistoND.h:840
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( const double *  coords,
unsigned  coordLength,
const Num2 &  weight 
)

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

Definition at line 1533 of file HistoND.h.

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

1535  {
1536  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1537  "In npstat::HistoND::fill: "
1538  "incompatible input point dimensionality");
1539  if (coordLength)
1540  {
1541  assert(coords);
1542  unsigned* idx = &indexBuf_[0];
1543  unsigned* over = idx + dim_;
1544  const Axis* ax = &axes_[0];
1545  unsigned overflown = 0U;
1546  for (unsigned i=0; i<dim_; ++i)
1547  {
1548  over[i] = ax[i].overflowIndex(coords[i], idx + i);
1549  overflown |= (over[i] - 1U);
1550  }
1551  if (overflown)
1552  {
1553  overflow_.value(over, dim_) += w;
1554  ++overCount_;
1555  }
1556  else
1557  data_.value(idx, dim_) += w;
1558  }
1559  else
1560  data_() += w;
1561  ++fillCount_; ++modCount_;
1562  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( const Num2 &  weight)
inline

Convenience "fill" method for histograms of corresponding dimensionality

Definition at line 1707 of file HistoND.h.

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

1708  {
1709  if (dim_) Private::h_badargs("fill");
1710  data_() += w;
1711  ++fillCount_; ++modCount_;
1712  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
T w() const
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
const Num2 &  weight 
)

Definition at line 1748 of file HistoND.h.

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

1749  {
1750  if (dim_ != 1U) Private::h_badargs("fill");
1751  unsigned i0;
1752  const unsigned ov0 = axes_[0].overflowIndex(x0, &i0);
1753  if (ov0 == 1U)
1754  data_(i0) += w;
1755  else
1756  {
1757  overflow_(ov0) += w;
1758  ++overCount_;
1759  }
1760  ++fillCount_; ++modCount_;
1761  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1817 of file HistoND.h.

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

1819  {
1820  if (dim_ != 2U) Private::h_badargs("fill");
1821  unsigned i0, i1;
1822  const Axis* ax = &axes_[0];
1823  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1824  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1825  if (o0 == 1U && o1 == 1U)
1826  data_(i0, i1) += w;
1827  else
1828  {
1829  overflow_(o0, o1) += w;
1830  ++overCount_;
1831  }
1832  ++fillCount_; ++modCount_;
1833  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
const Num2 &  weight 
)

Definition at line 1901 of file HistoND.h.

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

1903  {
1904  if (dim_ != 3U) Private::h_badargs("fill");
1905  unsigned i0, i1, i2;
1906  const Axis* ax = &axes_[0];
1907  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
1908  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
1909  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
1910  if (o0 == 1U && o1 == 1U && o2 == 1U)
1911  data_(i0, i1, i2) += w;
1912  else
1913  {
1914  overflow_(o0, o1, o2) += w;
1915  ++overCount_;
1916  }
1917  ++fillCount_; ++modCount_;
1918  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
const Num2 &  weight 
)

Definition at line 1992 of file HistoND.h.

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

1995  {
1996  if (dim_ != 4U) Private::h_badargs("fill");
1997  unsigned i0, i1, i2, i3;
1998  const Axis* ax = &axes_[0];
1999  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2000  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2001  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2002  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2003  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2004  data_(i0, i1, i2, i3) += w;
2005  else
2006  {
2007  overflow_(o0, o1, o2, o3) += w;
2008  ++overCount_;
2009  }
2010  ++fillCount_; ++modCount_;
2011  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
const Num2 &  weight 
)

Definition at line 2093 of file HistoND.h.

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

2096  {
2097  if (dim_ != 5U) Private::h_badargs("fill");
2098  unsigned i0, i1, i2, i3, i4;
2099  const Axis* ax = &axes_[0];
2100  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2101  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2102  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2103  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2104  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2105  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2106  data_(i0, i1, i2, i3, i4) += w;
2107  else
2108  {
2109  overflow_(o0, o1, o2, o3, o4) += w;
2110  ++overCount_;
2111  }
2112  ++fillCount_; ++modCount_;
2113  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
const Num2 &  weight 
)

Definition at line 2200 of file HistoND.h.

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

2204  {
2205  if (dim_ != 6U) Private::h_badargs("fill");
2206  unsigned i0, i1, i2, i3, i4, i5;
2207  const Axis* ax = &axes_[0];
2208  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2209  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2210  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2211  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2212  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2213  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2214  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2215  o3 == 1U && o4 == 1U && o5 == 1U)
2216  data_(i0, i1, i2, i3, i4, i5) += w;
2217  else
2218  {
2219  overflow_(o0, o1, o2, o3, o4, o5) += w;
2220  ++overCount_;
2221  }
2222  ++fillCount_; ++modCount_;
2223  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
const Num2 &  weight 
)

Definition at line 2322 of file HistoND.h.

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

2326  {
2327  if (dim_ != 7U) Private::h_badargs("fill");
2328  unsigned i0, i1, i2, i3, i4, i5, i6;
2329  const Axis* ax = &axes_[0];
2330  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2331  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2332  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2333  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2334  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2335  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2336  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2337  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2338  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2339  data_(i0, i1, i2, i3, i4, i5, i6) += w;
2340  else
2341  {
2342  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2343  ++overCount_;
2344  }
2345  ++fillCount_; ++modCount_;
2346  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
const Num2 &  weight 
)

Definition at line 2449 of file HistoND.h.

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

2454  {
2455  if (dim_ != 8U) Private::h_badargs("fill");
2456  unsigned i0, i1, i2, i3, i4, i5, i6, i7;
2457  const Axis* ax = &axes_[0];
2458  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2459  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2460  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2461  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2462  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2463  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2464  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2465  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2466  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2467  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2468  data_(i0, i1, i2, i3, i4, i5, i6, i7) += w;
2469  else
2470  {
2471  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2472  ++overCount_;
2473  }
2474  ++fillCount_; ++modCount_;
2475  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
const Num2 &  weight 
)

Definition at line 2586 of file HistoND.h.

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

2591  {
2592  if (dim_ != 9U) Private::h_badargs("fill");
2593  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8;
2594  const Axis* ax = &axes_[0];
2595  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2596  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2597  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2598  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2599  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2600  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2601  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2602  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2603  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2604  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2605  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2606  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) += w;
2607  else
2608  {
2609  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2610  ++overCount_;
2611  }
2612  ++fillCount_; ++modCount_;
2613  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fill ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
const Num2 &  weight 
)

Definition at line 2729 of file HistoND.h.

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

2735  {
2736  if (dim_ != 10U) Private::h_badargs("fill");
2737  unsigned i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
2738  const Axis* ax = &axes_[0];
2739  const unsigned o0 = ax[0].overflowIndex(x0, &i0);
2740  const unsigned o1 = ax[1].overflowIndex(x1, &i1);
2741  const unsigned o2 = ax[2].overflowIndex(x2, &i2);
2742  const unsigned o3 = ax[3].overflowIndex(x3, &i3);
2743  const unsigned o4 = ax[4].overflowIndex(x4, &i4);
2744  const unsigned o5 = ax[5].overflowIndex(x5, &i5);
2745  const unsigned o6 = ax[6].overflowIndex(x6, &i6);
2746  const unsigned o7 = ax[7].overflowIndex(x7, &i7);
2747  const unsigned o8 = ax[8].overflowIndex(x8, &i8);
2748  const unsigned o9 = ax[9].overflowIndex(x9, &i9);
2749  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2750  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2751  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) += w;
2752  else
2753  {
2754  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2755  ++overCount_;
2756  }
2757  ++fillCount_; ++modCount_;
2758  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( const double *  coords,
unsigned  coordLength,
const Num2 &  weight 
)

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

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

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

Definition at line 1673 of file HistoND.h.

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

1675  {
1676  if (coordLength != dim_) throw npstat::NpstatInvalidArgument(
1677  "In npstat::HistoND::fillC: "
1678  "incompatible input point dimensionality");
1679  if (coordLength)
1680  {
1681  assert(coords);
1682  double* wg = &weightBuf_[0];
1683  unsigned* idx = &indexBuf_[0];
1684  unsigned* over = idx + dim_;
1685  const Axis* ax = &axes_[0];
1686  unsigned overflown = 0U;
1687  for (unsigned i=0; i<dim_; ++i)
1688  {
1689  over[i] = ax[i].overflowIndexWeighted(coords[i], idx+i, wg+i);
1690  overflown |= (over[i] - 1U);
1691  }
1692  if (overflown)
1693  {
1694  overflow_.value(over, dim_) += w;
1695  ++overCount_;
1696  }
1697  else
1699  }
1700  else
1701  data_() += w;
1702  ++fillCount_; ++modCount_;
1703  }
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( const Num2 &  weight)
inline

Convenience "fillC" method for histograms of corresponding dimensionality

Definition at line 1725 of file HistoND.h.

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

1726  {
1727  if (dim_) Private::h_badargs("fillC");
1728  data_() += w;
1729  ++fillCount_; ++modCount_;
1730  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
ArrayND< Numeric > data_
Definition: HistoND.h:832
T w() const
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
const Num2 &  weight 
)

Definition at line 1779 of file HistoND.h.

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

1780  {
1781  if (dim_ != 1U) Private::h_badargs("fillC");
1782  double* wg = &weightBuf_[0];
1783  unsigned* idx = &indexBuf_[0];
1784  const unsigned ov0 = axes_[0].overflowIndexWeighted(x0, idx, wg);
1785  if (ov0 == 1U)
1787  else
1788  {
1789  overflow_(ov0) += w;
1790  ++overCount_;
1791  }
1792  ++fillCount_; ++modCount_;
1793  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
const Num2 &  weight 
)

Definition at line 1854 of file HistoND.h.

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

1856  {
1857  if (dim_ != 2U) Private::h_badargs("fillC");
1858  double* wg = &weightBuf_[0];
1859  unsigned* idx = &indexBuf_[0];
1860  const Axis* ax = &axes_[0];
1861  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
1862  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
1863  if (o0 == 1U && o1 == 1U)
1865  else
1866  {
1867  overflow_(o0, o1) += w;
1868  ++overCount_;
1869  }
1870  ++fillCount_; ++modCount_;
1871  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
const Num2 &  weight 
)

Definition at line 1940 of file HistoND.h.

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

1942  {
1943  if (dim_ != 3U) Private::h_badargs("fillC");
1944  double* wg = &weightBuf_[0];
1945  unsigned* idx = &indexBuf_[0];
1946  const Axis* ax = &axes_[0];
1947  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
1948  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
1949  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
1950  if (o0 == 1U && o1 == 1U && o2 == 1U)
1952  else
1953  {
1954  overflow_(o0, o1, o2) += w;
1955  ++overCount_;
1956  }
1957  ++fillCount_; ++modCount_;
1958  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
const Num2 &  weight 
)

Definition at line 2035 of file HistoND.h.

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

2038  {
2039  if (dim_ != 4U) Private::h_badargs("fillC");
2040  double* wg = &weightBuf_[0];
2041  unsigned* idx = &indexBuf_[0];
2042  const Axis* ax = &axes_[0];
2043  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2044  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2045  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2046  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2047  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U)
2049  else
2050  {
2051  overflow_(o0, o1, o2, o3) += w;
2052  ++overCount_;
2053  }
2054  ++fillCount_; ++modCount_;
2055  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
const Num2 &  weight 
)

Definition at line 2138 of file HistoND.h.

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

2141  {
2142  if (dim_ != 5U) Private::h_badargs("fillC");
2143  double* wg = &weightBuf_[0];
2144  unsigned* idx = &indexBuf_[0];
2145  const Axis* ax = &axes_[0];
2146  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2147  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2148  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2149  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2150  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2151  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U)
2153  else
2154  {
2155  overflow_(o0, o1, o2, o3, o4) += w;
2156  ++overCount_;
2157  }
2158  ++fillCount_; ++modCount_;
2159  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
const Num2 &  weight 
)

Definition at line 2251 of file HistoND.h.

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

2255  {
2256  if (dim_ != 6U) Private::h_badargs("fillC");
2257  double* wg = &weightBuf_[0];
2258  unsigned* idx = &indexBuf_[0];
2259  const Axis* ax = &axes_[0];
2260  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2261  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2262  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2263  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2264  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2265  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2266  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2267  o3 == 1U && o4 == 1U && o5 == 1U)
2269  else
2270  {
2271  overflow_(o0, o1, o2, o3, o4, o5) += w;
2272  ++overCount_;
2273  }
2274  ++fillCount_; ++modCount_;
2275  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
const Num2 &  weight 
)

Definition at line 2375 of file HistoND.h.

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

2379  {
2380  if (dim_ != 7U) Private::h_badargs("fillC");
2381  double* wg = &weightBuf_[0];
2382  unsigned* idx = &indexBuf_[0];
2383  const Axis* ax = &axes_[0];
2384  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2385  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2386  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2387  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2388  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2389  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2390  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2391  if (o0 == 1U && o1 == 1U && o2 == 1U &&
2392  o3 == 1U && o4 == 1U && o5 == 1U && o6 == 1U)
2394  else
2395  {
2396  overflow_(o0, o1, o2, o3, o4, o5, o6) += w;
2397  ++overCount_;
2398  }
2399  ++fillCount_; ++modCount_;
2400  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
const Num2 &  weight 
)

Definition at line 2506 of file HistoND.h.

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

2511  {
2512  if (dim_ != 8U) Private::h_badargs("fillC");
2513  double* wg = &weightBuf_[0];
2514  unsigned* idx = &indexBuf_[0];
2515  const Axis* ax = &axes_[0];
2516  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2517  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2518  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2519  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2520  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2521  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2522  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2523  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2524  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U &&
2525  o4 == 1U && o5 == 1U && o6 == 1U && o7 == 1U)
2527  else
2528  {
2529  overflow_(o0, o1, o2, o3, o4, o5, o6, o7) += w;
2530  ++overCount_;
2531  }
2532  ++fillCount_; ++modCount_;
2533  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
const Num2 &  weight 
)

Definition at line 2645 of file HistoND.h.

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

2650  {
2651  if (dim_ != 9U) Private::h_badargs("fillC");
2652  double* wg = &weightBuf_[0];
2653  unsigned* idx = &indexBuf_[0];
2654  const Axis* ax = &axes_[0];
2655  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2656  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2657  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2658  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2659  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2660  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2661  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2662  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2663  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
2664  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2665  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U)
2667  else
2668  {
2669  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8) += w;
2670  ++overCount_;
2671  }
2672  ++fillCount_; ++modCount_;
2673  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillC ( double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
const Num2 &  weight 
)

Definition at line 2792 of file HistoND.h.

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

2798  {
2799  if (dim_ != 10U) Private::h_badargs("fillC");
2800  double* wg = &weightBuf_[0];
2801  unsigned* idx = &indexBuf_[0];
2802  const Axis* ax = &axes_[0];
2803  const unsigned o0 = ax[0].overflowIndexWeighted(x0, idx+0, wg+0);
2804  const unsigned o1 = ax[1].overflowIndexWeighted(x1, idx+1, wg+1);
2805  const unsigned o2 = ax[2].overflowIndexWeighted(x2, idx+2, wg+2);
2806  const unsigned o3 = ax[3].overflowIndexWeighted(x3, idx+3, wg+3);
2807  const unsigned o4 = ax[4].overflowIndexWeighted(x4, idx+4, wg+4);
2808  const unsigned o5 = ax[5].overflowIndexWeighted(x5, idx+5, wg+5);
2809  const unsigned o6 = ax[6].overflowIndexWeighted(x6, idx+6, wg+6);
2810  const unsigned o7 = ax[7].overflowIndexWeighted(x7, idx+7, wg+7);
2811  const unsigned o8 = ax[8].overflowIndexWeighted(x8, idx+8, wg+8);
2812  const unsigned o9 = ax[9].overflowIndexWeighted(x9, idx+9, wg+9);
2813  if (o0 == 1U && o1 == 1U && o2 == 1U && o3 == 1U && o4 == 1U &&
2814  o5 == 1U && o6 == 1U && o7 == 1U && o8 == 1U && o9 == 1U)
2816  else
2817  {
2818  overflow_(o0, o1, o2, o3, o4, o5, o6, o7, o8, o9) += w;
2819  ++overCount_;
2820  }
2821  ++fillCount_; ++modCount_;
2822  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
void h_badargs(const char *method)
Definition: HistoND.h:1087
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fillPreservingCentroid(const Num2 &weight)
Definition: HistoND.h:1644
std::vector< Axis > axes_
Definition: HistoND.h:834
T w() const
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::fillPreservingCentroid ( const Num2 &  weight)
private

Definition at line 1644 of file HistoND.h.

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

1645  {
1646  const double* weights = &weightBuf_[0];
1647  const unsigned* cell = &indexBuf_[0];
1648  const unsigned long* strides = data_.strides();
1649  const unsigned long maxcycle = 1UL << dim_;
1650  for (unsigned long icycle=0; icycle<maxcycle; ++icycle)
1651  {
1652  double w = 1.0;
1653  unsigned long icell = 0UL;
1654  for (unsigned i=0; i<dim_; ++i)
1655  {
1656  if (icycle & (1UL << i))
1657  {
1658  w *= (1.0 - weights[i]);
1659  icell += strides[i]*(cell[i] + 1U);
1660  }
1661  else
1662  {
1663  w *= weights[i];
1664  icell += strides[i]*cell[i];
1665  }
1666  }
1667  data_.linearValue(icell) += (value * w);
1668  }
1669  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
Numeric & linearValue(unsigned long index)
Definition: ArrayND.h:3139
ArrayND< Numeric > data_
Definition: HistoND.h:832
std::vector< double > weightBuf_
Definition: HistoND.h:835
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
const unsigned long * strides() const
Definition: ArrayND.h:261
T w() const
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 797 of file HistoND.h.

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

797 {return modCount_;}
unsigned long modCount_
Definition: HistoND.h:839
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 804 of file HistoND.h.

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

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

Integral of the histogram

Definition at line 1380 of file HistoND.h.

References data, and i.

1381  {
1382  typedef typename PreciseType<Numeric>::type Precise;
1383 
1384  if (dim_ == 0U)
1385  return 0.0;
1386  if (isUniformlyBinned())
1387  {
1388  Precise sum = data_.template sum<Precise>();
1389  return static_cast<double>(sum)*binVolume();
1390  }
1391  else
1392  {
1393  Precise sum = Precise();
1394  const Numeric* data = data_.data();
1395  const unsigned long len = data_.length();
1396  for (unsigned long i=0; i<len; ++i)
1397  sum += data[i]*binVolume(i);
1398  return static_cast<double>(sum);
1399  }
1400  }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
unsigned long length() const
Definition: ArrayND.h:231
double binVolume(unsigned long binNumber=0) const
Definition: HistoND.h:1504
ArrayND< Numeric > data_
Definition: HistoND.h:832
const Numeric * data() const
Definition: ArrayND.h:234
bool isUniformlyBinned() const
Definition: HistoND.h:1371
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 1477 of file HistoND.h.

1478  {
1479  return dim_ == r.dim_ &&
1480  overflow_ == r.overflow_ &&
1481  data_ == r.data_;
1482  }
unsigned dim_
Definition: HistoND.h:840
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::isUniformlyBinned ( ) const

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

Definition at line 1371 of file HistoND.h.

References i.

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

1372  {
1373  for (unsigned i=0; i<dim_; ++i)
1374  if (!axes_[i].isUniform())
1375  return false;
1376  return true;
1377  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric, class Axis>
unsigned long npstat::HistoND< Numeric, Axis >::nBins ( ) const
inline

Total number of bins

Definition at line 152 of file HistoND.h.

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

152 {return data_.length();}
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:832
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 158 of file HistoND.h.

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

159  {return fillCount_ - overCount_;}
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long overCount_
Definition: HistoND.h:838
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 162 of file HistoND.h.

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

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

Total number of fills performed

Definition at line 155 of file HistoND.h.

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

155 {return fillCount_;}
unsigned long fillCount_
Definition: HistoND.h:837
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator!= ( const HistoND< Numeric, Axis > &  r) const
inline

Logical negation of operator==

Definition at line 1498 of file HistoND.h.

References alignCSCRings::r.

1499  {
1500  return !(*this == r);
1501  }
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 3222 of file HistoND.h.

References alignCSCRings::r.

3223  {
3224  data_ *= r;
3225  overflow_ *= r;
3226  ++modCount_;
3227  return *this;
3228  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 3188 of file HistoND.h.

3190  {
3191  data_ += r.data_;
3192  overflow_ += r.overflow_;
3193  fillCount_ += r.fillCount_;
3194  overCount_ += r.overCount_;
3195  ++modCount_;
3196  return *this;
3197  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 3201 of file HistoND.h.

3203  {
3204  data_ -= r.data_;
3205  overflow_ -= r.overflow_;
3206 
3207  // Subtraction does not make much sense for fill counts.
3208  // We will assume that what we want should be equivalent
3209  // to the in-place multiplication of the other histogram
3210  // by -1 and then adding.
3211  //
3212  fillCount_ += r.fillCount_;
3213  overCount_ += r.overCount_;
3214 
3215  ++modCount_;
3216  return *this;
3217  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 3233 of file HistoND.h.

References alignCSCRings::r.

3234  {
3235  data_ /= r;
3236  overflow_ /= r;
3237  ++modCount_;
3238  return *this;
3239  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 3277 of file HistoND.h.

3278  {
3279  if (&r != this)
3280  {
3281  title_ = r.title_;
3282  accumulatedDataLabel_ = r.accumulatedDataLabel_;
3283  data_.uninitialize();
3284  data_ = r.data_;
3286  overflow_ = r.overflow_;
3287  axes_ = r.axes_;
3288  weightBuf_ = r.weightBuf_;
3289  indexBuf_ = r.indexBuf_;
3290  fillCount_ = r.fillCount_;
3291  overCount_ = r.overCount_;
3292  dim_ = r.dim_;
3293  ++modCount_;
3294  }
3295  return *this;
3296  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
unsigned long modCount_
Definition: HistoND.h:839
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
ArrayND & uninitialize()
Definition: ArrayND.h:4601
std::vector< double > weightBuf_
Definition: HistoND.h:835
unsigned long overCount_
Definition: HistoND.h:838
std::vector< unsigned > indexBuf_
Definition: HistoND.h:836
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::operator== ( const HistoND< Numeric, Axis > &  r) const
inline

Comparison for equality

Definition at line 1485 of file HistoND.h.

1486  {
1487  return dim_ == r.dim_ &&
1488  fillCount_ == r.fillCount_ &&
1489  overCount_ == r.overCount_ &&
1490  title_ == r.title_ &&
1491  accumulatedDataLabel_ == r.accumulatedDataLabel_ &&
1492  axes_ == r.axes_ &&
1493  overflow_ == r.overflow_ &&
1494  data_ == r.data_;
1495  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned dim_
Definition: HistoND.h:840
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 142 of file HistoND.h.

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

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

Definition at line 3481 of file HistoND.h.

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

3483  {
3484  static const gs::ClassId current(
3485  gs::ClassId::makeId<HistoND<Numeric,Axis> >());
3486  current.ensureSameId(id);
3487 
3489  gs::read_pod(in, &title);
3490 
3492  gs::read_pod(in, &accumulatedDataLabel);
3493 
3494  unsigned long fillCount = 0, overCount = 0;
3495  gs::read_pod(in, &fillCount);
3496  gs::read_pod(in, &overCount);
3497  if (in.fail()) throw gs::IOReadFailure(
3498  "In npstat::HistoND::read: input stream failure");
3499 
3500  std::vector<Axis> axes;
3501  gs::read_heap_obj_vector_as_placed(in, &axes);
3502  gs::ClassId ida(in, 1);
3503  ArrayND<Numeric> data, over;
3504  ArrayND<Numeric>::restore(ida, in, &data);
3505  ArrayND<Numeric>::restore(ida, in, &over);
3506  CPP11_auto_ptr<HistoND<Numeric,Axis> > result(
3507  new HistoND<Numeric,Axis>(axes, title.c_str(),
3508  accumulatedDataLabel.c_str()));
3509  result->data_ = data;
3510  result->overflow_ = over;
3511  result->fillCount_ = fillCount;
3512  result->overCount_ = overCount;
3513  return result.release();
3514  }
const std::string & accumulatedDataLabel() const
Definition: HistoND.h:135
const std::string & title() const
Definition: HistoND.h:132
tuple result
Definition: query.py:137
const std::vector< Axis > & axes() const
Definition: HistoND.h:145
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:5870
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 3418 of file HistoND.h.

3419  {
3420  const long double nOver = overflow_.template sum<long double>();
3421  const long double nData = data_.template sum<long double>();
3422  overCount_ = static_cast<unsigned long>(nOver);
3423  fillCount_ = static_cast<unsigned long>(nData + nOver);
3424  ++modCount_;
3425  }
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::scaleBinContents ( const Num2 *  data,
unsigned long  dataLength 
)

Multiplication by a value which is different for every bin

Definition at line 3370 of file HistoND.h.

References i.

3372  {
3373  if (dataLength != data_.length()) throw npstat::NpstatInvalidArgument(
3374  "In npstat::HistoND::scaleBinContents: incompatible data length");
3375  assert(data);
3376  Numeric* dat = const_cast<Numeric*>(data_.data());
3377  for (unsigned long i=0; i<dataLength; ++i)
3378  dat[i] *= data[i];
3379  ++modCount_;
3380  }
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:839
unsigned long length() const
Definition: ArrayND.h:231
ArrayND< Numeric > data_
Definition: HistoND.h:832
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 3384 of file HistoND.h.

References i.

3386  {
3387  if (dataLength != overflow_.length()) throw npstat::NpstatInvalidArgument(
3388  "In npstat::HistoND::scaleOverflows: incompatible data length");
3389  assert(data);
3390  Numeric* dat = const_cast<Numeric*>(overflow_.data());
3391  for (unsigned long i=0; i<dataLength; ++i)
3392  dat[i] *= data[i];
3393  ++modCount_;
3394  }
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:839
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:833
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 175 of file HistoND.h.

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

176  {accumulatedDataLabel_ = newlabel ? newlabel : ""; ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:839
std::string accumulatedDataLabel_
Definition: HistoND.h:831
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 179 of file HistoND.h.

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

180  {axes_.at(axisNum).setLabel(newlabel); ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:839
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const unsigned *  index,
unsigned  indexLen,
const Num2 &  v 
)
inline

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

Definition at line 2882 of file HistoND.h.

References findQualityFiles::v.

2885  {
2886  data_.value(index, indexLen) = v;
2887  ++modCount_;
2888  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & value(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3099
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( const Num2 &  v)
inline

Definition at line 2902 of file HistoND.h.

References findQualityFiles::v.

2903  {
2904  data_() = v;
2905  ++modCount_;
2906  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
const Num2 &  v 
)
inline

Definition at line 2918 of file HistoND.h.

References findQualityFiles::v.

2920  {
2921  data_(i0) = v;
2922  ++modCount_;
2923  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
const Num2 &  v 
)
inline

Definition at line 2936 of file HistoND.h.

References findQualityFiles::v.

2939  {
2940  data_(i0, i1) = v;
2941  ++modCount_;
2942  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
)
inline

Definition at line 2956 of file HistoND.h.

References findQualityFiles::v.

2960  {
2961  data_(i0, i1, i2) = v;
2962  ++modCount_;
2963  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
)
inline

Definition at line 2967 of file HistoND.h.

References findQualityFiles::v.

2972  {
2973  data_(i0, i1, i2, i3) = v;
2974  ++modCount_;
2975  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
)
inline

Definition at line 2979 of file HistoND.h.

References findQualityFiles::v.

2985  {
2986  data_(i0, i1, i2, i3, i4) = v;
2987  ++modCount_;
2988  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
)
inline

Definition at line 2992 of file HistoND.h.

References findQualityFiles::v.

2999  {
3000  data_(i0, i1, i2, i3, i4, i5) = v;
3001  ++modCount_;
3002  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
)
inline

Definition at line 3006 of file HistoND.h.

References findQualityFiles::v.

3014  {
3015  data_(i0, i1, i2, i3, i4, i5, i6) = v;
3016  ++modCount_;
3017  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
)
inline

Definition at line 3021 of file HistoND.h.

References findQualityFiles::v.

3030  {
3031  data_(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3032  ++modCount_;
3033  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
)
inline

Definition at line 3037 of file HistoND.h.

References findQualityFiles::v.

3047  {
3048  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3049  ++modCount_;
3050  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBin ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
)
inline

Definition at line 3054 of file HistoND.h.

References findQualityFiles::v.

3065  {
3066  data_(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3067  ++modCount_;
3068  }
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const unsigned *  index,
unsigned  indexLen,
const Num2 &  v 
)
inline

Method to set contents of individual bins with bounds checking

Definition at line 2892 of file HistoND.h.

References findQualityFiles::v.

2895  {
2896  data_.valueAt(index, indexLen) = v;
2897  ++modCount_;
2898  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & valueAt(const unsigned *index, unsigned indexLen)
Definition: ArrayND.h:3249
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( const Num2 &  v)
inline

Definition at line 2910 of file HistoND.h.

References findQualityFiles::v.

2911  {
2912  data_.at() = v;
2913  ++modCount_;
2914  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
const Num2 &  v 
)
inline

Definition at line 2927 of file HistoND.h.

References findQualityFiles::v.

2929  {
2930  data_.at(i0) = v;
2931  ++modCount_;
2932  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
const Num2 &  v 
)
inline

Definition at line 2946 of file HistoND.h.

References findQualityFiles::v.

2949  {
2950  data_.at(i0, i1) = v;
2951  ++modCount_;
2952  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
const Num2 &  v 
)
inline

Definition at line 3072 of file HistoND.h.

References findQualityFiles::v.

3076  {
3077  data_.at(i0, i1, i2) = v;
3078  ++modCount_;
3079  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
const Num2 &  v 
)
inline

Definition at line 3083 of file HistoND.h.

References findQualityFiles::v.

3088  {
3089  data_.at(i0, i1, i2, i3) = v;
3090  ++modCount_;
3091  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
const Num2 &  v 
)
inline

Definition at line 3095 of file HistoND.h.

References findQualityFiles::v.

3101  {
3102  data_.at(i0, i1, i2, i3, i4) = v;
3103  ++modCount_;
3104  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
const Num2 &  v 
)
inline

Definition at line 3108 of file HistoND.h.

References findQualityFiles::v.

3115  {
3116  data_.at(i0, i1, i2, i3, i4, i5) = v;
3117  ++modCount_;
3118  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
const Num2 &  v 
)
inline

Definition at line 3122 of file HistoND.h.

References findQualityFiles::v.

3130  {
3131  data_.at(i0, i1, i2, i3, i4, i5, i6) = v;
3132  ++modCount_;
3133  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
const Num2 &  v 
)
inline

Definition at line 3137 of file HistoND.h.

References findQualityFiles::v.

3146  {
3147  data_.at(i0, i1, i2, i3, i4, i5, i6, i7) = v;
3148  ++modCount_;
3149  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
const Num2 &  v 
)
inline

Definition at line 3153 of file HistoND.h.

References findQualityFiles::v.

3163  {
3164  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8) = v;
3165  ++modCount_;
3166  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinAt ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9,
const Num2 &  v 
)
inline

Definition at line 3170 of file HistoND.h.

References findQualityFiles::v.

3181  {
3182  data_.at(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) = v;
3183  ++modCount_;
3184  }
unsigned long modCount_
Definition: HistoND.h:839
Numeric & at()
Definition: ArrayND.h:3321
ArrayND< Numeric > data_
Definition: HistoND.h:832
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setBinContents ( const Num2 *  data,
unsigned long  dataLength,
bool  clearOverflows = true 
)
inline

This method sets all bin contents in one fell swoop

Definition at line 3398 of file HistoND.h.

3401  {
3402  data_.setData(data, dataLength);
3403  if (clearOverflowsNow)
3404  clearOverflows();
3405  ++modCount_;
3406  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:839
ArrayND< Numeric > data_
Definition: HistoND.h:832
void clearOverflows()
Definition: HistoND.h:1149
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 675 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:839
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4584
ArrayND< Numeric > data_
Definition: HistoND.h:832
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 701 of file HistoND.h.

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

702  {overCount_ = i; ++modCount_;}
int i
Definition: DBlmapReader.cc:9
unsigned long modCount_
Definition: HistoND.h:839
unsigned long overCount_
Definition: HistoND.h:838
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 699 of file HistoND.h.

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

700  {fillCount_ = i; ++modCount_;}
int i
Definition: DBlmapReader.cc:9
unsigned long fillCount_
Definition: HistoND.h:837
unsigned long modCount_
Definition: HistoND.h:839
template<typename Numeric , class Axis >
template<typename Num2 >
void npstat::HistoND< Numeric, Axis >::setOverflows ( const Num2 *  data,
unsigned long  dataLength 
)
inline

This method sets all overflows in one fell swoop

Definition at line 3410 of file HistoND.h.

3412  {
3413  overflow_.setData(data, dataLength);
3414  ++modCount_;
3415  }
ArrayND & setData(const Num2 *data, unsigned long dataLength)
unsigned long modCount_
Definition: HistoND.h:839
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
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 683 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:839
ArrayND & constFill(Numeric c)
Definition: ArrayND.h:4584
ArrayND< Numeric > overflow_
Definition: HistoND.h:833
template<typename Numeric, class Axis>
void npstat::HistoND< Numeric, Axis >::setTitle ( const char *  newtitle)
inline

Modify the histogram title

Definition at line 171 of file HistoND.h.

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

172  {title_ = newtitle ? newtitle : ""; ++modCount_;}
unsigned long modCount_
Definition: HistoND.h:839
std::string title_
Definition: HistoND.h:830
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 3299 of file HistoND.h.

3301  {
3302  if (axisNum1 >= dim_ || axisNum2 >= dim_)
3303  throw npstat::NpstatOutOfRange("In npstat::HistoND::transpose: "
3304  "axis number is out of range");
3305  if (axisNum1 == axisNum2)
3306  // Just make a copy
3307  return *this;
3308  else
3309  return HistoND(*this, axisNum1, axisNum2);
3310  }
unsigned dim_
Definition: HistoND.h:840
template<typename Numeric, class Axis>
static unsigned npstat::HistoND< Numeric, Axis >::version ( )
inlinestatic

Definition at line 813 of file HistoND.h.

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

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

Definition at line 1519 of file HistoND.h.

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

1520  {
1521  double v = 1.0;
1522  if (dim_)
1523  {
1524  const Axis* ax = &axes_[0];
1525  for (unsigned i=0; i<dim_; ++i)
1526  v *= (ax[i].max() - ax[i].min());
1527  }
1528  return v;
1529  }
int i
Definition: DBlmapReader.cc:9
unsigned dim_
Definition: HistoND.h:840
const T & max(const T &a, const T &b)
std::vector< Axis > axes_
Definition: HistoND.h:834
template<typename Numeric , class Axis >
bool npstat::HistoND< Numeric, Axis >::write ( std::ostream &  of) const

Definition at line 3466 of file HistoND.h.

3467  {
3468  gs::write_pod(of, title_);
3469  gs::write_pod(of, accumulatedDataLabel_);
3470  gs::write_pod(of, fillCount_);
3471  gs::write_pod(of, overCount_);
3472 
3473  return !of.fail() &&
3474  gs::write_obj_vector(of, axes_) &&
3475  data_.classId().write(of) &&
3476  data_.write(of) &&
3477  overflow_.write(of);
3478  }
unsigned long fillCount_
Definition: HistoND.h:837
bool write(std::ostream &of) const
Definition: ArrayND.h:5859
std::string title_
Definition: HistoND.h:830
std::string accumulatedDataLabel_
Definition: HistoND.h:831
gs::ClassId classId() const
Definition: ArrayND.h:991
ArrayND< Numeric > data_
Definition: HistoND.h:832
unsigned long overCount_
Definition: HistoND.h:838
std::vector< Axis > axes_
Definition: HistoND.h:834
ArrayND< Numeric > overflow_
Definition: HistoND.h:833

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

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