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
 
 ~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
 

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 30 of file GBRTree2D.h.

Constructor & Destructor Documentation

◆ GBRTree2D()

GBRTree2D::GBRTree2D ( )
inline

Definition at line 32 of file GBRTree2D.h.

32 {}

◆ ~GBRTree2D()

GBRTree2D::~GBRTree2D ( )
inline

Definition at line 33 of file GBRTree2D.h.

33 {}

Member Function Documentation

◆ CutIndices() [1/2]

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

Definition at line 44 of file GBRTree2D.h.

44 { return fCutIndices; }

References fCutIndices.

◆ CutIndices() [2/2]

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

Definition at line 45 of file GBRTree2D.h.

45 { return fCutIndices; }

References fCutIndices.

◆ CutVals() [1/2]

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

Definition at line 47 of file GBRTree2D.h.

47 { return fCutVals; }

References fCutVals.

◆ CutVals() [2/2]

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

Definition at line 48 of file GBRTree2D.h.

48 { return fCutVals; }

References fCutVals.

◆ GetResponse()

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

Definition at line 68 of file GBRTree2D.h.

68  {
69  int index = 0;
70 
71  unsigned short cutindex = fCutIndices[0];
72  float cutval = fCutVals[0];
73 
74  while (true) {
75  if (vector[cutindex] > cutval) {
77  } else {
79  }
80 
81  if (index > 0) {
82  cutindex = fCutIndices[index];
83  cutval = fCutVals[index];
84  } else {
85  x = fResponsesX[-index];
86  y = fResponsesY[-index];
87  return;
88  }
89  }
90 }

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

◆ LeftIndices() [1/2]

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

Definition at line 50 of file GBRTree2D.h.

50 { return fLeftIndices; }

References fLeftIndices.

◆ LeftIndices() [2/2]

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

Definition at line 51 of file GBRTree2D.h.

51 { return fLeftIndices; }

References fLeftIndices.

◆ ResponsesX() [1/2]

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

Definition at line 38 of file GBRTree2D.h.

38 { return fResponsesX; }

References fResponsesX.

◆ ResponsesX() [2/2]

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

Definition at line 39 of file GBRTree2D.h.

39 { return fResponsesX; }

References fResponsesX.

◆ ResponsesY() [1/2]

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

Definition at line 41 of file GBRTree2D.h.

41 { return fResponsesY; }

References fResponsesY.

◆ ResponsesY() [2/2]

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

Definition at line 42 of file GBRTree2D.h.

42 { return fResponsesY; }

References fResponsesY.

◆ RightIndices() [1/2]

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

Definition at line 53 of file GBRTree2D.h.

53 { return fRightIndices; }

References fRightIndices.

◆ RightIndices() [2/2]

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

Definition at line 54 of file GBRTree2D.h.

54 { 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 93 of file GBRTree2D.h.

93  {
94  int index = 0;
95 
96  unsigned short cutindex = fCutIndices[0];
97  float cutval = fCutVals[0];
98 
99  while (true) {
100  if (vector[cutindex] > cutval) {
102  } else {
104  }
105 
106  if (index > 0) {
107  cutindex = fCutIndices[index];
108  cutval = fCutVals[index];
109  } else {
110  return (-index);
111  }
112  }
113 }

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 64 of file GBRTree2D.h.

◆ cond::serialization::access

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

Definition at line 64 of file GBRTree2D.h.

Member Data Documentation

◆ fCutIndices

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

Definition at line 57 of file GBRTree2D.h.

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

◆ fCutVals

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

Definition at line 58 of file GBRTree2D.h.

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

◆ fLeftIndices

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

Definition at line 59 of file GBRTree2D.h.

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

◆ fResponsesX

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

Definition at line 61 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesX().

◆ fResponsesY

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

Definition at line 62 of file GBRTree2D.h.

Referenced by GetResponse(), and ResponsesY().

◆ fRightIndices

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

Definition at line 60 of file GBRTree2D.h.

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

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