CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
HcalPolynomialFunctor Class Reference

#include <HcalPolynomialFunctor.h>

Inheritance diagram for HcalPolynomialFunctor:
AbsHcalFunctor

Public Member Functions

 HcalPolynomialFunctor ()
 
 HcalPolynomialFunctor (const std::vector< double > &coeffs, double shift=0.0, double xmin=-DBL_MAX, double xmax=DBL_MAX, double outOfRangeValue=0.0)
 
double operator() (double x) const override
 
double xmax () const override
 
double xmin () const override
 
 ~HcalPolynomialFunctor () override
 
- Public Member Functions inherited from AbsHcalFunctor
bool operator!= (const AbsHcalFunctor &r) const
 
bool operator== (const AbsHcalFunctor &r) const
 
virtual ~AbsHcalFunctor ()
 

Protected Member Functions

bool isEqual (const AbsHcalFunctor &other) const override
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, unsigned)
 

Private Attributes

std::vector< double > coeffs_
 
double outOfRangeValue_
 
double shift_
 
double xmax_
 
double xmin_
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Protected Member Functions inherited from AbsHcalFunctor
template<class Iter >
static bool isStrictlyDecreasing (Iter begin, Iter const end)
 
template<class Iter >
static bool isStrictlyIncreasing (Iter begin, Iter const end)
 

Detailed Description

Definition at line 16 of file HcalPolynomialFunctor.h.

Constructor & Destructor Documentation

◆ HcalPolynomialFunctor() [1/2]

HcalPolynomialFunctor::HcalPolynomialFunctor ( )

Definition at line 6 of file HcalPolynomialFunctor.cc.

6 : shift_(0.0), xmin_(-DBL_MAX), xmax_(DBL_MAX), outOfRangeValue_(0.0) {}

◆ HcalPolynomialFunctor() [2/2]

HcalPolynomialFunctor::HcalPolynomialFunctor ( const std::vector< double > &  coeffs,
double  shift = 0.0,
double  xmin = -DBL_MAX,
double  xmax = DBL_MAX,
double  outOfRangeValue = 0.0 
)
explicit

Definition at line 8 of file HcalPolynomialFunctor.cc.

13  : coeffs_(coeffs), shift_(shift), xmin_(xmin), xmax_(xmax), outOfRangeValue_(outOfRangeValue) {}

◆ ~HcalPolynomialFunctor()

HcalPolynomialFunctor::~HcalPolynomialFunctor ( )
inlineoverride

Definition at line 32 of file HcalPolynomialFunctor.h.

32 {}

Member Function Documentation

◆ isEqual()

bool HcalPolynomialFunctor::isEqual ( const AbsHcalFunctor other) const
inlineoverrideprotectedvirtual

Implements AbsHcalFunctor.

Definition at line 39 of file HcalPolynomialFunctor.h.

39  {
40  const HcalPolynomialFunctor& r = static_cast<const HcalPolynomialFunctor&>(other);
41  return coeffs_ == r.coeffs_ && shift_ == r.shift_ && xmin_ == r.xmin_ && xmax_ == r.xmax_ &&
42  outOfRangeValue_ == r.outOfRangeValue_;
43  }

References coeffs_, trackingPlots::other, outOfRangeValue_, alignCSCRings::r, shift_, xmax_, and xmin_.

◆ operator()()

double HcalPolynomialFunctor::operator() ( double  x) const
overridevirtual

Implements AbsHcalFunctor.

Definition at line 15 of file HcalPolynomialFunctor.cc.

15  {
16  double result = outOfRangeValue_;
17  if (x >= xmin_ && x <= xmax_) {
18  result = 0.0;
19  if (!coeffs_.empty()) {
20  const double* a = &coeffs_[0];
21  const double y = x + shift_;
22  for (int deg = coeffs_.size() - 1; deg >= 0; --deg) {
23  result *= y;
24  result += a[deg];
25  }
26  }
27  }
28  return result;
29 }

References a, coeffs_, outOfRangeValue_, mps_fire::result, shift_, x, xmax_, xmin_, and y.

◆ serialize()

template<class Archive >
void HcalPolynomialFunctor::serialize ( Archive &  ar,
unsigned   
)
inlineprivate

Definition at line 55 of file HcalPolynomialFunctor.h.

55  {
56  boost::serialization::base_object<AbsHcalFunctor>(*this);
58  }

References coeffs_, outOfRangeValue_, shift_, xmax_, and xmin_.

◆ xmax()

double HcalPolynomialFunctor::xmax ( ) const
inlineoverridevirtual

Reimplemented from AbsHcalFunctor.

Definition at line 36 of file HcalPolynomialFunctor.h.

36 { return xmin_; }

References xmin_.

Referenced by svgfig.XAxis::__repr__().

◆ xmin()

double HcalPolynomialFunctor::xmin ( ) const
inlineoverridevirtual

Reimplemented from AbsHcalFunctor.

Definition at line 35 of file HcalPolynomialFunctor.h.

35 { return xmax_; };

References xmax_.

Referenced by svgfig.XAxis::__repr__(), svgfig.Axes::__repr__(), svgfig.HGrid::__repr__(), svgfig.Grid::__repr__(), and svgfig.Axes::SVG().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 52 of file HcalPolynomialFunctor.h.

Member Data Documentation

◆ coeffs_

std::vector<double> HcalPolynomialFunctor::coeffs_
private

Definition at line 46 of file HcalPolynomialFunctor.h.

Referenced by isEqual(), operator()(), and serialize().

◆ outOfRangeValue_

double HcalPolynomialFunctor::outOfRangeValue_
private

Definition at line 50 of file HcalPolynomialFunctor.h.

Referenced by isEqual(), operator()(), and serialize().

◆ shift_

double HcalPolynomialFunctor::shift_
private

Definition at line 47 of file HcalPolynomialFunctor.h.

Referenced by isEqual(), operator()(), and serialize().

◆ xmax_

double HcalPolynomialFunctor::xmax_
private

Definition at line 49 of file HcalPolynomialFunctor.h.

Referenced by isEqual(), operator()(), serialize(), and xmin().

◆ xmin_

double HcalPolynomialFunctor::xmin_
private

Definition at line 48 of file HcalPolynomialFunctor.h.

Referenced by isEqual(), operator()(), serialize(), and xmax().

HcalPolynomialFunctor::xmax
double xmax() const override
Definition: HcalPolynomialFunctor.h:36
DDAxes::y
HcalPolynomialFunctor::coeffs_
std::vector< double > coeffs_
Definition: HcalPolynomialFunctor.h:46
DDAxes::x
HcalPolynomialFunctor
Definition: HcalPolynomialFunctor.h:16
trackingPlots.other
other
Definition: trackingPlots.py:1465
HcalPolynomialFunctor::xmax_
double xmax_
Definition: HcalPolynomialFunctor.h:49
a
double a
Definition: hdecay.h:119
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
HcalPolynomialFunctor::xmin
double xmin() const override
Definition: HcalPolynomialFunctor.h:35
HcalPolynomialFunctor::shift_
double shift_
Definition: HcalPolynomialFunctor.h:47
HcalPolynomialFunctor::outOfRangeValue_
double outOfRangeValue_
Definition: HcalPolynomialFunctor.h:50
mps_fire.result
result
Definition: mps_fire.py:303
HcalPolynomialFunctor::xmin_
double xmin_
Definition: HcalPolynomialFunctor.h:48