Commit 43b81639 authored by Joseph Boudreau's avatar Joseph Boudreau
Browse files

Break dependency on CLHEP/Units. Please anybody who does not like the way...

Break dependency on CLHEP/Units.  Please anybody who does not like the way this is done CONTACT THE ORIGINAL AUTHOR OF THIS CODE.
parent a904d332
// -*- C++ -*-
// $Id: BivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// $Id: BivariateGaussian.cc,v 1.6 2003/12/29 18:17:18 boudreau Exp $
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/BivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
......@@ -47,7 +46,7 @@ double BivariateGaussian::operator() (const Argument & a) const {
double rho = _corr01.getValue();
double dt = (1.0+rho)*(1.0-rho);
return (1.0/(CLHEP::twopi*sx*sy*sqrt(dt))) *
return (1.0/(2*M_PI*sx*sy*sqrt(dt))) *
exp(-1.0/(2.0*dt)*(dx*dx/sxs+dy*dy/sys-2.0*rho*dx*dy/sx/sy));
}
......
// -*- C++ -*-
// $Id: Gaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// $Id: Gaussian.cc,v 1.6 2003/12/29 18:17:18 boudreau Exp $
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/Gaussian.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
......@@ -28,7 +27,7 @@ _sigma(right._sigma)
double Gaussian::operator() (double x) const {
double s = _sigma.getValue();
double x0 = _mean.getValue();
return (1.0/(sqrt(CLHEP::twopi)*s))*
return (1.0/(sqrt(2*M_PI)*s))*
exp(-(x-x0)*(x-x0)/(2.0*s*s));
}
......
......@@ -3,7 +3,6 @@
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/PtRelFcn.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for pow() and exp()
#include <float.h>
......@@ -55,7 +54,7 @@ double PtRelFcn::operator() (double x) const {
static const double s2 = sqrt(2.0);
double retVal=
norm*p0*pow(x,p1)*exp(-p2*pow(x,p3)) +
(2.0/(1+_erf(p5/p4/s2))*(1.0-p0)/(sqrt(CLHEP::twopi)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
(2.0/(1+_erf(p5/p4/s2))*(1.0-p0)/(sqrt(2*M_PI)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
//if (!finite(retVal)) return 1.0E-10;
......
// -*- C++ -*-
// $Id: TrivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// $Id: TrivariateGaussian.cc,v 1.6 2003/12/29 18:17:18 boudreau Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/TrivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
......@@ -72,7 +71,7 @@ double TrivariateGaussian::operator() (const Argument & a) const {
double dt = (1.0+rho1*rho2*rho3-rho1*rho1-rho2*rho2-rho3*rho3);
double tmp1 ,tmp2;
tmp1= 1.0/((CLHEP::twopi)*sqrt(CLHEP::twopi)*sx*sy*sz*sqrt(dt));
tmp1= 1.0/((2*M_PI)*sqrt(2*M_PI)*sx*sy*sz*sqrt(dt));
tmp2= exp(-0.5/dt*(dx*dx*(1.0-rho2*rho2)/sxs+dy*dy*(1.0-rho3*rho3)/sys+dz*dz*(1.0-rho1*rho1)/szs+2.0*dx*dy*(rho2*rho3-rho1)/sx/sy+2.0*dy*dz*(rho1*rho3-rho2)/sy/sz+2.0*dx*dz*(rho1*rho2-rho3)/sx/sz));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment