60 TMVA::PDEFoamTargetDensity::PDEFoamTargetDensity()
61 : PDEFoamDensityBase()
86 , fTarget(distr.fTarget)
109 Log() <<
kFATAL <<
"<PDEFoamTargetDensity::Density()> Binary tree not found!" <<
Endl;
112 std::vector<Double_t> lb(GetBox().size());
113 std::vector<Double_t> ub(GetBox().size());
116 const Double_t probevolume_inv = 1.0 / GetBoxVolume();
119 for (
UInt_t idim = 0; idim < GetBox().size(); ++idim) {
120 lb[idim] = xev[idim] - GetBox().at(idim) / 2.0;
121 ub[idim] = xev[idim] + GetBox().at(idim) / 2.0;
125 std::vector<const TMVA::BinarySearchTreeNode*> nodes;
128 const Double_t sumOfWeights = fBst->SearchVolume(&volume, &nodes);
131 event_density = nodes.size() * probevolume_inv;
135 for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
136 it != nodes.end(); ++it) {
137 n_tar += ((*it)->GetTargets()).
at(fTarget) * ((*it)->GetWeight());
141 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)
double distr(double *x, double *p)
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)
This function is needed during the foam buildup.