CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

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 $
4#include <assert.h>
5#include <cmath> // for exp()
6
7namespace Genfun {
8FUNCTION_OBJECT_IMP(ReverseExponential)
9
11 _decayConstant("Decay Constant", 1.0, 0,10)
12{}
13
15AbsFunction(right),
16_decayConstant(right._decayConstant)
17{
18}
19
21}
22
23double ReverseExponential::operator() (double x) const {
24 if (x>0) return 0;
25 return exp(x/_decayConstant.getValue())/_decayConstant.getValue();
26}
27
29 return _decayConstant;
30}
31
32
33Derivative 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
#define FUNCTION_OBJECT_IMP(classname)
virtual double getValue() const
Definition: Parameter.cc:27
virtual double operator()(double argument) const
Derivative partial(unsigned int) const