CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhotonXGBoostEstimator Class Reference

#include <PhotonXGBoostEstimator.h>

Public Member Functions

float computeMva (float rawEnergyIn, float r9In, float sigmaIEtaIEtaIn, float etaWidthIn, float phiWidthIn, float s4In, float etaIn, float hOvrEIn, float ecalPFIsoIn) const
 
 PhotonXGBoostEstimator (const edm::FileInPath &weightsFile, int best_ntree_limit)
 

Private Attributes

int best_ntree_limit_ = -1
 
std::unique_ptr< pat::XGBoosterbooster_
 

Detailed Description

Definition at line 9 of file PhotonXGBoostEstimator.h.

Constructor & Destructor Documentation

◆ PhotonXGBoostEstimator()

PhotonXGBoostEstimator::PhotonXGBoostEstimator ( const edm::FileInPath weightsFile,
int  best_ntree_limit 
)

Definition at line 3 of file PhotonXGBoostEstimator.cc.

References best_ntree_limit_, booster_, and pfClustersFromHGC3DClusters_cfi::weightsFile.

3  {
4  booster_ = std::make_unique<pat::XGBooster>(weightsFile.fullPath());
5  booster_->addFeature("rawEnergy");
6  booster_->addFeature("r9");
7  booster_->addFeature("sigmaIEtaIEta");
8  booster_->addFeature("etaWidth");
9  booster_->addFeature("phiWidth");
10  booster_->addFeature("s4");
11  booster_->addFeature("eta");
12  booster_->addFeature("hOvrE");
13  booster_->addFeature("ecalPFIso");
14 
15  best_ntree_limit_ = best_ntree_limit;
16 }
std::unique_ptr< pat::XGBooster > booster_

Member Function Documentation

◆ computeMva()

float PhotonXGBoostEstimator::computeMva ( float  rawEnergyIn,
float  r9In,
float  sigmaIEtaIEtaIn,
float  etaWidthIn,
float  phiWidthIn,
float  s4In,
float  etaIn,
float  hOvrEIn,
float  ecalPFIsoIn 
) const

Definition at line 18 of file PhotonXGBoostEstimator.cc.

References best_ntree_limit_, and booster_.

26  {
27  return booster_->predict(
28  {rawEnergyIn, r9In, sigmaIEtaIEtaIn, etaWidthIn, phiWidthIn, s4In, etaIn, hOvrEIn, ecalPFIsoIn},
30 }
std::unique_ptr< pat::XGBooster > booster_

Member Data Documentation

◆ best_ntree_limit_

int PhotonXGBoostEstimator::best_ntree_limit_ = -1
private

Definition at line 25 of file PhotonXGBoostEstimator.h.

Referenced by computeMva(), and PhotonXGBoostEstimator().

◆ booster_

std::unique_ptr<pat::XGBooster> PhotonXGBoostEstimator::booster_
private

Definition at line 24 of file PhotonXGBoostEstimator.h.

Referenced by computeMva(), and PhotonXGBoostEstimator().