CMS 3D CMS Logo

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

#include <LinInterpolatedTableND.h>

Public Types

typedef Axis axis_type
 
typedef Numeric value_type
 

Public Member Functions

const std::vector< Axis > & axes () const
 
const Axis & axis (const unsigned i) const
 
gs::ClassId classId () const
 
unsigned dim () const
 
const std::string & functionLabel () const
 
void getCoords (unsigned long linearIndex, double *coords, unsigned coordsBufferSize) const
 
std::vector< std::pair< bool, bool > > interpolationType () const
 
template<class Functor1 , class Functor2 >
std::unique_ptr< LinInterpolatedTableND< Numeric, Axis > > invertRatioResponse (const unsigned axisNumber, const Axis &replacementAxis, const bool leftLinear, const bool rightLinear, Functor1 invg, Functor2 invh, const char *functionLabel) const
 
template<class Functor1 , class Functor2 >
std::unique_ptr< LinInterpolatedTableNDinvertRatioResponse (unsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, Functor1 invg, Functor2 invh, const char *functionLabel=nullptr) const
 
template<typename ConvertibleToUnsigned >
std::unique_ptr< LinInterpolatedTableND< Numeric, Axis > > invertWRTAxis (const ConvertibleToUnsigned axisNumC, const Axis &replacementAxis, const bool leftLinear, const bool rightLinear, const char *functionLabel) const
 
template<typename ConvertibleToUnsigned >
std::unique_ptr< LinInterpolatedTableNDinvertWRTAxis (ConvertibleToUnsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, const char *functionLabel=nullptr) const
 
bool isUniformlyBinned () const
 
bool isWithinLimits (const double *point, unsigned dim) const
 
bool leftInterpolationLinear (unsigned i) const
 
unsigned long length () const
 
 LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const Axis &vAxis, bool leftV, bool rightV, const char *functionLabel=nullptr)
 
 LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const char *functionLabel=nullptr)
 
 LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const char *functionLabel=nullptr)
 
 LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const char *functionLabel=nullptr)
 
 LinInterpolatedTableND (const Axis &xAxis, bool leftX, bool rightX, const char *functionLabel=nullptr)
 
template<class Num2 >
 LinInterpolatedTableND (const LinInterpolatedTableND< Num2, Axis > &)
 
 LinInterpolatedTableND (const std::vector< Axis > &axes, const std::vector< std::pair< bool, bool > > &extrapolationType, const char *functionLabel=nullptr)
 
bool operator!= (const LinInterpolatedTableND &r) const
 
Numeric operator() (const double &x0) const
 
Numeric operator() (const double &x0, const double &x1) const
 
Numeric operator() (const double &x0, const double &x1, const double &x2) const
 
Numeric operator() (const double &x0, const double &x1, const double &x2, const double &x3) const
 
Numeric operator() (const double &x0, const double &x1, const double &x2, const double &x3, const double &x4) const
 
Numeric operator() (const double *point, unsigned dim) const
 
bool operator== (const LinInterpolatedTableND &) const
 
bool rightInterpolationLinear (unsigned i) const
 
void setFunctionLabel (const char *newlabel)
 
ArrayND< Numeric > & table ()
 
const ArrayND< Numeric > & table () const
 
bool write (std::ostream &of) const
 

Static Public Member Functions

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

Private Member Functions

bool allConstInterpolated () const
 
 LinInterpolatedTableND ()=delete
 
 LinInterpolatedTableND (const ArrayND< Numeric > &data, const std::vector< Axis > &axes, const char *leftInterpolation, const char *rightInterpolation, const std::string &label)
 

Static Private Member Functions

template<class Functor1 >
static void invert1DResponse (const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, bool newLeftLinear, bool newRightLinear, Functor1 invg, const double *rawx, const double *rawf, double *workspace, ArrayND< Numeric > *toSlice)
 
template<class Functor1 >
static double solveForRatioArg (double xmin, double xmax, double rmin, double rmax, double fval, Functor1 invg)
 

Private Attributes

bool allConstInterpolated_
 
std::vector< Axis > axes_
 
ArrayND< Numeric > data_
 
unsigned dim_
 
std::string functionLabel_
 
char leftInterpolationLinear_ [CHAR_BIT *sizeof(unsigned long)]
 
char rightInterpolationLinear_ [CHAR_BIT *sizeof(unsigned long)]
 

Friends

template<typename Num2 , typename Axis2 >
class LinInterpolatedTableND
 

Detailed Description

template<class Numeric, class Axis = UniformAxis>
class npstat::LinInterpolatedTableND< Numeric, Axis >

Template for multilinear interpolation/extrapolation of values provided on a rectangular coordinate grid. "Numeric" is the type stored in the table. "Axis" should be one of GridAxis, UniformAxis, or DualAxis classes or a user-provided class with a similar set of methods.

Definition at line 31 of file LinInterpolatedTableND.h.

Member Typedef Documentation

◆ axis_type

template<class Numeric, class Axis = UniformAxis>
typedef Axis npstat::LinInterpolatedTableND< Numeric, Axis >::axis_type

Definition at line 37 of file LinInterpolatedTableND.h.

◆ value_type

template<class Numeric, class Axis = UniformAxis>
typedef Numeric npstat::LinInterpolatedTableND< Numeric, Axis >::value_type

Definition at line 36 of file LinInterpolatedTableND.h.

Constructor & Destructor Documentation

◆ LinInterpolatedTableND() [1/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const std::vector< Axis > &  axes,
const std::vector< std::pair< bool, bool > > &  extrapolationType,
const char *  functionLabel = nullptr 
)

Main constructor for arbitrary-dimensional interpolators.

"axes" are the axes of the rectangular coordinate grid.

In each pair provided by the "extrapolationType" argument, the first element of the pair specifies whether the extrapolation to negative infinity should be linear (if "true") or constant (if "false"). The second element of the pair specifies whether to extrapolate linearly to positive infinity.

"functionLabel" is an arbitrary string which can potentially be used by plotting programs and such.

Definition at line 528 of file LinInterpolatedTableND.h.

531  if (dim_ == 0 || dim_ >= CHAR_BIT * sizeof(unsigned long))
533  "In npstat::LinInterpolatedTableND constructor: requested "
534  "table dimensionality is not supported");
535  if (dim_ != interpolationType.size())
537  "In npstat::LinInterpolatedTableND constructor: "
538  "incompatible number of interpolation specifications");
539  for (unsigned i = 0; i < dim_; ++i) {
540  const std::pair<bool, bool>& pair(interpolationType[i]);
541  leftInterpolationLinear_[i] = pair.first;
542  rightInterpolationLinear_[i] = pair.second;
543  }
544 
546  }

References npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated(), npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated_, npstat::LinInterpolatedTableND< Numeric, Axis >::dim_, mps_fire::i, npstat::LinInterpolatedTableND< Numeric, Axis >::interpolationType(), npstat::LinInterpolatedTableND< Numeric, Axis >::leftInterpolationLinear_, and npstat::LinInterpolatedTableND< Numeric, Axis >::rightInterpolationLinear_.

◆ LinInterpolatedTableND() [2/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const char *  functionLabel = nullptr 
)

◆ LinInterpolatedTableND() [3/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const char *  functionLabel = nullptr 
)

◆ LinInterpolatedTableND() [4/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const char *  functionLabel = nullptr 
)

◆ LinInterpolatedTableND() [5/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const Axis &  tAxis,
bool  leftT,
bool  rightT,
const char *  functionLabel = nullptr 
)

◆ LinInterpolatedTableND() [6/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const Axis &  tAxis,
bool  leftT,
bool  rightT,
const Axis &  vAxis,
bool  leftV,
bool  rightV,
const char *  functionLabel = nullptr 
)

Convenience constructor for 5-d interpolators

Definition at line 577 of file LinInterpolatedTableND.h.

593  : data_(Private::makeTableShape(xAxis, yAxis, zAxis, tAxis, vAxis)),
594  functionLabel_(label ? label : ""),
595  dim_(5U) {
596  axes_.reserve(dim_);
597  axes_.push_back(xAxis);
598  axes_.push_back(yAxis);
599  axes_.push_back(zAxis);
600  axes_.push_back(tAxis);
601  axes_.push_back(vAxis);
602 
603  unsigned i = 0;
604  leftInterpolationLinear_[i] = leftX;
605  rightInterpolationLinear_[i++] = rightX;
606  leftInterpolationLinear_[i] = leftY;
607  rightInterpolationLinear_[i++] = rightY;
608  leftInterpolationLinear_[i] = leftZ;
609  rightInterpolationLinear_[i++] = rightZ;
610  leftInterpolationLinear_[i] = leftT;
611  rightInterpolationLinear_[i++] = rightT;
612  leftInterpolationLinear_[i] = leftV;
613  rightInterpolationLinear_[i++] = rightV;
614  assert(i == dim_);
615 
617  }

References npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated(), npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated_, cms::cuda::assert(), npstat::LinInterpolatedTableND< Numeric, Axis >::axes_, npstat::LinInterpolatedTableND< Numeric, Axis >::dim_, mps_fire::i, npstat::LinInterpolatedTableND< Numeric, Axis >::leftInterpolationLinear_, npstat::LinInterpolatedTableND< Numeric, Axis >::rightInterpolationLinear_, HLT_FULL_cff::xAxis, HLT_FULL_cff::yAxis, and HLT_FULL_cff::zAxis.

◆ LinInterpolatedTableND() [7/9]

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

Converting copy constructor from interpolator with another storage type

Definition at line 550 of file LinInterpolatedTableND.h.

551  : data_(r.data_),
552  axes_(r.axes_),
553  functionLabel_(r.functionLabel_),
554  dim_(r.dim_),
555  allConstInterpolated_(r.allConstInterpolated_) {
556  for (unsigned i = 0; i < dim_; ++i) {
557  leftInterpolationLinear_[i] = r.leftInterpolationLinear_[i];
558  rightInterpolationLinear_[i] = r.rightInterpolationLinear_[i];
559  }
560  }

References npstat::LinInterpolatedTableND< Numeric, Axis >::dim_, mps_fire::i, npstat::LinInterpolatedTableND< Numeric, Axis >::leftInterpolationLinear_, alignCSCRings::r, and npstat::LinInterpolatedTableND< Numeric, Axis >::rightInterpolationLinear_.

◆ LinInterpolatedTableND() [8/9]

template<class Numeric, class Axis = UniformAxis>
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( )
privatedelete

◆ LinInterpolatedTableND() [9/9]

template<typename Numeric , class Axis >
npstat::LinInterpolatedTableND< Numeric, Axis >::LinInterpolatedTableND ( const ArrayND< Numeric > &  data,
const std::vector< Axis > &  axes,
const char *  leftInterpolation,
const char *  rightInterpolation,
const std::string &  label 
)
private

Member Function Documentation

◆ allConstInterpolated()

template<class Numeric , class Axis >
bool npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated ( ) const
private

Definition at line 428 of file LinInterpolatedTableND.h.

428  {
429  for (unsigned i = 0; i < dim_; ++i)
431  return false;
432  return true;
433  }

References mps_fire::i.

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

◆ axes()

template<class Numeric, class Axis = UniformAxis>
const std::vector<Axis>& npstat::LinInterpolatedTableND< Numeric, Axis >::axes ( ) const
inline

Definition at line 139 of file LinInterpolatedTableND.h.

139 { return axes_; }

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

◆ axis()

template<class Numeric, class Axis = UniformAxis>
const Axis& npstat::LinInterpolatedTableND< Numeric, Axis >::axis ( const unsigned  i) const
inline

Definition at line 140 of file LinInterpolatedTableND.h.

140 { return axes_.at(i); }

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

◆ classId()

template<class Numeric, class Axis = UniformAxis>
gs::ClassId npstat::LinInterpolatedTableND< Numeric, Axis >::classId ( ) const
inline

Definition at line 224 of file LinInterpolatedTableND.h.

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

◆ classname()

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

Definition at line 449 of file LinInterpolatedTableND.h.

449  {
450  static const std::string myClass(gs::template_class_name<Numeric, Axis>("npstat::LinInterpolatedTableND"));
451  return myClass.c_str();
452  }

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ dim()

