CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TMVAEvaluator.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_TMVAEvaluator_h
2 #define CommonTools_Utils_TMVAEvaluator_h
3 
4 #include <memory>
5 #include <string>
6 #include <vector>
7 #include <map>
8 
9 #include "TMVA/Reader.h"
10 
11 
13 
14  public:
15  TMVAEvaluator();
17 
18  void initialize(const std::string & options, const std::string & method, const std::string & weightFile,
19  const std::vector<std::string> & variables, const std::vector<std::string> & spectators);
20  float evaluate(const std::map<std::string,float> & inputs, const bool useSpectators=false);
21 
22  private:
24 
26  std::unique_ptr<TMVA::Reader> mReader;
27 
28  std::map<std::string,float> mVariables;
29  std::map<std::string,float> mSpectators;
30 };
31 
32 #endif // CommonTools_Utils_TMVAEvaluator_h
33 
std::map< std::string, float > mVariables
Definition: TMVAEvaluator.h:28
float evaluate(const std::map< std::string, float > &inputs, const bool useSpectators=false)
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)
std::string mMethod
Definition: TMVAEvaluator.h:25
std::unique_ptr< TMVA::Reader > mReader
Definition: TMVAEvaluator.h:26
std::map< std::string, float > mSpectators
Definition: TMVAEvaluator.h:29