70 TMVA::PDEFoamMultiTarget::PDEFoamMultiTarget()
72 , fTargetSelection(
kMean)
99 , fTargetSelection(ts)
108 , fTargetSelection(from.fTargetSelection)
110 Log() <<
kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
133 std::map<Int_t, Float_t> txvec;
134 for (std::map<Int_t, Float_t>::const_iterator it = xvec.begin();
135 it != xvec.end(); ++it) {
136 Float_t coordinate = it->second;
137 Int_t dim = it->first;
140 if (coordinate <= fXmin[dim])
142 else if (coordinate >= fXmax[dim])
145 txvec.insert(std::pair<Int_t, Float_t>(dim, VarTransform(dim, coordinate)));
149 std::map<Int_t, Float_t> target;
152 std::vector<PDEFoamCell*> cells = FindCells(txvec);
156 return std::vector<Float_t>(GetTotDim() - xvec.size(), 0);
160 for (
Int_t idim = 0; idim < GetTotDim(); ++idim) {
162 if (txvec.find(idim) == txvec.end())
163 target.insert(std::pair<Int_t, Float_t>(idim, 0));
166 switch (fTargetSelection) {
168 CalculateMean(target, cells);
171 CalculateMpv(target, cells);
174 Log() <<
"<PDEFoamMultiTarget::GetCellValue>: "
175 <<
"unknown target selection type!" <<
Endl;
180 std::vector<Float_t>
result;
181 result.reserve(target.size());
182 for (std::map<Int_t, Float_t>::const_iterator it = target.begin();
183 it != target.end(); ++it)
184 result.push_back(it->second);
208 for (std::vector<PDEFoamCell*>::const_iterator cell_it = cells.begin();
209 cell_it != cells.end(); ++cell_it) {
215 if (cell_density > max_dens) {
217 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
218 (*cell_it)->GetHcub(cellPosi, cellSize);
221 max_dens = cell_density;
224 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
225 target_it != target.end(); ++target_it) {
226 const Int_t dim = target_it->first;
228 VarTransformInvers(dim, cellPosi[dim] + 0.5 * cellSize[dim]);
251 std::map<Int_t, Float_t>
norm;
254 for (std::vector<PDEFoamCell*>::const_iterator cell_it = cells.begin();
255 cell_it != cells.end(); ++cell_it) {
261 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
262 (*cell_it)->GetHcub(cellPosi, cellSize);
265 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
266 target_it != target.end(); ++target_it) {
267 const Int_t dim = target_it->first;
268 target_it->second += cell_density *
269 VarTransformInvers(dim, cellPosi[dim] + 0.5 * cellSize[dim]);
270 norm[dim] += cell_density;
275 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
276 target_it != target.end(); ++target_it) {
279 const Int_t dim = target_it->first;
283 target[dim] /= norm[dim];
287 target[dim] = (fXmax[dim] - fXmin[dim]) / 2.;
MsgLogger & Endl(MsgLogger &ml)
virtual void CalculateMean(std::map< Int_t, Float_t > &, const std::vector< PDEFoamCell * > &)
ClassImp(TMVA::PDEFoamMultiTarget) TMVA
Default constructor for streamer, user should not use it.
virtual void CalculateMpv(std::map< Int_t, Float_t > &, const std::vector< PDEFoamCell * > &)
virtual std::vector< Float_t > GetCellValue(const std::map< Int_t, Float_t > &, ECellValue)
This function is overridden from PDFEFoam.
double norm(double *x, double *p)