template<class Numeric, class Axis = UniformAxis>
unsigned npstat::LinInterpolatedTableND< Numeric, Axis >::dim ( ) const
inline

Examine interpolator contents

Definition at line 138 of file LinInterpolatedTableND.h.

138 { return dim_; }

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

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

◆ functionLabel()

template<class Numeric, class Axis = UniformAxis>
const std::string& npstat::LinInterpolatedTableND< Numeric, Axis >::functionLabel ( ) const
inline

◆ getCoords()

template<typename Numeric , class Axis >
void npstat::LinInterpolatedTableND< Numeric, Axis >::getCoords ( unsigned long  linearIndex,
double *  coords,
unsigned  coordsBufferSize 
) const

Convenience function for getting coordinates of the grid points

Definition at line 868 of file LinInterpolatedTableND.h.

870  {
871  if (coordsBufferSize < dim_)
873  "In LinInterpolatedTableND::getCoords: "
874  "insufficient buffer size");
875  assert(coords);
876  unsigned index[CHAR_BIT * sizeof(unsigned long)];
877  data_.convertLinearIndex(linearIndex, index, dim_);
878  for (unsigned i = 0; i < dim_; ++i)
879  coords[i] = axes_[i].coordinate(index[i]);
880  }

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

◆ interpolationType()

template<typename Numeric , class Axis >
std::vector< std::pair< bool, bool > > npstat::LinInterpolatedTableND< Numeric, Axis >::interpolationType ( ) const

Definition at line 519 of file LinInterpolatedTableND.h.

519  {
520  std::vector<std::pair<bool, bool> > vec;
521  vec.reserve(dim_);
522  for (unsigned i = 0; i < dim_; ++i)
523  vec.push_back(std::pair<bool, bool>(leftInterpolationLinear_[i], rightInterpolationLinear_[i]));
524  return vec;
525  }

References mps_fire::i.

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

◆ invert1DResponse()

template<typename Numeric , class Axis >
template<class Functor1 >
void npstat::LinInterpolatedTableND< Numeric, Axis >::invert1DResponse ( const ArrayND< Numeric > &  fromSlice,
const Axis &  fromAxis,
const Axis &  toAxis,
bool  newLeftLinear,
bool  newRightLinear,
Functor1  invg,
const double *  rawx,
const double *  rawf,
double *  workspace,
ArrayND< Numeric > *  toSlice 
)
staticprivate

Definition at line 1083 of file LinInterpolatedTableND.h.

1092  {
1093  assert(toSlice);
1094  assert(fromSlice.rank() == 1U);
1095  assert(toSlice->rank() == 1U);
1096 
1097  const Numeric zero = Numeric();
1098  const Numeric* fromData = fromSlice.data();
1099  const unsigned fromLen = fromSlice.length();
1100  assert(fromLen > 1U);
1101  assert(fromLen == fromAxis.nCoords());
1102  Numeric* toD = const_cast<Numeric*>(toSlice->data());
1103  const unsigned nAxisPoints = toAxis.nCoords();
1104  assert(toSlice->length() == nAxisPoints);
1105 
1106  for (unsigned i = 0; i < fromLen; ++i) {
1107  if (fromData[i] <= zero)
1109  "In LinInterpolatedTableND::invert1DResponse: "
1110  "non-positive response found. This ratio "
1111  "response table is not invertible.");
1112  workspace[i] = rawx[i] * fromData[i];
1113  }
1114 
1115  const double yfirst = workspace[0];
1116  const double ylast = workspace[fromLen - 1U];
1117 
1118  bool adjustZero = false;
1119  unsigned nBelow = 0;
1120  for (unsigned ipt = 0; ipt < nAxisPoints; ++ipt) {
1121  const double y = rawf[ipt];
1122  unsigned i0 = 0;
1123  bool solve = false;
1124  if (y == 0.0) {
1125  assert(ipt == 0U);
1126  if (newLeftLinear)
1127  adjustZero = true;
1128  } else if (y <= yfirst) {
1129  ++nBelow;
1130  solve = newLeftLinear;
1131  } else if (y >= ylast) {
1132  solve = newRightLinear;
1133  i0 = solve ? fromLen - 2 : fromLen - 1;
1134  } else {
1135  solve = true;
1136  i0 = static_cast<unsigned>(std::lower_bound(workspace, workspace + fromLen, y) - workspace) - 1U;
1137  }
1138  if (solve) {
1139  const double x = solveForRatioArg(
1140  fromAxis.coordinate(i0), fromAxis.coordinate(i0 + 1), fromData[i0], fromData[i0 + 1], y, invg);
1141  toD[ipt] = invg(x) / y;
1142  } else
1143  toD[ipt] = 1.0 / fromData[i0];
1144  }
1145  if (adjustZero && nBelow)
1146  toD[0] = toD[1];
1147  }

References cms::cuda::assert(), npstat::ArrayND< Numeric, StackLen, StackDim >::data(), mps_fire::i, npstat::ArrayND< Numeric, StackLen, StackDim >::length(), pfDeepBoostedJetPreprocessParams_cfi::lower_bound, npstat::ArrayND< Numeric, StackLen, StackDim >::rank(), mitigatedMETSequence_cff::U, and SiPixelPI::zero.

◆ invertRatioResponse() [1/2]

template<class Numeric, class Axis = UniformAxis>
template<class Functor1 , class Functor2 >
std::unique_ptr<LinInterpolatedTableND<Numeric, Axis> > npstat::LinInterpolatedTableND< Numeric, Axis >::invertRatioResponse ( const unsigned  axisNumber,
const Axis &  replacementAxis,
const bool  leftLinear,
const bool  rightLinear,
Functor1  invg,
Functor2  invh,
const char *  functionLabel 
) const

Definition at line 769 of file LinInterpolatedTableND.h.

