CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SmoothStepFunction.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_SmoothStepFunction_h
2 #define PhysicsTools_Utilities_SmoothStepFunction_h
4 #include <boost/shared_ptr.hpp>
5 #include <cmath>
6 
7 namespace function {
8 
10  static const unsigned int arguments = 1;
11  SmoothStepFunction(const Parameter & t) :
12  trend(t.ptr()) { }
13  SmoothStepFunction(boost::shared_ptr<double> t):
14  trend(t) { }
16  trend(new double(t)){}
17  double operator()(double x) const {
18  double z = (x - 40)*(*trend);
19  if(fabs(z)<0) return 0;
20  return 2/(1+exp(-z)) -1;
21  }
22  boost::shared_ptr<double> trend;
23  };
24 
25 }
26 
27 #endif
Definition: vlib.h:256
double operator()(double x) const
SmoothStepFunction(const Parameter &t)
boost::shared_ptr< double > trend
SmoothStepFunction(boost::shared_ptr< double > t)
static const unsigned int arguments