28 #ifndef ROOT_TMVA_PDEFoam 29 #define ROOT_TMVA_PDEFoam 47 class PDEFoamDensityBase;
48 class PDEFoamKernelBase;
52 enum EDTSeparation { kFoam, kGiniIndex, kMisClassificationError,
56 enum EFoamType { kSeparate, kDiscr, kMonoTarget, kMultiTarget, kMultiClass };
67 enum ECellValue { kValue, kValueError, kValueDensity, kMeanValue,
68 kRms, kRmsOvMean, kCellVolume };
151 std::vector<TMVA::PDEFoamCell*>
FindCells(
const std::vector<Float_t>&)
const;
152 std::vector<TMVA::PDEFoamCell*>
FindCells(
const std::map<Int_t,Float_t>&)
const;
153 void FindCells(
const std::map<Int_t, Float_t>&,
PDEFoamCell*, std::vector<PDEFoamCell*> &)
const;
159 template<
typename T>
T Sqr(
T x)
const {
return x*
x; }
227 std::vector<Float_t>
VarTransform(
const std::vector<Float_t> &invec)
const;
259 virtual std::vector<Float_t>
GetCellValue(
const std::map<Int_t,Float_t>& xvec, ECellValue cv );
289 std::vector<Float_t> outvec;
290 for(
UInt_t i=0; i<invec.size(); i++)
306 std::vector<Float_t> outvec;
307 for(
UInt_t i=0; i<invec.size(); i++)
This PDEFoam kernel estimates a cell value for a given event by weighting all cell values with a gaus...
Bool_t fFillFoamWithOrigWeights
void Varedu(Double_t [], Int_t &, Double_t &, Double_t &)
Internal subprogram used by Create.
virtual void FillFoamCells(const Event *ev, Float_t wt)
This function fills a weight 'wt' into the PDEFoam cell, which corresponds to the given event 'ev'...
Random number generator class based on M.
Long_t PeekMax()
Internal subprogram used by Create.
This class is the abstract kernel interface for PDEFoam.
TObjArray * fVariableNames
timer for graphical output
Int_t * fInhiDiv
[fDim] Dynamic Mask for cell division
Collectable string class.
void OutputGrow(Bool_t finished=false)
message logger
Float_t VarTransform(Int_t idim, Float_t x) const
PDEFoamCell * GetRootCell() const
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
void Grow()
Internal subprogram used by Create.
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
Double_t GetXmax(Int_t idim) const
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
Int_t Divide(PDEFoamCell *)
Internal subprogram used by Create.
TObject * At(Int_t idx) const
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
void CheckAll(Int_t)
User utility, miscellaneous and debug.
Int_t CellFill(Int_t, PDEFoamCell *)
Internal subprogram used by Create.
void MakeAlpha()
Internal subprogram used by Create.
Timer * fTimer
distribution of training events
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
#define ClassDef(name, id)
void RootPlot2dim(const TString &filename, TString opt, Bool_t createCanvas=kTRUE, Bool_t colors=kTRUE)
Debugging tool which plots the cells of a 2-dimensional PDEFoam as rectangles in C++ format readable ...
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
PDEFoamDensityBase * fDistr
Double_t GetXmin(Int_t idim) const
void ResetCellElements()
Remove the cell elements from all cells.
virtual void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
void SetMaxDepth(UInt_t maxdepth)
Implementation of PDEFoam.
void SetnSampl(Long_t nSampl)
void InitCells()
Internal subprogram used by Create.
void PrintCells()
Prints geometry of ALL cells of the FOAM.
Float_t VarTransformInvers(Int_t idim, Float_t x) const
void AddVariableName(const char *s)
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
PDEFoamDensityBase * GetDistr() const
TObjString * GetVariableName(Int_t idx)
void SetDensity(PDEFoamDensityBase *dens)
void SetDim(Int_t kDim)
Sets dimension of cubical space.
tomato 1-D histogram with a double per channel (see TH1 documentation)}
void PrintCell(Long_t iCell=0)
Prints geometry of and elements of 'iCell', as well as relations to parent and daughter cells...
EDTSeparation fDTSeparation
Double_t Eval(Double_t *xRand, Double_t &event_density)
Internal subprogram.
TString GetFoamName() const
Int_t fNoAct
[fDim] Flags for inhibiting cell division
void SetnCells(Long_t nCells)
void Create()
Basic initialization of FOAM invoked by the user.
virtual TH2D * Project2(Int_t idim1, Int_t idim2, ECellValue cell_value=kValue, PDEFoamKernelBase *kernel=NULL, UInt_t nbin=50)
Project foam variable idim1 and variable idim2 to histogram.
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...
void AddVariableName(TObjString *s)
ostringstream derivative to redirect and format output
This PDEFoam kernel estimates a cell value for a given event by weighting with cell values of the nea...
Mother of all ROOT objects.
Abstract ClassifierFactory template that handles arbitrary types.
void DeleteBinarySearchTree()
Delete the foam's density estimator, which contains the binary search tree.
void FillBinarySearchTree(const Event *ev)
Insert event to internal foam's density estimator PDEFoamDensityBase.
virtual ~PDEFoam()
Default destructor.
void SetEvPerBin(Int_t EvPerBin)
This is an abstract class, which provides an interface for a PDEFoam density estimator.
This class is a trivial PDEFoam kernel estimator.
UInt_t GetNInActiveCells() const
Timing information for training and evaluation of MVA methods.
UInt_t GetNActiveCells() const
void SetInhiDiv(Int_t, Int_t)
This can be called before Create, after setting kDim It defines which variables are excluded in the p...
PDEFoam()
Default constructor for streamer, user should not use it.
tomato 2-D histogram with a double per channel (see TH1 documentation)}
UInt_t GetMaxDepth() const