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()) {}
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
std::vector< double > fResponses
Definition: GBRTreeD.h:59
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55
Definition: tree.py:1

Member Function Documentation

◆ CutIndices() [1/2]

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

Definition at line 42 of file GBRTreeD.h.

References fCutIndices.

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

◆ CutIndices() [2/2]

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

Definition at line 43 of file GBRTreeD.h.

References fCutIndices.

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

◆ CutVals() [1/2]

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

Definition at line 45 of file GBRTreeD.h.

References fCutVals.

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

◆ CutVals() [2/2]

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

Definition at line 46 of file GBRTreeD.h.

References fCutVals.

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

◆ GetResponse()

double GBRTreeD::GetResponse ( int  termidx) const
inline

Definition at line 36 of file GBRTreeD.h.

References fResponses.

36 { return fResponses[termidx]; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59

◆ LeftIndices() [1/2]

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

Definition at line 48 of file GBRTreeD.h.

References fLeftIndices.

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

◆ LeftIndices() [2/2]

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

Definition at line 49 of file GBRTreeD.h.

References fLeftIndices.

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

◆ Responses() [1/2]

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

Definition at line 39 of file GBRTreeD.h.

References fResponses.

39 { return fResponses; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59

◆ Responses() [2/2]

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

Definition at line 40 of file GBRTreeD.h.

References fResponses.

40 { return fResponses; }
std::vector< double > fResponses
Definition: GBRTreeD.h:59

◆ RightIndices() [1/2]

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

Definition at line 51 of file GBRTreeD.h.

References fRightIndices.

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

◆ RightIndices() [2/2]

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

Definition at line 52 of file GBRTreeD.h.

References fRightIndices.

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

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

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

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 }
std::vector< int > fRightIndices
Definition: GBRTreeD.h:58
std::vector< float > fCutVals
Definition: GBRTreeD.h:56
std::vector< int > fLeftIndices
Definition: GBRTreeD.h:57
std::vector< unsigned short > fCutIndices
Definition: GBRTreeD.h:55

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