meerkat is hosted by Hepforge, IPPP Durham
Meerkat  v1r3
Multidimensional kernel density estimation package
SumDensity.hh
Go to the documentation of this file.
1 #ifndef SUM_DENSITY
2 #define SUM_DENSITY
3 
4 #include "AbsDensity.hh"
5 #include "AbsPhaseSpace.hh"
6 
7 #include "TMath.h"
8 
9 #include <vector>
10 
12 
13 class SumDensity : public AbsDensity {
14 
15  public:
16 
18 
24  SumDensity(const char* pdfName,
25  AbsPhaseSpace* thePhaseSpace,
26  std::vector<AbsDensity*> &densityComponents,
27  std::vector<Double_t> &weights);
28 
30 
38  SumDensity(const char* pdfName,
39  AbsPhaseSpace* thePhaseSpace,
40  AbsDensity* d1,
41  AbsDensity* d2,
42  Double_t w1 = 1.,
43  Double_t w2 = 1.);
44 
46 
56  SumDensity(const char* pdfName,
57  AbsPhaseSpace* thePhaseSpace,
58  AbsDensity* d1,
59  AbsDensity* d2,
60  AbsDensity* d3,
61  Double_t w1 = 1.,
62  Double_t w2 = 1.,
63  Double_t w3 = 1.);
64 
66 
78  SumDensity(const char* pdfName,
79  AbsPhaseSpace* thePhaseSpace,
80  AbsDensity* d1,
81  AbsDensity* d2,
82  AbsDensity* d3,
83  AbsDensity* d4,
84  Double_t w1 = 1.,
85  Double_t w2 = 1.,
86  Double_t w3 = 1.,
87  Double_t w4 = 1.);
88 
90  virtual ~SumDensity();
91 
93 
97  Double_t density(std::vector<Double_t> &x);
98 
100 
104 
105  private:
106 
108 
113  void init(AbsPhaseSpace* thePhaseSpace,
114  std::vector<AbsDensity*> &densityComponents,
115  std::vector<Double_t> &weights);
116 
119 
121  std::vector<AbsDensity*> m_densityComponents;
122 
124  std::vector<Double_t> m_weights;
125 
127  UInt_t m_dim;
128 
129 };
130 
131 #endif
Double_t density(std::vector< Double_t > &x)
Calculate PDF value at the given point.
Definition: SumDensity.cpp:107
Abstract class which defines probability density interface.
Definition: AbsDensity.hh:16
AbsPhaseSpace * phaseSpace()
Return phase space definition for this PDF.
Definition: SumDensity.hh:103
virtual ~SumDensity()
Destructor.
Definition: SumDensity.cpp:75
AbsPhaseSpace * m_phaseSpace
Reference to phase space.
Definition: SumDensity.hh:118
std::vector< Double_t > m_weights
Vector of density component weights.
Definition: SumDensity.hh:124
SumDensity(const char *pdfName, AbsPhaseSpace *thePhaseSpace, std::vector< AbsDensity * > &densityComponents, std::vector< Double_t > &weights)
Constructor of Sum density of an arbitrary number of density components.
Definition: SumDensity.cpp:13
void init(AbsPhaseSpace *thePhaseSpace, std::vector< AbsDensity * > &densityComponents, std::vector< Double_t > &weights)
Common initialise function used by all constructors.
Definition: SumDensity.cpp:79
Abstract class which defines phase space interface.
UInt_t m_dim
Cached dimensionality of the phase space.
Definition: SumDensity.hh:127
Class that describes the sum density: the sum of two or more densities in the same phase spaces with ...
Definition: SumDensity.hh:13
std::vector< AbsDensity * > m_densityComponents
Vector of density components.
Definition: SumDensity.hh:121