CMS 3D CMS Logo

Namespaces | Classes | Typedefs | Functions
npstat Namespace Reference

Namespaces

 Private
 

Classes

struct  AbsArrayProjector
 
struct  AbsMultivariateFunctor
 
struct  AbsVisitor
 
struct  addmul_left
 
struct  addmul_right
 
class  ArrayND
 
class  ArrayNDScanner
 
struct  ArrayRange
 
struct  assign_left
 
struct  assign_right
 
struct  BoxND
 
class  BoxNDScanner
 
struct  CastingCopyConstructor
 
class  CircularMapper1d
 
struct  ComplexComparesAbs
 
struct  ComplexComparesAbs< std::complex< T > >
 
struct  ComplexComparesFalse
 
struct  ComplexComparesFalse< std::complex< T > >
 
class  CoordinateSelector
 
struct  DefaultConstructor0
 
struct  DefaultConstructor1
 
struct  DefaultConstructor2
 
struct  DefaultConstructor3
 
struct  diveq_left
 
struct  diveq_left_0by0isC
 
struct  diveq_right
 
struct  diveq_right_0by0isC
 
class  DualAxis
 
class  DualHistoAxis
 
struct  Element1D
 
struct  Element1DAt
 
class  EquidistantInLinearSpace
 
class  EquidistantInLogSpace
 
struct  FcnFunctor0
 
struct  FcnFunctor1
 
struct  FcnFunctor2
 
struct  FcnFunctor3
 
struct  Functor0
 
struct  Functor1
 
struct  Functor2
 
struct  Functor3
 
class  GridAxis
 
class  HistoAxis
 
class  HistoND
 
class  Interval
 
class  LinearMapper1d
 
class  LinInterpolatedTableND
 
struct  minuseq_left
 
struct  minuseq_right
 
struct  multeq_left
 
struct  multeq_right
 
class  MultivariateFunctorScanner
 
struct  NpstatDomainError
 
struct  NpstatException
 
struct  NpstatInvalidArgument
 
struct  NpstatOutOfRange
 
struct  NpstatRuntimeError
 
class  NUHistoAxis
 
struct  pluseq_left
 
struct  pluseq_right
 
struct  PreciseType
 
struct  PreciseType< const std::complex< T > >
 
struct  PreciseType< const volatile std::complex< T > >
 
struct  PreciseType< std::complex< T > >
 
struct  PreciseType< volatile std::complex< T > >
 
struct  PreciseTypeHelper
 
struct  PreciseTypeHelper< T, 1 >
 
struct  ProperDblFromCmpl
 
struct  ProperDblFromCmpl< const std::complex< T > >
 
struct  ProperDblFromCmpl< const volatile std::complex< T > >
 
struct  ProperDblFromCmpl< std::complex< T > >
 
struct  ProperDblFromCmpl< volatile std::complex< T > >
 
struct  Same
 
struct  SameRef
 
struct  scast_assign_left
 
struct  scast_assign_right
 
struct  scast_minuseq_left
 
struct  scast_minuseq_right
 
struct  scast_pluseq_left
 
struct  scast_pluseq_right
 
class  StorableHistoNDFunctor
 
class  StorableInterpolationFunctor
 
class  StorableMultivariateFunctor
 
class  StorableMultivariateFunctorReader
 
class  UniformAxis
 
class  VisitCounter
 

Typedefs

typedef std::vector< unsigned > ArrayShape
 
typedef StorableHistoNDFunctor< double, DualHistoAxisDoubleHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, DualAxisDoubleInterpolationFunctor
 
typedef StorableHistoNDFunctor< double, NUHistoAxisDoubleNUHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, GridAxisDoubleNUInterpolationFunctor
 
typedef StorableHistoNDFunctor< double, HistoAxisDoubleUAHistoNDFunctor
 
typedef StorableInterpolationFunctor< double, UniformAxisDoubleUAInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, DualHistoAxisFloatHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, DualAxisFloatInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, NUHistoAxisFloatNUHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, GridAxisFloatNUInterpolationFunctor
 
typedef StorableHistoNDFunctor< float, HistoAxisFloatUAHistoNDFunctor
 
typedef StorableInterpolationFunctor< float, UniformAxisFloatUAInterpolationFunctor
 
typedef gs::StaticReader< StorableMultivariateFunctorReaderStaticStorableMultivariateFunctorReader
 

Functions

template<typename T >
Private::AbsReturnType< T >::type absDifference (const T &v1, const T &v2)
 
template<typename T >
Private::AbsReturnType< T >::type absValue (const T &v1)
 
template<typename T >
void clearBuffer (T *buf, const unsigned long len)
 
bool closeWithinTolerance (const double &a, const double &b, const double &tol)
 
template<typename Histo >
void convertHistoToDensity (Histo *histogram, bool knownNonNegative=false)
 
UniformAxis convertToGridAxis (const HistoAxis &histoAxis)
 
GridAxis convertToGridAxis (const NUHistoAxis &histoAxis)
 
NUHistoAxis convertToHistoAxis (const GridAxis &gridAxis, double xMin)
 
HistoAxis convertToHistoAxis (const UniformAxis &gridAxis)
 
template<typename Histo >
std::vector< CircularMapper1dconvolutionHistoMap (const Histo &histo, bool doubleDataRange)
 
template<typename T1 , typename T2 >
void copyBuffer (T1 *dest, const T2 *source, const unsigned long len)
 
template<typename Histo >
std::vector< LinearMapper1ddensityScanHistoMap (const Histo &histo)
 
template<typename T >
void destroyBuffer (T *thisBuffer, const T *stackBuffer)
 
ArrayShape doubleShape (const ArrayShape &inputShape)
 
ArrayShape halfShape (const ArrayShape &inputShape)
 
template<typename T >
T interpolate_cubic (const double x, const T &f0, const T &f1, const T &f2, const T &f3)
 
template<typename T >
T interpolate_linear (const double x, const T &f0, const T &f1)
 
template<typename T >
T interpolate_quadratic (const double x, const T &f0, const T &f1, const T &f2)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, const double *coords, unsigned coordsDim, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, double x9, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, double x6, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, double x5, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, double x4, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, double x3, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, double x2, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, double x1, unsigned interpolationDegree)
 
