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

NonrelativisticBW.cc

Go to the documentation of this file.
00001 #include "CLHEP/GenericFunctions/NonrelativisticBW.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(NonrelativisticBWDistribution)
00016 
00017 
00018 NonrelativisticBWDistribution::NonrelativisticBWDistribution():
00019   _mass("mass",    50, 10, 90),
00020   _width ("width", 5, 0,   100)
00021 {}
00022 
00023   NonrelativisticBWDistribution::NonrelativisticBWDistribution(const NonrelativisticBWDistribution & right):
00024     AbsFunction(),
00025     _mass(right._mass),
00026     _width (right._width)
00027 {
00028 }
00029 
00030 NonrelativisticBWDistribution::~NonrelativisticBWDistribution() {
00031 }
00032 
00033 double NonrelativisticBWDistribution::operator() (double x) const {
00034   double M=_mass.getValue();
00035   double G=_width.getValue()/2.0;
00036   double f = (1.0/M_PI)*G/((x-M)*(x-M) +G*G);
00037   return f;
00038 
00039 }
00040 
00041 Parameter & NonrelativisticBWDistribution::mass() {
00042   return _mass;
00043 }
00044 
00045 
00046 Parameter & NonrelativisticBWDistribution::width() {
00047   return _width;
00048 }
00049 
00050 
00051 } // namespace Genfun

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7