CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
GenericFunctions
src
ReverseExponential.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: ReverseExponential.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
3
#include "
CLHEP/GenericFunctions/ReverseExponential.hh
"
4
#include <assert.h>
5
#include <cmath>
// for exp()
6
7
namespace
Genfun
{
8
FUNCTION_OBJECT_IMP
(ReverseExponential)
9
10
ReverseExponential
::
ReverseExponential
():
11
_decayConstant("Decay Constant", 1.0, 0,10)
12
{}
13
14
ReverseExponential::ReverseExponential
(
const
ReverseExponential
& right) :
15
AbsFunction
(right),
16
_decayConstant(right._decayConstant)
17
{
18
}
19
20
ReverseExponential::~ReverseExponential
() {
21
}
22
23
double
ReverseExponential::operator()
(
double
x)
const
{
24
if
(x>0)
return
0;
25
return
exp(x/_decayConstant.
getValue
())/_decayConstant.
getValue
();
26
}
27
28
Parameter
&
ReverseExponential::decayConstant
() {
29
return
_decayConstant;
30
}
31
32
33
Derivative
ReverseExponential::partial
(
unsigned
int
index)
const
{
34
assert(index==0);
35
const
AbsFunction
& fPrime = _decayConstant*(*this);
36
return
Derivative
(&fPrime);
37
}
38
39
40
}
// namespace Genfun
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:156
ReverseExponential.hh
Genfun::AbsFunction
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:48
Genfun::FunctionNoop
Definition:
CLHEP/GenericFunctions/FunctionNoop.hh:19
Genfun::Parameter
Definition:
CLHEP/GenericFunctions/Parameter.hh:35
Genfun::Parameter::getValue
virtual double getValue() const
Definition:
Parameter.cc:27
Genfun::ReverseExponential
Definition:
CLHEP/GenericFunctions/ReverseExponential.hh:20
Genfun::ReverseExponential::~ReverseExponential
virtual ~ReverseExponential()
Definition:
ReverseExponential.cc:20
Genfun::ReverseExponential::operator()
virtual double operator()(double argument) const
Definition:
ReverseExponential.cc:23
Genfun::ReverseExponential::decayConstant
Parameter & decayConstant()
Definition:
ReverseExponential.cc:28
Genfun::ReverseExponential::partial
Derivative partial(unsigned int) const
Definition:
ReverseExponential.cc:33
Genfun::ReverseExponential::ReverseExponential
ReverseExponential()
Definition:
ReverseExponential.cc:10
Genfun
Definition:
CLHEP/GenericFunctions/Abs.hh:14
Genfun::Derivative
FunctionNoop Derivative
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:42
Generated by
1.9.4