45 #ifndef ROOT_TMVA_PDEFoamTargetDensity
53 TMVA::PDEFoamTargetDensity::PDEFoamTargetDensity()
54 : PDEFoamDensityBase()
79 , fTarget(distr.fTarget)
102 Log() <<
kFATAL <<
"<PDEFoamTargetDensity::Density()> Binary tree not found!" <<
Endl;
105 std::vector<Double_t> lb(GetBox().size());
106 std::vector<Double_t> ub(GetBox().size());
109 const Double_t probevolume_inv = 1.0 / GetBoxVolume();
112 for (
UInt_t idim = 0; idim < GetBox().size(); ++idim) {
113 lb[idim] = xev[idim] - GetBox().at(idim) / 2.0;
114 ub[idim] = xev[idim] + GetBox().at(idim) / 2.0;
118 std::vector<const TMVA::BinarySearchTreeNode*> nodes;
121 const Double_t sumOfWeights = fBst->SearchVolume(&volume, &nodes);
124 event_density = nodes.size() * probevolume_inv;
128 for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
129 it != nodes.end(); ++it) {
130 n_tar += ((*it)->GetTargets()).
at(fTarget) * ((*it)->GetWeight());
134 return (n_tar / (sumOfWeights + 0.1)) * probevolume_inv;
ClassImp(TMVA::PDEFoamTargetDensity) TMVA
MsgLogger & Endl(MsgLogger &ml)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Abstract ClassifierFactory template that handles arbitrary types.
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)
This function is needed during the foam buildup.