776  {
777  if (axisNumber >= dim_)
779  "In npstat::LinInterpolatedTableND::invertRatioResponse: "
780  "axis number is out of range");
781 
782  // Generate the new set of axes
783  std::vector<Axis> newAxes(axes_);
784  newAxes[axisNumber] = replacementAxis;
785 
786  std::vector<std::pair<bool, bool> > iType(interpolationType());
787  iType[axisNumber] = std::pair<bool, bool>(leftLinear, rightLinear);
788 
789  // Transform the original axis to the raw x values
790  const Axis& oldAxis(axes_[axisNumber]);
791  std::vector<double> rawx;
792  const unsigned nCoords = oldAxis.nCoords();
793  rawx.reserve(nCoords);
794  for (unsigned i = 0; i < nCoords; ++i) {
795  const double x = invg(oldAxis.coordinate(i));
796  if (x < 0.0)
798  "In npstat::LinInterpolatedTableND::invertRatioResponse: "
799  "invalid original axis definition (negative transformed "
800  "coordinate)");
801  rawx.push_back(x);
802  }
803 
804  // Transform the new axis to the raw f(x) values
805  std::vector<double> rawf;
806  const unsigned nFuncs = replacementAxis.nCoords();
807  rawf.reserve(nFuncs);
808  for (unsigned i = 0; i < nFuncs; ++i) {
809  const double f = invh(replacementAxis.coordinate(i));
810  if (f < 0.0)
812  "In npstat::LinInterpolatedTableND::invertRatioResponse: "
813  "invalid new axis definition (negative transformed "
814  "coordinate)");
815  rawf.push_back(f);
816  }
817 
818  // Workspace needed for the inversion code
819  std::vector<double> workspace(nCoords);
820 
821  // Create the new table
822  CPP11_auto_ptr<LinInterpolatedTableND> pTable(new LinInterpolatedTableND(newAxes, iType, functionLabel));
823 
824  if (dim_ > 1U) {
825  // Prepare array slices
826  unsigned sliceIndex[CHAR_BIT * sizeof(unsigned long)];
827  unsigned fixedIndices[CHAR_BIT * sizeof(unsigned long)];
828  unsigned count = 0;
829  for (unsigned i = 0; i < dim_; ++i)
830  if (i != axisNumber) {
831  sliceIndex[count] = data_.span(i);
832  fixedIndices[count++] = i;
833  }
834  ArrayND<Numeric> parentSlice(data_, fixedIndices, count);
835  ArrayND<Numeric> dauSlice(pTable->data_, fixedIndices, count);
836 
837  // Cycle over the slices
838  for (ArrayNDScanner scan(sliceIndex, count); scan.isValid(); ++scan) {
839  scan.getIndex(sliceIndex, count);
840  data_.exportSlice(&parentSlice, fixedIndices, sliceIndex, count);
841  invert1DResponse(parentSlice,
842  oldAxis,
843  replacementAxis,
844  leftLinear,
845  rightLinear,
846  invg,
847  &rawx[0],
848  &rawf[0],
849  &workspace[0],
850  &dauSlice);
851  pTable->data_.importSlice(dauSlice, fixedIndices, sliceIndex, count);
852  }
853  } else
855  oldAxis,
856  replacementAxis,
857  leftLinear,
858  rightLinear,
859  invg,
860  &rawx[0],
861  &rawf[0],
862  &workspace[0],
863  &pTable->data_);
864  return pTable;
865  }

References submitPVResolutionJobs::count, f, mps_fire::i, npstat::ArrayNDScanner::isValid(), and mitigatedMETSequence_cff::U.

◆ invertRatioResponse() [2/2]

template<class Numeric, class Axis = UniformAxis>
template<class Functor1 , class Functor2 >
std::unique_ptr<LinInterpolatedTableND> npstat::LinInterpolatedTableND< Numeric, Axis >::invertRatioResponse ( unsigned  axisNumber,
const Axis &  replacementAxis,
bool  newAxisLeftLinear,
bool  newAxisRightLinear,
Functor1  invg,
Functor2  invh,
const char *  functionLabel = nullptr 
) const

This method inverts the ratio response. That is, we assume that the table encodes r(x) for some function f(x) = x*r(x). We also assume that the original axis does not represent x directly – instead, axis coordinates are given by g(x) (in practice, g is often the natural log). We will also assume that the new axis is not going to represent f(x) directly – it will be h(f(x)) instead. The functors "invg" and "invh" below must do the inverse: taking the axes coordinates to the actual values of x and f(x). Both "invg" and "invh" must be monotonously increasing functions. The code assumes that x*r(x) -> 0 when x->0 (that is, r(x) is bounded at 0) and it also assumes (but does not check explicitly) that x*r(x) is monotonously increasing with x.

The returned interpolation table encodes the values of x/f(x). Of course, they are just 1/r(x), but the trick is to be able to look them up quickly as a function of h(f(x)). Naturally, this whole operation is meaningful only in case "Numeric" type is either float or double.

◆ invertWRTAxis() [1/2]

template<class Numeric, class Axis = UniformAxis>
template<typename ConvertibleToUnsigned >
std::unique_ptr<LinInterpolatedTableND<Numeric, Axis> > npstat::LinInterpolatedTableND< Numeric, Axis >::invertWRTAxis ( const ConvertibleToUnsigned  axisNumC,
const Axis &  replacementAxis,
const bool  leftLinear,
const bool  rightLinear,
const char *  functionLabel 
) const

Definition at line 718 of file LinInterpolatedTableND.h.

723  {
724  const unsigned axisNumber = static_cast<unsigned>(axisNumC);
725 
726  if (axisNumber >= dim_)
728  "In npstat::LinInterpolatedTableND::invertAxis: "
729  "axis number is out of range");
730 
731  // Generate the new set of axes
732  std::vector<Axis> newAxes(axes_);
733  newAxes[axisNumber] = replacementAxis;
734 
735  std::vector<std::pair<bool, bool> > iType(interpolationType());
736  iType[axisNumber] = std::pair<bool, bool>(leftLinear, rightLinear);
737 
738  // Create the new table
739  CPP11_auto_ptr<LinInterpolatedTableND> pTable(new LinInterpolatedTableND(newAxes, iType, functionLabel));
740 
741  if (dim_ > 1U) {
742  // Prepare array slices
743  unsigned sliceIndex[CHAR_BIT * sizeof(unsigned long)];
744  unsigned fixedIndices[CHAR_BIT * sizeof(unsigned long)];
745  unsigned count = 0;
746  for (unsigned i = 0; i < dim_; ++i)
747  if (i != axisNumber) {
748  sliceIndex[count] = data_.span(i);
749  fixedIndices[count++] = i;
750  }
751  ArrayND<Numeric> parentSlice(data_, fixedIndices, count);
752  ArrayND<Numeric> dauSlice(pTable->data_, fixedIndices, count);
753 
754  // Cycle over the slices
755  for (ArrayNDScanner scan(sliceIndex, count); scan.isValid(); ++scan) {
756  scan.getIndex(sliceIndex, count);
757  data_.exportSlice(&parentSlice, fixedIndices, sliceIndex, count);
759  parentSlice, axes_[axisNumber], replacementAxis, leftLinear, rightLinear, &dauSlice);
760  pTable->data_.importSlice(dauSlice, fixedIndices, sliceIndex, count);
761  }
762  } else
763  Private::lind_invert1DSlice(data_, axes_[0], replacementAxis, leftLinear, rightLinear, &pTable->data_);
764  return pTable;
765  }

