CMS 3D CMS Logo

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

#include <HcalLinearCompositionFunctor.h>

Inheritance diagram for HcalLinearCompositionFunctor:
AbsHcalFunctor

Public Member Functions

double a () const
 
double b () const
 
 HcalLinearCompositionFunctor ()
 
 HcalLinearCompositionFunctor (std::shared_ptr< AbsHcalFunctor > p, double a, double b)
 
double operator() (double x) const override
 
double xmax () const override
 
double xmin () const override
 
 ~HcalLinearCompositionFunctor () 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

double a_
 
double b_
 
std::shared_ptr< AbsHcalFunctorother_
 

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 17 of file HcalLinearCompositionFunctor.h.

Constructor & Destructor Documentation

◆ HcalLinearCompositionFunctor() [1/2]

HcalLinearCompositionFunctor::HcalLinearCompositionFunctor ( )
inline

Definition at line 20 of file HcalLinearCompositionFunctor.h.

20 : a_(0.0), b_(0.0) {}

◆ HcalLinearCompositionFunctor() [2/2]

HcalLinearCompositionFunctor::HcalLinearCompositionFunctor ( std::shared_ptr< AbsHcalFunctor p,
double  a,
double  b 
)

Definition at line 5 of file HcalLinearCompositionFunctor.cc.

8  : other_(p), a_(ia), b_(ib) {
9  if (!other_.get())
10  throw cms::Exception(
11  "In HcalLinearCompositionFunctor constructor: "
12  "can not use a null pointer to another functor");
13 }

References other_.

◆ ~HcalLinearCompositionFunctor()

HcalLinearCompositionFunctor::~HcalLinearCompositionFunctor ( )
inlineoverride

Definition at line 25 of file HcalLinearCompositionFunctor.h.

25 {}

Member Function Documentation

◆ a()

double HcalLinearCompositionFunctor::a ( ) const
inline

Definition at line 32 of file HcalLinearCompositionFunctor.h.

32 { return a_; }

References a_.

◆ b()

double HcalLinearCompositionFunctor::b ( ) const
inline

Definition at line 33 of file HcalLinearCompositionFunctor.h.

33 { return b_; }

References b_.

◆ isEqual()

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

Implements AbsHcalFunctor.

Definition at line 36 of file HcalLinearCompositionFunctor.h.

36  {
37  const HcalLinearCompositionFunctor& r = static_cast<const HcalLinearCompositionFunctor&>(other);
38  return *other_ == *r.other_ && a_ == r.a_ && b_ == r.b_;
39  }

References a_, b_, trackingPlots::other, other_, and alignCSCRings::r.

◆ operator()()

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

Implements AbsHcalFunctor.

Definition at line 15 of file HcalLinearCompositionFunctor.cc.

15 { return a_ * (*other_)(x) + b_; }

References a_, b_, and x.

◆ serialize()

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

Definition at line 49 of file HcalLinearCompositionFunctor.h.

49  {
50  boost::serialization::base_object<AbsHcalFunctor>(*this);
51  // Direct polymorphic serialization of shared_ptr is broken
52  // in boost for versions 1.56, 1.57, 1.58. For detail, see
53  // https://svn.boost.org/trac/boost/ticket/10727
54 #if BOOST_VERSION < 105600 || BOOST_VERSION > 105800
55  ar& other_& a_& b_;
56 #else
57  throw cms::Exception(
58  "HcalLinearCompositionFunctor can not be"
59  " serialized with this version of boost");
60 #endif
61  }

References a_, b_, Exception, and other_.

◆ xmax()

double HcalLinearCompositionFunctor::xmax ( ) const
inlineoverridevirtual

Reimplemented from AbsHcalFunctor.

Definition at line 30 of file HcalLinearCompositionFunctor.h.

30 { return other_->xmax(); }

References other_.

Referenced by svgfig.XAxis::__repr__().

◆ xmin()

double HcalLinearCompositionFunctor::xmin ( ) const
inlineoverridevirtual

Reimplemented from AbsHcalFunctor.

Definition at line 29 of file HcalLinearCompositionFunctor.h.

29 { return other_->xmin(); }

References other_.

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 46 of file HcalLinearCompositionFunctor.h.

Member Data Documentation

◆ a_

double HcalLinearCompositionFunctor::a_
private

Definition at line 43 of file HcalLinearCompositionFunctor.h.

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

◆ b_

double HcalLinearCompositionFunctor::b_
private

Definition at line 44 of file HcalLinearCompositionFunctor.h.

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

◆ other_

std::shared_ptr<AbsHcalFunctor> HcalLinearCompositionFunctor::other_
private
HcalLinearCompositionFunctor::b_
double b_
Definition: HcalLinearCompositionFunctor.h:44
HcalLinearCompositionFunctor
Definition: HcalLinearCompositionFunctor.h:17
HcalLinearCompositionFunctor::a_
double a_
Definition: HcalLinearCompositionFunctor.h:43
DDAxes::x
trackingPlots.other
other
Definition: trackingPlots.py:1464
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cuy.ib
ib
Definition: cuy.py:661
alignCSCRings.r
r
Definition: alignCSCRings.py:93
Exception
Definition: hltDiff.cc:245
HcalLinearCompositionFunctor::other_
std::shared_ptr< AbsHcalFunctor > other_
Definition: HcalLinearCompositionFunctor.h:42
cms::Exception
Definition: Exception.h:70