62 TMVA::PDEFoamDiscriminantDensity::PDEFoamDiscriminantDensity()
63 : PDEFoamDensityBase()
112 Log() <<
kFATAL <<
"<PDEFoamDiscriminantDensity::Density()> Binary tree not set!" <<
Endl;
115 std::vector<Double_t> lb(GetBox().size());
116 std::vector<Double_t> ub(GetBox().size());
119 const Double_t probevolume_inv = 1.0 / GetBoxVolume();
122 for (
UInt_t idim = 0; idim < GetBox().size(); ++idim) {
123 lb[idim] = xev[idim] - GetBox().at(idim) / 2.0;
124 ub[idim] = xev[idim] + GetBox().at(idim) / 2.0;
128 std::vector<const TMVA::BinarySearchTreeNode*> nodes;
131 const Double_t sumOfWeights = fBst->SearchVolume(&volume, &nodes);
134 event_density = nodes.size() * probevolume_inv;
138 for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
139 it != nodes.end(); ++it) {
140 if ((*it)->GetClass() ==
fClass)
141 n_sig += (*it)->GetWeight();
145 return (n_sig / (sumOfWeights + 0.1)) * probevolume_inv;
MsgLogger & Endl(MsgLogger &ml)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
double distr(double *x, double *p)
TClass * fClass
pointer to the foreign object
PDEFoamDiscriminantDensity()
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)
This function is needed during the foam buildup.
ClassImp(TMVA::PDEFoamDiscriminantDensity) TMVA