References submitPVResolutionJobs::count, mps_fire::i, npstat::ArrayNDScanner::isValid(), npstat::Private::lind_invert1DSlice(), and mitigatedMETSequence_cff::U.

◆ invertWRTAxis() [2/2]

template<class Numeric, class Axis = UniformAxis>
template<typename ConvertibleToUnsigned >
std::unique_ptr<LinInterpolatedTableND> npstat::LinInterpolatedTableND< Numeric, Axis >::invertWRTAxis ( ConvertibleToUnsigned  axisNumber,
const Axis &  replacementAxis,
bool  newAxisLeftLinear,
bool  newAxisRightLinear,
const char *  functionLabel = nullptr 
) const

Invert the function w.r.t. the variable represented by one of the axes. The function values must change monotonously along the chosen axis. Note that this operation is meaningful only in case "Numeric" type is either float or double.

◆ isUniformlyBinned()

template<typename Numeric , class Axis >
bool npstat::LinInterpolatedTableND< Numeric, Axis >::isUniformlyBinned ( ) const

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

Definition at line 511 of file LinInterpolatedTableND.h.

511  {
512  for (unsigned i = 0; i < dim_; ++i)
513  if (!axes_[i].isUniform())
514  return false;
515  return true;
516  }

References mps_fire::i.

◆ isWithinLimits()

template<typename Numeric , class Axis >
bool npstat::LinInterpolatedTableND< Numeric, Axis >::isWithinLimits ( const double *  point,
unsigned  dim 
) const

This method will return "true" if the point is inside the grid limits or on the boundary

Definition at line 883 of file LinInterpolatedTableND.h.

883  {
884  if (len != dim_)
886  "In npstat::LinInterpolatedTableND::isWithinLimits: "
887  "incompatible point dimensionality");
888  assert(point);
889 
890  for (unsigned i = 0; i < dim_; ++i)
891  if (point[i] < axes_[i].min() || point[i] > axes_[i].max())
892  return false;
893  return true;
894  }

References cms::cuda::assert(), mps_fire::i, SiStripPI::max, min(), and point.

◆ leftInterpolationLinear()

template<typename Numeric , class Axis >
bool npstat::LinInterpolatedTableND< Numeric, Axis >::leftInterpolationLinear ( unsigned  i) const

Definition at line 493 of file LinInterpolatedTableND.h.

493  {
494  if (i >= dim_)
496  "In npstat::LinInterpolatedTableND::leftInterpolationLinear: "
497  "index out of range");
498  return leftInterpolationLinear_[i];
499  }

References mps_fire::i.

◆ length()

template<class Numeric, class Axis = UniformAxis>
unsigned long npstat::LinInterpolatedTableND< Numeric, Axis >::length ( ) const
inline

◆ operator!=()

template<class Numeric, class Axis = UniformAxis>
bool npstat::LinInterpolatedTableND< Numeric, Axis >::operator!= ( const LinInterpolatedTableND< Numeric, Axis > &  r) const
inline

Logical negation of operator==

Definition at line 220 of file LinInterpolatedTableND.h.

220 { return !(*this == r); }

References alignCSCRings::r.

◆ operator()() [1/6]

template<typename Numeric , class Axis >
Numeric npstat::LinInterpolatedTableND< Numeric, Axis >::operator() ( const double &  x0) const

Convenience function for low-dimensional interpolators

Definition at line 959 of file LinInterpolatedTableND.h.

959  {
960  const unsigned nArgs = 1U;
961  if (dim_ != nArgs)
963  "In npstat::LinInterpolatedTableND::operator(): number of "
964  "arguments, 1, is incompatible with the interpolator dimensionality");
965  double tmp[nArgs];
966  tmp[0] = x0;
967  return operator()(tmp, nArgs);
968  }

References createJobs::tmp, and mitigatedMETSequence_cff::U.

◆ operator()() [2/6]

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

Definition at line 971 of file LinInterpolatedTableND.h.

971  {
972  const unsigned nArgs = 2U;
973  if (dim_ != nArgs)
975  "In npstat::LinInterpolatedTableND::operator(): number of "
976  "arguments, 2, is incompatible with the interpolator dimensionality");
977  double tmp[nArgs];
978  tmp[0] = x0;
979  tmp[1] = x1;
980  return operator()(tmp, nArgs);
981  }

References createJobs::tmp, mitigatedMETSequence_cff::U, and testProducerWithPsetDescEmpty_cfi::x1.

◆ operator()() [3/6]

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

Definition at line 984 of file LinInterpolatedTableND.h.

986  {
987  const unsigned nArgs = 3U;
988  if (dim_ != nArgs)
990  "In npstat::LinInterpolatedTableND::operator(): number of "
991  "arguments, 3, is incompatible with the interpolator dimensionality");
992  double tmp[nArgs];
993  tmp[0] = x0;
994  tmp[1] = x1;
995  tmp[2] = x2;
996  return operator()(tmp, nArgs);
997  }

References createJobs::tmp, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ operator()() [4/6]

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

Definition at line 1000 of file LinInterpolatedTableND.h.

1003  {
1004  const unsigned nArgs = 4U;
1005  if (dim_ != nArgs)
1007  "In npstat::LinInterpolatedTableND::operator(): number of "
1008  "arguments, 4, is incompatible with the interpolator dimensionality");
1009  double tmp[nArgs];
1010  tmp[0] = x0;
1011  tmp[1] = x1;
1012  tmp[2] = x2;
1013  tmp[3] = x3;
1014  return operator()(tmp, nArgs);
1015  }

References createJobs::tmp, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ operator()() [5/6]

template<typename Numeric , class Axis >
Numeric npstat::LinInterpolatedTableND< Numeric, Axis >::operator() ( const double &  x0,
const double &  x1,
const double &  x2,
const double &  x3,
const double &  x4 
) const

Definition at line 1018 of file LinInterpolatedTableND.h.

1019  {
1020  const unsigned nArgs = 5U;
1021  if (dim_ != nArgs)
1023  "In npstat::LinInterpolatedTableND::operator(): number of "
1024  "arguments, 5, is incompatible with the interpolator dimensionality");
1025  double tmp[nArgs];
1026  tmp[0] = x0;
1027  tmp[1] = x1;
1028  tmp[2] = x2;
1029  tmp[3] = x3;
1030  tmp[4] = x4;
1031  return operator()(tmp, nArgs);
1032  }

References createJobs::tmp, mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, and testProducerWithPsetDescEmpty_cfi::x2.

◆ operator()() [6/6]

template<typename Numeric , class Axis >
Numeric npstat::LinInterpolatedTableND< Numeric, Axis >::operator() ( const double *  point,
unsigned  dim 
) const

Basic interpolation result. Argument point dimensionality must be compatible with the interpolator dimensionality.

Definition at line 897 of file LinInterpolatedTableND.h.

897  {
898  typedef typename ProperDblFromCmpl<Numeric>::type proper_double;
899 
900  if (len != dim_)
902  "In npstat::LinInterpolatedTableND::operator(): "
903  "incompatible point dimensionality");
904  assert(point);
905 
906  bool interpolateArray = true;
908  for (unsigned i = 0; i < dim_; ++i)
909  if ((leftInterpolationLinear_[i] && point[i] < axes_[i].min()) ||
910  (rightInterpolationLinear_[i] && point[i] > axes_[i].max())) {
911  interpolateArray = false;
912  break;
913  }
914 
915  if (interpolateArray) {
916  // Translate coordinates into the array system and
917  // simply use the ArrayND interpolation facilities
918  double buf[CHAR_BIT * sizeof(unsigned long)];
919  for (unsigned i = 0; i < dim_; ++i) {
920  const std::pair<unsigned, double>& pair = axes_[i].getInterval(point[i]);
921  buf[i] = pair.first + 1U - pair.second;
922  }
923  return data_.interpolate1(buf, dim_);
924  } else {
925  unsigned ix[CHAR_BIT * sizeof(unsigned long)];
926  double weight[CHAR_BIT * sizeof(unsigned long)];
927  for (unsigned i = 0; i < dim_; ++i) {
928  const bool linear = (leftInterpolationLinear_[i] && point[i] < axes_[i].min()) ||
930  const std::pair<unsigned, double>& pair =
931  linear ? axes_[i].linearInterval(point[i]) : axes_[i].getInterval(point[i]);
932  ix[i] = pair.first;
933  weight[i] = pair.second;
934  }
935 
936  Numeric sum = Numeric();
937  const unsigned long maxcycle = 1UL << dim_;
938  const unsigned long* strides = data_.strides();
939  const Numeric* dat = data_.data();
940  for (unsigned long icycle = 0UL; icycle < maxcycle; ++icycle) {
941  double w = 1.0;
942  unsigned long icell = 0UL;
943  for (unsigned i = 0; i < dim_; ++i) {
944  if (icycle & (1UL << i)) {
945  w *= (1.0 - weight[i]);
946  icell += strides[i] * (ix[i] + 1U);
947  } else {
948  w *= weight[i];
949  icell += strides[i] * ix[i];
950  }
951  }
952  sum += dat[icell] * static_cast<proper_double>(w);
953  }
954  return sum;
955  }
956  }

References cms::cuda::assert(), visDQMUpload::buf, mps_fire::i, linear(), SiStripPI::max, min(), point, mitigatedMETSequence_cff::U, and w.

◆ operator==()

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

Comparison for equality

Definition at line 436 of file LinInterpolatedTableND.h.

436  {
437  if (dim_ != r.dim_)
438  return false;
439  for (unsigned i = 0; i < dim_; ++i) {
440  if (leftInterpolationLinear_[i] != r.leftInterpolationLinear_[i])
441  return false;
442  if (rightInterpolationLinear_[i] != r.rightInterpolationLinear_[i])
443  return false;
444  }
445  return data_ == r.data_ && axes_ == r.axes_ && functionLabel_ == r.functionLabel_;
446  }

References mps_fire::i, and alignCSCRings::r.

◆ read()

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

Definition at line 466 of file LinInterpolatedTableND.h.

467  {
468  static const gs::ClassId current(gs::ClassId::makeId<LinInterpolatedTableND<Numeric, Axis> >());
469  current.ensureSameId(id);
470 
471  gs::ClassId ida(in, 1);
472  ArrayND<Numeric> data;
474  std::vector<Axis> axes;
475  gs::read_heap_obj_vector_as_placed(in, &axes);
476  const unsigned dim = axes.size();
477  if (dim > CHAR_BIT * sizeof(unsigned long) || data.rank() != dim)
478  throw gs::IOInvalidData(
479  "In npstat::LinInterpolatedTableND::read: "
480  "read back invalid dimensionality");
481  char leftInterpolation[CHAR_BIT * sizeof(unsigned long)];
482  gs::read_pod_array(in, leftInterpolation, dim);
483  char rightInterpolation[CHAR_BIT * sizeof(unsigned long)];
484  gs::read_pod_array(in, rightInterpolation, dim);
486  gs::read_pod(in, &label);
487  if (in.fail())
488  throw gs::IOReadFailure("In npstat::LinInterpolatedTableND::read: input stream failure");
489  return new LinInterpolatedTableND(data, axes, leftInterpolation, rightInterpolation, label);
490  }

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

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

