CMS 3D CMS Logo

Public Member Functions | Protected Attributes

GBRTree2D Class Reference

#include <GBRTree2D.h>

List of all members.

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
const std::vector< float > & ResponsesY () const
std::vector< float > & ResponsesY ()
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.

{}
GBRTree2D::~GBRTree2D ( ) [inline]

Definition at line 34 of file GBRTree2D.h.

{}

Member Function Documentation

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

Definition at line 45 of file GBRTree2D.h.

References fCutIndices.

{ return fCutIndices; }
const std::vector<unsigned short>& GBRTree2D::CutIndices ( ) const [inline]

Definition at line 46 of file GBRTree2D.h.

References fCutIndices.

{ return fCutIndices; }
std::vector<float>& GBRTree2D::CutVals ( ) [inline]

Definition at line 48 of file GBRTree2D.h.

References fCutVals.

{ return fCutVals; }
const std::vector<float>& GBRTree2D::CutVals ( ) const [inline]

Definition at line 49 of file GBRTree2D.h.

References fCutVals.

{ return fCutVals; }
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.

                                                                                  {
  
  int index = 0;
  
  unsigned short cutindex = fCutIndices[0];
  float cutval = fCutVals[0];
  
  while (true) {
     
    if (vector[cutindex] > cutval) {
      index = fRightIndices[index];
    }
    else {
      index = fLeftIndices[index];
    }
    
    if (index>0) {
      cutindex = fCutIndices[index];
      cutval = fCutVals[index];
    }
    else {
      x = fResponsesX[-index];
      y = fResponsesY[-index];
      return;
    }
    
  }
  

}
std::vector<int>& GBRTree2D::LeftIndices ( ) [inline]

Definition at line 51 of file GBRTree2D.h.

References fLeftIndices.

{ return fLeftIndices; }
const std::vector<int>& GBRTree2D::LeftIndices ( ) const [inline]

Definition at line 52 of file GBRTree2D.h.

References fLeftIndices.

{ return fLeftIndices; } 
const std::vector<float>& GBRTree2D::ResponsesX ( ) const [inline]

Definition at line 40 of file GBRTree2D.h.

References fResponsesX.

{ return fResponsesX; }
std::vector<float>& GBRTree2D::ResponsesX ( ) [inline]

Definition at line 39 of file GBRTree2D.h.

References fResponsesX.

{ return fResponsesX; }       
std::vector<float>& GBRTree2D::ResponsesY ( ) [inline]

Definition at line 42 of file GBRTree2D.h.

References fResponsesY.

{ return fResponsesY; }       
const std::vector<float>& GBRTree2D::ResponsesY ( ) const [inline]

Definition at line 43 of file GBRTree2D.h.

References fResponsesY.

{ return fResponsesY; }
std::vector<int>& GBRTree2D::RightIndices ( ) [inline]

Definition at line 54 of file GBRTree2D.h.

References fRightIndices.

{ return fRightIndices; }
const std::vector<int>& GBRTree2D::RightIndices ( ) const [inline]

Definition at line 55 of file GBRTree2D.h.

References fRightIndices.

{ return fRightIndices; }
int GBRTree2D::TerminalIndex ( const float *  vector) const [inline]

Definition at line 102 of file GBRTree2D.h.

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

                                                             {
  
  int index = 0;
  
  unsigned short cutindex = fCutIndices[0];
  float cutval = fCutVals[0];
  
  while (true) {
    if (vector[cutindex] > cutval) {
      index = fRightIndices[index];
    }
    else {
      index = fLeftIndices[index];
    }
    
    if (index>0) {
      cutindex = fCutIndices[index];
      cutval = fCutVals[index];
    }
    else {
      return (-index);
    }
    
  }
  

}

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().