CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
npstat::CircularMapper1d Class Reference

#include <CircularMapper1d.h>

Public Member Functions

double a () const
 
double b () const
 
 CircularMapper1d ()
 
 CircularMapper1d (const double ca, const double cb, const double cperiod)
 
 CircularMapper1d (const LinearMapper1d &mapper, const double cperiod)
 
LinearMapper1d linearMapper () const
 
double operator() (const double &x) const
 
double period () const
 

Private Member Functions

void check ()
 

Private Attributes

double a_
 
double b_
 
double period_
 

Detailed Description

1-d linear transformation functor followed by the shift of the result into the interval [-T/2, T/2], where T is the period

Definition at line 23 of file CircularMapper1d.h.

Constructor & Destructor Documentation

npstat::CircularMapper1d::CircularMapper1d ( )
inline

Definition at line 26 of file CircularMapper1d.h.

26 : a_(1.0), b_(0.0), period_(2.0*M_PI) {}
#define M_PI
Definition: BFit3D.cc:3
npstat::CircularMapper1d::CircularMapper1d ( const double  ca,
const double  cb,
const double  cperiod 
)
inline

Definition at line 28 of file CircularMapper1d.h.

References check().

30  : a_(ca), b_(cb), period_(std::abs(cperiod)) {check();}
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
npstat::CircularMapper1d::CircularMapper1d ( const LinearMapper1d mapper,
const double  cperiod 
)
inline

Definition at line 32 of file CircularMapper1d.h.

References check().

34  : a_(mapper.a()), b_(mapper.b()),
35  period_(std::abs(cperiod)) {check();}
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Function Documentation

double npstat::CircularMapper1d::a ( ) const
inline

Definition at line 46 of file CircularMapper1d.h.

References a_.

46 {return a_;}
double npstat::CircularMapper1d::b ( ) const
inline

Definition at line 47 of file CircularMapper1d.h.

References b_.

47 {return b_;}
void npstat::CircularMapper1d::check ( void  )
inlineprivate

Definition at line 53 of file CircularMapper1d.h.

References period_.

Referenced by CircularMapper1d().

54  {
56  "In npstat::CircularMapper1d constructor: "
57  "invalid period argument (can not be 0)");
58  }
LinearMapper1d npstat::CircularMapper1d::linearMapper ( ) const
inline

Definition at line 49 of file CircularMapper1d.h.

References a_, and b_.

50  {return LinearMapper1d(a_, b_);}
double npstat::CircularMapper1d::operator() ( const double &  x) const
inline

Definition at line 37 of file CircularMapper1d.h.

References a_, b_, period_, and relativeConstraints::value.

38  {
39  double value = a_*x + b_;
40  value -= period_*floor(value/period_);
41  if (value > period_/2.0)
42  value -= period_;
43  return value;
44  }
Definition: DDAxes.h:10
double npstat::CircularMapper1d::period ( ) const
inline

Definition at line 48 of file CircularMapper1d.h.

References period_.

48 {return period_;}

Member Data Documentation

double npstat::CircularMapper1d::a_
private

Definition at line 60 of file CircularMapper1d.h.

Referenced by a(), linearMapper(), and operator()().

double npstat::CircularMapper1d::b_
private

Definition at line 61 of file CircularMapper1d.h.

Referenced by b(), linearMapper(), and operator()().

double npstat::CircularMapper1d::period_
private

Definition at line 62 of file CircularMapper1d.h.

Referenced by check(), operator()(), and period().