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
 
virtual void AddAttributesToNode (void *node) const
 adding attributes to tree node
 
virtual void AddContentToNode (std::stringstream &s) const
 adding attributes to tree node
 
virtual NodeCreateNode () const
 
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
 
const std::vector< Float_t > & GetEventV () 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
 
virtual Bool_t GoesLeft (const Event &) const
 check if the event fed into the node goes/descends to the left daughter
 
virtual Bool_t GoesRight (const Event &) const
 check if the event fed into the node goes/descends to the right daughter
 
virtual TClassIsA () const
 
virtual void Print (std::ostream &os) const
 print the node
 
virtual void PrintRec (std::ostream &os) const
 recursively print the node and its daughters (--> print the 'tree')
 
virtual void ReadAttributes (void *node, UInt_t tmva_Version_Code=262657)
 read attributes from XML
 
virtual void ReadContent (std::stringstream &s)
 read events from node
 
virtual Bool_t ReadDataRecord (std::istream &is, UInt_t tmva_Version_Code=262657)
 Read the data block.
 
void SetSelector (Short_t i)
 set index of variable used for discrimination at this node
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TMVA::Node
 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
 
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
 
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
 
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 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 ()
 
- Static Public Member Functions inherited from TMVA::Node
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

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
 

Additional Inherited Members

- Protected Attributes inherited from TMVA::Node
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
 

#include <TMVA/BinarySearchTreeNode.h>

Inheritance diagram for TMVA::BinarySearchTreeNode:
[legend]

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 59 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 78 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 92 of file BinarySearchTreeNode.cxx.

◆ ~BinarySearchTreeNode()

TMVA::BinarySearchTreeNode::~BinarySearchTreeNode ( )
virtual

node destructor

Definition at line 113 of file BinarySearchTreeNode.cxx.

Member Function Documentation

◆ AddAttributesToNode()

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

adding attributes to tree node

Implements TMVA::Node.

Definition at line 245 of file BinarySearchTreeNode.cxx.

◆ AddContentToNode()

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

adding attributes to tree node

Implements TMVA::Node.

Definition at line 257 of file BinarySearchTreeNode.cxx.

◆ Class()

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

◆ Class_Name()

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

◆ Class_Version()

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

Definition at line 118 of file BinarySearchTreeNode.h.

◆ CreateNode()

virtual Node * TMVA::BinarySearchTreeNode::CreateNode ( ) const
inlinevirtual

Implements TMVA::Node.

Definition at line 72 of file BinarySearchTreeNode.h.

◆ DeclFileName()

static 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 139 of file BinarySearchTreeNode.cxx.

◆ GetClass()

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

Definition at line 90 of file BinarySearchTreeNode.h.

◆ GetEventV()

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

Definition at line 88 of file BinarySearchTreeNode.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
virtual

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

Implements TMVA::Node.

Definition at line 129 of file BinarySearchTreeNode.cxx.

◆ GoesRight()

Bool_t TMVA::BinarySearchTreeNode::GoesRight ( const Event e) const
virtual

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

Implements TMVA::Node.

Definition at line 120 of file BinarySearchTreeNode.cxx.

◆ IsA()

virtual TClass * TMVA::BinarySearchTreeNode::IsA ( ) const
inlinevirtual
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
virtual

print the node

Implements TMVA::Node.

Definition at line 151 of file BinarySearchTreeNode.cxx.

◆ PrintRec()

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

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

Implements TMVA::Node.

Definition at line 172 of file BinarySearchTreeNode.cxx.

◆ ReadAttributes()

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

read attributes from XML

Implements TMVA::Node.

Definition at line 225 of file BinarySearchTreeNode.cxx.

◆ ReadContent()

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

read events from node

Implements TMVA::Node.

Definition at line 268 of file BinarySearchTreeNode.cxx.

◆ ReadDataRecord()

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

Read the data block.

Implements TMVA::Node.

Definition at line 189 of file BinarySearchTreeNode.cxx.

◆ 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()

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

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.

◆ fEventV

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

Definition at line 110 of file BinarySearchTreeNode.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.

Libraries for TMVA::BinarySearchTreeNode:

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