Logo ROOT   6.07/09
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TMVA::BinarySearchTree Class Reference

Definition at line 71 of file BinarySearchTree.h.

Public Member Functions

 BinarySearchTree (void)
 default constructor More...
 
 BinarySearchTree (const BinarySearchTree &b)
 copy constructor that creates a true copy, i.e. a completely independent tree More...
 
virtual ~BinarySearchTree (void)
 destructor More...
 
void CalcStatistics (TMVA::Node *n=0)
 calculate basic statistics (mean, rms for each variable) More...
 
virtual const char * ClassName () const
 
void Clear (TMVA::Node *n=0)
 clear nodes More...
 
virtual NodeCreateNode (UInt_t) const
 
virtual BinaryTreeCreateTree () const
 
Double_t Fill (const std::vector< TMVA::Event * > &events, const std::vector< Int_t > &theVars, Int_t theType=-1)
 create the search tree from the event collection using ONLY the variables specified in "theVars" More...
 
Double_t Fill (const std::vector< TMVA::Event * > &events, Int_t theType=-1)
 create the search tree from the events in a TTree using ALL the variables specified included in the Event More...
 
UInt_t GetPeriode (void) const
 
Double_t GetSumOfWeights (void) const
 return the sum of event (node) weights More...
 
Double_t GetSumOfWeights (Int_t theType) const
 return the sum of event (node) weights More...
 
void Insert (const Event *)
 insert a new "event" in the binary tree More...
 
Float_t Max (Types::ESBType sb, UInt_t var)
 
Float_t Mean (Types::ESBType sb, UInt_t var)
 
Float_t Min (Types::ESBType sb, UInt_t var)
 
void NormalizeTree ()
 Normalisation of tree. More...
 
Float_t RMS (Types::ESBType sb, UInt_t var)
 
Float_t RMS (UInt_t var)
 
BinarySearchTreeNodeSearch (Event *event) const
 search the tree to find the node matching "event" More...
 
Double_t SearchVolume (Volume *, std::vector< const TMVA::BinarySearchTreeNode * > *events=0)
 search the whole tree and add up all weigths of events that lie within the given voluem More...
 
Int_t SearchVolumeWithMaxLimit (TMVA::Volume *, std::vector< const TMVA::BinarySearchTreeNode * > *events=0, Int_t=-1)
 
void SetNormalize (Bool_t norm)
 
void SetPeriode (Int_t p)
 
- Public Member Functions inherited from TMVA::BinaryTree
 BinaryTree (void)
 constructor for a yet "empty" tree. Needs to be filled afterwards More...
 
