CMS 3D CMS Logo

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

#include <GBRForestD.h>

Public Types

typedef GBRTreeD TreeT
 

Public Member Functions

 GBRForestD ()
 
template<typename InputForestT >
 GBRForestD (const InputForestT &forest)
 
double GetResponse (const float *vector) const
 
double InitialResponse () const
 
void SetInitialResponse (double response)
 
std::vector< GBRTreeD > & Trees ()
 
const std::vector< GBRTreeD > & Trees () const
 

Protected Attributes

double fInitialResponse = 0.0
 
std::vector< GBRTreeDfTrees
 

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 25 of file GBRForestD.h.

Member Typedef Documentation

◆ TreeT

Definition at line 27 of file GBRForestD.h.

Constructor & Destructor Documentation

◆ GBRForestD() [1/2]

GBRForestD::GBRForestD ( )
inline

Definition at line 29 of file GBRForestD.h.

29 {}

◆ GBRForestD() [2/2]

template<typename InputForestT >
GBRForestD::GBRForestD ( const InputForestT &  forest)

Definition at line 60 of file GBRForestD.h.

References fTrees.

60  : fInitialResponse(forest.InitialResponse()) {
61  //templated constructor to allow construction from Forest classes in GBRLikelihood
62  //without creating an explicit dependency
63 
64  for (typename std::vector<typename InputForestT::TreeT>::const_iterator treeit = forest.Trees().begin();
65  treeit != forest.Trees().end();
66  ++treeit) {
67  fTrees.push_back(GBRTreeD(*treeit));
68  }
69 }
std::vector< GBRTreeD > fTrees
Definition: GBRForestD.h:43
double fInitialResponse
Definition: GBRForestD.h:42

Member Function Documentation

◆ GetResponse()

double GBRForestD::GetResponse ( const float *  vector) const
inline

Definition at line 49 of file GBRForestD.h.

References fInitialResponse, fTrees, and trackerHitRTTI::vector.

Referenced by PFClusterEMEnergyCorrector::correctEnergies(), and EgammaRegressionContainer::operator()().

49  {
50  double response = fInitialResponse;
51  for (std::vector<GBRTreeD>::const_iterator it = fTrees.begin(); it != fTrees.end(); ++it) {
52  int termidx = it->TerminalIndex(vector);
53  response += it->GetResponse(termidx);
54  }
55  return response;
56 }
std::vector< GBRTreeD > fTrees
Definition: GBRForestD.h:43
double fInitialResponse
Definition: GBRForestD.h:42

◆ InitialResponse()

double GBRForestD::InitialResponse ( ) const
inline

Definition at line 35 of file GBRForestD.h.

References fInitialResponse.

35 { return fInitialResponse; }
double fInitialResponse
Definition: GBRForestD.h:42

◆ serialize()

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

◆ SetInitialResponse()

void GBRForestD::SetInitialResponse ( double  response)
inline

Definition at line 36 of file GBRForestD.h.

References fInitialResponse.

36 { fInitialResponse = response; }
double fInitialResponse
Definition: GBRForestD.h:42

◆ Trees() [1/2]

std::vector<GBRTreeD>& GBRForestD::Trees ( )
inline

Definition at line 38 of file GBRForestD.h.

References fTrees.

38 { return fTrees; }
std::vector< GBRTreeD > fTrees
Definition: GBRForestD.h:43

◆ Trees() [2/2]

const std::vector<GBRTreeD>& GBRForestD::Trees ( ) const
inline

Definition at line 39 of file GBRForestD.h.

References fTrees.

39 { return fTrees; }
std::vector< GBRTreeD > fTrees
Definition: GBRForestD.h:43

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 45 of file GBRForestD.h.

◆ cond::serialization::access

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

Definition at line 45 of file GBRForestD.h.

Member Data Documentation

◆ fInitialResponse

double GBRForestD::fInitialResponse = 0.0
protected

Definition at line 42 of file GBRForestD.h.

Referenced by GetResponse(), InitialResponse(), and SetInitialResponse().

◆ fTrees

std::vector<GBRTreeD> GBRForestD::fTrees
protected

Definition at line 43 of file GBRForestD.h.

Referenced by GBRForestD(), GetResponse(), and Trees().