CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Theta.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id:
3#include "CLHEP/GenericFunctions/Theta.hh"
4#include "CLHEP/GenericFunctions/FixedConstant.hh"
5#include <stdexcept>
6namespace Genfun {
8
10{}
11
13}
14
15Theta::Theta(const Theta & right) : AbsFunction(right)
16{ }
17
18
19double Theta::operator() (double x) const {
20 return (x>=0) ? 1.0:0.0;
21}
22
23
24
25Derivative Theta::partial(unsigned int index) const {
26 if (index!=0) throw std::runtime_error("Theta::Partial: index out of range");
27 const AbsFunction & fPrime = FixedConstant(0.0);
28 return Derivative(& fPrime);
29}
30
31} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual ~Theta()
Definition: Theta.cc:12
Derivative partial(unsigned int) const override
Definition: Theta.cc:25
virtual double operator()(double argument) const override
Definition: Theta.cc:19
Definition: Abs.hh:14
FunctionNoop Derivative
Definition: AbsFunction.hh:42