ROOT logo
ROOT » TMVA » TMVA::PDEFoam

class TMVA::PDEFoam: public TObject


 Implementation of PDEFoam

 The PDEFoam method is an
 extension of the PDERS method, which uses self-adapting binning to
 divide the multi-dimensional phase space in a finite number of
 hyper-rectangles (boxes).

 For a given number of boxes, the binning algorithm adjusts the size
 and position of the boxes inside the multidimensional phase space,
 minimizing the variance of the signal and background densities inside
 the boxes. The binned density information is stored in binary trees,
 allowing for a very fast and memory-efficient classification of
 events.

 The implementation of the PDEFoam is based on the monte-carlo
 integration package PDEFoam included in the analysis package ROOT.

Function Members (Methods)

public:
virtual~PDEFoam()
voidTObject::AbstractMethod(const char* method) const
voidAddVariableName(const char* s)
voidAddVariableName(TObjString* s)
voidAddXMLTo(void* parent)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
voidCalcCellDiscr()
voidCalcCellTarget()
voidCheckAll(Int_t)
voidCheckCells(Bool_t remove_empty_cells = false)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
voidCreate()
virtual voidTObject::Delete(Option_t* option = "")MENU
voidDeleteBinarySearchTree()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
TH1D*Draw1Dim(const char* opt, Int_t nbin)
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
voidFillBinarySearchTree(const TMVA::Event* ev, Bool_t NoNegWeights = kFALSE)
voidFillFoamCells(const TMVA::Event* ev, Bool_t NoNegWeights = kFALSE)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Double_tGetAverageNeighborsValue(vector<Float_t>& txvec, TMVA::ECellValue cv)
Double_tGetCellDensity(vector<Float_t>& xvec, TMVA::EKernel kernel = kNone)
Double_tGetCellDiscr(vector<Float_t>& xvec, TMVA::EKernel kernel = kNone)
Double_tGetCellRegValue0(vector<Float_t>&, TMVA::EKernel kernel = kNone)
Double_tGetCellValue(vector<Float_t>&, TMVA::ECellValue)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Bool_tGetFillFoamWithOrigWeights() const
TStringGetFoamName() const
TMVA::EFoamTypeGetFoamType() const
virtual const char*TObject::GetIconName() const
UInt_tGetMaxDepth() const
UInt_tGetNActiveCells() const
virtual const char*TObject::GetName() const
UInt_tGetNCells() const
UInt_tGetNElements() const
UInt_tGetNInActiveCells() const
UInt_tGetNmin()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
vector<Float_t>GetProjectedRegValue(vector<Float_t>& vals, TMVA::EKernel kernel = kNone, TMVA::ETargetSelection ts = kMean)
Double_tGetProjectionCellValue(TMVA::PDEFoamCell* cell, Int_t idim1, Int_t idim2, TMVA::ECellValue cv)
TMVA::PDEFoamCell*GetRootCell() const
virtual const char*TObject::GetTitle() const
Int_tGetTotDim() const
virtual UInt_tTObject::GetUniqueID() const
TObjString*GetVariableName(Int_t idx)
Float_tGetVolumeFraction() const
Double_tGetXmax(Int_t idim) const
Double_tGetXmin(Int_t idim) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
voidInit()
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
TMVA::MsgLogger&Log() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TMVA::PDEFoam&operator=(const TMVA::PDEFoam&)
virtual voidTObject::Paint(Option_t* option = "")
TMVA::PDEFoamPDEFoam()
TMVA::PDEFoamPDEFoam(const TString&)
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
voidPrintCell(Long_t iCell = 0)
voidPrintCellElements()
voidPrintCells()
voidPrintStream(ostream&) const
TH2D*Project2(Int_t idim1, Int_t idim2, const char* opt = "cell_value", const char* ker = "kNone", UInt_t maxbins = 50)
virtual Int_tTObject::Read(const char* name)
voidReadStream(istream&)
voidReadXML(void* parent)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRemoveEmptyCell(Int_t iCell)
voidTObject::ResetBit(UInt_t f)
voidResetCellElements(Bool_t allcells = false)
voidRootPlot2dim(const TString& filename, TString opt, Bool_t CreateCanvas = kTRUE, Bool_t colors = kTRUE, Bool_t log_colors = kFALSE)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetDim(Int_t kDim)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetDTSeparation(TMVA::EDTSeparation new_val)
voidSetEvPerBin(Int_t EvPerBin)
voidSetFillFoamWithOrigWeights(Bool_t new_val)
voidSetFoamType(TMVA::EFoamType ft)
voidSetInhiDiv(Int_t, Int_t)
voidSetMaxDepth(UInt_t maxdepth)
voidSetnBin(Int_t nBin)
voidSetnCells(Long_t nCells)
voidSetNElements(UInt_t numb)
voidSetNmin(UInt_t val)
voidSetnSampl(Long_t nSampl)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPeekMax(Bool_t new_val)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVolumeFraction(Float_t vfr)
voidSetXmax(Int_t idim, Double_t wmax)
voidSetXmin(Int_t idim, Double_t wmin)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
vector<Float_t>VarTransform(vector<Float_t>& invec) const
Float_tVarTransform(Int_t idim, Float_t x) const
vector<Float_t>VarTransformInvers(vector<Float_t>& invec) const
Float_tVarTransformInvers(Int_t idim, Float_t x) const
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
Int_tCellFill(Int_t, TMVA::PDEFoamCell*)
Bool_tCellValueIsUndefined(TMVA::PDEFoamCell*)
Int_tDivide(TMVA::PDEFoamCell*)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidDTExplore(TMVA::PDEFoamCell* Cell)
Double_tEval(Double_t* xRand, Double_t& event_density)
voidExplore(TMVA::PDEFoamCell* Cell)
TMVA::PDEFoamCell*FindCell(vector<Float_t>&)
vector<TMVA::PDEFoamCell*>FindCells(vector<Float_t>&)
voidFindCellsRecursive(vector<Float_t>&, TMVA::PDEFoamCell*, vector<TMVA::PDEFoamCell*,allocator<TMVA::PDEFoamCell*> >&)
Double_tGetBuildUpCellEvents(TMVA::PDEFoamCell* cell)
Double_tGetCellElement(TMVA::PDEFoamCell* cell, UInt_t i)
vector<Float_t>GetCellTargets(vector<Float_t>& tvals, TMVA::ETargetSelection ts)
Double_tGetCellValue(TMVA::PDEFoamCell*, TMVA::ECellValue)
Float_tGetSeparation(Float_t s, Float_t b)
voidGrow()
voidInitCells()
voidMakeAlpha()
voidTObject::MakeZombie()
voidOutputGrow(Bool_t finished = false)
TMVA::PDEFoamPDEFoam(const TMVA::PDEFoam&)
Long_tPeekLast()
Long_tPeekMax()
voidSetCellElement(TMVA::PDEFoamCell* cell, UInt_t i, Double_t value)
voidVaredu(Double_t*, Int_t&, Double_t&, Double_t&)
Float_tWeightGaus(TMVA::PDEFoamCell*, vector<Float_t>&, UInt_t dim = 0)
Double_tWeightLinNeighbors(vector<Float_t>& txvec, TMVA::ECellValue cv, Int_t dim1 = -1, Int_t dim2 = -1, Bool_t TreatEmptyCells = kFALSE)
private:
TMVA::PDEFoamDistr*GetDistr() const

