Commit be04d63c authored by Lynn Garren's avatar Lynn Garren
Browse files

merge in changes from HEAD

parent c553aed5
CLHEP-@PACKAGE@-@VERSION@ CLHEP-@PACKAGE@-@VERSION@
CLHEP-@PACKAGE@-@VERSION@ CLHEP-Units-@VERSION@
......@@ -76,6 +76,7 @@ pkginclude_HEADERS = \
Power.hh \
Psi2Hydrogen.hh \
PtRelFcn.hh \
PuncturedSmearedExp.hh \
RCBase.hh \
Rectangular.hh \
ReverseExponential.hh \
......
// -*- C++ -*-
// $Id: PuncturedSmearedExp.hh,v 1.1 2004/02/05 15:35:25 boudreau Exp $
// $Id: PuncturedSmearedExp.hh,v 1.1.2.1 2004/04/27 17:35:29 garren Exp $
// ------------------------------------------------------------------------------//
// This function-object makes an exponential with acceptance holes ("punctures") //
// smeared by a resolution function. //
......
// -*- C++ -*-
// $Id: BivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// $Id: BivariateGaussian.cc,v 1.5.2.1 2004/04/27 17:35:29 garren Exp $
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/BivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
#if (defined __STRICT_ANSI__) || (defined _WIN32)
#define M_PI 3.14159265358979323846
#endif // __STRICT_ANSI__
namespace Genfun {
FUNCTION_OBJECT_IMP(BivariateGaussian)
......@@ -47,7 +50,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.5.2.1 2004/04/27 17:35:29 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()
#if (defined __STRICT_ANSI__) || (defined _WIN32)
#define M_PI 3.14159265358979323846
#endif // __STRICT_ANSI__
namespace Genfun {
FUNCTION_OBJECT_IMP(Gaussian)
......@@ -28,7 +30,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));
}
......
......@@ -63,6 +63,7 @@ libCLHEP_GenericFunctions_@VERSION@_la_SOURCES = \
Power.cc \
Psi2Hydrogen.cc \
PtRelFcn.cc \
PuncturedSmearedExp.cc \
RCBase.cc \
Rectangular.cc \
ReverseExponential.cc \
......
......@@ -3,11 +3,14 @@
#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>
#if (defined __STRICT_ANSI__) || (defined _WIN32)
#define M_PI 3.14159265358979323846
#endif // __STRICT_ANSI__
namespace Genfun {
FUNCTION_OBJECT_IMP(PtRelFcn)
......@@ -55,7 +58,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: PuncturedSmearedExp.cc,v 1.2 2004/04/20 15:03:52 pfeiffer Exp $
// $Id: PuncturedSmearedExp.cc,v 1.2.2.1 2004/04/27 17:35:29 garren Exp $
#include "CLHEP/GenericFunctions/PuncturedSmearedExp.hh"
#include <sstream>
#include <cmath>
......
// -*- C++ -*-
// $Id: TrivariateGaussian.cc,v 1.5 2003/10/10 17:40:39 garren Exp $
// $Id: TrivariateGaussian.cc,v 1.5.2.1 2004/04/27 17:35:29 garren Exp $
// ---------------------------------------------------------------------------
#include "CLHEP/GenericFunctions/defs.h"
#include "CLHEP/GenericFunctions/TrivariateGaussian.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <assert.h>
#include <cmath> // for exp()
#if (defined __STRICT_ANSI__) || (defined _WIN32)
#define M_PI 3.14159265358979323846
#endif // __STRICT_ANSI__
namespace Genfun {
FUNCTION_OBJECT_IMP(TrivariateGaussian)
......@@ -72,7 +75,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));
......
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