Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::Node Class Referenceabstract

Node for the BinarySearch or Decision Trees.

For the binary search tree, it basically consists of the EVENT, and pointers to the parent and daughters

In case of the Decision Tree, it specifies parent and daughters, as well as "which variable is used" in the selection of this node, including the respective cut value.

Definition at line 58 of file Node.h.

Public Member Functions

 Node ()
 
 Node (const Node &n)
 copy constructor, make sure you don't just copy the pointer to the node, but that the parents/daughters are initialized to 0 (and set by the copy constructors of the derived classes
 
 Node (Node *p, char pos)
 constructor of a daughter node as a daughter of 'p'
 
virtual ~Node ()
 node destructor
 
virtual void AddAttributesToNode (void *node) const =0
 
virtual void AddContentToNode (std::stringstream &s) const =0
 
void * AddXMLTo (void *parent) const
 add attributes to XML
 
Int_t CountMeAndAllDaughters () const
 recursively go through the part of the tree below this node and count all daughters
 
virtual NodeCreateNode () const =0
 
int GetCount ()
 returns the global number of instantiated nodes
 
UInt_t GetDepth () const
 
virtual NodeGetLeft () const
 
virtual NodeGetParent () const
 
virtual TMVA::BinaryTreeGetParentTree () const
 
char GetPos () const
 
virtual NodeGetRight () const
 
virtual Bool_t GoesLeft (const Event &) const =0
 
virtual Bool_t GoesRight (const Event &) const =0
 
virtual TClassIsA () const
 
virtual void Print (std::ostream &os) const =0
 
virtual void PrintRec (std::ostream &os) const =0
 
virtual void ReadAttributes (void *node, UInt_t tmva_Version_Code=262657)=0
 
virtual void ReadContent (std::stringstream &s)=0
 
virtual Bool_t ReadDataRecord (std::istream &, UInt_t tmva_Version_Code=262657)=0
 
void ReadXML (void *node, UInt_t tmva_Version_Code=262657)
 read attributes from XML
 
void SetDepth (UInt_t d)
 
virtual void SetLeft (Node *l)
 
virtual void SetParent (Node *p)
 
virtual void SetParentTree (TMVA::BinaryTree *t)
 
void SetPos (char s)
 
virtual void SetRight (Node *r)
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Attributes

UInt_t fDepth
 depth of the node within the tree (seen from root node)
 
NodefLeft
 pointers to the two "daughter" nodes
 
NodefParent
 the previous (parent) node
 
BinaryTreefParentTree
 pointer to the parent tree to which the Node belongs
 
char fPos
 position, i.e. it is a left (l) or right (r) daughter
 
NodefRight
 pointers to the two "daughter" nodes
 

Static Private Attributes

static Int_t fgCount = 0
 counter of all nodes present.. for debug.. to spot memory leaks...
 

Friends

std::ostream & operator<< (std::ostream &os, const Node &node)
 
std::ostream & operator<< (std::ostream &os, const Node *node)
 

#include <TMVA/Node.h>

Inheritance diagram for TMVA::Node:
[legend]

Constructor & Destructor Documentation

◆ Node() [1/3]

TMVA::Node::Node ( )

Definition at line 51 of file Node.cxx.

◆ Node() [2/3]

TMVA::Node::Node ( Node p,
char  pos 
)

constructor of a daughter node as a daughter of 'p'

Definition at line 66 of file Node.cxx.

◆ Node() [3/3]

TMVA::Node::Node ( const Node n)

copy constructor, make sure you don't just copy the pointer to the node, but that the parents/daughters are initialized to 0 (and set by the copy constructors of the derived classes

Definition at line 84 of file Node.cxx.

◆ ~Node()

TMVA::Node::~Node ( )
virtual

node destructor

Definition at line 98 of file Node.cxx.

Member Function Documentation

◆ AddAttributesToNode()

virtual void TMVA::Node::AddAttributesToNode ( void *  node) const
pure virtual

◆ AddContentToNode()

virtual void TMVA::Node::AddContentToNode ( std::stringstream &  s) const
pure virtual

◆ AddXMLTo()

void * TMVA::Node::AddXMLTo ( void *  parent) const

add attributes to XML

Definition at line 147 of file Node.cxx.

◆ Class()

static TClass * TMVA::Node::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TMVA::Node::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TMVA::Node::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 151 of file Node.h.

◆ CountMeAndAllDaughters()

Int_t TMVA::Node::CountMeAndAllDaughters ( ) const

recursively go through the part of the tree below this node and count all daughters

Definition at line 114 of file Node.cxx.