Data Members

protected:
Double_t*fAlpha[fDim] Internal parameters of the hyperrectangle
TMVA::PDEFoamCell**fCells[fNCells] Array of ALL cells
TMVA::EDTSeparationfDTSeparationsplit cells according to decision tree logic
Int_tfDimDimension of the integration/simulation space
TMVA::PDEFoamDistr*fDistr! distribution of training events
Int_tfEvPerBinMaximum number of effective (wt=1) events per bin
Bool_tfFillFoamWithOrigWeightsfill the foam with boost or orig. weights
TMVA::EFoamTypefFoamTypetype of foam
TObjArray*fHistEdgHistograms of wt, one for each cell edge
Int_t*fInhiDiv! [fDim] Flags for inhibiting cell division
Int_tfLastCeIndex of the last cell
TMVA::MsgLogger*fLogger! message logger
Int_t*fMaskDiv! [fDim] Dynamic Mask for cell division
UInt_tfMaxDepthmaximum depth of cell tree
Int_tfNBinNo. of bins in the edge histogram for cell MC exploration
Int_tfNCellsMaximum number of cells
UInt_tfNElementsnumber of variables in every cell
Int_tfNSamplNo. of MC events, when dividing (exploring) cell
TStringfNameName of a given instance of the FOAM class
UInt_tfNminminimal number of events in cell to split cell
Int_tfNoActNumber of active cells
Bool_tfPeekMaxpeek up cell with max. driver integral for split
TRandom3*fPseRanPointer to user-defined generator of pseudorandom numbers
Double_t*fRvec[fDim] random number vector from r.n. generator fDim+1 maximum elements
TMVA::Timer*fTimertimer for graphical output
TObjArray*fVariableNamescollection of all variable names
Float_tfVolFracvolume fraction (with respect to total phase space
Double_t*fXmax[fDim] maximum for variable transform
Double_t*fXmin[fDim] minimum for variable transform

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

PDEFoam()
 Default constructor for streamer, user should not use it.
PDEFoam(const TString& )
 User constructor, to be employed by the user
~PDEFoam()
 Default destructor
PDEFoam(const TMVA::PDEFoam& )
 Copy Constructor  NOT IMPLEMENTED (NEVER USED)
void SetDim(Int_t kDim)
 Sets dimension of cubical space
void SetXmin(Int_t idim, Double_t wmin)
 set lower foam bound in dimension idim
void SetXmax(Int_t idim, Double_t wmax)
 set upper foam bound in dimension idim
void Create()
 Basic initialization of FOAM invoked by the user.
 IMPORTANT: Random number generator and the distribution object has to be
 provided using SetPseRan and SetRho prior to invoking this initializator!

 After the foam is grown, space for 2 variables is reserved in
 every cell.  They are used for filling the foam cells.
void InitCells()
 Internal subprogram used by Create.
 It initializes "root part" of the FOAM of the tree of cells.
Int_t CellFill(Int_t , TMVA::PDEFoamCell* )
 Internal subprogram used by Create.
 It initializes content of the newly allocated active cell.
void Explore(TMVA::PDEFoamCell* Cell)
 Internal subprogram used by Create.
 It explores newly defined cell with help of special short MC sampling.
 As a result, estimates of kTRUE and drive volume is defined/determined
 Average and dispersion of the weight distribution will is found along
 each edge and the best edge (minimum dispersion, best maximum weight)
 is memorized for future use.
 The optimal division point for eventual future cell division is
 determined/recorded. Recorded are also minimum and maximum weight etc.
 The volume estimate in all (inactive) parent cells is updated.
 Note that links to parents and initial volume = 1/2 parent has to be
 already defined prior to calling this routine.

 If fNmin > 0 then the total number of (training) events found in
 the cell during the exploration is stored in the cell.  This
 information is used withing PeekMax() to avoid splitting cells
 which contain less than fNmin events.
void DTExplore(TMVA::PDEFoamCell* Cell)
 Internal subprogram used by Create.  It explores newly defined
 cell with according to the decision tree logic.  The separation
 set by the 'fDTSeparation' option is used (see also
 GetSeparation()).

 The optimal division point for eventual future cell division is
 determined/recorded.  Note that links to parents and initial
 volume = 1/2 parent has to be already defined prior to calling
 this routine.

 Note, that according to the decision tree logic, a cell is only
 split, if the number of (unweighted) events in each dautghter
 cell is greater than fNmin.
Float_t GetSeparation(Float_t s, Float_t b)
 Calculate the separation depending on 'fDTSeparation' for the
 given number of signal and background events 's', 'b'.  Note,
 that if (s+b) < 0 or s < 0 or b < 0 than the return value is 0.
void Varedu(Double_t* , Int_t& , Double_t& , Double_t& )
 Internal subrogram used by Create.
 In determines the best edge candidate and the position of the cell division plane
 in case of the variance reduction for future cell division,
 using results of the MC exploration run stored in fHistEdg
void MakeAlpha()
 Internal subrogram used by Create.
 Provides random vector Alpha  0< Alpha(i) < 1
Long_t PeekMax()
 Internal subprogram used by Create.  It finds cell with maximal
 driver integral for the purpose of the division.  This function
 is overridden by the PDEFoam Class to apply cuts on the number
 of events in the cell (fNmin) and the cell tree depth
 (GetMaxDepth() > 0) during cell buildup.
Long_t PeekLast()
 Internal subprogram used by Create.  It finds the last created
 active cell for the purpose of the division.  Analogous to
 PeekMax() it is cut on the number of events in the cell (fNmin)
 and the cell tree depth (GetMaxDepth() > 0).
Int_t Divide(TMVA::PDEFoamCell* )
 Internal subrogram used by Create.
 It divides cell iCell into two daughter cells.
 The iCell is retained and tagged as inactive, daughter cells are appended
 at the end of the buffer.
 New vertex is added to list of vertices.
 List of active cells is updated, iCell removed, two daughters added
 and their properties set with help of MC sampling (PDEFoam_Explore)
 Returns Code RC=-1 of buffer limit is reached,  fLastCe=fnBuf.
Double_t Eval(Double_t* xRand, Double_t& event_density)
 Internal subprogram.
 Evaluates (training) distribution.
void Grow()
 Internal subrogram used by Create.
 It grow new cells by the binary division process.
 This function is overridden by the PDEFoam class to stop the foam buildup process
 if one of the cut conditions stop the cell split.
void SetInhiDiv(Int_t , Int_t )
 This can be called before Create, after setting kDim
 It defines which variables are excluded in the process of the cell division.
 For example 'FoamX->SetInhiDiv(1, 1);' inhibits division of y-variable.
void CheckAll(Int_t )
  User utility, miscellaneous and debug.
  Checks all pointers in the tree of cells. This is useful autodiagnostic.
  level=0, no printout, failures causes STOP
  level=1, printout, failures lead to WARNINGS only
void PrintCell(Long_t iCell = 0)
 Prints geometry of 'iCell'
void PrintCells(void)
 Prints geometry of ALL cells of the FOAM
void RemoveEmptyCell(Int_t iCell)
 This function removes a cell iCell, which has a volume equal to zero.
 It works the following way:
 1) find grandparent to iCell
 2) set daughter of the grandparent cell to the sister of iCell

 Result:
 iCell and its parent are alone standing ==> will be removed
void CheckCells(Bool_t remove_empty_cells = false)
 debug function: checks all cells with respect to critical
 values, f.e. cell volume, ...
void PrintCellElements()
 This debug function prints the cell elements of all active
 cells.
void ResetCellElements(Bool_t allcells = false)
 creates a TVectorD object with fNElements in every cell
 and initializes them by zero.
 The TVectorD object is used to store classification or
 regression data in every foam cell.

 Parameter:
   allcells == true  : create TVectorD on every cell
   allcells == false : create TVectorD on active cells with
                       cell index <= fLastCe (default)
void CalcCellTarget()
 Calculate average cell target in every cell and save them to the cell.
 This function is called when the Mono target regression option is set.
void CalcCellDiscr()
 Calc discriminator and its error for every cell and save it to the cell.
 This function is called when the fSigBgSeparated==False option is set.
Double_t GetCellDiscr(vector<Float_t>& xvec, TMVA::EKernel kernel = kNone)
 Get discriminator saved in cell (previously calculated in CalcCellDiscr())
 which encloses the coordinates given in xvec.
 This function is used, when the fSigBgSeparated==False option is set
 (unified foams).
void FillFoamCells(const TMVA::Event* ev, Bool_t NoNegWeights = kFALSE)
 This function fills an event into the foam.

 In case of Mono-Target regression this function prepares the
 calculation of the average target value in every cell.  Note,
 that only target 0 is saved in the cell!

 In case of a unified foam this function prepares the calculation of
 the cell discriminator in every cell.

 If 'NoNegWeights' is true, an event with negative weight will
 not be filled into the foam.  (Default value: false)
Double_t GetCellRegValue0(vector<Float_t>& , TMVA::EKernel kernel = kNone)
 Get regression value 0 from cell that contains the event vector xvec.
 This function is used when the MultiTargetRegression==False option is set.
Double_t GetAverageNeighborsValue(vector<Float_t>& txvec, TMVA::ECellValue cv)
 This function returns the average value 'cv' of only nearest
 neighbor cells.  It is used in cases, where empty cells shall
 not be evaluated.

 Parameters:
 - txvec - event vector, transformed into foam coordinates [0, 1]
 - cv - cell value, see definition of ECellValue
Bool_t CellValueIsUndefined(TMVA::PDEFoamCell* )
 Returns true, if the value of the given cell is undefined.
std::vector<Float_t> GetCellTargets(vector<Float_t>& tvals, TMVA::ETargetSelection ts)
 This function is used when the MultiTargetRegression==True
 option is set.  It calculates the mean target or most probable
 target values if 'tvals' variables are given ('tvals' does not
 contain targets)

 Parameters:
 - tvals - transformed event variables (element of [0,1]) (no targets!)
 - ts - method of target selection (kMean, kMpv)

 Result:
 vetor of mean targets or most probable targets over all cells
 which first coordinates enclose 'tvals'
std::vector<Float_t> GetProjectedRegValue(vector<Float_t>& vals, TMVA::EKernel kernel = kNone, TMVA::ETargetSelection ts = kMean)
 This function is used when the MultiTargetRegression==True option is set.
 Returns regression value i, given the event variables 'vals'.
 Note: number of foam dimensions = number of variables + number of targets

 Parameters:
 - vals - event variables (no targets)
 - kernel - used kernel (None or Gaus)
 - ts - method of target selection (Mean or Mpv)
