GooFit  v2.1.3
NovosibirskPdf.cu
Go to the documentation of this file.
1 #include <goofit/PDFs/basic/NovosibirskPdf.h>
2 
3 namespace GooFit {
4 
5 __device__ fptype device_Novosibirsk(fptype *evt, fptype *p, unsigned int *indices) {
6  fptype _Mean = p[indices[1]];
7  fptype _Sigma = p[indices[2]];
8  fptype _Tail = p[indices[3]];
9  fptype x = evt[indices[2 + indices[0]]];
10 
11  fptype qa = 0;
12  fptype qb = 0;
13  fptype qc = 0;
14  fptype qx = 0;
15  fptype qy = 0;
16 
17  if(fabs(_Tail) < 1.e-7) {
18  qc = 0.5 * POW2((x - _Mean) / _Sigma);
19  } else {
20  qa = _Tail * sqrt(log(4.));
21  qb = sinh(qa) / qa;
22  qx = (x - _Mean) / _Sigma * qb;
23  qy = 1. + _Tail * qx;
24 
25  //---- Cutting curve from right side
26 
27  if(qy > 1.e-7)
28  qc = 0.5 * (POW2(log(qy) / _Tail) + _Tail * _Tail);
29  else
30  qc = 15.0;
31  }
32 
33  //---- Normalize the result
34  return exp(-qc);
35 }
36 
37 __device__ device_function_ptr ptr_to_Novosibirsk = device_Novosibirsk;
38 
39 __host__ NovosibirskPdf::NovosibirskPdf(std::string n, Observable _x, Variable mean, Variable sigma, Variable tail)
40  : GooPdf(n, _x) {
41  std::vector<unsigned int> pindices;
42  pindices.push_back(registerParameter(mean));
43  pindices.push_back(registerParameter(sigma));
44  pindices.push_back(registerParameter(tail));
45  GET_FUNCTION_ADDR(ptr_to_Novosibirsk);
46  initialize(pindices);
47 }
48 
49 } // namespace GooFit