CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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#include <iostream>
7
8namespace Genfun {
9FUNCTION_OBJECT_IMP(ReverseExponential)
10
12 _decayConstant("Decay Constant", 1.0, 0,10)
13{}
14
16AbsFunction(right),
17_decayConstant(right._decayConstant)
18{
19}
20
22}
23
24double ReverseExponential::operator() (double x) const {
25 if (x>0) return 0;
26 return exp(x/_decayConstant.getValue())/_decayConstant.getValue();
27}
28
30 return _decayConstant;
31}
32
33// don't generate warnings about unused parameter inside assert
34#if defined __GNUC__
35 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
36 #pragma GCC diagnostic push
37 #pragma GCC diagnostic ignored "-Wunused-parameter"
38 #endif
39#endif
40#ifdef __clang__
41 #pragma clang diagnostic push
42 #pragma clang diagnostic ignored "-Wunused-parameter"
43#endif
44Derivative ReverseExponential::partial(unsigned int index) const {
45 assert(index==0);
46 const AbsFunction & fPrime = _decayConstant*(*this);
47 return Derivative(&fPrime);
48}
49#if defined __GNUC__
50 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
51 #pragma GCC diagnostic pop
52 #endif
53#endif
54#ifdef __clang__
55 #pragma clang diagnostic pop
56#endif
57
58} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual double getValue() const
Definition: Parameter.cc:29
Derivative partial(unsigned int) const override
virtual double operator()(double argument) const override
Definition: Abs.hh:14
FunctionNoop Derivative
Definition: AbsFunction.hh:42