36 #ifndef ROOT_TMVA_PDEFoamKernelLinN
45 TMVA::PDEFoamKernelLinN::PDEFoamKernelLinN()
75 Log() <<
kFATAL <<
"<PDEFoamKernelLinN::Estimate>: PDEFoam not set!" <<
Endl;
77 return WeightLinNeighbors(foam, txvec, cv,
kTRUE);
108 Log() <<
kFATAL <<
"Wrong dimension of event variable!" <<
Endl;
114 cell->
GetHcub(cellPosi, cellSize);
123 cellval = GetAverageNeighborsValue(foam, txvec, cv);
127 std::vector<Float_t> ntxvec(txvec);
131 mindist = (txvec[dim] - cellPosi[dim]) / cellSize[dim];
133 ntxvec[dim] = cellPosi[dim] - xoffset;
134 mindistcell = foam->
FindCell(ntxvec);
136 mindist = 1 - mindist;
137 ntxvec[dim] = cellPosi[dim] + cellSize[dim] + xoffset;
138 mindistcell = foam->
FindCell(ntxvec);
145 result += cellval * (0.5 + mindist);
146 result += mindistcellval * (0.5 - mindist);
150 if (norm == 0)
return cellval;
151 else return result /
norm;
166 std::vector<Float_t> &txvec,
176 cell->
GetHcub(cellPosi, cellSize);
180 std::vector<Float_t> ntxvec(txvec);
185 ntxvec[dim] = cellPosi[dim] - xoffset;
193 ntxvec[dim] = cellPosi[dim] + cellSize[dim] + xoffset;
194 right_cell = foam->
FindCell(ntxvec);
201 if (norm > 0) result /=
norm;
MsgLogger & Endl(MsgLogger &ml)
ClassImp(TMVA::PDEFoamKernelLinN) TMVA
Default constructor for streamer.
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)
Linear neighbors kernel estimator.
Float_t WeightLinNeighbors(PDEFoam *, std::vector< Float_t > &, ECellValue, Bool_t)
Returns the cell value, corresponding to 'txvec' (foam coordinates [0,1]), weighted by the neighbor c...
virtual Float_t GetCellValue(const std::vector< Float_t > &xvec, ECellValue cv, PDEFoamKernelBase *)
This function finds the cell, which corresponds to the given untransformed event vector 'xvec' and re...
Abstract ClassifierFactory template that handles arbitrary types.
Float_t GetAverageNeighborsValue(PDEFoam *, std::vector< Float_t > &, ECellValue)
This function returns the average value 'cv' of only nearest neighbor cells.
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
double norm(double *x, double *p)