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
GBRTree2D Class Reference

#include <GBRTree2D.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
 
 GBRTree2D ()
 
void GetResponse (const float *vector, double &x, double &y) const
 
std::vector< int > & LeftIndices ()
 
const std::vector< int > & LeftIndices () const
 
std::vector< float > & ResponsesX ()
 
const std::vector< float > & ResponsesX () const
 
std::vector< float > & ResponsesY ()
 
const std::vector< float > & ResponsesY () const
 
std::vector< int > & RightIndices ()
 
const std::vector< int > & RightIndices () const
 
int TerminalIndex (const float *vector) const
 
 ~GBRTree2D ()
 

Protected Attributes

std::vector< unsigned short > fCutIndices
 
std::vector< float > fCutVals
 
std::vector< int > fLeftIndices
 
std::vector< float > fResponsesX
 
std::vector< float > fResponsesY
 
std::vector< int > fRightIndices
 

Detailed Description

Definition at line 29 of file GBRTree2D.h.

Constructor & Destructor Documentation

GBRTree2D::GBRTree2D ( )
inline

Definition at line 33 of file GBRTree2D.h.

33 {}
GBRTree2D::~GBRTree2D ( )
inline

Definition at line 34 of file GBRTree2D.h.

34 {}

Member Function Documentation

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

Definition at line 45 of file GBRTree2D.h.

References fCutIndices.

45 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:60
const std::vector<unsigned short>& GBRTree2D::CutIndices ( ) const
inline

Definition at line 46 of file GBRTree2D.h.

References fCutIndices.

46 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:60
std::vector<float>& GBRTree2D::CutVals ( )
inline

Definition at line 48 of file GBRTree2D.h.

References fCutVals.

48 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree2D.h:61
const std::vector<float>& GBRTree2D::CutVals ( ) const
inline

Definition at line 49 of file GBRTree2D.h.

References fCutVals.

49 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree2D.h:61
void GBRTree2D::GetResponse ( const float *  vector,
double &  x,
double &  y 
) const
inline

Definition at line 70 of file GBRTree2D.h.

References fCutIndices, fCutVals, fLeftIndices, fResponsesX, fResponsesY, fRightIndices, and getHLTprescales::index.

70  {
71 
72  int index = 0;
73 
74  unsigned short cutindex = fCutIndices[0];
75  float cutval = fCutVals[0];
76 
77  while (true) {
78 
79  if (vector[cutindex] > cutval) {
80  index = fRightIndices[index];
81  }
82  else {
83  index = fLeftIndices[index];
84  }
85 
86  if (index>0) {
87  cutindex = fCutIndices[index];
88  cutval = fCutVals[index];
89  }
90  else {
91  x = fResponsesX[-index];
92  y = fResponsesY[-index];
93  return;
94  }
95 
96  }
97 
98 
99 }
std::vector< float > fResponsesY
Definition: GBRTree2D.h:65
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:62
std::vector< int > fRightIndices
Definition: GBRTree2D.h:63
std::vector< float > fResponsesX
Definition: GBRTree2D.h:64
x
Definition: VDTMath.h:216
std::vector< float > fCutVals
Definition: GBRTree2D.h:61
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:60
std::vector<int>& GBRTree2D::LeftIndices ( )
inline

Definition at line 51 of file GBRTree2D.h.

References fLeftIndices.

51 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:62
const std::vector<int>& GBRTree2D::LeftIndices ( ) const
inline

Definition at line 52 of file GBRTree2D.h.

References fLeftIndices.

52 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:62
std::vector<float>& GBRTree2D::ResponsesX ( )
inline

Definition at line 39 of file GBRTree2D.h.

References fResponsesX.

39 { return fResponsesX; }
std::vector< float > fResponsesX
Definition: GBRTree2D.h:64
const std::vector<float>& GBRTree2D::ResponsesX ( ) const
inline

Definition at line 40 of file GBRTree2D.h.

References fResponsesX.

40 { return fResponsesX; }
std::vector< float > fResponsesX
Definition: GBRTree2D.h:64
std::vector<float>& GBRTree2D::ResponsesY ( )
inline

Definition at line 42 of file GBRTree2D.h.

References fResponsesY.

42 { return fResponsesY; }
std::vector< float > fResponsesY
Definition: GBRTree2D.h:65
const std::vector<float>& GBRTree2D::ResponsesY ( ) const
inline

Definition at line 43 of file GBRTree2D.h.

References fResponsesY.

43 { return fResponsesY; }
std::vector< float > fResponsesY
Definition: GBRTree2D.h:65
std::vector<int>& GBRTree2D::RightIndices ( )
inline

Definition at line 54 of file GBRTree2D.h.

References fRightIndices.

54 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTree2D.h:63
const std::vector<int>& GBRTree2D::RightIndices ( ) const
inline

Definition at line 55 of file GBRTree2D.h.

References fRightIndices.

55 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTree2D.h:63
int GBRTree2D::TerminalIndex ( const float *  vector) const
inline

Definition at line 102 of file GBRTree2D.h.

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

102  {
103 
104  int index = 0;
105 
106  unsigned short cutindex = fCutIndices[0];
107  float cutval = fCutVals[0];
108 
109  while (true) {
110  if (vector[cutindex] > cutval) {
111  index = fRightIndices[index];
112  }
113  else {
114  index = fLeftIndices[index];
115  }
116 
117  if (index>0) {
118  cutindex = fCutIndices[index];
119  cutval = fCutVals[index];
120  }
121  else {
122  return (-index);
123  }
124 
125  }
126 
127 
128 }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:62
std::vector< int > fRightIndices
Definition: GBRTree2D.h:63
std::vector< float > fCutVals
Definition: GBRTree2D.h:61
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:60

Member Data Documentation

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

Definition at line 60 of file GBRTree2D.h.

Referenced by CutIndices(), GetResponse(), and TerminalIndex().

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

Definition at line 61 of file GBRTree2D.h.

Referenced by CutVals(), GetResponse(), and TerminalIndex().

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

Definition at line 62 of file GBRTree2D.h.

Referenced by GetResponse(), LeftIndices(), and TerminalIndex().

std::vector<float> GBRTree2D::fResponsesX
protected

Definition at line 64 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesX().

std::vector<float> GBRTree2D::fResponsesY
protected

Definition at line 65 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesY().

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

Definition at line 63 of file GBRTree2D.h.

Referenced by GetResponse(), RightIndices(), and TerminalIndex().