CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Friends
GBRTreeD Class Reference

#include <GBRTreeD.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
 
 GBRTreeD ()
 
template<typename InputTreeT >
 GBRTreeD (const InputTreeT &tree)
 
double GetResponse (int termidx) const
 
std::vector< int > & LeftIndices ()
 
const std::vector< int > & LeftIndices () const
 
std::vector< double > & Responses ()
 
const std::vector< double > & Responses () const
 
std::vector< int > & RightIndices ()
 
const std::vector< int > & RightIndices () const
 
int TerminalIndex (const float *vector) const
 
virtual ~GBRTreeD ()
 

Protected Attributes

std::vector< unsigned short > fCutIndices
 
std::vector< float > fCutVals
 
std::vector< int > fLeftIndices
 
std::vector< double > fResponses
 
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 33 of file GBRTreeD.h.

Constructor & Destructor Documentation

◆ GBRTreeD() [1/2]

GBRTreeD::GBRTreeD ( )
inline

Definition at line 35 of file GBRTreeD.h.

35 {}

◆ GBRTreeD() [2/2]

template<typename InputTreeT >
GBRTreeD::GBRTreeD ( const InputTreeT &  tree)

Definition at line 94 of file GBRTreeD.h.

95  : fCutIndices(tree.CutIndices()),
96  fCutVals(tree.CutVals()),
97  fLeftIndices(tree.LeftIndices()),
98  fRightIndices(tree.RightIndices()),
99  fResponses(tree.Responses()) {}

◆ ~GBRTreeD()

GBRTreeD::~GBRTreeD ( )
virtual

Definition at line 4 of file GBRTreeD.cc.

4 {}

Member Function Documentation

◆ CutIndices() [1/2]

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

Definition at line 47 of file GBRTreeD.h.

47 { return fCutIndices; }

References fCutIndices.

◆ CutIndices() [2/2]

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

Definition at line 48 of file GBRTreeD.h.

48 { return fCutIndices; }

References fCutIndices.

◆ CutVals() [1/2]

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

Definition at line 50 of file GBRTreeD.h.

50 { return fCutVals; }

References fCutVals.

◆ CutVals() [2/2]

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

Definition at line 51 of file GBRTreeD.h.

51 { return fCutVals; }

References fCutVals.

◆ GetResponse()

double GBRTreeD::GetResponse ( int  termidx) const
inline

Definition at line 41 of file GBRTreeD.h.

41 { return fResponses[termidx]; }

References fResponses.

◆ LeftIndices() [1/2]

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

Definition at line 53 of file GBRTreeD.h.

53 { return fLeftIndices; }

References fLeftIndices.

◆ LeftIndices() [2/2]

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

Definition at line 54 of file GBRTreeD.h.

54 { return fLeftIndices; }

References fLeftIndices.

◆ Responses() [1/2]

std::vector<double>& GBRTreeD::Responses ( )
inline

Definition at line 44 of file GBRTreeD.h.

44 { return fResponses; }

References fResponses.

◆ Responses() [2/2]

const std::vector<double>& GBRTreeD::Responses ( ) const
inline

Definition at line 45 of file GBRTreeD.h.

45 { return fResponses; }

References fResponses.

◆ RightIndices() [1/2]

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

Definition at line 56 of file GBRTreeD.h.

56 { return fRightIndices; }

References fRightIndices.

◆ RightIndices() [2/2]

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

Definition at line 57 of file GBRTreeD.h.

57 { return fRightIndices; }

References fRightIndices.

◆ serialize()

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

◆ TerminalIndex()

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

Definition at line 70 of file GBRTreeD.h.

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

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 66 of file GBRTreeD.h.

◆ cond::serialization::access

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

Definition at line 66 of file GBRTreeD.h.

Member Data Documentation

◆ fCutIndices

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

Definition at line 60 of file GBRTreeD.h.

Referenced by CutIndices(), and TerminalIndex().

◆ fCutVals

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

Definition at line 61 of file GBRTreeD.h.

Referenced by CutVals(), and TerminalIndex().

◆ fLeftIndices

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

Definition at line 62 of file GBRTreeD.h.

Referenced by LeftIndices(), and TerminalIndex().

◆ fResponses

std::vector<double> GBRTreeD::fResponses
protected

Definition at line 64 of file GBRTreeD.h.

Referenced by GetResponse(), and Responses().

◆ fRightIndices

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

Definition at line 63 of file GBRTreeD.h.

Referenced by RightIndices(), and TerminalIndex().

GBRTreeD::fRightIndices
std::vector< int > fRightIndices
Definition: GBRTreeD.h:63
tree
Definition: tree.py:1
GBRTreeD::fCutVals
std::vector< float > fCutVals
Definition: GBRTreeD.h:61
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
GBRTreeD::fCutIndices
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:60
GBRTreeD::fResponses
std::vector< double > fResponses
Definition: GBRTreeD.h:64
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
GBRTreeD::fLeftIndices
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:62