GooFit  v2.1.3
ResonancePdf.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <goofit/PDFs/GooPdf.h>
5 
6 namespace GooFit {
7 
8 #define MAXNKNOBS 1000
9 
10 typedef fpcomplex (*resonance_function_ptr)(fptype, fptype, fptype, unsigned int *);
11 
12 __device__ fptype twoBodyCMmom(double rMassSq, fptype d1m, fptype d2m);
13 
14 __device__ fptype dampingFactorSquare(const fptype &cmmom, const int &spin, const fptype &mRadius);
15 
16 __device__ fptype spinFactor(unsigned int spin,
17  fptype motherMass,
18  fptype daug1Mass,
19  fptype daug2Mass,
20  fptype daug3Mass,
21  fptype m12,
22  fptype m13,
23  fptype m23,
24  unsigned int cyclic_index);
25 
32 class ResonancePdf : public GooPdf {
33  friend class TddpPdf;
34  friend class DalitzPlotPdf;
35  friend class IncoherentSumPdf;
36 
37  public:
38  ~ResonancePdf() override = default;
39 
40  __host__ virtual void recalculateCache() const {}
41 
42  __host__ Variable get_amp_real() const { return amp_real; }
43  __host__ Variable get_amp_img() const { return amp_imag; }
44 
45  protected:
47  ResonancePdf(std::string name, Variable ar, Variable ai)
48  : GooPdf(name)
49  , amp_real(ar)
50  , amp_imag(ai) {
51  // Dummy index for constants - won't use it, but calling
52  // functions can't know that and will call setConstantIndex anyway.
53  pindices.push_back(0);
54  }
55 
56  void setConstantIndex(unsigned int idx) { host_indices[parameters + 1] = idx; }
57 
60 
61  std::vector<unsigned int> pindices;
62 
63  std::vector<fptype> host_constants;
64 };
65 
66 namespace Resonances {
68 class RBW : public ResonancePdf {
69  public:
70  RBW(std::string name,
71  Variable ar,
72  Variable ai,
73  Variable mass,
74  Variable width,
75  unsigned int sp,
76  unsigned int cyc,
77  bool sym = false);
78  ~RBW() override = default;
79 };
80 
82 class LASS : public ResonancePdf {
83  public:
84  LASS(std::string name, Variable ar, Variable ai, Variable mass, Variable width, unsigned int sp, unsigned int cyc);
85  ~LASS() override = default;
86 };
87 
89 class GS : public ResonancePdf {
90  public:
91  GS(std::string name, Variable ar, Variable ai, Variable mass, Variable width, unsigned int sp, unsigned int cyc);
92  ~GS() override = default;
93 };
94 
96 class FLATTE : public ResonancePdf {
97  public:
98  FLATTE(std::string name,
99  Variable ar,
100  Variable ai,
101  Variable mean,
102  Variable g1,
103  Variable rg2og1,
104  unsigned int cyc,
105  bool symmDP);
106  ~FLATTE() override = default;
107 };
108 
110 class Gauss : public ResonancePdf {
111  public:
112  Gauss(std::string name, Variable ar, Variable ai, Variable mean, Variable sigma, unsigned int cyc);
113  ~Gauss() override = default;
114 };
115 
117 class NonRes : public ResonancePdf {
118  public:
119  NonRes(std::string name, Variable ar, Variable ai);
120  ~NonRes() override = default;
121 };
122 
124 class Spline : public ResonancePdf {
125  public:
126  Spline(std::string name,
127  Variable ar,
128  Variable ai,
129  std::vector<fptype> &HH_bin_limits,
130  std::vector<Variable> &pwa_coefs_reals,
131  std::vector<Variable> &pwa_coefs_imags,
132  unsigned int cyc,
133  bool symmDP = false);
134  ~Spline() override = default;
135 
137  __host__ void recalculateCache() const override;
138 };
139 } // namespace Resonances
140 
141 } // namespace GooFit
Cubic spline constructor.
Definition: ResonancePdf.h:124
double fptype
unsigned int host_indices[maxParams]
Definition: PdfBase.cpp:31
void setConstantIndex(unsigned int idx)
Definition: ResonancePdf.h:56
Nonresonant constructor.
Definition: ResonancePdf.h:117
__device__ fptype spinFactor(unsigned int spin, fptype motherMass, fptype daug1Mass, fptype daug2Mass, fptype daug3Mass, fptype m12, fptype m13, fptype m23, unsigned int cyclic_index)
__device__ fptype dampingFactorSquare(const fptype &cmmom, const int &spin, const fptype &mRadius)
std::vector< unsigned int > pindices
Definition: ResonancePdf.h:61
Gaussian constructor.
Definition: ResonancePdf.h:110
Observable * m12
unsigned int parameters
Definition: PdfBase.h:132
FLATTE constructor.
Definition: ResonancePdf.h:96
thrust::complex< fptype > fpcomplex
Definition: Complex.h:8
ResonancePdf(std::string name, Variable ar, Variable ai)
Special constructor that subclasses use.
Definition: ResonancePdf.h:47
Gounaris-Sakurai.
Definition: ResonancePdf.h:89
Observable * m13
Observable * sigma
__host__ Variable get_amp_img() const
Definition: ResonancePdf.h:43
~ResonancePdf() override=default
__host__ Variable get_amp_real() const
Definition: ResonancePdf.h:42
__device__ fptype twoBodyCMmom(double rMassSq, fptype d1m, fptype d2m)
std::vector< fptype > host_constants
Definition: ResonancePdf.h:63
Relativistic Breit-Wigner.
Definition: ResonancePdf.h:68
fpcomplex(* resonance_function_ptr)(fptype, fptype, fptype, unsigned int *)
Definition: ResonancePdf.h:10
virtual __host__ void recalculateCache() const
Definition: ResonancePdf.h:40