CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Friends
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
 

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
 

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 GBRTree2D.h.

Constructor & Destructor Documentation

◆ GBRTree2D()

GBRTree2D::GBRTree2D ( )
inline

Definition at line 31 of file GBRTree2D.h.

31 {}

Member Function Documentation

◆ CutIndices() [1/2]

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

Definition at line 42 of file GBRTree2D.h.

References fCutIndices.

42 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:55

◆ CutIndices() [2/2]

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

Definition at line 43 of file GBRTree2D.h.

References fCutIndices.

43 { return fCutIndices; }
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:55

◆ CutVals() [1/2]

std::vector<float>& GBRTree2D::CutVals ( )
inline

Definition at line 45 of file GBRTree2D.h.

References fCutVals.

45 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree2D.h:56

◆ CutVals() [2/2]

const std::vector<float>& GBRTree2D::CutVals ( ) const
inline

Definition at line 46 of file GBRTree2D.h.

References fCutVals.

46 { return fCutVals; }
std::vector< float > fCutVals
Definition: GBRTree2D.h:56

◆ GetResponse()

void GBRTree2D::GetResponse ( const float *  vector,
double &  x,
double &  y 
) const
inline

Definition at line 66 of file GBRTree2D.h.

References fCutIndices, fCutVals, fLeftIndices, fResponsesX, fResponsesY, fRightIndices, trackerHitRTTI::vector, x, and y.

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

◆ LeftIndices() [1/2]

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

Definition at line 48 of file GBRTree2D.h.

References fLeftIndices.

48 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:57

◆ LeftIndices() [2/2]

const std::vector<int>& GBRTree2D::LeftIndices ( ) const
inline

Definition at line 49 of file GBRTree2D.h.

References fLeftIndices.

49 { return fLeftIndices; }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:57

◆ ResponsesX() [1/2]

std::vector<float>& GBRTree2D::ResponsesX ( )
inline

Definition at line 36 of file GBRTree2D.h.

References fResponsesX.

36 { return fResponsesX; }
std::vector< float > fResponsesX
Definition: GBRTree2D.h:59

◆ ResponsesX() [2/2]

const std::vector<float>& GBRTree2D::ResponsesX ( ) const
inline

Definition at line 37 of file GBRTree2D.h.

References fResponsesX.

37 { return fResponsesX; }
std::vector< float > fResponsesX
Definition: GBRTree2D.h:59

◆ ResponsesY() [1/2]

std::vector<float>& GBRTree2D::ResponsesY ( )
inline

Definition at line 39 of file GBRTree2D.h.

References fResponsesY.

39 { return fResponsesY; }
std::vector< float > fResponsesY
Definition: GBRTree2D.h:60

◆ ResponsesY() [2/2]

const std::vector<float>& GBRTree2D::ResponsesY ( ) const
inline

Definition at line 40 of file GBRTree2D.h.

References fResponsesY.

40 { return fResponsesY; }
std::vector< float > fResponsesY
Definition: GBRTree2D.h:60

◆ RightIndices() [1/2]

std::vector<int>& GBRTree2D::RightIndices ( )
inline

Definition at line 51 of file GBRTree2D.h.

References fRightIndices.

51 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTree2D.h:58

◆ RightIndices() [2/2]

const std::vector<int>& GBRTree2D::RightIndices ( ) const
inline

Definition at line 52 of file GBRTree2D.h.

References fRightIndices.

52 { return fRightIndices; }
std::vector< int > fRightIndices
Definition: GBRTree2D.h:58

◆ serialize()

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

◆ TerminalIndex()

int GBRTree2D::TerminalIndex ( const float *  vector) const
inline

Definition at line 91 of file GBRTree2D.h.

References fCutIndices, fCutVals, fLeftIndices, fRightIndices, and trackerHitRTTI::vector.

91  {
92  int index = 0;
93 
94  unsigned short cutindex = fCutIndices[0];
95  float cutval = fCutVals[0];
96 
97  while (true) {
98  if (vector[cutindex] > cutval) {
100  } else {
102  }
103 
104  if (index > 0) {
105  cutindex = fCutIndices[index];
106  cutval = fCutVals[index];
107  } else {
108  return (-index);
109  }
110  }
111 }
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:57
std::vector< int > fRightIndices
Definition: GBRTree2D.h:58
std::vector< float > fCutVals
Definition: GBRTree2D.h:56
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:55

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 62 of file GBRTree2D.h.

◆ cond::serialization::access

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

Definition at line 62 of file GBRTree2D.h.

Member Data Documentation

◆ fCutIndices

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

Definition at line 55 of file GBRTree2D.h.

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

◆ fCutVals

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

Definition at line 56 of file GBRTree2D.h.

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

◆ fLeftIndices

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

Definition at line 57 of file GBRTree2D.h.

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

◆ fResponsesX

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

Definition at line 59 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesX().

◆ fResponsesY

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

Definition at line 60 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesY().

◆ fRightIndices

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

Definition at line 58 of file GBRTree2D.h.

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