1 #include <goofit/PDFs/basic/ScaledGaussianPdf.h>
2 #include <goofit/Variable.h>
8 __device__ fptype device_ScaledGaussian(fptype *evt, fptype *p, unsigned int *indices) {
10 fptype mean = p[indices[1]] + p[indices[3]];
11 fptype sigma = p[indices[2]] * (1 + p[indices[4]]);
12 fptype ret = exp(-0.5 * (x - mean) * (x - mean) / (sigma * sigma));
17 __device__ device_function_ptr ptr_to_ScaledGaussian = device_ScaledGaussian;
19 __host__ ScaledGaussianPdf::ScaledGaussianPdf(
20 std::string n, Observable _x, Variable mean, Variable sigma, Variable delta, Variable epsilon)
22 registerParameter(mean);
23 registerParameter(sigma);
24 registerParameter(delta);
25 registerParameter(epsilon);
27 std::vector<unsigned int> pindices;
28 pindices.push_back(mean.getIndex());
29 pindices.push_back(sigma.getIndex());
30 pindices.push_back(delta.getIndex());
31 pindices.push_back(epsilon.getIndex());
32 GET_FUNCTION_ADDR(ptr_to_ScaledGaussian);