CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::HcalPolynomialFunctor ( )
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) {}
double xmax() const override
std::vector< double > coeffs_
static unsigned int const shift
double xmin() const override
HcalPolynomialFunctor::~HcalPolynomialFunctor ( )
inlineoverride

Definition at line 32 of file HcalPolynomialFunctor.h.

32 {}

Member Function Documentation

bool HcalPolynomialFunctor::isEqual ( const AbsHcalFunctor other) const
inlineoverrideprotectedvirtual
double HcalPolynomialFunctor::operator() ( double  x) const
overridevirtual

Implements AbsHcalFunctor.

Definition at line 15 of file HcalPolynomialFunctor.cc.

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

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 }
tuple result
Definition: mps_fire.py:311
std::vector< double > coeffs_
double a
Definition: hdecay.h:119
template<class Archive >
void HcalPolynomialFunctor::serialize ( Archive &  ar,
unsigned   
)
inlineprivate

Definition at line 55 of file HcalPolynomialFunctor.h.

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

55  {
56  boost::serialization::base_object<AbsHcalFunctor>(*this);
58  }
std::vector< double > coeffs_
double HcalPolynomialFunctor::xmax ( ) const
inlineoverridevirtual

Reimplemented from AbsHcalFunctor.

Definition at line 36 of file HcalPolynomialFunctor.h.

References xmin_.

Referenced by svgfig.XAxis::__repr__().

36 { return xmin_; }
double HcalPolynomialFunctor::xmin ( ) const
inlineoverridevirtual

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 52 of file HcalPolynomialFunctor.h.

Member Data Documentation

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

Definition at line 46 of file HcalPolynomialFunctor.h.

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

double HcalPolynomialFunctor::outOfRangeValue_
private

Definition at line 50 of file HcalPolynomialFunctor.h.

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

double HcalPolynomialFunctor::shift_
private

Definition at line 47 of file HcalPolynomialFunctor.h.

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

double HcalPolynomialFunctor::xmax_
private

Definition at line 49 of file HcalPolynomialFunctor.h.

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

double HcalPolynomialFunctor::xmin_
private

Definition at line 48 of file HcalPolynomialFunctor.h.

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