15 std::vector<AbsDensity*> &densityComponents,
16 std::vector<Double_t> &weights) :
AbsDensity(pdfName) {
18 init(thePhaseSpace, densityComponents, weights);
24 Double_t w1, Double_t w2) :
AbsDensity(pdfName) {
26 std::vector<AbsDensity*> densityVector(2);
27 densityVector[0] = d1;
28 densityVector[1] = d2;
30 std::vector<Double_t> weightVector(2);
34 init(thePhaseSpace, densityVector, weightVector);
40 Double_t w1, Double_t w2, Double_t w3) :
AbsDensity(pdfName) {
42 std::vector<AbsDensity*> densityVector(3);
43 densityVector[0] = d1;
44 densityVector[1] = d2;
45 densityVector[2] = d3;
47 std::vector<Double_t> weightVector(3);
52 init(thePhaseSpace, densityVector, weightVector);
58 Double_t w1, Double_t w2, Double_t w3, Double_t w4) :
AbsDensity(pdfName) {
60 std::vector<AbsDensity*> densityVector(4);
61 densityVector[0] = d1;
62 densityVector[1] = d2;
63 densityVector[2] = d3;
64 densityVector[3] = d4;
66 std::vector<Double_t> weightVector(4);
72 init(thePhaseSpace, densityVector, weightVector);
80 std::vector<AbsDensity*> &densityComponents,
81 std::vector<Double_t> &weights) {
87 if (densityComponents.size() != weights.size() ) {
88 Logger::print(2,
"%20.20s ERROR: Dimensionalities of the phase space and weight vectors differ\n",
m_name);
92 Logger::print(0,
"%20.20s INFO: Creating sum density of %d components\n",
m_name, (UInt_t)densityComponents.size() );
96 std::vector<AbsDensity*>::iterator i;
97 for (i=densityComponents.begin(); i != densityComponents.end(); i++) {
98 UInt_t dim = (*i)->phaseSpace()->dimensionality();
100 Logger::print(2,
"%20.20s ERROR: Dimensionalities of the sum phase space and its component %s differ\n",
m_name, (*i)->name() );
109 if (x.size() !=
m_dim) {
110 Logger::print(2,
"%20.20s ERROR: Dimensionality of vector (%d) does not correspond to phase space definition (%d)\n",
Double_t density(std::vector< Double_t > &x)
Calculate PDF value at the given point.
Abstract class which defines probability density interface.
void print(int level, const char *format,...)
char m_name[256]
PDF name.
virtual ~SumDensity()
Destructor.
AbsPhaseSpace * m_phaseSpace
Reference to phase space.
std::vector< Double_t > m_weights
Vector of density component weights.
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.
void init(AbsPhaseSpace *thePhaseSpace, std::vector< AbsDensity * > &densityComponents, std::vector< Double_t > &weights)
Common initialise function used by all constructors.
Abstract class which defines phase space interface.
UInt_t m_dim
Cached dimensionality of the phase space.
virtual UInt_t dimensionality()=0
Get dimensionality of phase space.
std::vector< AbsDensity * > m_densityComponents
Vector of density components.
virtual Double_t density(std::vector< Double_t > &x)=0
Calculate PDF value at the given point.