template<typename Float , class Axis >
Float interpolateHistoND (const HistoND< Float, Axis > &histo, double x0, unsigned interpolationDegree)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1, const T &f2)
 
template<typename T >
unsigned interpolation_coefficients (T *buffer, unsigned bufLen, const T &f0, const T &f1, const T &f2, const T &f3)
 
template<class Iter >
bool isMonotonous (Iter const begin, Iter const end)
 
template<class Iter >
bool isNonDecreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isNonIncreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyDecreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyIncreasing (Iter begin, Iter const end)
 
template<class Iter >
bool isStrictlyMonotonous (Iter const begin, Iter const end)
 
bool isSubShape (const ArrayShape &sh1, const ArrayShape &sh2)
 
template<typename T >
TmakeBuffer (unsigned sizeNeeded, T *stackBuffer, unsigned sizeofStackBuffer)
 
ArrayShape makeShape ()
 
ArrayShape makeShape (const unsigned *indices, unsigned nIndices)
 
ArrayShape makeShape (unsigned i0)
 
ArrayShape makeShape (unsigned i0, unsigned i1)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8)
 
ArrayShape makeShape (unsigned i0, unsigned i1, unsigned i2, unsigned i3, unsigned i4, unsigned i5, unsigned i6, unsigned i7, unsigned i8, unsigned i9)
 
template<typename Num1 , unsigned Len1, unsigned Dim1, typename Num2 , unsigned Len2, unsigned Dim2>
void rescanArray (const ArrayND< Num1, Len1, Dim1 > &from, ArrayND< Num2, Len2, Dim2 > *to, unsigned interpolationDegree=0)
 
template<typename T1 , typename T2 >
void transposeBuffer (T1 *dest, const T2 *source, const unsigned long dim)
 
template<typename T1 , typename T2 >
void transposeBuffer (T1 *dest, const T2 *source, const unsigned long M, const unsigned long N)
 

Typedef Documentation

◆ ArrayShape

typedef std::vector<unsigned> npstat::ArrayShape

This type will be used to specify array length in each dimension

Definition at line 21 of file ArrayShape.h.

◆ DoubleHistoNDFunctor

Definition at line 18 of file HistoNDFunctorInstances.h.

◆ DoubleInterpolationFunctor

Definition at line 19 of file InterpolationFunctorInstances.h.

◆ DoubleNUHistoNDFunctor

Definition at line 22 of file HistoNDFunctorInstances.h.

◆ DoubleNUInterpolationFunctor

Definition at line 23 of file InterpolationFunctorInstances.h.

◆ DoubleUAHistoNDFunctor

Definition at line 20 of file HistoNDFunctorInstances.h.

◆ DoubleUAInterpolationFunctor

Definition at line 21 of file InterpolationFunctorInstances.h.

◆ FloatHistoNDFunctor

Definition at line 24 of file HistoNDFunctorInstances.h.

◆ FloatInterpolationFunctor

Definition at line 25 of file InterpolationFunctorInstances.h.

◆ FloatNUHistoNDFunctor

Definition at line 28 of file HistoNDFunctorInstances.h.

◆ FloatNUInterpolationFunctor

Definition at line 29 of file InterpolationFunctorInstances.h.

◆ FloatUAHistoNDFunctor

Definition at line 26 of file HistoNDFunctorInstances.h.

◆ FloatUAInterpolationFunctor

Definition at line 27 of file InterpolationFunctorInstances.h.

◆ StaticStorableMultivariateFunctorReader

The reader factory for descendants of StorableMultivariateFunctor

Definition at line 30 of file StorableMultivariateFunctorReader.h.

Function Documentation

◆ absDifference()

template<typename T >
Private::AbsReturnType<T>::type npstat::absDifference ( const T v1,
const T v2 
)
inline

Absolute value of the difference between two numbers. Works for all standard numeric types, including unsigned and complex.

Definition at line 73 of file absDifference.h.

73  {
75  }

References dumpMFGeometry_cfg::delta.

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::isClose(), npstat::ArrayND< Num1, Len1, Dim1 >::makeCopulaSteps(), and npstat::ArrayND< Num1, Len1, Dim1 >::maxAbsDifference().

◆ absValue()

template<typename T >
Private::AbsReturnType<T>::type npstat::absValue ( const T v1)
inline

Absolute value of a number. Works for all standard numeric types, including unsigned and complex.

Definition at line 82 of file absDifference.h.

References relativeConstraints::value.

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::sumsq().

◆ clearBuffer()

template<typename T >
void npstat::clearBuffer ( T buf,
const unsigned long  len 
)
inline

Clear a buffer (set all elements to the value produced by the default constructor)

Definition at line 86 of file allocators.h.

86  {
87  if (len) {
88  assert(buf);
89  const T zero = T();
90  for (unsigned long i = 0; i < len; ++i)
91  *buf++ = zero;
92  }
93  }

References cms::cuda::assert(), visDQMUpload::buf, mps_fire::i, and SiPixelPI::zero.

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::ArrayND(), npstat::ArrayND< Num1, Len1, Dim1 >::exportSubrange(), npstat::ArrayND< Num1, Len1, Dim1 >::importSubrange(), and npstat::ArrayND< Num1, Len1, Dim1 >::rotate().

◆ closeWithinTolerance()

bool npstat::closeWithinTolerance ( const double &  a,
const double &  b,
const double &  tol 
)
inline

Check if two doubles are within certain relative tolerance from each other. The "tol" argument which specifies the tolerance must be non-negative.

Definition at line 25 of file closeWithinTolerance.h.

25  {
26  if (tol < 0.0)
28  "In npstat::closeWithinTolerance: "
29  "negative tolerance is not allowed");
30  if (a == b)
31  return true;
32  else
33  return fabs(a - b) / std::max(fabs(a), fabs(b)) <= tol;
34  }

References a, b, and SiStripPI::max.

Referenced by npstat::UniformAxis::isClose(), npstat::NUHistoAxis::isClose(), npstat::GridAxis::isClose(), and npstat::HistoAxis::isClose().

◆ convertHistoToDensity()

template<typename Histo >
void npstat::convertHistoToDensity ( Histo *  histogram,
bool  knownNonNegative = false 
)

Reset negative histogram bins to zero and then divide histogram bin contents by the histogram integral. If the "knownNonNegative" argument is true, it will be assumed that there are no negative bins, and their explicit reset is unnecessary.

