#include <TMVAEvaluator.h>
Public Member Functions | |
float | evaluate (const std::map< std::string, float > &inputs, bool useSpectators=false) const |
float | evaluateGBRForest (const std::map< std::string, float > &inputs) const |
float | evaluateTMVA (const std::map< std::string, float > &inputs, bool useSpectators) const |
void | initialize (const std::string &options, const std::string &method, const std::string &weightFile, const std::vector< std::string > &variables, const std::vector< std::string > &spectators, bool useGBRForest=false, bool useAdaBoost=false) |
void | initializeGBRForest (const GBRForest *gbrForest, const std::vector< std::string > &variables, const std::vector< std::string > &spectators, bool useAdaBoost=false) |
void | initializeGBRForest (const edm::EventSetup &iSetup, const std::string &label, const std::vector< std::string > &variables, const std::vector< std::string > &spectators, bool useAdaBoost=false) |
TMVAEvaluator () | |
~TMVAEvaluator () | |
Private Attributes | |
std::mutex | m_mutex |
std::unique_ptr< const GBRForest > | mGBRForest |
std::unique_ptr< TMVA::IMethod > | mIMethod |
bool | mIsInitialized |
std::string | mMethod |
std::unique_ptr< TMVA::Reader > | mReader |
bool | mReleaseAtEnd |
std::map< std::string, std::pair< size_t, float > > | mSpectators |
bool | mUseAdaBoost |
bool | mUsingGBRForest |
std::map< std::string, std::pair< size_t, float > > | mVariables |
Definition at line 16 of file TMVAEvaluator.h.
TMVAEvaluator::TMVAEvaluator | ( | ) |
Definition at line 10 of file TMVAEvaluator.cc.
TMVAEvaluator::~TMVAEvaluator | ( | ) |
Definition at line 16 of file TMVAEvaluator.cc.
References mGBRForest, and mReleaseAtEnd.
float TMVAEvaluator::evaluate | ( | const std::map< std::string, float > & | inputs, |
bool | useSpectators = false |
||
) | const |
Definition at line 157 of file TMVAEvaluator.cc.
References evaluateGBRForest(), evaluateTMVA(), mIsInitialized, mSpectators, mUsingGBRForest, mVariables, and relativeConstraints::value.
float TMVAEvaluator::evaluateGBRForest | ( | const std::map< std::string, float > & | inputs | ) | const |
Definition at line 132 of file TMVAEvaluator.cc.
References mGBRForest, mUseAdaBoost, mVariables, and relativeConstraints::value.
Referenced by evaluate().
float TMVAEvaluator::evaluateTMVA | ( | const std::map< std::string, float > & | inputs, |
bool | useSpectators | ||
) | const |
Definition at line 95 of file TMVAEvaluator.cc.
References CommonMethods::lock(), m_mutex, mMethod, mReader, mSpectators, mVariables, and relativeConstraints::value.
Referenced by evaluate().
void TMVAEvaluator::initialize | ( | const std::string & | options, |
const std::string & | method, | ||
const std::string & | weightFile, | ||
const std::vector< std::string > & | variables, | ||
const std::vector< std::string > & | spectators, | ||
bool | useGBRForest = false , |
||
bool | useAdaBoost = false |
||
) |
Definition at line 23 of file TMVAEvaluator.cc.
References reco::details::loadTMVAWeights(), PFRecoTauDiscriminationAgainstElectronMVA3GBR_cfi::method, mGBRForest, mIMethod, mIsInitialized, mMethod, mReader, mSpectators, mUseAdaBoost, mUsingGBRForest, and mVariables.
void TMVAEvaluator::initializeGBRForest | ( | const GBRForest * | gbrForest, |
const std::vector< std::string > & | variables, | ||
const std::vector< std::string > & | spectators, | ||
bool | useAdaBoost = false |
||
) |
Definition at line 64 of file TMVAEvaluator.cc.
References mGBRForest, mIsInitialized, mReleaseAtEnd, mSpectators, mUseAdaBoost, mUsingGBRForest, and mVariables.
Referenced by initializeGBRForest().
void TMVAEvaluator::initializeGBRForest | ( | const edm::EventSetup & | iSetup, |
const std::string & | label, | ||
const std::vector< std::string > & | variables, | ||
const std::vector< std::string > & | spectators, | ||
bool | useAdaBoost = false |
||
) |
Definition at line 84 of file TMVAEvaluator.cc.
References edm::EventSetup::get(), initializeGBRForest(), edm::ESHandle< class >::product(), and makeLayoutFileForGui::variables.
|
mutableprivate |
Definition at line 39 of file TMVAEvaluator.h.
Referenced by evaluateTMVA().
|
private |
Definition at line 42 of file TMVAEvaluator.h.
Referenced by evaluateGBRForest(), initialize(), initializeGBRForest(), and ~TMVAEvaluator().
|
private |
Definition at line 41 of file TMVAEvaluator.h.
Referenced by initialize().
|
private |
Definition at line 33 of file TMVAEvaluator.h.
Referenced by evaluate(), initialize(), and initializeGBRForest().
|
private |
Definition at line 38 of file TMVAEvaluator.h.
Referenced by evaluateTMVA(), and initialize().
|
private |
Definition at line 40 of file TMVAEvaluator.h.
Referenced by evaluateTMVA(), and initialize().
|
private |
Definition at line 36 of file TMVAEvaluator.h.
Referenced by initializeGBRForest(), and ~TMVAEvaluator().
|
mutableprivate |
Definition at line 45 of file TMVAEvaluator.h.
Referenced by evaluate(), evaluateTMVA(), initialize(), and initializeGBRForest().
|
private |
Definition at line 35 of file TMVAEvaluator.h.
Referenced by evaluateGBRForest(), initialize(), and initializeGBRForest().
|
private |
Definition at line 34 of file TMVAEvaluator.h.
Referenced by evaluate(), initialize(), and initializeGBRForest().
|
mutableprivate |
Definition at line 44 of file TMVAEvaluator.h.
Referenced by evaluate(), evaluateGBRForest(), evaluateTMVA(), initialize(), and initializeGBRForest().