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
 

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

Constructor & Destructor Documentation

◆ GBRTreeD() [1/2]

GBRTreeD::GBRTreeD ( )
inline

Definition at line 31 of file GBRTreeD.h.

31 {}

◆ GBRTreeD() [2/2]

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

Definition at line 89 of file GBRTreeD.h.

90  : fCutIndices(tree.CutIndices()),
91  fCutVals(tree.CutVals()),
92  fLeftIndices(tree.LeftIndices()),
93  fRightIndices(tree.RightIndices()),
94  fResponses(tree.Responses()) {}

Member Function Documentation

◆ CutIndices() [1/2]

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

Definition at line 42 of file GBRTreeD.h.

42 { return fCutIndices; }

References fCutIndices.

◆ CutIndices() [2/2]

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

Definition at line 43 of file GBRTreeD.h.

43 { return fCutIndices; }

References fCutIndices.

◆ CutVals() [1/2]

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

Definition at line 45 of file GBRTreeD.h.

45 { return fCutVals; }

References fCutVals.

◆ CutVals() [2/2]

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

Definition at line 46 of file GBRTreeD.h.

46 { return fCutVals; }

References fCutVals.

◆ GetResponse()

double GBRTreeD::GetResponse ( int  termidx) const
inline

Definition at line 36 of file GBRTreeD.h.

36 { return fResponses[termidx]; }

References fResponses.

◆ LeftIndices() [1/2]

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

Definition at line 48 of file GBRTreeD.h.

48 { return fLeftIndices; }

References fLeftIndices.

◆ LeftIndices() [2/2]

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

Definition at line 49 of file GBRTreeD.h.

49 { return fLeftIndices; }

References fLeftIndices.

◆ Responses() [1/2]

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

Definition at line 39 of file GBRTreeD.h.

39 { return fResponses; }

References fResponses.

◆ Responses() [2/2]

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

Definition at line 40 of file GBRTreeD.h.

40 { return fResponses; }

References fResponses.

◆ RightIndices() [1/2]

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

Definition at line 51 of file GBRTreeD.h.

51 { return fRightIndices; }

References fRightIndices.

◆ RightIndices() [2/2]

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

Definition at line 52 of file GBRTreeD.h.

52 { 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 65 of file GBRTreeD.h.

65  {
66  int index = 0;
67 
68  unsigned short cutindex = fCutIndices[0];
69  float cutval = fCutVals[0];
70 
71  while (true) {
72  if (vector[cutindex] > cutval) {
74  } else {
76  }
77 
78  if (index > 0) {
79  cutindex = fCutIndices[index];
80  cutval = fCutVals[index];
81  } else {
82  return (-index);
83  }
84  }
85 }

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

◆ cond::serialization::access

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

Definition at line 61 of file GBRTreeD.h.

Member Data Documentation

◆ fCutIndices

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

Definition at line 55 of file GBRTreeD.h.

Referenced by CutIndices(), and TerminalIndex().

◆ fCutVals

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

Definition at line 56 of file GBRTreeD.h.

Referenced by CutVals(), and TerminalIndex().

◆ fLeftIndices

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

Definition at line 57 of file GBRTreeD.h.

Referenced by LeftIndices(), and TerminalIndex().

◆ fResponses

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

Definition at line 59 of file GBRTreeD.h.

Referenced by GetResponse(), and Responses().

◆ fRightIndices

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

Definition at line 58 of file GBRTreeD.h.

Referenced by RightIndices(), and TerminalIndex().

GBRTreeD::fRightIndices
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
tree
Definition: tree.py:1
GBRTreeD::fCutVals
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
GBRTreeD::fCutIndices
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55
GBRTreeD::fResponses
std::vector< double > fResponses
Definition: GBRTreeD.h:59
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
GBRTreeD::fLeftIndices
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57