This function will throw npstat::NpstatRuntimeError in case the histogram is empty after all negative bins are reset.

This function is not a member of the HistoND class itself because these operations do not necessarily make sense for all bin types. Making such operation a member would make creation of HistoND scripting API (e.g., for python) more difficult.

Definition at line 3533 of file HistoND.h.

3533  {
3534  assert(h);
3535  if (!knownNonNegative)
3536  (const_cast<ArrayND<typename Histo::value_type>&>(h->binContents())).makeNonNegative();
3537  const double integ = h->integral();
3538  *h /= integ;
3539  }

References cms::cuda::assert().

◆ convertToGridAxis() [1/2]

UniformAxis npstat::convertToGridAxis ( const HistoAxis histoAxis)

Convert uniform histogram to uniform grid axis axis

Definition at line 15 of file convertAxis.cc.

15  {
16  const unsigned nBins = histoAxis.nBins();
17  const double xmin = histoAxis.binCenter(0);
18  const double xmax = histoAxis.binCenter(nBins - 1);
19  UniformAxis ax(nBins, xmin, xmax, histoAxis.label().c_str());
20  return ax;
21  }

References npstat::HistoAxis::binCenter(), npstat::HistoAxis::label(), seedmultiplicitymonitor_newtracking_cfi::nBins, npstat::HistoAxis::nBins(), TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

◆ convertToGridAxis() [2/2]

GridAxis npstat::convertToGridAxis ( const NUHistoAxis histoAxis)

Note that conversion from non-uniform histogram axis into the grid axis is always possible, but it is loosing information (we are writing the positions of bin centers only, not edges)

Definition at line 42 of file convertAxis.cc.

42  {
43  const unsigned nBins = histoAxis.nBins();
44  std::vector<double> coords;
45  coords.reserve(nBins);
46  for (unsigned i = 0; i < nBins; ++i)
47  coords.push_back(histoAxis.binCenter(i));
48  GridAxis ax(coords, histoAxis.label().c_str());
49  return ax;
50  }

References npstat::NUHistoAxis::binCenter(), mps_fire::i, npstat::NUHistoAxis::label(), seedmultiplicitymonitor_newtracking_cfi::nBins, and npstat::NUHistoAxis::nBins().

◆ convertToHistoAxis() [1/2]

NUHistoAxis npstat::convertToHistoAxis ( const GridAxis gridAxis,
double  xMin 
)

The conversion from non-uniform grid axis to non-uniform histogram axis is only unambiguous when some additional info is available. Here, in particular, we are asking for the position of the axis minimum. This function will throw npstat::NpstatInvalidArgument in case the conversion is impossible.

Definition at line 23 of file convertAxis.cc.

23  {
24  const unsigned nCoords = gridAxis.nCoords();
25  std::vector<double> binEdges;
26  binEdges.reserve(nCoords + 1U);
27  binEdges.push_back(xMin);
28  for (unsigned i = 0; i < nCoords; ++i) {
29  const double x = gridAxis.coordinate(i);
30  if (x <= xMin)
32  "In npstat::convertToHistoAxis: "
33  "conversion is impossible");
34  const double halfbin = x - xMin;
35  xMin = x + halfbin;
36  binEdges.push_back(xMin);
37  }
38  NUHistoAxis ax(binEdges, gridAxis.label().c_str());
39  return ax;
40  }

References npstat::GridAxis::coordinate(), mps_fire::i, npstat::GridAxis::label(), npstat::GridAxis::nCoords(), mitigatedMETSequence_cff::U, and photonAnalyzer_cfi::xMin.

◆ convertToHistoAxis() [2/2]

HistoAxis npstat::convertToHistoAxis ( const UniformAxis gridAxis)

Convert uniform grid axis to uniform histogram axis

Definition at line 6 of file convertAxis.cc.

6  {
7  const unsigned nBins = gridAxis.nCoords();
8  const double xmin = gridAxis.min();
9  const double xmax = gridAxis.max();
10  const double hbw = 0.5 * (xmax - xmin) / (nBins - 1U);
11  HistoAxis ax(nBins, xmin - hbw, xmax + hbw, gridAxis.label().c_str());
12  return ax;
13  }

References npstat::UniformAxis::label(), npstat::UniformAxis::max(), npstat::UniformAxis::min(), seedmultiplicitymonitor_newtracking_cfi::nBins, npstat::UniformAxis::nCoords(), mitigatedMETSequence_cff::U, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

◆ convolutionHistoMap()

template<typename Histo >
std::vector< CircularMapper1d > npstat::convolutionHistoMap ( const Histo &  histo,
bool  doubleDataRange 
)

Generate a density scanning map for subsequent use with the "DensityScanND" template when a density is to be convolved with the histogram data. Only histograms with uniform binning can be used here.

The "doubleDataRange" should be set "true" in case the data will be mirrored (or just empty range added) to avoid circular spilling after convolution.

Definition at line 3554 of file HistoND.h.

3554  {
3555  std::vector<CircularMapper1d> result;
3556  const unsigned d = histo.dim();
3557  result.reserve(d);
3558  for (unsigned i = 0; i < d; ++i)
3559  result.push_back(histo.axis(i).kernelScanMapper(doubleRange));
3560  return result;
3561  }

References ztail::d, timingPdfMaker::histo, mps_fire::i, and mps_fire::result.

◆ copyBuffer()

template<typename T1 , typename T2 >
void npstat::copyBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  len 
)
inline

Copy a buffer (with possible type conversion on the fly)

Definition at line 38 of file allocators.h.

38  {
39  if (len) {
40  assert(dest);
41  assert(source);
42  for (unsigned long i = 0; i < len; ++i)
43  *dest++ = static_cast<T1>(*source++);
44  }
45  }

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

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::ArrayND(), npstat::ArrayND< Num1, Len1, Dim1 >::dot(), npstat::ArrayND< Num1, Len1, Dim1 >::operator=(), npstat::ArrayND< Num1, Len1, Dim1 >::setData(), and npstat::ArrayND< Num1, Len1, Dim1 >::transpose().

◆ densityScanHistoMap()

template<typename Histo >
std::vector< LinearMapper1d > npstat::densityScanHistoMap ( const Histo &  histo)

Generate a density scanning map for subsequent use with the "DensityScanND" template. Naturally, only histograms with uniform binning can be used here.