Double_t GetCellDensity(vector<Float_t>& xvec, TMVA::EKernel kernel = kNone)
 Returns density (=number of entries / volume) of cell that
 encloses the untransformed event vector 'xvec'.  This function
 is called by GetMvaValue() in case of two separated foams
 (signal and background).  'kernel' can be either kNone or kGaus.
Double_t GetCellValue( PDEFoamCell* cell, ECellValue cv )
 This function returns a value, which was saved in the foam cell,
 depending on the foam type.  The value to return is specified
 with the 'cv' parameter.
Double_t GetCellValue(vector<Float_t>& , TMVA::ECellValue )
 This function finds the cell, which corresponds to the given
 untransformed event vector 'xvec' and return its value, which is
 given by the parameter 'cv'.
Double_t GetBuildUpCellEvents(TMVA::PDEFoamCell* cell)
 Returns the number of events, saved in the 'cell' during foam build-up.
 Only used during foam build-up!
Double_t WeightLinNeighbors(vector<Float_t>& txvec, TMVA::ECellValue cv, Int_t dim1 = -1, Int_t dim2 = -1, Bool_t TreatEmptyCells = kFALSE)
 Returns the cell value, corresponding to 'txvec' (foam
 coordinates [0,1]), weighted by the neighbor cells via a linear
 function.

 Parameters:
  - txvec - event vector, transformed into foam coordinates [0,1]

  - cv - cell value to be weighted

  - dim1, dim2 - dimensions for two-dimensional projection.
    Default values: dim1 = dim2 = -1
    If dim1 and dim2 are set to values >=0 and <fDim, than
    the function GetProjectionCellValue() is used to get cell
    value.  This is used for projection to two dimensions within
    Project2().

  - TreatEmptyCells - if this option is set false (default),
    it is not checked, wether the cell or its neighbors are empty
    or not.  If this option is set true, than only non-empty
    neighbor cells are taken into account for weighting.  If the
    cell, which contains txvec is empty, than its value is
    replaced by the average value of the non-empty neighbor cells
Float_t WeightGaus(TMVA::PDEFoamCell* , vector<Float_t>& , UInt_t dim = 0)
 Returns the gauss weight between the 'cell' and a given coordinate 'txvec'.

 Parameters:
 - cell - the cell

 - txvec - the transformed event variables (in [0,1]) (coordinates <0 are
   set to 0, >1 are set to 1)

 - dim - number of dimensions for the calculation of the euclidean distance.
   If dim=0, all dimensions of the foam are taken.  Else only the first 'dim'
   coordinates of 'txvec' are used for the calculation of the euclidean distance.

 Returns:
 exp(-(d/sigma)^2/2), where
  - d - is the euclidean distance between 'txvec' and the point of the 'cell'
    which is most close to 'txvec' (in order to avoid artefacts because of the
    form of the cells).
  - sigma = 1/VolFrac
