Commit b7d488e4 authored by Lynn Garren's avatar Lynn Garren

restore cmath and CLHEP::twopi

parent 92f7433d
// -*- C++ -*-
// $Id: ACos.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: ACos.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/ACos.hh"
#include "CLHEP/GenericFunctions/Sqrt.hh"
#include "CLHEP/GenericFunctions/Square.hh"
#include <assert.h>
#include <cmath> // for acos()
namespace Genfun {
FUNCTION_OBJECT_IMP(ACos)
......
// -*- C++ -*-
// $Id: ASin.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: ASin.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/ASin.hh"
#include "CLHEP/GenericFunctions/Sqrt.hh"
#include "CLHEP/GenericFunctions/Square.hh"
#include <assert.h>
#include <cmath> // for asin()
namespace Genfun {
FUNCTION_OBJECT_IMP(ASin)
......
// -*- C++ -*-
// $Id: ATan.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: ATan.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/ATan.hh"
#include "CLHEP/GenericFunctions/Square.hh"
#include <assert.h>
#include <cmath> // for atan()
namespace Genfun {
FUNCTION_OBJECT_IMP(ATan)
......
......@@ -2,7 +2,7 @@
// -*- C++ -*-
//
#include "CLHEP/GenericFunctions/Abs.hh"
#include <math.h>
#include <cmath>
namespace Genfun {
......@@ -19,7 +19,7 @@ Abs::~Abs() {
}
double Abs::operator() (double x) const {
return fabs(x);
return std::abs(x);
}
}
......
// -*- C++ -*-
// $Id: BivariateGaussian.cc,v 1.4 2003/09/06 14:04:14 boudreau Exp $
// $Id: BivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/BivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
namespace Genfun {
FUNCTION_OBJECT_IMP(BivariateGaussian)
......@@ -44,7 +47,7 @@ double BivariateGaussian::operator() (const Argument & a) const {
double rho = _corr01.getValue();
double dt = (1.0+rho)*(1.0-rho);
return (1.0/(2.0*M_PI*sx*sy*sqrt(dt))) *
return (1.0/(CLHEP::twopi*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: Cos.cc,v 1.4 2003/09/06 14:04:14 boudreau Exp $
// $Id: Cos.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/Cos.hh"
#include "CLHEP/GenericFunctions/Sin.hh"
#include <cmath>
namespace Genfun {
FUNCTION_OBJECT_IMP(Cos)
......
// -*- C++ -*-
// $Id: Exp.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Exp.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/Exp.hh"
#include <assert.h>
#include <cmath> // for exp()
namespace Genfun {
FUNCTION_OBJECT_IMP(Exp)
......
// -*- C++ -*-
// $Id: Exponential.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Exponential.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/Exponential.hh"
#include <assert.h>
#include <cmath> // for exp()
namespace Genfun {
FUNCTION_OBJECT_IMP(Exponential)
......
// -*- C++ -*-
// $Id: FunctionNumDeriv.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: FunctionNumDeriv.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/FunctionNumDeriv.hh"
#include <assert.h>
#include <cmath> // for pow()
namespace Genfun {
FUNCTION_OBJECT_IMP(FunctionNumDeriv)
......
// -*- C++ -*-
// $Id: Gaussian.cc,v 1.4 2003/09/06 14:04:14 boudreau Exp $
// $Id: Gaussian.cc,v 1.5 2003/10/10 17:40:39 garren 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()
namespace Genfun {
......@@ -25,7 +28,7 @@ _sigma(right._sigma)
double Gaussian::operator() (double x) const {
double s = _sigma.getValue();
double x0 = _mean.getValue();
return (1.0/(sqrt(2.0*M_PI)*s))*
return (1.0/(sqrt(CLHEP::twopi)*s))*
exp(-(x-x0)*(x-x0)/(2.0*s*s));
}
......
// -*- C++ -*-
// $Id: IncompleteGamma.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: IncompleteGamma.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/IncompleteGamma.hh"
#include <assert.h>
#include <math.h>
#include <cmath>
using namespace std;
namespace Genfun {
FUNCTION_OBJECT_IMP(IncompleteGamma)
......
// -*- C++ -*-
// $Id: Landau.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Landau.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/Landau.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include <math.h>
#include <cmath>
#include <assert.h>
using namespace std;
namespace Genfun {
FUNCTION_OBJECT_IMP(Landau)
......
// -*- C++ -*-
// $Id: LikelihoodFunctional.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: LikelihoodFunctional.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/LikelihoodFunctional.hh"
#include "CLHEP/GenericFunctions/Argument.hh"
#include "CLHEP/GenericFunctions/AbsFunction.hh"
#include <iostream>
#include <cmath> // for log()
namespace Genfun {
LikelihoodFunctional::LikelihoodFunctional(const ArgumentList & aList):
......
// -*- C++ -*-
// $Id: Ln.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Ln.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/Ln.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include <assert.h>
#include <cmath> // for log()
namespace Genfun {
FUNCTION_OBJECT_IMP(Ln)
......
// -*- C++ -*-
// $Id: LogGamma.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: LogGamma.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/LogGamma.hh"
#include <cmath> // for log()
namespace Genfun {
FUNCTION_OBJECT_IMP(LogGamma)
......
// -*- C++ -*-
// $Id:
#include "CLHEP/GenericFunctions/Mod.hh"
#include <math.h>
#include <cmath>
#include <limits.h>
namespace Genfun {
FUNCTION_OBJECT_IMP(Mod)
......
// -*- C++ -*-
// $Id: PeriodicRectangular.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: PeriodicRectangular.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/PeriodicRectangular.hh"
#include "CLHEP/GenericFunctions/FixedConstant.hh"
#include <assert.h>
#include <cmath> // for floor()
namespace Genfun {
FUNCTION_OBJECT_IMP(PeriodicRectangular)
......
// -*- C++ -*-
// $Id: Power.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Power.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/Power.hh"
#include <cmath> // for pow()
namespace Genfun {
FUNCTION_OBJECT_IMP(Power)
......
......@@ -10,6 +10,7 @@
#include "CLHEP/GenericFunctions/Variable.hh"
#include "CLHEP/GenericFunctions/Power.hh"
#include <assert.h>
#include <cmath> // for pow()
namespace Genfun {
FUNCTION_OBJECT_IMP(Psi2Hydrogen)
......
// -*- C++ -*-
// $Id:
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/PtRelFcn.hh"
#include "CLHEP/GenericFunctions/Variable.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <math.h>
#include <cmath> // for pow() and exp()
#include <float.h>
namespace Genfun {
......@@ -53,7 +55,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(2.0*M_PI)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
(2.0/(1+_erf(p5/p4/s2))*(1.0-p0)/(sqrt(CLHEP::twopi)*p4))*exp(-(x-p5)*(x-p5)/(2.0*p4*p4));
//if (!finite(retVal)) return 1.0E-10;
......
......@@ -4,6 +4,7 @@
#include "CLHEP/GenericFunctions/Variable.hh"
#include <assert.h>
#include <climits>
#include <cmath> // for pow()
namespace Genfun {
FUNCTION_OBJECT_IMP(RKIntegrator::RKFunction)
......
// -*- C++ -*-
// $Id: ReverseExponential.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: ReverseExponential.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/ReverseExponential.hh"
#include <assert.h>
#include <cmath> // for exp()
namespace Genfun {
FUNCTION_OBJECT_IMP(ReverseExponential)
......
// -*- C++ -*-
// $Id: Sin.cc,v 1.4 2003/09/06 14:04:14 boudreau Exp $
// $Id: Sin.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
#include "CLHEP/GenericFunctions/Sin.hh"
#include "CLHEP/GenericFunctions/Cos.hh"
#include <assert.h>
#include <cmath>
namespace Genfun {
FUNCTION_OBJECT_IMP(Sin)
......
// -*- C++ -*-
// $Id: Tan.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
// $Id: Tan.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/Tan.hh"
#include "CLHEP/GenericFunctions/Cos.hh"
#include <assert.h>
#include <cmath>
namespace Genfun {
FUNCTION_OBJECT_IMP(Tan)
......
// -*- C++ -*-
// $Id: TrivariateGaussian.cc,v 1.4 2003/09/06 14:04:14 boudreau Exp $
// $Id: TrivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/TrivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
namespace Genfun {
FUNCTION_OBJECT_IMP(TrivariateGaussian)
......@@ -69,7 +72,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/((2.0*M_PI)*sqrt(2.0*M_PI)*sx*sy*sz*sqrt(dt));
tmp1= 1.0/((CLHEP::twopi)*sqrt(CLHEP::twopi)*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));
......
Markdown is supported
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