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++)
291 outvec.push_back(VarTransform(i, invec.at(i)));
299 return x*(fXmax[idim]-fXmin[idim]) + fXmin[idim];
306 std::vector<Float_t> outvec;
307 for(
UInt_t i=0; i<invec.size(); i++)
308 outvec.push_back(VarTransformInvers(i, invec.at(i)));
#define ClassDef(name, id)
1-D histogram with a double per channel (see TH1 documentation)}
2-D histogram with a double per channel (see TH1 documentation)}
ostringstream derivative to redirect and format output
This is an abstract class, which provides an interface for a PDEFoam density estimator.
This class is the abstract kernel interface for PDEFoam.
This PDEFoam kernel estimates a cell value for a given event by weighting all cell values with a gaus...
This PDEFoam kernel estimates a cell value for a given event by weighting with cell values of the nea...
This class is a trivial PDEFoam kernel estimator.
Implementation of PDEFoam.
void AddVariableName(const char *s)
void Varedu(Double_t[], Int_t &, Double_t &, Double_t &)
Internal subprogram used by Create.
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
void DeleteBinarySearchTree()
Delete the foam's density estimator, which contains the binary search tree.
TObjString * GetVariableName(Int_t idx)
void SetMaxDepth(UInt_t maxdepth)
void MakeAlpha()
Internal subprogram used by Create.
Timer * fTimer
distribution of training events
TObjArray * fVariableNames
timer for graphical output
UInt_t GetMaxDepth() const
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 OutputGrow(Bool_t finished=false)
message logger
UInt_t GetNInActiveCells() const
Double_t GetXmax(Int_t idim) const
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
void SetDensity(PDEFoamDensityBase *dens)
Float_t VarTransformInvers(Int_t idim, Float_t x) const
Float_t VarTransform(Int_t idim, Float_t x) const
Int_t Divide(PDEFoamCell *)
Internal subprogram used by Create.
Bool_t fFillFoamWithOrigWeights
EDTSeparation fDTSeparation
void PrintCell(Long_t iCell=0)
Prints geometry of and elements of 'iCell', as well as relations to parent and daughter cells.
void ResetCellElements()
Remove the cell elements from all cells.
void Grow()
Internal subprogram used by Create.
Double_t Eval(Double_t *xRand, Double_t &event_density)
Internal subprogram.
void PrintCells()
Prints geometry of ALL cells of the FOAM.
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
PDEFoamDensityBase * GetDistr() const
virtual ~PDEFoam()
Default destructor.
PDEFoam()
Default constructor for streamer, user should not use it.
void SetEvPerBin(Int_t EvPerBin)
PDEFoamCell * GetRootCell() const
PDEFoamDensityBase * fDistr
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
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'.
void Create()
Basic initialization of FOAM invoked by the user.
void SetInhiDiv(Int_t, Int_t)
This can be called before Create, after setting kDim It defines which variables are excluded in the p...
Int_t * fInhiDiv
[fDim] Dynamic Mask for cell division
void InitCells()
Internal subprogram used by Create.
void AddVariableName(TObjString *s)
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
void FillBinarySearchTree(const Event *ev)
Insert event to internal foam's density estimator PDEFoamDensityBase.
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 void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
UInt_t GetNActiveCells() const
void SetnCells(Long_t nCells)
Int_t CellFill(Int_t, PDEFoamCell *)
Internal subprogram used by Create.
Long_t PeekMax()
Internal subprogram used by Create.
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 ...
void SetnSampl(Long_t nSampl)
Int_t fNoAct
[fDim] Flags for inhibiting cell division
TString GetFoamName() const
Double_t GetXmin(Int_t idim) const
void CheckAll(Int_t)
User utility, miscellaneous and debug.
void SetDim(Int_t kDim)
Sets dimension of cubical space.
Timing information for training and evaluation of MVA methods.
TObject * At(Int_t idx) const
Collectable string class.
Mother of all ROOT objects.
Random number generator class based on M.
static constexpr double s
create variable transformations