◆ CreateNode()

virtual Node * TMVA::Node::CreateNode ( ) const
pure virtual

◆ DeclFileName()

static const char * TMVA::Node::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 151 of file Node.h.

◆ GetCount()

int TMVA::Node::GetCount ( )

returns the global number of instantiated nodes

Definition at line 106 of file Node.cxx.

◆ GetDepth()

UInt_t TMVA::Node::GetDepth ( ) const
inline

Definition at line 116 of file Node.h.

◆ GetLeft()

virtual Node * TMVA::Node::GetLeft ( ) const
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 89 of file Node.h.

◆ GetParent()

virtual Node * TMVA::Node::GetParent ( ) const
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 91 of file Node.h.

◆ GetParentTree()

virtual TMVA::BinaryTree * TMVA::Node::GetParentTree ( ) const
inlinevirtual

Definition at line 125 of file Node.h.

◆ GetPos()

char TMVA::Node::GetPos ( ) const
inline

Definition at line 122 of file Node.h.

◆ GetRight()

virtual Node * TMVA::Node::GetRight ( ) const
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 90 of file Node.h.

◆ GoesLeft()

virtual Bool_t TMVA::Node::GoesLeft ( const Event ) const
pure virtual

◆ GoesRight()

virtual Bool_t TMVA::Node::GoesRight ( const Event ) const
pure virtual

◆ IsA()

virtual TClass * TMVA::Node::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Reimplemented in TMVA::BinarySearchTreeNode, and TMVA::DecisionTreeNode.

Definition at line 151 of file Node.h.

◆ Print()

virtual void TMVA::Node::Print ( std::ostream &  os) const
pure virtual

◆ PrintRec()

virtual void TMVA::Node::PrintRec ( std::ostream &  os) const
pure virtual

◆ ReadAttributes()

virtual void TMVA::Node::ReadAttributes ( void *  node,
UInt_t  tmva_Version_Code = 262657 
)
pure virtual

◆ ReadContent()

virtual void TMVA::Node::ReadContent ( std::stringstream &  s)
pure virtual

◆ ReadDataRecord()

virtual Bool_t TMVA::Node::ReadDataRecord ( std::istream &  ,
UInt_t  tmva_Version_Code = 262657 
)
pure virtual

◆ ReadXML()

void TMVA::Node::ReadXML ( void *  node,
UInt_t  tmva_Version_Code = 262657 
)

read attributes from XML

Definition at line 163 of file Node.cxx.

◆ SetDepth()

void TMVA::Node::SetDepth ( UInt_t  d)
inline

Definition at line 113 of file Node.h.

◆ SetLeft()

virtual void TMVA::Node::SetLeft ( Node l)
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 94 of file Node.h.

◆ SetParent()

virtual void TMVA::Node::SetParent ( Node p)
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 96 of file Node.h.

◆ SetParentTree()

virtual void TMVA::Node::SetParentTree ( TMVA::BinaryTree t)
inlinevirtual

Definition at line 128 of file Node.h.

◆ SetPos()

void TMVA::Node::SetPos ( char  s)
inline

Definition at line 119 of file Node.h.

◆ SetRight()

virtual void TMVA::Node::SetRight ( Node r)
inlinevirtual

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 95 of file Node.h.

◆ Streamer()

virtual void TMVA::Node::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TMVA::Node::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 151 of file Node.h.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const Node node 
)
friend

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const Node node 
)
friend

Member Data Documentation

◆ fDepth

UInt_t TMVA::Node::fDepth
protected

depth of the node within the tree (seen from root node)

Definition at line 143 of file Node.h.

◆ fgCount

Int_t TMVA::Node::fgCount = 0
staticprivate

counter of all nodes present.. for debug.. to spot memory leaks...

Definition at line 148 of file Node.h.

◆ fLeft

Node* TMVA::Node::fLeft
protected

pointers to the two "daughter" nodes

Definition at line 139 of file Node.h.

◆ fParent

Node* TMVA::Node::fParent
protected

the previous (parent) node

Definition at line 138 of file Node.h.

◆ fParentTree

BinaryTree* TMVA::Node::fParentTree
protected

pointer to the parent tree to which the Node belongs

Definition at line 145 of file Node.h.

◆ fPos

char TMVA::Node::fPos
protected

position, i.e. it is a left (l) or right (r) daughter

Definition at line 142 of file Node.h.

◆ fRight

Node* TMVA::Node::fRight
protected

pointers to the two "daughter" nodes

Definition at line 140 of file Node.h.

Libraries for TMVA::Node:

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