CMS 3D CMS Logo

LinInterpolatedTableND.h
Go to the documentation of this file.
1 #ifndef NPSTAT_LININTERPOLATEDTABLEND_HH_
2 #define NPSTAT_LININTERPOLATEDTABLEND_HH_
3 
14 #include <climits>
15 #include <vector>
16 #include <utility>
17 
18 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
19 
22 
23 namespace npstat {
30  template <class Numeric, class Axis = UniformAxis>
32  template <typename Num2, typename Axis2>
33  friend class LinInterpolatedTableND;
34 
35  public:
36  typedef Numeric value_type;
37  typedef Axis axis_type;
38 
53  LinInterpolatedTableND(const std::vector<Axis>& axes,
54  const std::vector<std::pair<bool, bool> >& extrapolationType,
55  const char* functionLabel = nullptr);
56 
58  LinInterpolatedTableND(const Axis& xAxis, bool leftX, bool rightX, const char* functionLabel = nullptr);
59 
61  LinInterpolatedTableND(const Axis& xAxis,
62  bool leftX,
63  bool rightX,
64  const Axis& yAxis,
65  bool leftY,
66  bool rightY,
67  const char* functionLabel = nullptr);
68 
70  LinInterpolatedTableND(const Axis& xAxis,
71  bool leftX,
72  bool rightX,
73  const Axis& yAxis,
74  bool leftY,
75  bool rightY,
76  const Axis& zAxis,
77  bool leftZ,
78  bool rightZ,
79  const char* functionLabel = nullptr);
80 
82  LinInterpolatedTableND(const Axis& xAxis,
83  bool leftX,
84  bool rightX,
85  const Axis& yAxis,
86  bool leftY,
87  bool rightY,
88  const Axis& zAxis,
89  bool leftZ,
90  bool rightZ,
91  const Axis& tAxis,
92  bool leftT,
93  bool rightT,
94  const char* functionLabel = nullptr);
95 
97  LinInterpolatedTableND(const Axis& xAxis,
98  bool leftX,
99  bool rightX,
100  const Axis& yAxis,
101  bool leftY,
102  bool rightY,
103  const Axis& zAxis,
104  bool leftZ,
105  bool rightZ,
106  const Axis& tAxis,
107  bool leftT,
108  bool rightT,
109  const Axis& vAxis,
110  bool leftV,
111  bool rightV,
112  const char* functionLabel = nullptr);
113 
118  template <class Num2>
120 
125  Numeric operator()(const double* point, unsigned dim) const;
126 
128 
129  Numeric operator()(const double& x0) const;
130  Numeric operator()(const double& x0, const double& x1) const;
131  Numeric operator()(const double& x0, const double& x1, const double& x2) const;
132  Numeric operator()(const double& x0, const double& x1, const double& x2, const double& x3) const;
133  Numeric operator()(const double& x0, const double& x1, const double& x2, const double& x3, const double& x4) const;
135 
137 
138  inline unsigned dim() const { return dim_; }
139  inline const std::vector<Axis>& axes() const { return axes_; }
140  inline const Axis& axis(const unsigned i) const { return axes_.at(i); }
141  inline unsigned long length() const { return data_.length(); }
142  bool leftInterpolationLinear(unsigned i) const;
143  bool rightInterpolationLinear(unsigned i) const;
144  std::vector<std::pair<bool, bool> > interpolationType() const;
145  inline const std::string& functionLabel() const { return functionLabel_; }
147 
149 
150  inline const ArrayND<Numeric>& table() const { return data_; }
151  inline ArrayND<Numeric>& table() { return data_; }
153 
155  void getCoords(unsigned long linearIndex, double* coords, unsigned coordsBufferSize) const;
156 
161  bool isUniformlyBinned() const;
162 
167  bool isWithinLimits(const double* point, unsigned dim) const;
168 
170  inline void setFunctionLabel(const char* newlabel) { functionLabel_ = newlabel ? newlabel : ""; }
171 
178  template <typename ConvertibleToUnsigned>
179  CPP11_auto_ptr<LinInterpolatedTableND> invertWRTAxis(ConvertibleToUnsigned axisNumber,
180  const Axis& replacementAxis,
181  bool newAxisLeftLinear,
182  bool newAxisRightLinear,
183  const char* functionLabel = nullptr) const;
184 
207  template <class Functor1, class Functor2>
208  CPP11_auto_ptr<LinInterpolatedTableND> invertRatioResponse(unsigned axisNumber,
209  const Axis& replacementAxis,
210  bool newAxisLeftLinear,
211  bool newAxisRightLinear,
212  Functor1 invg,
213  Functor2 invh,
214  const char* functionLabel = nullptr) const;
215 
217  bool operator==(const LinInterpolatedTableND&) const;
218 
220  inline bool operator!=(const LinInterpolatedTableND& r) const { return !(*this == r); }
221 
223  // Method related to "geners" I/O
224  inline gs::ClassId classId() const { return gs::ClassId(*this); }
225  bool write(std::ostream& of) const;
227 
228  static const char* classname();
229  static inline unsigned version() { return 1; }
230  static LinInterpolatedTableND* read(const gs::ClassId& id, std::istream& in);
231 
232  private:
233  LinInterpolatedTableND() = delete;
234 
236  const std::vector<Axis>& axes,
237  const char* leftInterpolation,
238  const char* rightInterpolation,
239  const std::string& label);
240 
241  bool allConstInterpolated() const;
242 
244  std::vector<Axis> axes_;
246  char leftInterpolationLinear_[CHAR_BIT * sizeof(unsigned long)];
247  char rightInterpolationLinear_[CHAR_BIT * sizeof(unsigned long)];
248  unsigned dim_;
250 
251  template <class Functor1>
252  static double solveForRatioArg(double xmin, double xmax, double rmin, double rmax, double fval, Functor1 invg);
253 
254  template <class Functor1>
255  static void invert1DResponse(const ArrayND<Numeric>& fromSlice,
256  const Axis& fromAxis,
257  const Axis& toAxis,
258  bool newLeftLinear,
259  bool newRightLinear,
260  Functor1 invg,
261  const double* rawx,
262  const double* rawf,
263  double* workspace,
264  ArrayND<Numeric>* toSlice);
265  };
266 } // namespace npstat
267 
268 #include <cmath>
269 #include <cfloat>
270 #include <cassert>
271 #include <algorithm>
272 #include <functional>
273 
274 #include "Alignment/Geners/interface/binaryIO.hh"
275 
278 
279 namespace npstat {
280  namespace Private {
281  template <class Axis>
282  ArrayShape makeTableShape(const std::vector<Axis>& axes) {
283  const unsigned n = axes.size();
285  result.reserve(n);
286  for (unsigned i = 0; i < n; ++i)
287  result.push_back(axes[i].nCoords());
288  return result;
289  }
290 
291  template <class Axis>
294  result.reserve(1U);
295  result.push_back(xAxis.nCoords());
296  return result;
297  }
298 
299  template <class Axis>
300  ArrayShape makeTableShape(const Axis& xAxis, const Axis& yAxis) {
302  result.reserve(2U);
303  result.push_back(xAxis.nCoords());
304  result.push_back(yAxis.nCoords());
305  return result;
306  }
307 
308  template <class Axis>
309  ArrayShape makeTableShape(const Axis& xAxis, const Axis& yAxis, const Axis& zAxis) {
311  result.reserve(3U);
312  result.push_back(xAxis.nCoords());
313  result.push_back(yAxis.nCoords());
314  result.push_back(zAxis.nCoords());
315  return result;
316  }
317 
318  template <class Axis>
319  ArrayShape makeTableShape(const Axis& xAxis, const Axis& yAxis, const Axis& zAxis, const Axis& tAxis) {
321  result.reserve(4U);
322  result.push_back(xAxis.nCoords());
323  result.push_back(yAxis.nCoords());
324  result.push_back(zAxis.nCoords());
325  result.push_back(tAxis.nCoords());
326  return result;
327  }
328 
329  template <class Axis>
331  const Axis& xAxis, const Axis& yAxis, const Axis& zAxis, const Axis& tAxis, const Axis& vAxis) {
333  result.reserve(5U);
334  result.push_back(xAxis.nCoords());
335  result.push_back(yAxis.nCoords());
336  result.push_back(zAxis.nCoords());
337  result.push_back(tAxis.nCoords());
338  result.push_back(vAxis.nCoords());
339  return result;
340  }
341 
342  inline double lind_interpolateSimple(
343  const double x0, const double x1, const double y0, const double y1, const double x) {
344  return y0 + (y1 - y0) * ((x - x0) / (x1 - x0));
345  }
346 
347  template <typename Numeric, class Axis>
348  void lind_invert1DSlice(const ArrayND<Numeric>& fromSlice,
349  const Axis& fromAxis,
350  const Axis& toAxis,
351  const bool leftLinear,
352  const bool rightLinear,
353  ArrayND<Numeric>* toSlice) {
354  assert(toSlice);
355  assert(fromSlice.rank() == 1U);
356  assert(toSlice->rank() == 1U);
357 
358  const Numeric* fromData = fromSlice.data();
359  const unsigned fromLen = fromSlice.length();
360  assert(fromLen > 1U);
361  assert(fromLen == fromAxis.nCoords());
362  const Numeric* fromDataEnd = fromData + fromLen;
363  if (!isStrictlyMonotonous(fromData, fromDataEnd))
365  "In npstat::Private::lind_invert1DSlice: "
366  "slice data is not monotonous and can not be inverted");
367 
368  const Numeric yfirst = fromData[0];
369  const Numeric ylast = fromData[fromLen - 1U];
370  const bool increasing = yfirst < ylast;
371 
372  Numeric* toD = const_cast<Numeric*>(toSlice->data());
373  const unsigned nAxisPoints = toAxis.nCoords();
374  assert(toSlice->length() == nAxisPoints);
375 
376  for (unsigned ipt = 0; ipt < nAxisPoints; ++ipt) {
377  const Numeric y = static_cast<Numeric>(toAxis.coordinate(ipt));
378  if (increasing) {
379  if (y <= yfirst) {
380  if (leftLinear)
382  yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1), y);
383  else
384  toD[ipt] = fromAxis.coordinate(0);
385  } else if (y >= ylast) {
386  if (rightLinear)
387  toD[ipt] = Private::lind_interpolateSimple(ylast,
388  fromData[fromLen - 2U],
389  fromAxis.coordinate(fromLen - 1U),
390  fromAxis.coordinate(fromLen - 2U),
391  y);
392  else
393  toD[ipt] = fromAxis.coordinate(fromLen - 1U);
394  } else {
395  const unsigned i = std::lower_bound(fromData, fromDataEnd, y) - fromData;
397  fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i), y);
398  }
399  } else {
400  // The role of left and right are exchanged
401  // with respect to first and last point
402  if (y <= ylast) {
403  if (leftLinear)
404  toD[ipt] = Private::lind_interpolateSimple(ylast,
405  fromData[fromLen - 2U],
406  fromAxis.coordinate(fromLen - 1U),
407  fromAxis.coordinate(fromLen - 2U),
408  y);
409  else
410  toD[ipt] = fromAxis.coordinate(fromLen - 1U);
411  } else if (y >= yfirst) {
412  if (rightLinear)
414  yfirst, fromData[1], fromAxis.coordinate(0), fromAxis.coordinate(1), y);
415  else
416  toD[ipt] = fromAxis.coordinate(0);
417  } else {
418  const unsigned i = std::lower_bound(fromData, fromDataEnd, y, std::greater<Numeric>()) - fromData;
420  fromData[i - 1U], fromData[i], fromAxis.coordinate(i - 1U), fromAxis.coordinate(i), y);
421  }
422  }
423  }
424  }
425  } // namespace Private
426 
427  template <class Numeric, class Axis>
429  for (unsigned i = 0; i < dim_; ++i)
430  if (leftInterpolationLinear_[i] || rightInterpolationLinear_[i])
431  return false;
432  return true;
433  }
434 
435  template <class Numeric, class Axis>
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  }
447 
448  template <typename Numeric, class Axis>
450  static const std::string myClass(gs::template_class_name<Numeric, Axis>("npstat::LinInterpolatedTableND"));
451  return myClass.c_str();
452  }
453 
454  template <typename Numeric, class Axis>
455  bool LinInterpolatedTableND<Numeric, Axis>::write(std::ostream& of) const {
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  }
464 
465  template <typename Numeric, class Axis>
467  std::istream& in) {
468  static const gs::ClassId current(gs::ClassId::makeId<LinInterpolatedTableND<Numeric, Axis> >());
469  current.ensureSameId(id);
470 
471  gs::ClassId ida(in, 1);
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  }
491 
492  template <typename Numeric, class Axis>
494  if (i >= dim_)
496  "In npstat::LinInterpolatedTableND::leftInterpolationLinear: "
497  "index out of range");
498  return leftInterpolationLinear_[i];
499  }
500 
501  template <typename Numeric, class Axis>
503  if (i >= dim_)
505  "In npstat::LinInterpolatedTableND::rightInterpolationLinear: "
506  "index out of range");
507  return rightInterpolationLinear_[i];
508  }
509 
510  template <typename Numeric, class Axis>
512  for (unsigned i = 0; i < dim_; ++i)
513  if (!axes_[i].isUniform())
514  return false;
515  return true;
516  }
517 
518  template <typename Numeric, class Axis>
519  std::vector<std::pair<bool, bool> > LinInterpolatedTableND<Numeric, Axis>::interpolationType() const {
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  }
526 
527  template <typename Numeric, class Axis>
529  const std::vector<Axis>& axes, const std::vector<std::pair<bool, bool> >& interpolationType, const char* label)
530  : data_(Private::makeTableShape(axes)), axes_(axes), functionLabel_(label ? label : ""), dim_(axes.size()) {
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  }
547 
548  template <typename Numeric, class Axis>
549  template <class Num2>
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  }
561 
562  template <typename Numeric, class Axis>
564  const std::vector<Axis>& axes,
565  const char* leftInterpolation,
566  const char* rightInterpolation,
567  const std::string& label)
568  : data_(data), axes_(axes), functionLabel_(label), dim_(data.rank()) {
569  for (unsigned i = 0; i < dim_; ++i) {
570  leftInterpolationLinear_[i] = leftInterpolation[i];
571  rightInterpolationLinear_[i] = rightInterpolation[i];
572  }
574  }
575 
576  template <typename Numeric, class Axis>
578  bool leftX,
579  bool rightX,
580  const Axis& yAxis,
581  bool leftY,
582  bool rightY,
583  const Axis& zAxis,
584  bool leftZ,
585  bool rightZ,
586  const Axis& tAxis,
587  bool leftT,
588  bool rightT,
589  const Axis& vAxis,
590  bool leftV,
591  bool rightV,
592  const char* label)
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  }
618 
619  template <typename Numeric, class Axis>
621  bool leftX,
622  bool rightX,
623  const Axis& yAxis,
624  bool leftY,
625  bool rightY,
626  const Axis& zAxis,
627  bool leftZ,
628  bool rightZ,
629  const Axis& tAxis,
630  bool leftT,
631  bool rightT,
632  const char* label)
633  : data_(Private::makeTableShape(xAxis, yAxis, zAxis, tAxis)), functionLabel_(label ? label : ""), dim_(4U) {
634  axes_.reserve(dim_);
635  axes_.push_back(xAxis);
636  axes_.push_back(yAxis);
637  axes_.push_back(zAxis);
638  axes_.push_back(tAxis);
639 
640  unsigned i = 0;
641  leftInterpolationLinear_[i] = leftX;
642  rightInterpolationLinear_[i++] = rightX;
643  leftInterpolationLinear_[i] = leftY;
644  rightInterpolationLinear_[i++] = rightY;
645  leftInterpolationLinear_[i] = leftZ;
646  rightInterpolationLinear_[i++] = rightZ;
647  leftInterpolationLinear_[i] = leftT;
648  rightInterpolationLinear_[i++] = rightT;
649  assert(i == dim_);
650 
652  }
653 
654  template <typename Numeric, class Axis>
656  bool leftX,
657  bool rightX,
658  const Axis& yAxis,
659  bool leftY,
660  bool rightY,
661  const Axis& zAxis,
662  bool leftZ,
663  bool rightZ,
664  const char* label)
665  : data_(Private::makeTableShape(xAxis, yAxis, zAxis)), functionLabel_(label ? label : ""), dim_(3U) {
666  axes_.reserve(dim_);
667  axes_.push_back(xAxis);
668  axes_.push_back(yAxis);
669  axes_.push_back(zAxis);
670 
671  unsigned i = 0;
672  leftInterpolationLinear_[i] = leftX;
673  rightInterpolationLinear_[i++] = rightX;
674  leftInterpolationLinear_[i] = leftY;
675  rightInterpolationLinear_[i++] = rightY;
676  leftInterpolationLinear_[i] = leftZ;
677  rightInterpolationLinear_[i++] = rightZ;
678  assert(i == dim_);
679 
681  }
682 
683  template <typename Numeric, class Axis>
685  const Axis& xAxis, bool leftX, bool rightX, const Axis& yAxis, bool leftY, bool rightY, const char* label)
686  : data_(Private::makeTableShape(xAxis, yAxis)), functionLabel_(label ? label : ""), dim_(2U) {
687  axes_.reserve(dim_);
688  axes_.push_back(xAxis);
689  axes_.push_back(yAxis);
690 
691  unsigned i = 0;
692  leftInterpolationLinear_[i] = leftX;
693  rightInterpolationLinear_[i++] = rightX;
694  leftInterpolationLinear_[i] = leftY;
695  rightInterpolationLinear_[i++] = rightY;
696  assert(i == dim_);
697 
699  }
700 
701  template <typename Numeric, class Axis>
703  bool leftX,
704  bool rightX,
705  const char* label)
706  : data_(Private::makeTableShape(xAxis)), functionLabel_(label ? label : ""), dim_(1U) {
707  axes_.reserve(dim_);
708  axes_.push_back(xAxis);
709 
710  leftInterpolationLinear_[0] = leftX;
711  rightInterpolationLinear_[0] = rightX;
712 
714  }
715 
716  template <typename Numeric, class Axis>
717  template <typename ConvertibleToUnsigned>
718  CPP11_auto_ptr<LinInterpolatedTableND<Numeric, Axis> > LinInterpolatedTableND<Numeric, Axis>::invertWRTAxis(
719  const ConvertibleToUnsigned axisNumC,
720  const Axis& replacementAxis,
721  const bool leftLinear,
722  const bool rightLinear,
723  const char* functionLabel) const {
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  }
766 
767  template <typename Numeric, class Axis>
768  template <class Functor1, class Functor2>
769  CPP11_auto_ptr<LinInterpolatedTableND<Numeric, Axis> > LinInterpolatedTableND<Numeric, Axis>::invertRatioResponse(
770  const unsigned axisNumber,
771  const Axis& replacementAxis,
772  const bool leftLinear,
773  const bool rightLinear,
774  Functor1 invg,
775  Functor2 invh,
776  const char* functionLabel) const {
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
854  invert1DResponse(data_,
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  }
866 
867  template <typename Numeric, class Axis>
868  void LinInterpolatedTableND<Numeric, Axis>::getCoords(const unsigned long linearIndex,
869  double* coords,
870  const unsigned coordsBufferSize) const {
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  }
881 
882  template <typename Numeric, class Axis>
883  bool LinInterpolatedTableND<Numeric, Axis>::isWithinLimits(const double* point, const unsigned len) const {
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  }
895 
896  template <typename Numeric, class Axis>
897  Numeric LinInterpolatedTableND<Numeric, Axis>::operator()(const double* point, const unsigned len) const {
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;
907  if (!allConstInterpolated_)
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()) ||
929  (rightInterpolationLinear_[i] && point[i] > axes_[i].max());
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  }
957 
958  template <typename Numeric, class Axis>
959  Numeric LinInterpolatedTableND<Numeric, Axis>::operator()(const double& x0) const {
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  }
969 
970  template <typename Numeric, class Axis>
971  Numeric LinInterpolatedTableND<Numeric, Axis>::operator()(const double& x0, const double& x1) const {
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  }
982 
983  template <typename Numeric, class Axis>
985  const double& x1,
986  const double& x2) const {
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  }
998 
999  template <typename Numeric, class Axis>
1001  const double& x1,
1002  const double& x2,
1003  const double& x3) const {
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  }
1016 
1017  template <typename Numeric, class Axis>
1019  const double& x0, const double& x1, const double& x2, const double& x3, const double& x4) const {
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  }
1033 
1034  template <typename Numeric, class Axis>
1035  template <class Functor1>
1037  const double xmin, const double xmax, const double rmin, const double rmax, const double fval, Functor1 invg) {
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  }
1080 
1081  template <typename Numeric, class Axis>
1082  template <class Functor1>
1084  const Axis& fromAxis,
1085  const Axis& toAxis,
1086  const bool newLeftLinear,
1087  const bool newRightLinear,
1088  Functor1 invg,
1089  const double* rawx,
1090  const double* rawf,
1091  double* workspace,
1092  ArrayND<Numeric>* toSlice) {
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  }
1148 } // namespace npstat
1149 
1150 #endif // NPSTAT_LININTERPOLATEDTABLEND_HH_
UniformAxis.h
Uniformly spaced coordinate sets for use in constructing rectangular grids.
npstat::Private::makeTableShape
ArrayShape makeTableShape(const Axis &xAxis, const Axis &yAxis, const Axis &zAxis, const Axis &tAxis, const Axis &vAxis)
Definition: LinInterpolatedTableND.h:330
mps_fire.i
i
Definition: mps_fire.py:428
npstat::LinInterpolatedTableND::axes
const std::vector< Axis > & axes() const
Definition: LinInterpolatedTableND.h:139
npstat::ArrayNDScanner::isValid
bool isValid() const
Definition: ArrayNDScanner.h:57
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
npstat::ArrayND::restore
static void restore(const gs::ClassId &id, std::istream &in, ArrayND *array)
Definition: ArrayND.h:5386
npstat::LinInterpolatedTableND::axis
const Axis & axis(const unsigned i) const
Definition: LinInterpolatedTableND.h:140
step
step
Definition: StallMonitor.cc:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
npstat::LinInterpolatedTableND::isWithinLimits
bool isWithinLimits(const double *point, unsigned dim) const
Definition: LinInterpolatedTableND.h:883
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::leftInterpolationLinear
bool leftInterpolationLinear(unsigned i) const
Definition: LinInterpolatedTableND.h:493
npstat::LinInterpolatedTableND::operator==
bool operator==(const LinInterpolatedTableND &) const
Definition: LinInterpolatedTableND.h:436
npstat::LinInterpolatedTableND::isUniformlyBinned
bool isUniformlyBinned() const
Definition: LinInterpolatedTableND.h:511
npstat::LinInterpolatedTableND::setFunctionLabel
void setFunctionLabel(const char *newlabel)
Definition: LinInterpolatedTableND.h:170
npstat::LinInterpolatedTableND::allConstInterpolated
bool allConstInterpolated() const
Definition: LinInterpolatedTableND.h:428
cms::cuda::assert
assert(be >=bs)
npstat::LinInterpolatedTableND::table
const ArrayND< Numeric > & table() const
Definition: LinInterpolatedTableND.h:150
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
npstat::ArrayND::rank
unsigned rank() const
Definition: ArrayND.h:242
npstat::LinInterpolatedTableND::invertWRTAxis
std::unique_ptr< LinInterpolatedTableND > invertWRTAxis(ConvertibleToUnsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, const char *functionLabel=nullptr) const
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::isStrictlyMonotonous
bool isStrictlyMonotonous(Iter const begin, Iter const end)
Definition: isMonotonous.h:44
npstat::LinInterpolatedTableND::data_
ArrayND< Numeric > data_
Definition: LinInterpolatedTableND.h:243
npstat::LinInterpolatedTableND::length
unsigned long length() const
Definition: LinInterpolatedTableND.h:141
npstat::ArrayShape
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
isMonotonous.h
A few simple template functions for checking monotonicity of container values.
npstat
Definition: AbsArrayProjector.h:14
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
npstat::Functor1
Definition: SimpleFunctors.h:27
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
npstat::NpstatRuntimeError
Definition: NpstatException.h:46
npstat::LinInterpolatedTableND::write
bool write(std::ostream &of) const
Definition: LinInterpolatedTableND.h:455
npstat::LinInterpolatedTableND::rightInterpolationLinear
bool rightInterpolationLinear(unsigned i) const
Definition: LinInterpolatedTableND.h:502
npstat::LinInterpolatedTableND::getCoords
void getCoords(unsigned long linearIndex, double *coords, unsigned coordsBufferSize) const
Definition: LinInterpolatedTableND.h:868
npstat::LinInterpolatedTableND::table
ArrayND< Numeric > & table()
Definition: LinInterpolatedTableND.h:151
npstat::LinInterpolatedTableND::solveForRatioArg
static double solveForRatioArg(double xmin, double xmax, double rmin, double rmax, double fval, Functor1 invg)
Definition: LinInterpolatedTableND.h:1036
npstat::LinInterpolatedTableND::value_type
Numeric value_type
Definition: LinInterpolatedTableND.h:36
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
npstat::LinInterpolatedTableND::version
static unsigned version()
Definition: LinInterpolatedTableND.h:229
HLT_FULL_cff.zAxis
zAxis
Definition: HLT_FULL_cff.py:46209
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
ArrayND.h
Arbitrary-dimensional array template.
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
npstat::LinInterpolatedTableND::invertRatioResponse
std::unique_ptr< LinInterpolatedTableND > invertRatioResponse(unsigned axisNumber, const Axis &replacementAxis, bool newAxisLeftLinear, bool newAxisRightLinear, Functor1 invg, Functor2 invh, const char *functionLabel=nullptr) const
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
npstat::LinInterpolatedTableND::read
static LinInterpolatedTableND * read(const gs::ClassId &id, std::istream &in)
Definition: LinInterpolatedTableND.h:466
npstat::ArrayNDScanner
Definition: ArrayNDScanner.h:36
npstat::LinInterpolatedTableND::classId
gs::ClassId classId() const
Definition: LinInterpolatedTableND.h:224
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
npstat::Functor2
Definition: SimpleFunctors.h:37
HLT_FULL_cff.yAxis
yAxis
Definition: HLT_FULL_cff.py:46210
recoMuon::in
Definition: RecoMuonEnumerators.h:6
npstat::LinInterpolatedTableND::dim
unsigned dim() const
Definition: LinInterpolatedTableND.h:138
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
npstat::ArrayND< Numeric >
npstat::ProperDblFromCmpl::type
double type
Definition: ProperDblFromCmpl.h:20
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
ArrayNDScanner.h
Iteration over indices of a multidimensional array.
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:46208
npstat::LinInterpolatedTableND
Definition: LinInterpolatedTableND.h:31
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
npstat::LinInterpolatedTableND::operator!=
bool operator!=(const LinInterpolatedTableND &r) const
Definition: LinInterpolatedTableND.h:220
mps_fire.result
result
Definition: mps_fire.py:311
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
npstat::LinInterpolatedTableND::classname
static const char * classname()
Definition: LinInterpolatedTableND.h:449
npstat::LinInterpolatedTableND::axis_type
Axis axis_type
Definition: LinInterpolatedTableND.h:37
label
const char * label
Definition: PFTauDecayModeTools.cc:11
weight
Definition: weight.py:1
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443