Definition at line 3542 of file HistoND.h.

3542  {
3543  std::vector<LinearMapper1d> result;
3544  const unsigned d = histo.dim();
3545  result.reserve(d);
3546  for (unsigned i = 0; i < d; ++i) {
3547  const LinearMapper1d& m = histo.axis(i).binNumberMapper(false);
3548  result.push_back(m.inverse());
3549  }
3550  return result;
3551  }

References ztail::d, timingPdfMaker::histo, mps_fire::i, visualization-live-secondInstance_cfg::m, and mps_fire::result.

◆ destroyBuffer()

template<typename T >
void npstat::destroyBuffer ( T thisBuffer,
const T stackBuffer 
)
inline

◆ doubleShape()

ArrayShape npstat::doubleShape ( const ArrayShape inputShape)

Multiply the sise in each dimension by 2

Definition at line 148 of file ArrayShape.cc.

148  {
149  ArrayShape s(inputShape);
150  const unsigned len = s.size();
151  for (unsigned i = 0; i < len; ++i)
152  s[i] *= 2U;
153  return s;
154  }

References mps_fire::i, alignCSCRings::s, and mitigatedMETSequence_cff::U.

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::multiMirror().

◆ halfShape()

ArrayShape npstat::halfShape ( const ArrayShape inputShape)

Divide the size in each dimension by 2 (generate dynamic fault if odd)

Definition at line 156 of file ArrayShape.cc.

156  {
157  ArrayShape s(inputShape);
158  const unsigned len = s.size();
159  for (unsigned i = 0; i < len; ++i) {
160  if (!(s[i] % 2U == 0))
162  "In npstat::halfShape: array span must be "
163  "even in each dimension");
164  s[i] /= 2U;
165  }
166  return s;
167  }

References mps_fire::i, alignCSCRings::s, and mitigatedMETSequence_cff::U.

◆ interpolate_cubic()

template<typename T >
T npstat::interpolate_cubic ( const double  x,
const T f0,
const T f1,
const T f2,
const T f3 
)
inline

Cubic interpolation. Assume that the function values are given at 0, 1, 2, and 3.

Definition at line 44 of file interpolate.h.

44  {
45  return interpolate_linear(
46  x * (3.0 - x) / 2.0, interpolate_linear(x / 3.0, f0, f3), interpolate_linear(x - 1.0, f1, f2));
47  }

References DeadROC_duringRun::f1, DeadROC_duringRun::f2, and interpolate_linear().

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::interpolateLoop().

◆ interpolate_linear()

template<typename T >
T npstat::interpolate_linear ( const double  x,
const T f0,
const T f1 
)
inline

Linear interpolation. Assumes that the function values are given at 0 and 1.

Definition at line 23 of file interpolate.h.

23  {
24  const typename ProperDblFromCmpl<T>::type dx = 1.0 - x;
25  return f0 * dx + f1 * static_cast<typename ProperDblFromCmpl<T>::type>(x);
26  }

References PVValHelper::dx, and DeadROC_duringRun::f1.

Referenced by interpolate_cubic(), and npstat::ArrayND< Num1, Len1, Dim1 >::interpolateLoop().

◆ interpolate_quadratic()

template<typename T >
T npstat::interpolate_quadratic ( const double  x,
const T f0,
const T f1,
const T f2 
)
inline

Quadratic interpolation. Assume that the function values are given at 0, 1, and 2.

Definition at line 33 of file interpolate.h.

33  {
34  static const typename ProperDblFromCmpl<T>::type two = 2.0;
35  const typename ProperDblFromCmpl<T>::type dx = x - 1.0;
36  return f1 + ((f2 - f0) / two + ((f2 - f1) + (f0 - f1)) * (dx / two)) * dx;
37  }

References PVValHelper::dx, DeadROC_duringRun::f1, DeadROC_duringRun::f2, and SiPixelPI::two.

Referenced by npstat::ArrayND< Num1, Len1, Dim1 >::interpolateLoop().

◆ interpolateHistoND() [1/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
const double *  coords,
unsigned  coordsDim,
unsigned  interpolationDegree 
)

The interpolation degree in this method can be set to 0, 1, or 3 which results, respectively, in closest bin lookup, multilinear interpolation, or multicubic interpolation. Value of the closest bin inside the histogram range is used if some coordinate is outside of the corresponding axis limits.

Definition at line 156 of file interpolateHistoND.h.

159  {
160  Private::iHND_checkArgs(histo, xDim, interpolationDegree);
161  assert(x);
162  const Axis* ax = &histo.axes()[0];
163  double coords[CHAR_BIT * sizeof(unsigned long)];
164  for (unsigned i = 0; i < xDim; ++i)
165  coords[i] = ax[i].fltBinNumber(x[i], false);
166  const ArrayND<Float>& bins(histo.binContents());
167  switch (interpolationDegree) {
168  case 1U:
169  return bins.interpolate1(coords, xDim);
170  case 3U:
171  return bins.interpolate3(coords, xDim);
172  default:
173  return bins.closest(coords, xDim);
174  }
175  }

References cms::cuda::assert(), trigObjTnPSource_cfi::bins, timingPdfMaker::histo, mps_fire::i, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

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

◆ interpolateHistoND() [2/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
double  x9,
unsigned  interpolationDegree 
)

Definition at line 426 of file interpolateHistoND.h.