◆ rightInterpolationLinear()

template<typename Numeric , class Axis >
bool npstat::LinInterpolatedTableND< Numeric, Axis >::rightInterpolationLinear ( unsigned  i) const

Definition at line 502 of file LinInterpolatedTableND.h.

502  {
503  if (i >= dim_)
505  "In npstat::LinInterpolatedTableND::rightInterpolationLinear: "
506  "index out of range");
508  }

References mps_fire::i.

◆ setFunctionLabel()

template<class Numeric, class Axis = UniformAxis>
void npstat::LinInterpolatedTableND< Numeric, Axis >::setFunctionLabel ( const char *  newlabel)
inline

Modifier for the function label

Definition at line 170 of file LinInterpolatedTableND.h.

170 { functionLabel_ = newlabel ? newlabel : ""; }

References npstat::LinInterpolatedTableND< Numeric, Axis >::functionLabel_.

◆ solveForRatioArg()

template<typename Numeric , class Axis >
template<class Functor1 >
double npstat::LinInterpolatedTableND< Numeric, Axis >::solveForRatioArg ( double  xmin,
double  xmax,
double  rmin,
double  rmax,
double  fval,
Functor1  invg 
)
staticprivate

Definition at line 1036 of file LinInterpolatedTableND.h.

1037  {
1038  // Find two values of x so that f(x0) <= fval <= f(x1)
1039  double x0 = xmin;
1040  double x1 = xmax;
1041  double fmin = invg(xmin) * rmin;
1042  double fmax = invg(xmax) * rmax;
1043  const double step = xmax - xmin;
1044  assert(fmin < fmax);
1045  assert(step > 0.0);
1046 
1047  unsigned stepcount = 0;
1048  const unsigned maxSteps = 1000U;
1049  for (double stepfactor = 1.0; (fval < fmin || fval > fmax) && stepcount < maxSteps; stepfactor *= 2.0, ++stepcount)
1050  if (fval < fmin) {
1051  x1 = x0;
1052  fmax = fmin;
1053  x0 -= stepfactor * step;
1054  fmin = invg(x0) * Private::lind_interpolateSimple(xmin, xmax, rmin, rmax, x0);
1055  } else {
1056  x0 = x1;
1057  fmin = fmax;
1058  x1 += stepfactor * step;
1059  fmax = invg(x1) * Private::lind_interpolateSimple(xmin, xmax, rmin, rmax, x1);
1060  }
1061  if (stepcount == maxSteps)
1063  "In LinInterpolatedTableND::solveForRatioArg: "
1064  "faled to bracket the root");
1065 
1066  assert(x1 >= x0);
1067  while ((x1 - x0) / (std::abs(x1) + std::abs(x0) + DBL_EPSILON) > 4.0 * DBL_EPSILON) {
1068  const double xhalf = (x1 + x0) / 2.0;
1069  const double fhalf = invg(xhalf) * Private::lind_interpolateSimple(xmin, xmax, rmin, rmax, xhalf);
1070  if (fval < fhalf) {
1071  x1 = xhalf;
1072  fmax = fhalf;
1073  } else {
1074  x0 = xhalf;
1075  fmin = fhalf;
1076  }
1077  }
1078  return (x1 + x0) / 2.0;
1079  }

References funct::abs(), cms::cuda::assert(), npstat::Private::lind_interpolateSimple(), mitigatedMETSequence_cff::U, testProducerWithPsetDescEmpty_cfi::x1, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

◆ table() [1/2]

template<class Numeric, class Axis = UniformAxis>
ArrayND<Numeric>& npstat::LinInterpolatedTableND< Numeric, Axis >::table ( )
inline

Definition at line 151 of file LinInterpolatedTableND.h.

151 { return data_; }

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

◆ table() [2/2]

template<class Numeric, class Axis = UniformAxis>
const ArrayND<Numeric>& npstat::LinInterpolatedTableND< Numeric, Axis >::table ( ) const
inline

Access the interpolator table data

Definition at line 150 of file LinInterpolatedTableND.h.

150 { return data_; }

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

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

◆ version()

template<class Numeric, class Axis = UniformAxis>
static unsigned npstat::LinInterpolatedTableND< Numeric, Axis >::version ( )
inlinestatic

Definition at line 229 of file LinInterpolatedTableND.h.

229 { return 1; }

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

◆ write()

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

Definition at line 455 of file LinInterpolatedTableND.h.

455  {
456  const bool status = data_.classId().write(of) && data_.write(of) && gs::write_obj_vector(of, axes_);
457  if (status) {
458  gs::write_pod_array(of, leftInterpolationLinear_, dim_);
459  gs::write_pod_array(of, rightInterpolationLinear_, dim_);
460  gs::write_pod(of, functionLabel_);
461  }
462  return status && !of.fail();
463  }

References mps_update::status.

Friends And Related Function Documentation

◆ LinInterpolatedTableND

template<class Numeric, class Axis = UniformAxis>
template<typename Num2 , typename Axis2 >
friend class LinInterpolatedTableND
friend

Definition at line 33 of file LinInterpolatedTableND.h.

Member Data Documentation

◆ allConstInterpolated_

template<class Numeric, class Axis = UniformAxis>
bool npstat::LinInterpolatedTableND< Numeric, Axis >::allConstInterpolated_
private

◆ axes_

template<class Numeric, class Axis = UniformAxis>
std::vector<Axis> npstat::LinInterpolatedTableND< Numeric, Axis >::axes_
private

◆ data_

template<class Numeric, class Axis = UniformAxis>
ArrayND<Numeric> npstat::LinInterpolatedTableND< Numeric, Axis >::data_
private

◆ dim_

template<class Numeric, class Axis = UniformAxis>
unsigned npstat::LinInterpolatedTableND< Numeric, Axis >::dim_
private

◆ functionLabel_

template<class Numeric, class Axis = UniformAxis>
std::string npstat::LinInterpolatedTableND< Numeric, Axis >::functionLabel_
private

◆ leftInterpolationLinear_

template<class Numeric, class Axis = UniformAxis>
char npstat::LinInterpolatedTableND< Numeric, Axis >::leftInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
private

◆ rightInterpolationLinear_

