CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Friends
GBRTreeD Class Reference

#include <GBRTreeD.h>

Public Member Functions

std::vector< unsigned short > & CutIndices ()
 
const std::vector< unsigned
short > & 
CutIndices () const
 
std::vector< float > & CutVals ()
 
const std::vector< float > & CutVals () const
 
 GBRTreeD ()
 
template<typename InputTreeT >
 GBRTreeD (const InputTreeT &tree)
 
double GetResponse (int termidx) const
 
std::vector< int > & LeftIndices ()
 
const std::vector< int > & LeftIndices () const
 
std::vector< double > & Responses ()
 
const std::vector< double > & Responses () const
 
std::vector< int > & RightIndices ()
 
const std::vector< int > & RightIndices () const
 
int TerminalIndex (const float *vector) const
 

Protected Attributes

std::vector< unsigned short > fCutIndices
 
std::vector< float > fCutVals
 
std::vector< int > fLeftIndices
 
std::vector< double > fResponses
 
std::vector< int > fRightIndices
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 29 of file GBRTreeD.h.

Constructor & Destructor Documentation

GBRTreeD::GBRTreeD ( )
inline

Definition at line 31 of file GBRTreeD.h.

31 {}
template<typename InputTreeT >
GBRTreeD::GBRTreeD ( const InputTreeT &  tree)

Definition at line 89 of file GBRTreeD.h.

90  : fCutIndices(tree.CutIndices()),
91  fCutVals(tree.CutVals()),
92  fLeftIndices(tree.LeftIndices()),
93  fRightIndices(tree.RightIndices()),
94  fResponses(tree.Responses()) {}
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
std::vector< double > fResponses
Definition: GBRTreeD.h:59
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55

Member Function Documentation

std::vector<unsigned short>& GBRTreeD::CutIndices ( )
inline

Definition at line 42 of file GBRTreeD.h.

References fCutIndices.

42 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55
const std::vector<unsigned short>& GBRTreeD::CutIndices ( ) const
inline

Definition at line 43 of file GBRTreeD.h.

References fCutIndices.

43 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55
std::vector<float>& GBRTreeD::CutVals ( )
inline

Definition at line 45 of file GBRTreeD.h.

References fCutVals.

45 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
const std::vector<float>& GBRTreeD::CutVals ( ) const
inline

Definition at line 46 of file GBRTreeD.h.

References fCutVals.

46 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
double GBRTreeD::GetResponse ( int  termidx) const
inline

Definition at line 36 of file GBRTreeD.h.

References fResponses.

36 { return fResponses[termidx]; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59
std::vector<int>& GBRTreeD::LeftIndices ( )
inline

Definition at line 48 of file GBRTreeD.h.

References fLeftIndices.

48 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
const std::vector<int>& GBRTreeD::LeftIndices ( ) const
inline

Definition at line 49 of file GBRTreeD.h.

References fLeftIndices.

49 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
std::vector<double>& GBRTreeD::Responses ( )
inline

Definition at line 39 of file GBRTreeD.h.

References fResponses.

39 { return fResponses; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59
const std::vector<double>& GBRTreeD::Responses ( ) const
inline

Definition at line 40 of file GBRTreeD.h.

References fResponses.

40 { return fResponses; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59
std::vector<int>& GBRTreeD::RightIndices ( )
inline

Definition at line 51 of file GBRTreeD.h.

References fRightIndices.

51 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
const std::vector<int>& GBRTreeD::RightIndices ( ) const
inline

Definition at line 52 of file GBRTreeD.h.

References fRightIndices.

52 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
template<class Archive >
void GBRTreeD::serialize ( Archive &  ar,
const unsigned int  version 
)
private
int GBRTreeD::TerminalIndex ( const float *  vector) const
inline

Definition at line 65 of file GBRTreeD.h.

References fCutIndices, fCutVals, fLeftIndices, and fRightIndices.

65  {
66  int index = 0;
67 
68  unsigned short cutindex = fCutIndices[0];
69  float cutval = fCutVals[0];
70 
71  while (true) {
72  if (vector[cutindex] > cutval) {
73  index = fRightIndices[index];
74  } else {
75  index = fLeftIndices[index];
76  }
77 
78  if (index > 0) {
79  cutindex = fCutIndices[index];
80  cutval = fCutVals[index];
81  } else {
82  return (-index);
83  }
84  }
85 }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 61 of file GBRTreeD.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 61 of file GBRTreeD.h.

Member Data Documentation

std::vector<unsigned short> GBRTreeD::fCutIndices
protected

Definition at line 55 of file GBRTreeD.h.

Referenced by CutIndices(), and TerminalIndex().

std::vector<float> GBRTreeD::fCutVals
protected

Definition at line 56 of file GBRTreeD.h.

Referenced by CutVals(), and TerminalIndex().

std::vector<int> GBRTreeD::fLeftIndices
protected

Definition at line 57 of file GBRTreeD.h.

Referenced by LeftIndices(), and TerminalIndex().

std::vector<double> GBRTreeD::fResponses
protected

Definition at line 59 of file GBRTreeD.h.

Referenced by GetResponse(), and Responses().

std::vector<int> GBRTreeD::fRightIndices
protected

Definition at line 58 of file GBRTreeD.h.

Referenced by RightIndices(), and TerminalIndex().