CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: 00003 #include "CLHEP/GenericFunctions/Theta.hh" 00004 #include "CLHEP/GenericFunctions/FixedConstant.hh" 00005 #include <stdexcept> 00006 namespace Genfun { 00007 FUNCTION_OBJECT_IMP(Theta) 00008 00009 Theta::Theta() 00010 {} 00011 00012 Theta::~Theta() { 00013 } 00014 00015 Theta::Theta(const Theta & right) : AbsFunction(right) 00016 { } 00017 00018 00019 double Theta::operator() (double x) const { 00020 return (x>=0) ? 1.0:0.0; 00021 } 00022 00023 00024 00025 Derivative Theta::partial(unsigned int index) const { 00026 if (index!=0) throw std::runtime_error("Theta::Partial: index out of range"); 00027 const AbsFunction & fPrime = FixedConstant(0.0); 00028 return Derivative(& fPrime); 00029 } 00030 00031 } // namespace Genfun