|
ROOT
Reference Guide |
|
Go to the documentation of this file.
28 #ifndef ROOT_TMVA_PDEFoam
29 #define ROOT_TMVA_PDEFoam
49 class PDEFoamDensityBase;
50 class PDEFoamKernelBase;
54 enum EDTSeparation { kFoam, kGiniIndex, kMisClassificationError,
58 enum EFoamType { kSeparate, kDiscr, kMonoTarget, kMultiTarget, kMultiClass };
69 enum ECellValue {
kValue, kValueError, kValueDensity, kMeanValue,
70 kRms, kRmsOvMean, kCellVolume };
153 std::vector<TMVA::PDEFoamCell*>
FindCells(
const std::vector<Float_t>&)
const;
154 std::vector<TMVA::PDEFoamCell*>
FindCells(
const std::map<Int_t,Float_t>&)
const;
155 void FindCells(
const std::map<Int_t, Float_t>&,
PDEFoamCell*, std::vector<PDEFoamCell*> &)
const;
161 template<
typename T>
T Sqr(
T x)
const {
return x*
x; }
229 std::vector<Float_t>
VarTransform(
const std::vector<Float_t> &invec)
const;
261 virtual std::vector<Float_t>
GetCellValue(
const std::map<Int_t,Float_t>& xvec, ECellValue cv );
291 std::vector<Float_t> outvec;
292 for(
UInt_t i=0; i<invec.size(); i++)
293 outvec.push_back(VarTransform(i, invec.at(i)));
301 return x*(fXmax[idim]-fXmin[idim]) + fXmin[idim];
308 std::vector<Float_t> outvec;
309 for(
UInt_t i=0; i<invec.size(); i++)
310 outvec.push_back(VarTransformInvers(i, invec.at(i)));
void SetDensity(PDEFoamDensityBase *dens)
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.
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'.
TObjString * GetVariableName(Int_t idx)
PDEFoamCell * GetRootCell() const
Long_t PeekMax()
Internal subprogram used by Create.
void PrintCells()
Prints geometry of ALL cells of the FOAM.
Int_t * fInhiDiv
[fDim] Dynamic Mask for cell division
void Varedu(Double_t[], Int_t &, Double_t &, Double_t &)
Internal subprogram used by Create.
This is an abstract class, which provides an interface for a PDEFoam density estimator.
void Grow()
Internal subprogram used by Create.
void PrintCell(Long_t iCell=0)
Prints geometry of and elements of 'iCell', as well as relations to parent and daughter cells.
This class is the abstract kernel interface for PDEFoam.
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
Int_t Divide(PDEFoamCell *)
Internal subprogram used by Create.
Float_t VarTransform(Int_t idim, Float_t x) const
1-D histogram with a double per channel (see TH1 documentation)}
Int_t fNoAct
[fDim] Flags for inhibiting cell division
static constexpr double s
void SetDim(Int_t kDim)
Sets dimension of cubical space.
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 SetEvPerBin(Int_t EvPerBin)
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
Double_t Eval(Double_t *xRand, Double_t &event_density)
Internal subprogram.
void AddVariableName(TObjString *s)
TObject * At(Int_t idx) const
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
UInt_t GetNInActiveCells() const
Int_t CellFill(Int_t, PDEFoamCell *)
Internal subprogram used by Create.
PDEFoamDensityBase * fDistr
void ResetCellElements()
Remove the cell elements from all cells.
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
Collectable string class.
void SetMaxDepth(UInt_t maxdepth)
Implementation of PDEFoam.
virtual ~PDEFoam()
Default destructor.
Random number generator class based on M.
Bool_t fFillFoamWithOrigWeights
void SetnSampl(Long_t nSampl)
void InitCells()
Internal subprogram used by Create.
This class is a trivial PDEFoam kernel estimator.
Float_t VarTransformInvers(Int_t idim, Float_t x) const
2-D histogram with a double per channel (see TH1 documentation)}
UInt_t GetNActiveCells() const
TObjArray * fVariableNames
timer for graphical output
void AddVariableName(const char *s)
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
EDTSeparation fDTSeparation
This PDEFoam kernel estimates a cell value for a given event by weighting all cell values with a gaus...
Double_t GetXmax(Int_t idim) const
PDEFoamDensityBase * GetDistr() const
void OutputGrow(Bool_t finished=false)
message logger
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
This PDEFoam kernel estimates a cell value for a given event by weighting with cell values of the nea...
TString GetFoamName() const
Timing information for training and evaluation of MVA methods.
Timer * fTimer
distribution of training events
ostringstream derivative to redirect and format output
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
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 CheckAll(Int_t)
User utility, miscellaneous and debug.
void Create()
Basic initialization of FOAM invoked by the user.
void DeleteBinarySearchTree()
Delete the foam's density estimator, which contains the binary search tree.
void SetnCells(Long_t nCells)
Mother of all ROOT objects.
#define ClassDef(name, id)
void MakeAlpha()
Internal subprogram used by Create.
void FillBinarySearchTree(const Event *ev)
Insert event to internal foam's density estimator PDEFoamDensityBase.
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
Double_t GetXmin(Int_t idim) const
virtual void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
UInt_t GetMaxDepth() const
create variable transformations