template<class Numeric, class Axis = UniformAxis>
char npstat::LinInterpolatedTableND< Numeric, Axis >::rightInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
private
DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
npstat::LinInterpolatedTableND::axes
const std::vector< Axis > & axes() const
Definition: LinInterpolatedTableND.h:139
npstat::ArrayND::write
bool write(std::ostream &of) const
Definition: ArrayND.h:5378
npstat::ArrayND::restore
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:5386
step
step
Definition: StallMonitor.cc:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
npstat::LinInterpolatedTableND::axes_
std::vector< Axis > axes_
Definition: LinInterpolatedTableND.h:244
mps_update.status
status
Definition: mps_update.py:69
min
T min(T a, T b)
Definition: MathUtil.h:58
npstat::LinInterpolatedTableND::functionLabel
const std::string & functionLabel() const
Definition: LinInterpolatedTableND.h:145
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
npstat::LinInterpolatedTableND::allConstInterpolated
bool allConstInterpolated() const
Definition: LinInterpolatedTableND.h:428
cms::cuda::assert
assert(be >=bs)
DDAxes::x
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
npstat::ArrayND::rank
unsigned rank() const
Definition: ArrayND.h:242
npstat::LinInterpolatedTableND::invert1DResponse
static void invert1DResponse(const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, bool newLeftLinear, bool newRightLinear, Functor1 invg, const double *rawx, const double *rawf, double *workspace, ArrayND< Numeric > *toSlice)
Definition: LinInterpolatedTableND.h:1083
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
npstat::LinInterpolatedTableND::allConstInterpolated_
bool allConstInterpolated_
Definition: LinInterpolatedTableND.h:249
npstat::ArrayND::data_
Numeric * data_
Definition: ArrayND.h:1049
npstat::LinInterpolatedTableND::data_
ArrayND< Numeric > data_
Definition: LinInterpolatedTableND.h:243
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
npstat::NpstatRuntimeError
Definition: NpstatException.h:46
npstat::LinInterpolatedTableND::solveForRatioArg
static double solveForRatioArg(double xmin, double xmax, double rmin, double rmax, double fval, Functor1 invg)
Definition: LinInterpolatedTableND.h:1036
npstat::ArrayND::data
const Numeric * data() const
Definition: ArrayND.h:236
w
const double w
Definition: UKUtility.cc:23
npstat::ArrayND::length
unsigned long length() const
Definition: ArrayND.h:233
HLT_FULL_cff.zAxis
zAxis
Definition: HLT_FULL_cff.py:46151
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
npstat::LinInterpolatedTableND::dim_
unsigned dim_
Definition: LinInterpolatedTableND.h:248
npstat::NpstatInvalidArgument
Definition: NpstatException.h:38
npstat::Private::lind_invert1DSlice
void lind_invert1DSlice(const ArrayND< Numeric > &fromSlice, const Axis &fromAxis, const Axis &toAxis, const bool leftLinear, const bool rightLinear, ArrayND< Numeric > *toSlice)
Definition: LinInterpolatedTableND.h:348
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
npstat::ArrayND::exportSlice
void exportSlice(ArrayND< Num2, Len2, Dim2 > *slice, const unsigned *fixedIndices, const unsigned *fixedIndexValues, unsigned nFixedIndices) const
Definition: ArrayND.h:696
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
npstat::ArrayND::classId
gs::ClassId classId() const
Definition: ArrayND.h:1039
HLT_FULL_cff.yAxis
yAxis
Definition: HLT_FULL_cff.py:46152
recoMuon::in
Definition: RecoMuonEnumerators.h:6
npstat::LinInterpolatedTableND::dim
unsigned dim() const
Definition: LinInterpolatedTableND.h:138
npstat::ArrayND::span
unsigned span(unsigned dim) const
Definition: ArrayND.h:5088
npstat::ArrayND::interpolate1
Numeric interpolate1(const double *x, unsigned xDim) const
Definition: ArrayND.h:4211
npstat::ProperDblFromCmpl::type
double type
Definition: ProperDblFromCmpl.h:20
npstat::ArrayND::convertLinearIndex
void convertLinearIndex(unsigned long l, unsigned *index, unsigned indexLen) const
Definition: ArrayND.h:3048
npstat::ArrayND::strides
const unsigned long * strides() const
Definition: ArrayND.h:263
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
npstat::NpstatDomainError
Definition: NpstatException.h:54
alignCSCRings.r
r
Definition: alignCSCRings.py:93
npstat::Private::makeTableShape
ArrayShape makeTableShape(const std::vector< Axis > &axes)
Definition: LinInterpolatedTableND.h:282
linear
float linear(float x)
Definition: OccupancyPlotMacros.cc:26
npstat::NpstatOutOfRange
Definition: NpstatException.h:30
npstat::LinInterpolatedTableND::rightInterpolationLinear_
char rightInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
Definition: LinInterpolatedTableND.h:247
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
npstat::Private::lind_interpolateSimple
double lind_interpolateSimple(const double x0, const double x1, const double y0, const double y1, const double x)
Definition: LinInterpolatedTableND.h:342
AlignmentPI::coordinate
coordinate
Definition: AlignmentPayloadInspectorHelper.h:33
npstat::LinInterpolatedTableND::functionLabel_
std::string functionLabel_
Definition: LinInterpolatedTableND.h:245
HLT_FULL_cff.xAxis
xAxis
Definition: HLT_FULL_cff.py:46150
npstat::LinInterpolatedTableND::interpolationType
std::vector< std::pair< bool, bool > > interpolationType() const
Definition: LinInterpolatedTableND.h:519
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
npstat::LinInterpolatedTableND::operator()
Numeric operator()(const double *point, unsigned dim) const
Definition: LinInterpolatedTableND.h:897
npstat::LinInterpolatedTableND::LinInterpolatedTableND
LinInterpolatedTableND()=delete
npstat::LinInterpolatedTableND::leftInterpolationLinear_
char leftInterpolationLinear_[CHAR_BIT *sizeof(unsigned long)]
Definition: LinInterpolatedTableND.h:246
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
label
const char * label
Definition: PFTauDecayModeTools.cc:11
weight
Definition: weight.py:1