437  {
438  const unsigned expDim = 10U;
439  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
440  const Axis* ax = &histo.axes()[0];
441  double coords[expDim];
442  coords[0] = ax[0].fltBinNumber(x0, false);
443  coords[1] = ax[1].fltBinNumber(x1, false);
444  coords[2] = ax[2].fltBinNumber(x2, false);
445  coords[3] = ax[3].fltBinNumber(x3, false);
446  coords[4] = ax[4].fltBinNumber(x4, false);
447  coords[5] = ax[5].fltBinNumber(x5, false);
448  coords[6] = ax[6].fltBinNumber(x6, false);
449  coords[7] = ax[7].fltBinNumber(x7, false);
450  coords[8] = ax[8].fltBinNumber(x8, false);
451  coords[9] = ax[9].fltBinNumber(x9, false);
452  const ArrayND<Float>& bins(histo.binContents());
453  switch (interpolationDegree) {
454  case 1U:
455  return bins.interpolate1(coords, expDim);
456  case 3U:
457  return bins.interpolate3(coords, expDim);
458  default:
459  return bins.closest(coords, expDim);
460  }
461  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [3/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
double  x8,
unsigned  interpolationDegree 
)

Definition at line 390 of file interpolateHistoND.h.

400  {
401  const unsigned expDim = 9U;
402  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
403  const Axis* ax = &histo.axes()[0];
404  double coords[expDim];
405  coords[0] = ax[0].fltBinNumber(x0, false);
406  coords[1] = ax[1].fltBinNumber(x1, false);
407  coords[2] = ax[2].fltBinNumber(x2, false);
408  coords[3] = ax[3].fltBinNumber(x3, false);
409  coords[4] = ax[4].fltBinNumber(x4, false);
410  coords[5] = ax[5].fltBinNumber(x5, false);
411  coords[6] = ax[6].fltBinNumber(x6, false);
412  coords[7] = ax[7].fltBinNumber(x7, false);
413  coords[8] = ax[8].fltBinNumber(x8, false);
414  const ArrayND<Float>& bins(histo.binContents());
415  switch (interpolationDegree) {
416  case 1U:
417  return bins.interpolate1(coords, expDim);
418  case 3U:
419  return bins.interpolate3(coords, expDim);
420  default:
421  return bins.closest(coords, expDim);
422  }
423  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [4/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
double  x7,
unsigned  interpolationDegree 
)

Definition at line 356 of file interpolateHistoND.h.

365  {
366  const unsigned expDim = 8U;
367  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
368  const Axis* ax = &histo.axes()[0];
369  double coords[expDim];
370  coords[0] = ax[0].fltBinNumber(x0, false);
371  coords[1] = ax[1].fltBinNumber(x1, false);
372  coords[2] = ax[2].fltBinNumber(x2, false);
373  coords[3] = ax[3].fltBinNumber(x3, false);
374  coords[4] = ax[4].fltBinNumber(x4, false);
375  coords[5] = ax[5].fltBinNumber(x5, false);
376  coords[6] = ax[6].fltBinNumber(x6, false);
377  coords[7] = ax[7].fltBinNumber(x7, false);
378  const ArrayND<Float>& bins(histo.binContents());
379  switch (interpolationDegree) {
380  case 1U:
381  return bins.interpolate1(coords, expDim);
382  case 3U:
383  return bins.interpolate3(coords, expDim);
384  default:
385  return bins.closest(coords, expDim);
386  }
387  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [5/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
double  x6,
unsigned  interpolationDegree 
)

Definition at line 324 of file interpolateHistoND.h.

332  {
333  const unsigned expDim = 7U;
334  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
335  const Axis* ax = &histo.axes()[0];
336  double coords[expDim];
337  coords[0] = ax[0].fltBinNumber(x0, false);
338  coords[1] = ax[1].fltBinNumber(x1, false);
339  coords[2] = ax[2].fltBinNumber(x2, false);
340  coords[3] = ax[3].fltBinNumber(x3, false);
341  coords[4] = ax[4].fltBinNumber(x4, false);
342  coords[5] = ax[5].fltBinNumber(x5, false);
343  coords[6] = ax[6].fltBinNumber(x6, false);
344  const ArrayND<Float>& bins(histo.binContents());
345  switch (interpolationDegree) {
346  case 1U:
347  return bins.interpolate1(coords, expDim);
348  case 3U:
349  return bins.interpolate3(coords, expDim);
350  default:
351  return bins.closest(coords, expDim);
352  }
353  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [6/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
double  x5,
unsigned  interpolationDegree 
)

Definition at line 294 of file interpolateHistoND.h.

301  {
302  const unsigned expDim = 6U;
303  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
304  const Axis* ax = &histo.axes()[0];
305  double coords[expDim];
306  coords[0] = ax[0].fltBinNumber(x0, false);
307  coords[1] = ax[1].fltBinNumber(x1, false);
308  coords[2] = ax[2].fltBinNumber(x2, false);
309  coords[3] = ax[3].fltBinNumber(x3, false);
310  coords[4] = ax[4].fltBinNumber(x4, false);
311  coords[5] = ax[5].fltBinNumber(x5, false);
312  const ArrayND<Float>& bins(histo.binContents());
313  switch (interpolationDegree) {
314  case 1U:
315  return bins.interpolate1(coords, expDim);
316  case 3U:
317  return bins.interpolate3(coords, expDim);
318  default:
319  return bins.closest(coords, expDim);
320  }
321  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [7/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
double  x4,
unsigned  interpolationDegree 
)

Definition at line 266 of file interpolateHistoND.h.

272  {
273  const unsigned expDim = 5U;
274  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
275  const Axis* ax = &histo.axes()[0];
276  double coords[expDim];
277  coords[0] = ax[0].fltBinNumber(x0, false);
278  coords[1] = ax[1].fltBinNumber(x1, false);
279  coords[2] = ax[2].fltBinNumber(x2, false);
280  coords[3] = ax[3].fltBinNumber(x3, false);
281  coords[4] = ax[4].fltBinNumber(x4, false);
282  const ArrayND<Float>& bins(histo.binContents());
283  switch (interpolationDegree) {
284  case 1U:
285  return bins.interpolate1(coords, expDim);
286  case 3U:
287  return bins.interpolate3(coords, expDim);
288  default:
289  return bins.closest(coords, expDim);
290  }
291  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [8/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
double  x3,
unsigned  interpolationDegree 
)

Definition at line 240 of file interpolateHistoND.h.

245  {
246  const unsigned expDim = 4U;
247  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
248  const Axis* ax = &histo.axes()[0];
249  double coords[expDim];
250  coords[0] = ax[0].fltBinNumber(x0, false);
251  coords[1] = ax[1].fltBinNumber(x1, false);
252  coords[2] = ax[2].fltBinNumber(x2, false);
253  coords[3] = ax[3].fltBinNumber(x3, false);
254  const ArrayND<Float>& bins(histo.binContents());
255  switch (interpolationDegree) {
256  case 1U:
257  return bins.interpolate1(coords, expDim);
258  case 3U:
259  return bins.interpolate3(coords, expDim);
260  default:
261  return bins.closest(coords, expDim);
262  }
263  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [9/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
double  x2,
unsigned  interpolationDegree 
)

Definition at line 216 of file interpolateHistoND.h.

220  {
221  const unsigned expDim = 3U;
222  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
223  const Axis* ax = &histo.axes()[0];
224  double coords[expDim];
225  coords[0] = ax[0].fltBinNumber(x0, false);
226  coords[1] = ax[1].fltBinNumber(x1, false);
227  coords[2] = ax[2].fltBinNumber(x2, false);
228  const ArrayND<Float>& bins(histo.binContents());
229  switch (interpolationDegree) {
230  case 1U:
231  return bins.interpolate1(coords, expDim);
232  case 3U:
233  return bins.interpolate3(coords, expDim);
234  default:
235  return bins.closest(coords, expDim);
236  }
237  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ interpolateHistoND() [10/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
double  x1,
unsigned  interpolationDegree 
)

Definition at line 194 of file interpolateHistoND.h.

197  {
198  const unsigned expDim = 2U;
199  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
200  const Axis* ax = &histo.axes()[0];
201  double coords[expDim];
202  coords[0] = ax[0].fltBinNumber(x0, false);
203  coords[1] = ax[1].fltBinNumber(x1, false);
204  const ArrayND<Float>& bins(histo.binContents());
205  switch (interpolationDegree) {
206  case 1U:
207  return bins.interpolate1(coords, expDim);
208  case 3U:
209  return bins.interpolate3(coords, expDim);
210  default:
211  return bins.closest(coords, expDim);
212  }
213  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), mitigatedMETSequence_cff::U, and testProducerWithPsetDescEmpty_cfi::x1.

◆ interpolateHistoND() [11/11]

template<typename Float , class Axis >
Float npstat::interpolateHistoND ( const HistoND< Float, Axis > &  histo,
double  x0,
unsigned  interpolationDegree 
)

Convenience function for interpolating histograms, with an explicit coordinate argument for each histogram dimension

Definition at line 178 of file interpolateHistoND.h.

178  {
179  const unsigned expDim = 1U;
180  Private::iHND_checkArgs(histo, expDim, interpolationDegree);
181  const double coords = histo.axis(0).fltBinNumber(x0, false);
182  const ArrayND<Float>& bins(histo.binContents());
183  switch (interpolationDegree) {
184  case 1U:
185  return bins.interpolate1(&coords, expDim);
186  case 3U:
187  return bins.interpolate3(&coords, expDim);
188  default:
189  return bins.closest(&coords, expDim);
190  }
191  }

References trigObjTnPSource_cfi::bins, timingPdfMaker::histo, npstat::Private::iHND_checkArgs(), and mitigatedMETSequence_cff::U.

◆ interpolation_coefficients() [1/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1 
)

Get the coefficients of the interpolating polynomial. The interpolated function values are provided at 0, 1, ... The return value of the function is the number of coefficients (i.e., the polynomial degree plus one). On exit, the coefficients are placed into the "buffer" array in the order of increasing monomial degree. The length of the provided buffer must be sufficient to hold all these coefficients.

Definition at line 73 of file interpolate.h.

73  {
74  if (bufLen <= 1U)
76  "In npstat::interpolation_coefficients: "
77  "insufficient length of the output buffer");
78  buffer[0] = f0;
79  buffer[1] = f1 - f0;
80  return 2U;
81  }

References edmScanValgrind::buffer, DeadROC_duringRun::f1, and mitigatedMETSequence_cff::U.

◆ interpolation_coefficients() [2/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1,
const T f2 
)

Definition at line 84 of file interpolate.h.

84  {
85  if (bufLen <= 2U)
87  "In npstat::interpolation_coefficients: "
88  "insufficient length of the output buffer");
89  buffer[0] = f0;
90  buffer[1] = static_cast<T>((f1 - f2 + 3 * (f1 - f0)) / 2.0);
91  buffer[2] = static_cast<T>(((f0 - f1) + (f2 - f1)) / 2.0);
92  return 3U;
93  }

References edmScanValgrind::buffer, DeadROC_duringRun::f1, DeadROC_duringRun::f2, and mitigatedMETSequence_cff::U.

◆ interpolation_coefficients() [3/3]

template<typename T >
unsigned npstat::interpolation_coefficients ( T buffer,
unsigned  bufLen,
const T f0,
const T f1,
const T f2,
const T f3 
)

Definition at line 96 of file interpolate.h.

97  {
98  if (bufLen <= 3U)
100  "In npstat::interpolation_coefficients: "
101  "insufficient length of the output buffer");
102  buffer[0] = f0;
103  buffer[1] = static_cast<T>((11 * (f1 - f0) + 7 * (f1 - f2) + 2 * (f3 - f2)) / 6.0);
104  buffer[2] = static_cast<T>((2 * (f0 - f1) + 3 * (f2 - f1) + (f2 - f3)) / 2.0);
105  buffer[3] = static_cast<T>(((f3 - f0) + 3 * (f1 - f2)) / 6.0);
106  return 4U;
107  }

References edmScanValgrind::buffer, DeadROC_duringRun::f1, DeadROC_duringRun::f2, and mitigatedMETSequence_cff::U.

◆ isMonotonous()

template<class Iter >
bool npstat::isMonotonous ( Iter const  begin,
Iter const  end 
)
inline

Check if the sequence of values is either non-increasing or non-decreasing

Definition at line 79 of file isMonotonous.h.

79  {
80  return isNonDecreasing(begin, end) || isNonIncreasing(begin, end);
81  }

References mps_fire::end, isNonDecreasing(), and isNonIncreasing().

◆ isNonDecreasing()

template<class Iter >
bool npstat::isNonDecreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is not decreasing

Definition at line 50 of file isMonotonous.h.

50  {
51  if (begin == end)
52  return false;
53  Iter first(begin);
54  bool status = ++begin != end;
55  for (; begin != end && status; ++begin, ++first)
56  if (*begin < *first)
57  status = false;
58  return status;
59  }

References mps_fire::end, dqmdumpme::first, and mps_update::status.

Referenced by isMonotonous().

◆ isNonIncreasing()

template<class Iter >
bool npstat::isNonIncreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is not increasing

Definition at line 63 of file isMonotonous.h.

63  {
64  if (begin == end)
65  return false;
66  Iter first(begin);
67  bool status = ++begin != end;
68  for (; begin != end && status; ++begin, ++first)
69  if (*begin > *first)
70  status = false;
71  return status;
72  }

References mps_fire::end, dqmdumpme::first, and mps_update::status.

Referenced by isMonotonous().

◆ isStrictlyDecreasing()

template<class Iter >
bool npstat::isStrictlyDecreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly decreasing

Definition at line 31 of file isMonotonous.h.

31  {
32  if (begin == end)
33  return false;
34  Iter first(begin);
35  bool status = ++begin != end;
36  for (; begin != end && status; ++begin, ++first)
37  if (!(*begin < *first))
38  status = false;
39  return status;
40  }

References mps_fire::end, dqmdumpme::first, and mps_update::status.

Referenced by isStrictlyMonotonous().

◆ isStrictlyIncreasing()

template<class Iter >
bool npstat::isStrictlyIncreasing ( Iter  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly increasing

Definition at line 18 of file isMonotonous.h.

18  {
19  if (begin == end)
20  return false;
21  Iter first(begin);
22  bool status = ++begin != end;
23  for (; begin != end && status; ++begin, ++first)
24  if (!(*first < *begin))
25  status = false;
26  return status;
27  }

References mps_fire::end, dqmdumpme::first, and mps_update::status.

Referenced by isStrictlyMonotonous().

◆ isStrictlyMonotonous()

template<class Iter >
bool npstat::isStrictlyMonotonous ( Iter const  begin,
Iter const  end 
)
inline

Check if the sequence of values is strictly increasing or decreasing

Definition at line 44 of file isMonotonous.h.

44  {
45  return isStrictlyIncreasing(begin, end) || isStrictlyDecreasing(begin, end);
46  }

References mps_fire::end, isStrictlyDecreasing(), and isStrictlyIncreasing().

Referenced by npstat::Private::lind_invert1DSlice().

◆ isSubShape()

bool npstat::isSubShape ( const ArrayShape sh1,
const ArrayShape sh2 
)

This function returns true if the number of elements is the same in both vectors and every element of the first vector does not exceed corresponding element of the second

Definition at line 169 of file ArrayShape.cc.

169  {
170  const unsigned len = sh1.size();
171  if (len != sh2.size())
172  return false;
173  for (unsigned i = 0; i < len; ++i)
174  if (sh1[i] > sh2[i])
175  return false;
176  return true;
177  }

References mps_fire::i.

◆ makeBuffer()

template<typename T >
T* npstat::makeBuffer ( unsigned  sizeNeeded,
T stackBuffer,
unsigned  sizeofStackBuffer 
)
inline

◆ makeShape() [1/12]

ArrayShape npstat::makeShape ( )

This convenience function will construct an array shape using an explicit list of indices

Definition at line 7 of file ArrayShape.cc.

7 { return ArrayShape(); }

◆ makeShape() [2/12]

ArrayShape npstat::makeShape ( const unsigned *  indices,
unsigned  nIndices 
)

Definition at line 137 of file ArrayShape.cc.

137  {
138  ArrayShape s;
139  if (nIndices) {
140  assert(indices);
141  s.reserve(nIndices);
142  for (unsigned i = 0; i < nIndices; ++i)
143  s.push_back(indices[i]);
144  }
145  return s;
146  }

References cms::cuda::assert(), mps_fire::i, bTagCombinedSVVariables_cff::indices, and alignCSCRings::s.

◆ makeShape() [3/12]

ArrayShape npstat::makeShape ( unsigned  i0)

Definition at line 9 of file ArrayShape.cc.

9 { return ArrayShape(1, i0); }

◆ makeShape() [4/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1 
)

Definition at line 11 of file ArrayShape.cc.

11  {
12  ArrayShape s;
13  s.reserve(2);
14  s.push_back(i0);
15  s.push_back(i1);
16  return s;
17  }

References testProducerWithPsetDescEmpty_cfi::i1, and alignCSCRings::s.

◆ makeShape() [5/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2 
)

Definition at line 19 of file ArrayShape.cc.

19  {
20  ArrayShape s;
21  s.reserve(3);
22  s.push_back(i0);
23  s.push_back(i1);
24  s.push_back(i2);
25  return s;
26  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, and alignCSCRings::s.

◆ makeShape() [6/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3 
)

Definition at line 28 of file ArrayShape.cc.

28  {
29  ArrayShape s;
30  s.reserve(4);
31  s.push_back(i0);
32  s.push_back(i1);
33  s.push_back(i2);
34  s.push_back(i3);
35  return s;
36  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [7/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4 
)

Definition at line 38 of file ArrayShape.cc.

38  {
39  ArrayShape s;
40  s.reserve(5);
41  s.push_back(i0);
42  s.push_back(i1);
43  s.push_back(i2);
44  s.push_back(i3);
45  s.push_back(i4);
46  return s;
47  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [8/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5 
)

Definition at line 49 of file ArrayShape.cc.

49  {
50  ArrayShape s;
51  s.reserve(6);
52  s.push_back(i0);
53  s.push_back(i1);
54  s.push_back(i2);
55  s.push_back(i3);
56  s.push_back(i4);
57  s.push_back(i5);
58  return s;
59  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [9/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6 
)

Definition at line 61 of file ArrayShape.cc.

61  {
62  ArrayShape s;
63  s.reserve(7);
64  s.push_back(i0);
65  s.push_back(i1);
66  s.push_back(i2);
67  s.push_back(i3);
68  s.push_back(i4);
69  s.push_back(i5);
70  s.push_back(i6);
71  return s;
72  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [10/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7 
)

Definition at line 74 of file ArrayShape.cc.

75  {
76  ArrayShape s;
77  s.reserve(8);
78  s.push_back(i0);
79  s.push_back(i1);
80  s.push_back(i2);
81  s.push_back(i3);
82  s.push_back(i4);
83  s.push_back(i5);
84  s.push_back(i6);
85  s.push_back(i7);
86  return s;
87  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [11/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8 
)

Definition at line 89 of file ArrayShape.cc.

97  {
98  ArrayShape s;
99  s.reserve(9);
100  s.push_back(i0);
101  s.push_back(i1);
102  s.push_back(i2);
103  s.push_back(i3);
104  s.push_back(i4);
105  s.push_back(i5);
106  s.push_back(i6);
107  s.push_back(i7);
108  s.push_back(i8);
109  return s;
110  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ makeShape() [12/12]

ArrayShape npstat::makeShape ( unsigned  i0,
unsigned  i1,
unsigned  i2,
unsigned  i3,
unsigned  i4,
unsigned  i5,
unsigned  i6,
unsigned  i7,
unsigned  i8,
unsigned  i9 
)

Definition at line 112 of file ArrayShape.cc.

121  {
122  ArrayShape s;
123  s.reserve(10);
124  s.push_back(i0);
125  s.push_back(i1);
126  s.push_back(i2);
127  s.push_back(i3);
128  s.push_back(i4);
129  s.push_back(i5);
130  s.push_back(i6);
131  s.push_back(i7);
132  s.push_back(i8);
133  s.push_back(i9);
134  return s;
135  }

References testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, testProducerWithPsetDescEmpty_cfi::i3, and alignCSCRings::s.

◆ rescanArray()

template<typename Num1 , unsigned Len1, unsigned Dim1, typename Num2 , unsigned Len2, unsigned Dim2>
void npstat::rescanArray ( const ArrayND< Num1, Len1, Dim1 > &  from,
ArrayND< Num2, Len2, Dim2 > *  to,
unsigned  interpolationDegree = 0 
)

A utility for filling one array using values of another. The array shapes do not have to be the same but the ranks have to be. Roughly, the arrays are treated as values of histogram bins inside the unit box. The array "to" is filled either with the closest bin value of the array "from" or with an interpolated value (if "interpolationDegree" parameter is not 0).

interpolationDegree parameter must be one of 0, 1, or 3.

Definition at line 103 of file rescanArray.h.

106  {
107  assert(to);
108  if (from.rank() != to->rank()) throw npstat::NpstatInvalidArgument(
109  "In npstat::rescanArray: incompatible dimensionalities "
110  "of input and output arrays");
111  if (!(interpolationDegree == 0U ||
112  interpolationDegree == 1U ||
113  interpolationDegree == 3U)) throw npstat::NpstatInvalidArgument(
114  "In npstat::rescanArray: unsupported interpolation degree");
115  to->functorFill(Private::ArrayMapper<Num1,Len1,Dim1,Num2,Len2,Dim2>(
116  from, *to, interpolationDegree));
117  }

References cms::cuda::assert(), npstat::ArrayND< Numeric, StackLen, StackDim >::rank(), and mitigatedMETSequence_cff::U.

◆ transposeBuffer() [1/2]

template<typename T1 , typename T2 >
void npstat::transposeBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  dim 
)
inline

Copy a buffer (with possible type conversion on the fly) transposing it in the process (treating as a square matrix)

Definition at line 52 of file allocators.h.

52  {
53  if (dim) {
54  assert(dest);
55  assert(source);
56  for (unsigned long i = 0; i < dim; ++i) {
57  for (unsigned long j = 0; j < dim; ++j)
58  dest[j * dim] = static_cast<T1>(*source++);
59  ++dest;
60  }
61  }
62  }

References cms::cuda::assert(), mps_fire::dest, mps_fire::i, dqmiolumiharvest::j, and source.

◆ transposeBuffer() [2/2]

template<typename T1 , typename T2 >
void npstat::transposeBuffer ( T1 *  dest,
const T2 *  source,
const unsigned long  M,
const unsigned long  N 
)
inline

Copy a buffer (with possible type conversion on the fly) transposing it in the process (treating as an M x N matrix)

Definition at line 69 of file allocators.h.

69  {
70  if (M && N) {
71  assert(dest);
72  assert(source);
73  for (unsigned long i = 0; i < M; ++i) {
74  for (unsigned long j = 0; j < N; ++j)
75  dest[j * M] = static_cast<T1>(*source++);
76  ++dest;
77  }
78  }
79  }

References cms::cuda::assert(), mps_fire::dest, mps_fire::i, dqmiolumiharvest::j, N, and source.

bTagCombinedSVVariables_cff.indices
indices
Definition: bTagCombinedSVVariables_cff.py:67
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i3
i3
Definition: testProducerWithPsetDescEmpty_cfi.py:47
mps_fire.i
i
Definition: mps_fire.py:428
mps_update.status
status
Definition: mps_update.py:69
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
to
cms::cuda::assert
assert(be >=bs)
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
npstat::ArrayND::rank
unsigned rank() const
Definition: ArrayND.h:242
npstat::isNonIncreasing
bool isNonIncreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:63
dqmdumpme.first
first
Definition: dqmdumpme.py:55
npstat::ArrayShape
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
npstat::Private::iHND_checkArgs
void iHND_checkArgs(const HistoND< Float, Axis > &histo, const unsigned xDim, const unsigned interpolationDegree)
Definition: interpolateHistoND.h:135
photonAnalyzer_cfi.xMin
xMin
Definition: photonAnalyzer_cfi.py:82
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mps_fire.end
end
Definition: mps_fire.py:242
source
static const std::string source
Definition: EdmProvDump.cc:47
N
#define N
Definition: blowfish.cc:9
npstat::isStrictlyIncreasing
bool isStrictlyIncreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:18
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
h
npstat::NpstatInvalidArgument
Definition: NpstatException.h:38
b
double b
Definition: hdecay.h:118
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
a
double a
Definition: hdecay.h:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
DeadROC_duringRun.f2
f2
Definition: DeadROC_duringRun.py:220
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
SiPixelPI::two
Definition: SiPixelPayloadInspectorHelper.h:39
npstat::isStrictlyDecreasing
bool isStrictlyDecreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:31
T
long double T
Definition: Basic3DVectorLD.h:48
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
relativeConstraints.value
value
Definition: relativeConstraints.py:53
npstat::isNonDecreasing
bool isNonDecreasing(Iter begin, Iter const end)
Definition: isMonotonous.h:50
genVertex_cff.x
x
Definition: genVertex_cff.py:12
ztail.d
d
Definition: ztail.py:151
mps_fire.result
result
Definition: mps_fire.py:311
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20
npstat::interpolate_linear
T interpolate_linear(const double x, const T &f0, const T &f1)
Definition: interpolate.h:23
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DeadROC_duringRun.f1
f1
Definition: DeadROC_duringRun.py:219
PVValHelper::dx
Definition: PVValidationHelpers.h:48
mps_fire.dest
dest
Definition: mps_fire.py:179