TMVA::PDEFoamCell* FindCell(vector<Float_t>& )
 Find cell that contains 'xvec' (in foam coordinates [0,1]).

 Loop to find cell that contains 'xvec' starting at root cell,
 and traversing binary tree to find the cell quickly.  Note, that
 if 'xvec' lies outside the foam, the cell which is nearest to
 'xvec' is returned.  (The returned pointer should never be
 NULL.)
void FindCellsRecursive(vector<Float_t>& , TMVA::PDEFoamCell* , vector<TMVA::PDEFoamCell*,allocator<TMVA::PDEFoamCell*> >& )
 This is a helper function for FindCells().  It saves in 'cells'
 all cells, which contain txvec.  It works analogous to
 FindCell().

 Parameters:

 - txvec - vector of variables (no targets!) (transformed into
   foam)

 - cell - cell to start searching with (usually root cell
   fCells[0])

 - cells - list of cells found
std::vector<TMVA::PDEFoamCell*> FindCells(vector<Float_t>& )
 Find all cells, that contain txvec.  This function can be used,
 when the dimension of the foam is greater than the dimension of
 txvec.  E.G this is the case for multi-target regression

 Parameters:

 - txvec - vector of variables (no targets!) (transformed into
   foam)

 Return value:

 - vector of cells, that fit txvec
TH1D* Draw1Dim(const char* opt, Int_t nbin)
 Draws 1-dimensional foam (= histogram)

 Parameters:

 - opt - cell_value, rms, rms_ov_mean
   if cell_value is set, the following values will be filled into
   the result histogram:
    - number of events - in case of classification with 2 separate
                         foams or multi-target regression
    - discriminator    - in case of classification with one
                         unified foam
    - target           - in case of mono-target regression

 - nbin - number of bins of result histogram

 Warning: This function is not well tested!
TH2D* Project2(Int_t idim1, Int_t idim2, const char* opt = "cell_value", const char* ker = "kNone", UInt_t maxbins = 50)
 Project foam variable idim1 and variable idim2 to histogram.

 Parameters:

 - idim1, idim2 - dimensions to project to

 - opt - cell_value, rms, rms_ov_mean
   if cell_value is set, the following values will be filled into
   the result histogram:
    - number of events - in case of classification with 2 separate
                         foams or multi-target regression
    - discriminator    - in case of classification with one
                         unified foam
    - target           - in case of mono-target regression

 - ker - kGaus, kNone (warning: Gaus may be very slow!)

 - nbin - number of bins in x and y direction of result histogram.

 Returns:
 a 2-dimensional histogram
Double_t GetProjectionCellValue(TMVA::PDEFoamCell* cell, Int_t idim1, Int_t idim2, TMVA::ECellValue cv)
 Helper function for projection function Project2().  It returns
 the cell value of 'cell' corresponding to the given option 'cv'.
 The two dimensions are needed for weighting the return value,
 because Project2() projects the foam to two dimensions.
Double_t GetCellElement(TMVA::PDEFoamCell* cell, UInt_t i)
 Returns cell element i of cell 'cell'.
void SetCellElement(TMVA::PDEFoamCell* cell, UInt_t i, Double_t value)
 Set cell element i of cell to value.
void OutputGrow(Bool_t finished = false)
 Overridden function of PDEFoam to avoid native foam output.
 Draw TMVA-process bar instead.
void RootPlot2dim(const TString& filename, TString opt, Bool_t CreateCanvas = kTRUE, Bool_t colors = kTRUE, Bool_t log_colors = kFALSE)
 Debugging tool which plots the cells of a 2-dimensional PDEFoam
 as rectangles in C++ format readable for ROOT.

 Parameters:
 - filename - filename of ouput root macro

 - opt - cell_value, rms, rms_ov_mean
   If cell_value is set, the following values will be filled into
   the result histogram:
    - number of events - in case of classification with 2 separate
                         foams or multi-target regression
    - discriminator    - in case of classification with one
                         unified foam
    - target           - in case of mono-target regression
   If none of {cell_value, rms, rms_ov_mean} is given, the cells
   will not be filled.
   If 'opt' contains the string 'cellnumber', the index of
   each cell is draw in addition.

 - CreateCanvas - whether to create a new canvas or not

 - colors - whether to fill cells with colors or shades of grey

 - log_colors - whether to fill cells with colors (logarithmic scale)

 Example:

   The following commands load a mono-target regression foam from
   file 'foam.root' and create a ROOT macro 'output.C', which
   draws all PDEFoam cells with little boxes.  The latter are
   filled with colors according to the target value stored in the
   cell.  Also the cell number is drawn.

   TFile file("foam.root");
   TMVA::PDEFoam *foam = (TMVA::PDEFoam*) gDirectory->Get("MonoTargetRegressionFoam");
   foam->RootPlot2dim("output.C","cell_value,cellnumber");
   gROOT->Macro("output.C");
void FillBinarySearchTree(const TMVA::Event* ev, Bool_t NoNegWeights = kFALSE)
 Insert event to internal foam density PDEFoamDistr.
void DeleteBinarySearchTree()
 Delete the fDistr object, which contains the binary search tree
void Init()
 Initialize binary search tree, stored in object of type
 PDEFoamDistr
void SetFoamType(TMVA::EFoamType ft)
 Set the foam type.  This determinates the method of the
 calculation of the density during the foam build-up.
void ReadStream(istream& )
 Read PDEFoam variables from stream 'istr'.
void PrintStream(ostream& ) const
 Write PDEFoam variables to stream 'os'.
void AddXMLTo(void* parent)
 write foam variables to xml
void ReadXML(void* parent)
Float_t VarTransform(Int_t idim, Float_t x) const
std::vector<Float_t> VarTransform(vector<Float_t>& invec) const
Float_t VarTransformInvers(Int_t idim, Float_t x) const
std::vector<Float_t> VarTransformInvers(vector<Float_t>& invec) const
PDEFoamDistr* GetDistr() const
{ assert(fDistr); return fDistr; }
void SetnCells(Long_t nCells)
{fNCells =nCells;}
void SetnSampl(Long_t nSampl)
{fNSampl =nSampl;}
void SetnBin(Int_t nBin)
{fNBin = nBin;}
void SetEvPerBin(Int_t EvPerBin)
{fEvPerBin =EvPerBin;}
void SetNElements(UInt_t numb)
{fNElements = numb;}
void SetVolumeFraction(Float_t vfr)
{fVolFrac = vfr;}
void SetFillFoamWithOrigWeights(Bool_t new_val)
void SetDTSeparation(TMVA::EDTSeparation new_val)
{fDTSeparation=new_val;}
void SetPeekMax(Bool_t new_val)
{ fPeekMax = new_val; }
Int_t GetTotDim() const
 coverity[ -tainted_data_return ]
{return fDim; }
TString GetFoamName() const
{return fName; }
UInt_t GetNElements() const
{return fNElements; }
Float_t GetVolumeFraction() const
{return fVolFrac;}
EFoamType GetFoamType() const
{return fFoamType;}
UInt_t GetNActiveCells() const
{return fNoAct;}
UInt_t GetNInActiveCells() const
UInt_t GetNCells() const
{return fNCells;}
PDEFoamCell* GetRootCell() const
{return fCells[0];}
void SetNmin(UInt_t val)
 Getters and Setters for user cut options
{ fNmin=val; }
UInt_t GetNmin()
{ return fNmin; }
Bool_t GetFillFoamWithOrigWeights() const
void SetMaxDepth(UInt_t maxdepth)
{ fMaxDepth = maxdepth; }
UInt_t GetMaxDepth() const
{ return fMaxDepth; }
Double_t GetXmin(Int_t idim) const
{return fXmin[idim];}
Double_t GetXmax(Int_t idim) const
{return fXmax[idim];}
void AddVariableName(const char* s)
 Getters and Setters for variable names
void AddVariableName(TObjString* s)
TObjString* GetVariableName(Int_t idx)
{return dynamic_cast<TObjString*>(fVariableNames->At(idx));}