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 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
 
virtual ~GBRTreeD ()
 

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 33 of file GBRTreeD.h.

Constructor & Destructor Documentation

GBRTreeD::GBRTreeD ( )
inline

Definition at line 37 of file GBRTreeD.h.

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

Definition at line 100 of file GBRTreeD.h.

100  :
101  fCutIndices(tree.CutIndices()),
102  fCutVals(tree.CutVals()),
103  fLeftIndices(tree.LeftIndices()),
104  fRightIndices(tree.RightIndices()),
105  fResponses(tree.Responses()) {
106 
107 }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:64
std::vector< double > fResponses
Definition: GBRTreeD.h:65
std::vector< float > fCutVals
Definition: GBRTreeD.h:62
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:63
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:61
GBRTreeD::~GBRTreeD ( )
virtual

Definition at line 4 of file GBRTreeD.cc.

4  {
5 
6 }

Member Function Documentation

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

Definition at line 48 of file GBRTreeD.h.

References fCutIndices.

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

Definition at line 49 of file GBRTreeD.h.

References fCutIndices.

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

Definition at line 51 of file GBRTreeD.h.

References fCutVals.

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

Definition at line 52 of file GBRTreeD.h.

References fCutVals.

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

Definition at line 42 of file GBRTreeD.h.

References fResponses.

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

Definition at line 54 of file GBRTreeD.h.

References fLeftIndices.

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

Definition at line 55 of file GBRTreeD.h.

References fLeftIndices.

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

Definition at line 45 of file GBRTreeD.h.

References fResponses.

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

Definition at line 46 of file GBRTreeD.h.

References fResponses.

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

Definition at line 57 of file GBRTreeD.h.

References fRightIndices.

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

Definition at line 58 of file GBRTreeD.h.

References fRightIndices.

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

Definition at line 72 of file GBRTreeD.h.

References fCutIndices, fCutVals, fLeftIndices, fRightIndices, and cmsHarvester::index.

72  {
73 
74  int index = 0;
75 
76  unsigned short cutindex = fCutIndices[0];
77  float cutval = fCutVals[0];
78 
79  while (true) {
80  if (vector[cutindex] > cutval) {
81  index = fRightIndices[index];
82  }
83  else {
84  index = fLeftIndices[index];
85  }
86 
87  if (index>0) {
88  cutindex = fCutIndices[index];
89  cutval = fCutVals[index];
90  }
91  else {
92  return (-index);
93  }
94 
95  }
96 
97 }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:64
std::vector< float > fCutVals
Definition: GBRTreeD.h:62
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:63
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:61

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 67 of file GBRTreeD.h.

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

Definition at line 67 of file GBRTreeD.h.

Member Data Documentation

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

Definition at line 61 of file GBRTreeD.h.

Referenced by CutIndices(), and TerminalIndex().

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

Definition at line 62 of file GBRTreeD.h.

Referenced by CutVals(), and TerminalIndex().

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

Definition at line 63 of file GBRTreeD.h.

Referenced by LeftIndices(), and TerminalIndex().

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

Definition at line 65 of file GBRTreeD.h.

Referenced by GetResponse(), and Responses().

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

Definition at line 64 of file GBRTreeD.h.

Referenced by RightIndices(), and TerminalIndex().