CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 #include "CLHEP/GenericFunctions/RelativisticBW.hh" 00002 #include "CLHEP/GenericFunctions/Variable.hh" 00003 #include <assert.h> 00004 #include <cmath> 00005 00006 #if (defined __STRICT_ANSI__) || (defined _WIN32) 00007 #ifndef M_PI 00008 #define M_PI 3.14159265358979323846 00009 #endif // M_PI 00010 #endif // __STRICT_ANSI__ 00011 00012 using namespace std; 00013 00014 namespace Genfun { 00015 FUNCTION_OBJECT_IMP(RelativisticBWDistribution) 00016 00017 00018 RelativisticBWDistribution::RelativisticBWDistribution(): 00019 _mass("mass", 50, 10, 90), 00020 _width ("width", 5, 0, 100) 00021 {} 00022 00023 RelativisticBWDistribution::RelativisticBWDistribution(const RelativisticBWDistribution & right): 00024 AbsFunction(), 00025 _mass(right._mass), 00026 _width (right._width) 00027 { 00028 } 00029 00030 RelativisticBWDistribution::~RelativisticBWDistribution() { 00031 } 00032 00033 double RelativisticBWDistribution::operator() (double x) const { 00034 double M=_mass.getValue(); 00035 double G=_width.getValue(); 00036 double g=sqrt(M*M*(M*M+G*G)); 00037 double k = 2.0*sqrt(2.0)*M*G*g/M_PI/sqrt(M*M+g); 00038 double f = k/((x-M)*(x-M)*(x+M)*(x+M)+M*M*G*G); 00039 return f; 00040 00041 } 00042 00043 Parameter & RelativisticBWDistribution::mass() { 00044 return _mass; 00045 } 00046 00047 00048 Parameter & RelativisticBWDistribution::width() { 00049 return _width; 00050 } 00051 00052 00053 } // namespace Genfun