virtual ~BinaryTree ()
 destructor (deletes the nodes and "events" if owned by the tree More...
 
virtual voidAddXMLTo (void *parent) const
 add attributes to XML More...
 
UInt_t CountNodes (Node *n=NULL)
 return the number of nodes in the tree. (make a new count –> takes time) More...
 
NodeGetLeftDaughter (Node *n)
 get left daughter node current node "n" More...
 
UInt_t GetNNodes () const
 
NodeGetRightDaughter (Node *n)
 get right daughter node current node "n" More...
 
virtual NodeGetRoot () const
 
UInt_t GetTotalTreeDepth () const
 
virtual void Print (std::ostream &os) const
 recursively print the tree More...
 
virtual void Read (std::istream &istr, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
 Read the binary tree from an input stream. More...
 
virtual void ReadXML (void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
 read attributes from XML More...
 
void SetRoot (Node *r)
 
void SetTotalTreeDepth (Int_t depth)
 
void SetTotalTreeDepth (Node *n=NULL)
 descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time. More...
 

Static Public Member Functions

static BinarySearchTreeCreateFromXML (void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
 re-create a new tree (decision tree or search tree) from XML More...
 

Private Member Functions

void DestroyNode (BinarySearchTreeNode *)
 
void Insert (const Event *, Node *)
 private internal function to insert a event (node) at the proper position More...
 
Bool_t InVolume (const std::vector< Float_t > &, Volume *) const
 
void NormalizeTree (std::vector< std::pair< Double_t, const TMVA::Event * > >::iterator, std::vector< std::pair< Double_t, const TMVA::Event * > >::iterator, UInt_t)
 
BinarySearchTreeNodeSearch (Event *, Node *) const
 Private, recursive, function for searching. More...
 
Double_t SearchVolume (Node *, Volume *, Int_t, std::vector< const TMVA::BinarySearchTreeNode * > *events)
 recursively walk through the daughter nodes and add up all weigths of events that lie within the given volume More...
 

Private Attributes

Bool_t fCanNormalize
 
UInt_t fCurrentDepth
 
std::vector< Float_tfMax [2]
 
std::vector< Float_tfMeans [2]
 
std::vector< Float_tfMin [2]
 
Double_t fNEventsW [2]
 
std::vector< std::pair< Double_t, const TMVA::Event * > > fNormalizeTreeTable
 
UInt_t fPeriod
 
std::vector< Float_tfRMS [2]
 
Bool_t fStatisticsIsValid
 
std::vector< Double_tfSum [2]
 
Double_t fSumOfWeights
 
std::vector< Double_tfSumSq [2]
 

Additional Inherited Members

- Protected Member Functions inherited from TMVA::BinaryTree
void DeleteNode (Node *)
 protected, recursive, function used by the class destructor and when Pruning More...
 
MsgLoggerLog () const
 
- Protected Attributes inherited from TMVA::BinaryTree
UInt_t fDepth
 
UInt_t fNNodes
 
NodefRoot
 

#include <TMVA/BinarySearchTree.h>

Inheritance diagram for TMVA::BinarySearchTree:
[legend]

Constructor & Destructor Documentation

TMVA::BinarySearchTree::BinarySearchTree ( void  )

default constructor

Definition at line 83 of file BinarySearchTree.cxx.

TMVA::BinarySearchTree::BinarySearchTree ( const BinarySearchTree b)

copy constructor that creates a true copy, i.e. a completely independent tree

Definition at line 97 of file BinarySearchTree.cxx.

TMVA::BinarySearchTree::~BinarySearchTree ( void  )
virtual

destructor

Definition at line 112 of file BinarySearchTree.cxx.

Member Function Documentation

void TMVA::BinarySearchTree::CalcStatistics ( TMVA::Node n = 0)

calculate basic statistics (mean, rms for each variable)

Definition at line 449 of file BinarySearchTree.cxx.

virtual const char* TMVA::BinarySearchTree::ClassName ( ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 87 of file BinarySearchTree.h.

void TMVA::BinarySearchTree::Clear ( TMVA::Node n = 0)

clear nodes

Definition at line 375 of file BinarySearchTree.cxx.

TMVA::BinarySearchTree * TMVA::BinarySearchTree::CreateFromXML ( void node,
UInt_t  tmva_Version_Code = TMVA_VERSION_CODE 
)
static

re-create a new tree (decision tree or search tree) from XML

Definition at line 123 of file BinarySearchTree.cxx.

virtual Node* TMVA::BinarySearchTree::CreateNode ( UInt_t  ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 84 of file BinarySearchTree.h.

virtual BinaryTree* TMVA::BinarySearchTree::CreateTree ( ) const
inlinevirtual

Implements TMVA::BinaryTree.

Definition at line 85 of file BinarySearchTree.h.

void TMVA::BinarySearchTree::DestroyNode ( BinarySearchTreeNode )
private
Double_t TMVA::BinarySearchTree::Fill ( const std::vector< TMVA::Event * > &  events,
const std::vector< Int_t > &  theVars,
Int_t  theType = -1 
)

create the search tree from the event collection using ONLY the variables specified in "theVars"

Definition at line 269 of file BinarySearchTree.cxx.

Double_t TMVA::BinarySearchTree::Fill ( const std::vector< TMVA::Event * > &  events,
Int_t  theType = -1 
)

create the search tree from the events in a TTree using ALL the variables specified included in the Event

Definition at line 280 of file BinarySearchTree.cxx.

UInt_t TMVA::BinarySearchTree::GetPeriode ( void  ) const
inline

Definition at line 106 of file BinarySearchTree.h.

Double_t TMVA::BinarySearchTree::GetSumOfWeights ( void  ) const

return the sum of event (node) weights

Definition at line 238 of file BinarySearchTree.cxx.

Double_t TMVA::BinarySearchTree::GetSumOfWeights ( Int_t  theType) const

return the sum of event (node) weights

Definition at line 253 of file BinarySearchTree.cxx.

void TMVA::BinarySearchTree::Insert ( const Event event)

insert a new "event" in the binary tree

Definition at line 134 of file BinarySearchTree.cxx.

void TMVA::BinarySearchTree::Insert ( const Event event,
Node node 
)
private

private internal function to insert a event (node) at the proper position

Definition at line 167 of file BinarySearchTree.cxx.

Bool_t TMVA::BinarySearchTree::InVolume ( const std::vector< Float_t > &  event,
Volume volume 
) const
private

Definition at line 433 of file BinarySearchTree.cxx.

Float_t TMVA::BinarySearchTree::Max ( Types::ESBType  sb,
UInt_t  var 
)
inline

Definition at line 134 of file BinarySearchTree.h.

Float_t TMVA::BinarySearchTree::Mean ( Types::ESBType  sb,
UInt_t  var 
)
inline

Definition at line 125 of file BinarySearchTree.h.

Float_t TMVA::BinarySearchTree::Min ( Types::ESBType  sb,
UInt_t  var 
)
inline

Definition at line 131 of file BinarySearchTree.h.

void TMVA::BinarySearchTree::NormalizeTree ( )

Normalisation of tree.

Definition at line 364 of file BinarySearchTree.cxx.

void TMVA::BinarySearchTree::NormalizeTree ( std::vector< std::pair< Double_t, const TMVA::Event * > >::iterator  leftBound,
std::vector< std::pair< Double_t, const TMVA::Event * > >::iterator  rightBound,
UInt_t  actDim 
)
private

Definition at line 306 of file BinarySearchTree.cxx.

Float_t TMVA::BinarySearchTree::RMS ( Types::ESBType  sb,
UInt_t  var 
)
inline

Definition at line 128 of file BinarySearchTree.h.

Float_t TMVA::BinarySearchTree::RMS ( UInt_t  var)
inline

Definition at line 139 of file BinarySearchTree.h.

TMVA::BinarySearchTreeNode * TMVA::BinarySearchTree::Search ( Event event) const

search the tree to find the node matching "event"

Definition at line 213 of file BinarySearchTree.cxx.

TMVA::BinarySearchTreeNode * TMVA::BinarySearchTree::Search ( Event event,
Node node 
) const
private

Private, recursive, function for searching.

Definition at line 221 of file BinarySearchTree.cxx.

Double_t TMVA::BinarySearchTree::SearchVolume ( Volume volume,
std::vector< const TMVA::BinarySearchTreeNode * > *  events = 0 
)

search the whole tree and add up all weigths of events that lie within the given voluem

Definition at line 391 of file BinarySearchTree.cxx.

Double_t TMVA::BinarySearchTree::SearchVolume ( Node t,
Volume volume,
Int_t  depth,
std::vector< const TMVA::BinarySearchTreeNode * > *  events 
)
private

recursively walk through the daughter nodes and add up all weigths of events that lie within the given volume

Definition at line 401 of file BinarySearchTree.cxx.

Int_t TMVA::BinarySearchTree::SearchVolumeWithMaxLimit ( TMVA::Volume volume,
std::vector< const TMVA::BinarySearchTreeNode * > *  events = 0,
Int_t  max_points = -1 
)

Definition at line 510 of file BinarySearchTree.cxx.

void TMVA::BinarySearchTree::SetNormalize ( Bool_t  norm)
inline

Definition at line 141 of file BinarySearchTree.h.

void TMVA::BinarySearchTree::SetPeriode ( Int_t  p)
inline

Definition at line 103 of file BinarySearchTree.h.

Member Data Documentation

Bool_t TMVA::BinarySearchTree::fCanNormalize
private

Definition at line 176 of file BinarySearchTree.h.

UInt_t TMVA::BinarySearchTree::fCurrentDepth
private

Definition at line 163 of file BinarySearchTree.h.

std::vector<Float_t> TMVA::BinarySearchTree::fMax[2]
private

Definition at line 169 of file BinarySearchTree.h.

std::vector<Float_t> TMVA::BinarySearchTree::fMeans[2]
private

Definition at line 166 of file BinarySearchTree.h.

std::vector<Float_t> TMVA::BinarySearchTree::fMin[2]
private

Definition at line 168 of file BinarySearchTree.h.

Double_t TMVA::BinarySearchTree::fNEventsW[2]
private

Definition at line 172 of file BinarySearchTree.h.

std::vector< std::pair<Double_t,const TMVA::Event*> > TMVA::BinarySearchTree::fNormalizeTreeTable
private

Definition at line 177 of file BinarySearchTree.h.

UInt_t TMVA::BinarySearchTree::fPeriod
private

Definition at line 162 of file BinarySearchTree.h.

std::vector<Float_t> TMVA::BinarySearchTree::fRMS[2]
private

Definition at line 167 of file BinarySearchTree.h.

Bool_t TMVA::BinarySearchTree::fStatisticsIsValid
private

Definition at line 164 of file BinarySearchTree.h.

std::vector<Double_t> TMVA::BinarySearchTree::fSum[2]
private

Definition at line 170 of file BinarySearchTree.h.

Double_t TMVA::BinarySearchTree::fSumOfWeights
private

Definition at line 173 of file BinarySearchTree.h.

std::vector<Double_t> TMVA::BinarySearchTree::fSumSq[2]
private

Definition at line 171 of file BinarySearchTree.h.


The documentation for this class was generated from the following files: