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.

42 { return fCutIndices; }

References fCutIndices.

◆ CutIndices() [2/2]

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

Definition at line 43 of file GBRTree2D.h.

43 { return fCutIndices; }

References fCutIndices.

◆ CutVals() [1/2]

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

Definition at line 45 of file GBRTree2D.h.

45 { return fCutVals; }

References fCutVals.

◆ CutVals() [2/2]

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

Definition at line 46 of file GBRTree2D.h.

46 { return fCutVals; }

References fCutVals.

◆ GetResponse()

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

Definition at line 66 of file GBRTree2D.h.

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 }

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

◆ LeftIndices() [1/2]

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

Definition at line 48 of file GBRTree2D.h.

48 { return fLeftIndices; }

References fLeftIndices.

◆ LeftIndices() [2/2]

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

Definition at line 49 of file GBRTree2D.h.

49 { return fLeftIndices; }

References fLeftIndices.

◆ ResponsesX() [1/2]

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

Definition at line 36 of file GBRTree2D.h.

36 { return fResponsesX; }

References fResponsesX.

◆ ResponsesX() [2/2]

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

Definition at line 37 of file GBRTree2D.h.

37 { return fResponsesX; }

References fResponsesX.

◆ ResponsesY() [1/2]

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

Definition at line 39 of file GBRTree2D.h.

39 { return fResponsesY; }

References fResponsesY.

◆ ResponsesY() [2/2]

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

Definition at line 40 of file GBRTree2D.h.

40 { return fResponsesY; }

References fResponsesY.

◆ RightIndices() [1/2]

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

Definition at line 51 of file GBRTree2D.h.

51 { return fRightIndices; }

References fRightIndices.

◆ RightIndices() [2/2]

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

Definition at line 52 of file GBRTree2D.h.

52 { return fRightIndices; }

References fRightIndices.

◆ 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.

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 }

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

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

DDAxes::y
GBRTree2D::fCutVals
std::vector< float > fCutVals
Definition: GBRTree2D.h:56
DDAxes::x
GBRTree2D::fResponsesY
std::vector< float > fResponsesY
Definition: GBRTree2D.h:60
GBRTree2D::fCutIndices
std::vector< unsigned short > fCutIndices
Definition: GBRTree2D.h:55
GBRTree2D::fLeftIndices
std::vector< int > fLeftIndices
Definition: GBRTree2D.h:57
GBRTree2D::fRightIndices
std::vector< int > fRightIndices
Definition: GBRTree2D.h:58
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
GBRTree2D::fResponsesX
std::vector< float > fResponsesX
Definition: GBRTree2D.h:59
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46