GooFit  v2.1.3
BWPdf.cu
Go to the documentation of this file.
1 #include <goofit/PDFs/basic/BWPdf.h>
2 
3 namespace GooFit {
4 
5 __device__ fptype device_BW(fptype *evt, fptype *p, unsigned int *indices) {
6  fptype x = evt[indices[2 + indices[0]]];
7  fptype mean = p[indices[1]];
8  fptype gamma = p[indices[2]];
9  fptype rootPi = -2. * atan2(-1.0, 0.0);
10  fptype ret = (gamma / ((x - mean) * (x - mean) + gamma * gamma / 4)) / (2 * rootPi);
11  return ret;
12 }
13 
14 __device__ device_function_ptr ptr_to_BW = device_BW;
15 
16 __host__ BWPdf::BWPdf(std::string n, Observable _x, Variable mean, Variable width)
17  : GooPdf(n, _x) {
18  std::vector<unsigned int> pindices;
19  pindices.push_back(registerParameter(mean));
20  pindices.push_back(registerParameter(width));
21  GET_FUNCTION_ADDR(ptr_to_BW);
22  initialize(pindices);
23 }
24 } // namespace GooFit