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

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 55 of file BinarySearchTreeNode.h.

Public Member Functions

 BinarySearchTreeNode (BinarySearchTreeNode *parent, char pos)
 constructor of a daughter node as a daughter of 'p'
 BinarySearchTreeNode (const BinarySearchTreeNode &n, BinarySearchTreeNode *parent=nullptr)
 copy constructor of a node.
 BinarySearchTreeNode (const Event *e=nullptr, UInt_t signalClass=0)
 constructor of a node for the search tree
virtual ~BinarySearchTreeNode ()
 node destructor
void AddAttributesToNode (void *node) const override
 adding attributes to tree node
void AddContentToNode (std::stringstream &s) const override
 adding attributes to tree node
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
NodeCreateNode () const override
virtual Bool_t EqualsMe (const Event &) const
 check if the event fed into the node actually equals the event that forms the node (in case of a search tree)
UInt_t GetClass () const
int GetCount ()
 returns the global number of instantiated nodes
UInt_t GetDepth () const
const std::vector< Float_t > & GetEventV () const
virtual NodeGetLeft () const
virtual NodeGetParent () const
virtual TMVA::BinaryTreeGetParentTree () const
char GetPos () const
virtual NodeGetRight () const
Short_t GetSelector () const
 return index of variable used for discrimination at this node
const std::vector< Float_t > & GetTargets () const
Float_t GetWeight () const
Bool_t GoesLeft (const Event &) const override
 check if the event fed into the node goes/descends to the left daughter
Bool_t GoesRight (const Event &) const override
 check if the event fed into the node goes/descends to the right daughter
TClassIsA () const override
void Print (std::ostream &os) const override
 print the node
void PrintRec (std::ostream &os) const override
 recursively print the node and its daughters (--> print the 'tree')
void ReadAttributes (void *node, UInt_t tmva_Version_Code=262657) override
 read attributes from XML
void ReadContent (std::stringstream &s) override
 read events from node
Bool_t ReadDataRecord (std::istream &is, UInt_t tmva_Version_Code=262657) override
 Read the data block.
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)
void SetSelector (Short_t i)
 set index of variable used for discrimination at this node
void Streamer (TBuffer &) override
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

Private Attributes

UInt_t fClass
std::vector< Float_tfEventV
Short_t fSelector
 index of variable used in node selection (decision tree)
std::vector< Float_tfTargets
Float_t fWeight

Static Private Attributes

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

#include <TMVA/BinarySearchTreeNode.h>

Inheritance diagram for TMVA::BinarySearchTreeNode:
TMVA::Node

Constructor & Destructor Documentation

◆ BinarySearchTreeNode() [1/3]

TMVA::BinarySearchTreeNode::BinarySearchTreeNode ( const Event * e = nullptr,
UInt_t signalClass = 0 )

constructor of a node for the search tree

Definition at line 58 of file BinarySearchTreeNode.cxx.

◆ BinarySearchTreeNode() [2/3]

TMVA::BinarySearchTreeNode::BinarySearchTreeNode ( BinarySearchTreeNode * parent,
char pos )

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

Definition at line 77 of file BinarySearchTreeNode.cxx.

◆ BinarySearchTreeNode() [3/3]

TMVA::BinarySearchTreeNode::BinarySearchTreeNode ( const BinarySearchTreeNode & n,
BinarySearchTreeNode * parent = nullptr )

copy constructor of a node.

It will result in an explicit copy of the node and recursively all it's daughters

Definition at line 91 of file BinarySearchTreeNode.cxx.

◆ ~BinarySearchTreeNode()

TMVA::BinarySearchTreeNode::~BinarySearchTreeNode ( )
virtual

node destructor

Definition at line 112 of file BinarySearchTreeNode.cxx.

Member Function Documentation

◆ AddAttributesToNode()

void TMVA::BinarySearchTreeNode::AddAttributesToNode ( void * node) const
overridevirtual

adding attributes to tree node

Implements TMVA::Node.

Definition at line 244 of file BinarySearchTreeNode.cxx.

◆ AddContentToNode()

void TMVA::BinarySearchTreeNode::AddContentToNode ( std::stringstream & s) const
overridevirtual

adding attributes to tree node

Implements TMVA::Node.

Definition at line 256 of file BinarySearchTreeNode.cxx.

◆ AddXMLTo()

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

add attributes to XML

Definition at line 146 of file Node.cxx.

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

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

Definition at line 118 of file BinarySearchTreeNode.h.

◆ CountMeAndAllDaughters()

Int_t TMVA::Node::CountMeAndAllDaughters ( ) const
inherited

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

Definition at line 113 of file Node.cxx.

◆ CreateNode()

Node * TMVA::BinarySearchTreeNode::CreateNode ( ) const
inlineoverridevirtual

Implements TMVA::Node.

Definition at line 72 of file BinarySearchTreeNode.h.

◆ DeclFileName()

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

Definition at line 118 of file BinarySearchTreeNode.h.

◆ EqualsMe()

Bool_t TMVA::BinarySearchTreeNode::EqualsMe ( const Event & e) const
virtual

check if the event fed into the node actually equals the event that forms the node (in case of a search tree)

Definition at line 138 of file BinarySearchTreeNode.cxx.

◆ GetClass()

UInt_t TMVA::BinarySearchTreeNode::GetClass ( ) const
inline

Definition at line 90 of file BinarySearchTreeNode.h.

◆ GetCount()

int TMVA::Node::GetCount ( )
inherited

returns the global number of instantiated nodes

Definition at line 105 of file Node.cxx.

◆ GetDepth()

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

Definition at line 116 of file Node.h.

◆ GetEventV()

const std::vector< Float_t > & TMVA::BinarySearchTreeNode::GetEventV ( ) const
inline

Definition at line 88 of file BinarySearchTreeNode.h.

◆ GetLeft()

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

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 89 of file Node.h.

◆ GetParent()

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

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 91 of file Node.h.

◆ GetParentTree()

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

Definition at line 125 of file Node.h.

◆ GetPos()

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

Definition at line 122 of file Node.h.

◆ GetRight()

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

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 90 of file Node.h.

◆ GetSelector()

Short_t TMVA::BinarySearchTreeNode::GetSelector ( ) const
inline

return index of variable used for discrimination at this node

Definition at line 86 of file BinarySearchTreeNode.h.

◆ GetTargets()

const std::vector< Float_t > & TMVA::BinarySearchTreeNode::GetTargets ( ) const
inline

Definition at line 92 of file BinarySearchTreeNode.h.

◆ GetWeight()

Float_t TMVA::BinarySearchTreeNode::GetWeight ( ) const
inline

Definition at line 89 of file BinarySearchTreeNode.h.

◆ GoesLeft()

Bool_t TMVA::BinarySearchTreeNode::GoesLeft ( const Event & e) const
overridevirtual

check if the event fed into the node goes/descends to the left daughter

Implements TMVA::Node.

Definition at line 128 of file BinarySearchTreeNode.cxx.

◆ GoesRight()

Bool_t TMVA::BinarySearchTreeNode::GoesRight ( const Event & e) const
overridevirtual

check if the event fed into the node goes/descends to the right daughter

Implements TMVA::Node.

Definition at line 119 of file BinarySearchTreeNode.cxx.

◆ IsA()

TClass * TMVA::BinarySearchTreeNode::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TMVA::Node.

Definition at line 118 of file BinarySearchTreeNode.h.

◆ Print()

void TMVA::BinarySearchTreeNode::Print ( std::ostream & os) const
overridevirtual

print the node

Implements TMVA::Node.

Definition at line 150 of file BinarySearchTreeNode.cxx.

◆ PrintRec()

void TMVA::BinarySearchTreeNode::PrintRec ( std::ostream & os) const
overridevirtual

recursively print the node and its daughters (--> print the 'tree')

Implements TMVA::Node.

Definition at line 171 of file BinarySearchTreeNode.cxx.

◆ ReadAttributes()

void TMVA::BinarySearchTreeNode::ReadAttributes ( void * node,
UInt_t tmva_Version_Code = 262657 )
overridevirtual

read attributes from XML

Implements TMVA::Node.

Definition at line 224 of file BinarySearchTreeNode.cxx.

◆ ReadContent()

void TMVA::BinarySearchTreeNode::ReadContent ( std::stringstream & s)
overridevirtual

read events from node

Implements TMVA::Node.

Definition at line 267 of file BinarySearchTreeNode.cxx.

◆ ReadDataRecord()

Bool_t TMVA::BinarySearchTreeNode::ReadDataRecord ( std::istream & is,
UInt_t tmva_Version_Code = 262657 )
overridevirtual

Read the data block.

Implements TMVA::Node.

Definition at line 188 of file BinarySearchTreeNode.cxx.

◆ ReadXML()

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

read attributes from XML

Definition at line 162 of file Node.cxx.

◆ SetDepth()

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

Definition at line 113 of file Node.h.

◆ SetLeft()

virtual void TMVA::Node::SetLeft ( Node * l)
inlinevirtualinherited

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 94 of file Node.h.

◆ SetParent()

virtual void TMVA::Node::SetParent ( Node * p)
inlinevirtualinherited

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 96 of file Node.h.

◆ SetParentTree()

virtual void TMVA::Node::SetParentTree ( TMVA::BinaryTree * t)
inlinevirtualinherited

Definition at line 128 of file Node.h.

◆ SetPos()

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

Definition at line 119 of file Node.h.

◆ SetRight()

virtual void TMVA::Node::SetRight ( Node * r)
inlinevirtualinherited

Reimplemented in TMVA::DecisionTreeNode.

Definition at line 95 of file Node.h.

◆ SetSelector()

void TMVA::BinarySearchTreeNode::SetSelector ( Short_t i)
inline

set index of variable used for discrimination at this node

Definition at line 84 of file BinarySearchTreeNode.h.

◆ Streamer()

void TMVA::BinarySearchTreeNode::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TMVA::Node.

◆ StreamerNVirtual()

void TMVA::BinarySearchTreeNode::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 118 of file BinarySearchTreeNode.h.

Member Data Documentation

◆ fClass

UInt_t TMVA::BinarySearchTreeNode::fClass
private

Definition at line 114 of file BinarySearchTreeNode.h.

◆ fDepth

UInt_t TMVA::Node::fDepth
protectedinherited

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

Definition at line 143 of file Node.h.

◆ fEventV

std::vector<Float_t> TMVA::BinarySearchTreeNode::fEventV
private

Definition at line 110 of file BinarySearchTreeNode.h.

◆ fgCount

Int_t TMVA::Node::fgCount = 0
staticprivateinherited

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

Definition at line 148 of file Node.h.

◆ fLeft

Node* TMVA::Node::fLeft
protectedinherited

pointers to the two "daughter" nodes

Definition at line 139 of file Node.h.

◆ fParent

Node* TMVA::Node::fParent
protectedinherited

the previous (parent) node

Definition at line 138 of file Node.h.

◆ fParentTree

BinaryTree* TMVA::Node::fParentTree
protectedinherited

pointer to the parent tree to which the Node belongs

Definition at line 145 of file Node.h.

◆ fPos

char TMVA::Node::fPos
protectedinherited

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
protectedinherited

pointers to the two "daughter" nodes

Definition at line 140 of file Node.h.

◆ fSelector

Short_t TMVA::BinarySearchTreeNode::fSelector
private

index of variable used in node selection (decision tree)

Definition at line 116 of file BinarySearchTreeNode.h.

◆ fTargets

std::vector<Float_t> TMVA::BinarySearchTreeNode::fTargets
private

Definition at line 111 of file BinarySearchTreeNode.h.

◆ fWeight

Float_t TMVA::BinarySearchTreeNode::fWeight
private

Definition at line 113 of file BinarySearchTreeNode.h.


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