test
CMS 3D CMS Logo

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

#include <GBRTree.h>

Public Member Functions

std::vector< unsigned char > & CutIndices ()
 
const std::vector< unsigned
char > & 
CutIndices () const
 
std::vector< float > & CutVals ()
 
const std::vector< float > & CutVals () const
 
 GBRTree ()
 
 GBRTree (const TMVA::DecisionTree *tree, double scale, bool useyesnoleaf, bool adjustboundary)
 
double GetResponse (const float *vector) const
 
std::vector< int > & LeftIndices ()
 
const std::vector< int > & LeftIndices () const
 
std::vector< float > & Responses ()
 
const std::vector< float > & Responses () const
 
std::vector< int > & RightIndices ()
 
const std::vector< int > & RightIndices () const
 
int TerminalIndex (const float *vector) const
 
virtual ~GBRTree ()
 

Protected Member Functions

void AddNode (const TMVA::DecisionTreeNode *node, double scale, bool isregression, bool useyesnoleaf, bool adjustboundary)
 
unsigned int CountIntermediateNodes (const TMVA::DecisionTreeNode *node)
 
unsigned int CountTerminalNodes (const TMVA::DecisionTreeNode *node)
 

Protected Attributes

std::vector< unsigned char > fCutIndices
 
std::vector< float > fCutVals
 
std::vector< int > fLeftIndices
 
std::vector< float > 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 36 of file GBRTree.h.

Constructor & Destructor Documentation

GBRTree::GBRTree ( )
GBRTree::GBRTree ( const TMVA::DecisionTree *  tree,
double  scale,
bool  useyesnoleaf,
bool  adjustboundary 
)
explicit
virtual GBRTree::~GBRTree ( )
virtual

Member Function Documentation

void GBRTree::AddNode ( const TMVA::DecisionTreeNode *  node,
double  scale,
bool  isregression,
bool  useyesnoleaf,
bool  adjustboundary 
)
protected
unsigned int GBRTree::CountIntermediateNodes ( const TMVA::DecisionTreeNode *  node)
protected
unsigned int GBRTree::CountTerminalNodes ( const TMVA::DecisionTreeNode *  node)
protected
std::vector<unsigned char>& GBRTree::CutIndices ( )
inline

Definition at line 50 of file GBRTree.h.

References fCutIndices.

50 { return fCutIndices; }
std::vector< unsigned char > fCutIndices
Definition: GBRTree.h:70
const std::vector<unsigned char>& GBRTree::CutIndices ( ) const
inline

Definition at line 51 of file GBRTree.h.

References fCutIndices.

51 { return fCutIndices; }
std::vector< unsigned char > fCutIndices
Definition: GBRTree.h:70
std::vector<float>& GBRTree::CutVals ( )
inline

Definition at line 53 of file GBRTree.h.

References fCutVals.

53 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree.h:71
const std::vector<float>& GBRTree::CutVals ( ) const
inline

Definition at line 54 of file GBRTree.h.

References fCutVals.

54 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree.h:71
double GBRTree::GetResponse ( const float *  vector) const
inline

Definition at line 81 of file GBRTree.h.

References fResponses, and TerminalIndex().

81  {
82  return fResponses[TerminalIndex(vector)];
83 }
std::vector< float > fResponses
Definition: GBRTree.h:74
int TerminalIndex(const float *vector) const
Definition: GBRTree.h:86
std::vector<int>& GBRTree::LeftIndices ( )
inline

Definition at line 56 of file GBRTree.h.

References fLeftIndices.

56 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree.h:72
const std::vector<int>& GBRTree::LeftIndices ( ) const
inline

Definition at line 57 of file GBRTree.h.

References fLeftIndices.

57 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree.h:72
std::vector<float>& GBRTree::Responses ( )
inline

Definition at line 47 of file GBRTree.h.

References fResponses.

47 { return fResponses; }
std::vector< float > fResponses
Definition: GBRTree.h:74
const std::vector<float>& GBRTree::Responses ( ) const
inline

Definition at line 48 of file GBRTree.h.

References fResponses.

48 { return fResponses; }
std::vector< float > fResponses
Definition: GBRTree.h:74
std::vector<int>& GBRTree::RightIndices ( )
inline

Definition at line 59 of file GBRTree.h.

References fRightIndices.

59 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTree.h:73
const std::vector<int>& GBRTree::RightIndices ( ) const
inline

Definition at line 60 of file GBRTree.h.

References fRightIndices.

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

Definition at line 86 of file GBRTree.h.

References fCutIndices, fCutVals, fLeftIndices, fRightIndices, cmsHarvester::index, cmsLHEtoEOSManager::l, and alignCSCRings::r.

Referenced by GetResponse().

86  {
87  int index = 0;
88  do {
89  auto r = fRightIndices[index];
90  auto l = fLeftIndices[index];
91  index = vector[fCutIndices[index]] > fCutVals[index] ? r : l;
92  } while (index>0);
93  return -index;
94 }
std::vector< int > fRightIndices
Definition: GBRTree.h:73
std::vector< float > fCutVals
Definition: GBRTree.h:71
std::vector< int > fLeftIndices
Definition: GBRTree.h:72
std::vector< unsigned char > fCutIndices
Definition: GBRTree.h:70

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 77 of file GBRTree.h.

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

Definition at line 77 of file GBRTree.h.

Member Data Documentation

std::vector<unsigned char> GBRTree::fCutIndices
protected

Definition at line 70 of file GBRTree.h.

Referenced by CutIndices(), and TerminalIndex().

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

Definition at line 71 of file GBRTree.h.

Referenced by CutVals(), and TerminalIndex().

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

Definition at line 72 of file GBRTree.h.

Referenced by LeftIndices(), and TerminalIndex().

std::vector<float> GBRTree::fResponses
protected

Definition at line 74 of file GBRTree.h.

Referenced by GetResponse(), and Responses().

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

Definition at line 73 of file GBRTree.h.

Referenced by RightIndices(), and TerminalIndex().