67 for (
UInt_t ivar=0; ivar<
e->GetNVariables(); ivar++)
fEventV.push_back(
e->GetValue(ivar));
68 for (std::vector<Float_t>::const_iterator it =
e->GetTargets().begin(); it < e->
GetTargets().end(); ++it ) {
101 if (
n.GetLeft() == 0 ) this->
SetLeft(NULL);
104 if (
n.GetRight() == 0 ) this->
SetRight(NULL);
152 os <<
"< *** " << std::endl <<
" node.Data: ";
153 std::vector<Float_t>::const_iterator it=
fEventV.begin();
154 os <<
fEventV.size() <<
" vars: ";
155 for (;it!=
fEventV.end(); ++it) os <<
" " << std::setw(10) << *it;
156 os <<
" EvtWeight " << std::setw(10) <<
fWeight;
157 os << std::setw(10) <<
"Class: " <<
GetClass() << std::endl;
159 os <<
"Selector: " << this->
GetSelector() <<std::endl;
160 os <<
"My address is " << (
Longptr_t)
this <<
", ";
165 os <<
" **** > "<< std::endl;
174 <<
" data: " << std::endl;
175 std::vector<Float_t>::const_iterator it=
fEventV.begin();
176 os <<
fEventV.size() <<
" vars: ";
177 for (;it!=
fEventV.end(); ++it) os <<
" " << std::setw(10) << *it;
178 os <<
" EvtWeight " << std::setw(10) <<
fWeight;
179 os << std::setw(10) <<
"Class: " <<
GetClass() << std::endl;
192 UInt_t depth, selIdx, nvar;
199 if ( itmp==-1 ) {
return kFALSE; }
211 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
212 is >> evtValFloat;
fEventV.push_back(evtValFloat);
216 fClass = (sigbkgd==
"S" || sigbkgd==
"Signal")?0:1;
230 if (sb==
"Signal" || sb==
"0")
258 std::ios_base::fmtflags ff = s.flags();
274 while (s >> temp)
fTargets.push_back(temp);
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
float Float_t
Float 4 bytes (float).
std::vector< Float_t > fTargets
void PrintRec(std::ostream &os) const override
recursively print the node and its daughters (--> print the 'tree')
std::vector< Float_t > fEventV
virtual ~BinarySearchTreeNode()
node destructor
Bool_t GoesLeft(const Event &) const override
check if the event fed into the node goes/descends to the left daughter
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 sear...
void ReadAttributes(void *node, UInt_t tmva_Version_Code=262657) override
read attributes from XML
BinarySearchTreeNode(const Event *e=nullptr, UInt_t signalClass=0)
constructor of a node for the search tree
Bool_t ReadDataRecord(std::istream &is, UInt_t tmva_Version_Code=262657) override
Read the data block.
Bool_t GoesRight(const Event &) const override
check if the event fed into the node goes/descends to the right daughter
Short_t fSelector
index of variable used in node selection (decision tree)
const std::vector< Float_t > & GetTargets() const
void SetSelector(Short_t i)
set index of variable used for discrimination at this node
void AddContentToNode(std::stringstream &s) const override
adding attributes to tree node
Float_t GetWeight() const
const std::vector< Float_t > & GetEventV() const
void AddAttributesToNode(void *node) const override
adding attributes to tree node
void Print(std::ostream &os) const override
print the node
Short_t GetSelector() const
return index of variable used for discrimination at this node
void ReadContent(std::stringstream &s) override
read events from node
virtual Node * GetLeft() const
virtual Node * GetParent() const
virtual void SetRight(Node *r)
virtual void SetLeft(Node *l)
virtual void SetParent(Node *p)
virtual Node * GetRight() const
create variable transformations