GooFit  v2.1.3
LineshapesPdf.h
Go to the documentation of this file.
1 /*
2 04/05/2016 Christoph Hasse
3 DISCLAIMER:
4 
5 This code is not sufficently tested yet and still under heavy development!
6 See *.cu file for more details
7 */
8 
9 #pragma once
10 
11 #include <goofit/PDFs/GooPdf.h>
13 #include <goofit/Variable.h>
14 #include <goofit/Version.h>
15 
16 #include <array>
17 
18 #include <goofit/detail/Complex.h>
19 
20 namespace GooFit {
21 
22 class SpinFactor;
23 
24 // PDG notation for FF
25 enum class FF : unsigned int { One = 0, BL, BL_Prime, BL2 };
26 
33 
34 class Lineshape : public GooPdf {
35  protected:
36  friend class DPPdf;
37  friend class TDDP4;
38 
39  std::vector<unsigned int> pindices{0};
40 
42  Lineshape(std::string name);
43 
44  public:
45  ~Lineshape() override = default;
46 
47  void setConstantIndex(unsigned int idx) { host_indices[parameters + 1] = idx; }
48 
49  bool operator==(const Lineshape &L) const { return (L.getName() == getName()); }
50 };
51 
52 namespace Lineshapes {
53 
54 using spline_t = std::tuple<fptype, fptype, unsigned int>;
55 
56 class RBW : public Lineshape {
57  public:
58  RBW(std::string name,
59  Variable mass,
60  Variable width,
61  unsigned int L,
62  unsigned int Mpair,
63  FF FormFac = FF::BL_Prime,
64  fptype radius = 1.5);
65 
66  ~RBW() override = default;
67 };
68 
69 class One : public Lineshape {
70  public:
71  One(std::string name,
72  Variable mass,
73  Variable width,
74  unsigned int L,
75  unsigned int Mpair,
76  FF FormFac = FF::BL_Prime,
77  fptype radius = 1.5);
78 
79  ~One() override = default;
80 };
81 
82 class LASS : public Lineshape {
83  public:
84  LASS(std::string name,
85  Variable mass,
86  Variable width,
87  unsigned int L,
88  unsigned int Mpair,
89  FF FormFac = FF::BL_Prime,
90  fptype radius = 1.5);
91 
92  ~LASS() override = default;
93 };
94 
95 class NonRes : public Lineshape {
96  public:
97  NonRes(std::string name,
98  Variable mass,
99  Variable width,
100  unsigned int L,
101  unsigned int Mpair,
102  FF FormFac = FF::BL_Prime,
103  fptype radius = 1.5);
104 
105  ~NonRes() override = default;
106 };
107 
108 class Bugg : public Lineshape {
109  public:
110  Bugg(std::string name,
111  Variable mass,
112  Variable width,
113  unsigned int L,
114  unsigned int Mpair,
115  FF FormFac = FF::BL_Prime,
116  fptype radius = 1.5);
117 
118  ~Bugg() override = default;
119 };
120 
121 class Bugg3 : public Lineshape {
122  public:
123  Bugg3(std::string name,
124  Variable mass,
125  Variable width,
126  unsigned int L,
127  unsigned int Mpair,
128  FF FormFac = FF::BL_Prime,
129  fptype radius = 1.5);
130 
131  ~Bugg3() override = default;
132 };
133 
134 class Flatte : public Lineshape {
135  public:
136  Flatte(std::string name,
137  Variable mass,
138  Variable width,
139  unsigned int L,
140  unsigned int Mpair,
141  FF FormFac = FF::BL_Prime,
142  fptype radius = 1.5);
143 
144  ~Flatte() override = default;
145 };
146 
147 class SBW : public Lineshape {
148  public:
149  SBW(std::string name,
150  Variable mass,
151  Variable width,
152  unsigned int L,
153  unsigned int Mpair,
154  FF FormFac = FF::BL_Prime,
155  fptype radius = 1.5);
156 
157  ~SBW() override = default;
158 };
159 
160 class FOCUS : public Lineshape {
161  public:
162  enum class Mod { Kpi = 0, KEta, I32 };
163  FOCUS(std::string name,
164  Mod mod,
165  Variable mass,
166  Variable width,
167  unsigned int L,
168  unsigned int Mpair,
169  FF FormFac = FF::BL_Prime,
170  fptype radius = 1.5);
171 
172  ~FOCUS() override = default;
173 };
174 
175 #if GOOFIT_KMATRIX
176 class kMatrix : public Lineshape {
177  public:
178  kMatrix(std::string name,
179  unsigned int pterm, //< 0 or 1
180  bool is_pole, //< False for prod
181  Variable sA0,
182  Variable sA,
183  Variable s0_prod,
184  Variable s0_scatt,
185  std::array<Variable, 5> f,
186  std::array<Variable, 5 * 6> poles,
187  Variable mass,
188  Variable width,
189  unsigned int L,
190  unsigned int Mpair,
191  FF FormFac = FF::BL_Prime,
192  fptype radius = 1.5);
193 
194  ~kMatrix() override = default;
195 };
196 #endif
197 
198 class GLASS : public Lineshape {
199  public:
200  GLASS(std::string name,
201  Variable mass,
202  Variable width,
203  unsigned int L,
204  unsigned int Mpair,
205  FF FormFac,
206  fptype radius,
207  std::vector<Variable> AdditionalVars);
208 
209  ~GLASS() override = default;
210 };
211 
213 class GSpline : public Lineshape {
214  public:
216  GSpline(std::string name,
217  Variable mass,
218  Variable width,
219  unsigned int L,
220  unsigned int Mpair,
221  FF FormFac,
222  fptype radius,
223  std::vector<Variable> AdditionalVars,
224  spline_t SplineInfo);
225 
226  ~GSpline() override = default;
227 };
228 } // namespace Lineshapes
229 
230 class Amplitude {
231  friend class DPPdf;
232  friend class TDDP4;
233 
234  public:
235  Amplitude(std::string uniqueDecayStr,
236  Variable ar,
237  Variable ai,
238  std::vector<Lineshape *> LS,
239  std::vector<SpinFactor *> SF,
240  unsigned int nPerm = 1);
241 
242  bool operator==(const Amplitude &A) const;
243 
244  private:
245  std::string _uniqueDecayStr;
246  Variable _ar;
247  Variable _ai;
248  std::vector<SpinFactor *> _SF;
249  std::vector<Lineshape *> _LS;
250  unsigned int _nPerm;
251 };
252 } // namespace GooFit
double fptype
unsigned int host_indices[maxParams]
Definition: PdfBase.cpp:31
A spline implementaiton for the width (Gamma = G)
bool operator==(const Lineshape &L) const
Definition: LineshapesPdf.h:49
std::tuple< fptype, fptype, unsigned int > spline_t
Definition: LineshapesPdf.h:54
void setConstantIndex(unsigned int idx)
Definition: LineshapesPdf.h:47
__host__ std::string getName() const
Definition: PdfBase.h:93