FairRoot/PandaRoot
PndMultiClassBdtClassify.h
Go to the documentation of this file.
1 /* ***************************************
2  * MultiClass MLP Classifier functions *
3  * Author: M.Babai@rug.nl *
4  * Version: *
5  * LICENSE: *
6  * ***************************************
7  */
8 /*
9  * Note: This is just an interface to the original TMVA
10  * implementation. To find out the available options, please read TMVA
11  * manuals. In case of errors or wrong outputs produced by TMVA
12  * classifiers, try to read their mailing list and send your questions
13  * to the same list.
14  ******* VERY IMORTANT ****
15  * You NEED TMVA version > 4.1.X before this works.
16  */
17 //#pragma once
18 #ifndef PND_MULTICLASS_BDT_CLASSIFY_H
19 #define PND_MULTICLASS_BDT_CLASSIFY_H
20 
21 //Local includes
22 #include "PndMvaClassifier.h"
23 
24 // Root && TMVA
25 #include "TMVA/Reader.h"
26 
27 // Interface definition for Multiclass MLP Classifier
29 {
30  //______________ Public ____________________
31  public:
38  explicit PndMultiClassBdtClassify(std::string const& inputFile,
39  std::vector<std::string> const& classNames,
40  std::vector<std::string> const& varNames);
44  virtual ~PndMultiClassBdtClassify();
45 
50  void GetMvaValues( std::vector<float> EvtData,
51  std::map<std::string, float>& result );
56  std::string *Classify( std::vector<float> EvtData );
57 
61  void Initialize();
62 
63  //______________________________________________
64  //====== Getters and setters.
65  inline void SetReaderOptions(std::string const& opt);
66  inline void SetWeightsFileName(std::string const& name);
67 
68  inline std::string const& GetReaderOptions() const;
69  inline std::string const& GetWeightsFileName() const;
70 
71  //______________ Protected__________________
72  //protected:
73  //______________ Private ____________________
74  private:
75  // To avoid mistakes.
78 
79  // Set the TMVA reader options.
80  void SetOptions();
81 
82  //======================
83  TMVA::Reader* m_reader;
84 
85  std::string m_weightsFile;
86  std::string m_readerOptions;
87  std::vector<float> m_EventContainer;
88 };// End of classifier interface definition.
89 
90 //=============== inline functions implementation. ========
91 //__________________________________________
92 inline void PndMultiClassBdtClassify::SetReaderOptions(std::string const& opt)
93 {
94  this->m_readerOptions = opt;
95 };
96 
97 inline std::string const& PndMultiClassBdtClassify::GetReaderOptions() const
98 {
99  return m_readerOptions;
100 };
101 
102 inline void PndMultiClassBdtClassify::SetWeightsFileName(std::string const& name)
103 {
104  this->m_weightsFile = name;
105 };
106 
107 inline std::string const& PndMultiClassBdtClassify::GetWeightsFileName() const
108 {
109  return m_weightsFile;
110 };
111 #endif
void SetWeightsFileName(std::string const &name)
virtual ~PndMultiClassBdtClassify()
std::string m_weightsFile
TMVA reader.
PndMultiClassBdtClassify(std::string const &inputFile, std::vector< std::string > const &classNames, std::vector< std::string > const &varNames)
PndMultiClassBdtClassify & operator=(PndMultiClassBdtClassify const &oth)
std::string const & GetWeightsFileName() const
std::vector< float > m_EventContainer
TString name
std::string * Classify(std::vector< float > EvtData)
void GetMvaValues(std::vector< float > EvtData, std::map< std::string, float > &result)
std::string const & GetReaderOptions() const
void SetReaderOptions(std::string const &opt)