GooFit  v2.1.3
IncoherentSumPdf.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <goofit/PDFs/GooPdf.h>
6 
7 namespace GooFit {
8 
9 // Very similar class to TddpPdf, but without time dependence
10 // (so no time resolution or mixing) and ignoring interference between
11 // waves. This makes the code just different enough, the assumptions are
12 // just enough changed, that it's not worth trying to modify or subclass
13 // TddpPdf to deal with both cases. So instead we have a separate
14 // class with fairly similar structure.
15 
16 class SpecialIncoherentIntegrator;
17 class SpecialIncoherentResonanceCalculator;
18 
19 class IncoherentSumPdf : public GooPdf {
20  public:
22  std::string n, Observable m12, Observable m13, EventNumber eventNumber, DecayInfo3 decay, GooPdf *eff);
23  // Note that 'efficiency' refers to anything which depends on (m12, m13) and multiplies the
24  // incoherent sum. The caching method requires that it be done this way or the ProdPdf
25  // normalisation will get *really* confused and give wrong answers.
26  __host__ fptype normalize() const override;
27  __host__ void setDataSize(unsigned int dataSize, unsigned int evtSize = 3);
28  __host__ void setForceIntegrals(bool f = true) { forceRedoIntegrals = f; }
29 
30  protected:
31  private:
32  DecayInfo3 decayInfo;
33  Observable _m12;
34  Observable _m13;
35  fptype *dalitzNormRange;
36 
37  // Following variables are useful if masses and widths, involved in difficult BW calculation,
38  // change infrequently while amplitudes, only used in adding BW results together, change rapidly.
39  thrust::device_vector<fpcomplex> *cachedResonances; // BW (and other) results for each event.
40  double *integrals; // Integrals of each BW resonance across the Daliz plot.
41 
42  bool *redoIntegral;
43  mutable bool forceRedoIntegrals;
44  fptype *cachedMasses;
45  fptype *cachedWidths;
46  int totalEventSize;
47  int cacheToUse;
48  PdfBase *efficiency;
49  SpecialIncoherentIntegrator **integrators;
51 };
52 
53 class SpecialIncoherentIntegrator : public thrust::unary_function<thrust::tuple<int, fptype *>, fptype> {
54  public:
55  SpecialIncoherentIntegrator(int pIdx, unsigned int ri);
56  __device__ fptype operator()(thrust::tuple<int, fptype *> t) const;
57 
58  private:
59  unsigned int resonance_i;
60  unsigned int parameters;
61 };
62 
64  : public thrust::unary_function<thrust::tuple<int, fptype *, int>, fpcomplex> {
65  public:
66  SpecialIncoherentResonanceCalculator(int pIdx, unsigned int res_idx);
67  __device__ fpcomplex operator()(thrust::tuple<int, fptype *, int> t) const;
68 
69  private:
70  unsigned int resonance_i;
71  unsigned int parameters;
72 };
73 
74 } // namespace GooFit
double fptype
Observable * m12
Special class for observables. Used in DataSets.
Definition: Variable.h:109
unsigned int parameters
Definition: PdfBase.h:132
thrust::complex< fptype > fpcomplex
Definition: Complex.h:8
Observable * m13
__host__ void setForceIntegrals(bool f=true)
EventNumber * eventNumber
__host__ fptype normalize() const override
A normalize function. This fills in the host_normalize.
IncoherentSumPdf(std::string n, Observable m12, Observable m13, EventNumber eventNumber, DecayInfo3 decay, GooPdf *eff)
__host__ void setDataSize(unsigned int dataSize, unsigned int evtSize=3)