34 #ifndef ROOT_TMVA_Reader
35 #define ROOT_TMVA_Reader
63 class Reader :
public Configurable {
68 Reader(
const TString& theOption=
"", Bool_t verbose = 0 );
71 Reader( std::vector<std::string>& varNames,
const TString& theOption =
"", Bool_t verbose = 0 );
72 Reader(
const std::string& varNames,
const TString& theOption, Bool_t verbose = 0 );
75 Reader( std::vector<TString>& varNames,
const TString& theOption =
"", Bool_t verbose = 0 );
76 Reader(
const TString& varNames,
const TString& theOption, Bool_t verbose = 0 );
78 virtual ~Reader(
void );
81 IMethod* BookMVA(
const TString& methodTag,
const TString& weightfile );
82 IMethod* BookMVA( TMVA::Types::EMVA methodType,
const char* xmlstr );
83 IMethod* FindMVA(
const TString& methodTag );
86 MethodCuts* FindCutsMVA(
const TString& methodTag );
90 Double_t EvaluateMVA(
const std::vector<Float_t> &,
const TString& methodTag, Double_t aux = 0 );
91 Double_t EvaluateMVA(
const std::vector<Double_t>&,
const TString& methodTag, Double_t aux = 0 );
92 Double_t EvaluateMVA( MethodBase* method, Double_t aux = 0 );
93 Double_t EvaluateMVA(
const TString& methodTag, Double_t aux = 0 );
97 Double_t GetMVAError()
const {
return fMvaEventError; }
98 Double_t GetMVAErrorLower()
const {
return fMvaEventError; }
99 Double_t GetMVAErrorUpper()
const {
return fMvaEventErrorUpper; }
102 const std::vector< Float_t >& EvaluateRegression(
const TString& methodTag, Double_t aux = 0 );
103 const std::vector< Float_t >& EvaluateRegression( MethodBase* method, Double_t aux = 0 );
104 Float_t EvaluateRegression( UInt_t tgtNumber,
const TString& methodTag, Double_t aux = 0 );
107 const std::vector< Float_t >& EvaluateMulticlass(
const TString& methodTag, Double_t aux = 0 );
108 const std::vector< Float_t >& EvaluateMulticlass( MethodBase* method, Double_t aux = 0 );
109 Float_t EvaluateMulticlass( UInt_t clsNumber,
const TString& methodTag, Double_t aux = 0 );
112 Double_t GetProba (
const TString& methodTag, Double_t ap_sig=0.5, Double_t mvaVal=-9999999 );
113 Double_t GetRarity(
const TString& methodTag, Double_t mvaVal=-9999999 );
116 virtual const char* GetName()
const {
return "Reader"; }
117 Bool_t Verbose(
void )
const {
return fVerbose; }
118 void SetVerbose( Bool_t v ) { fVerbose = v; }
120 const DataSetInfo& DataInfo()
const {
return fDataSetInfo; }
121 DataSetInfo& DataInfo() {
return fDataSetInfo; }
123 void AddVariable(
const TString& expression, Float_t* );
124 void AddVariable(
const TString& expression, Int_t* );
126 void AddSpectator(
const TString& expression, Float_t* );
127 void AddSpectator(
const TString& expression, Int_t* );
131 DataSetManager* fDataSetManager;
134 TString GetMethodTypeFromFile(
const TString& filename );
137 IMethod* BookMVA( Types::EMVA method,
const TString& weightfile );
139 DataSetInfo fDataSetInfo;
141 DataInputHandler fDataInputHandler;
147 void DecodeVarNames(
const std::string& varNames );
148 void DecodeVarNames(
const TString& varNames );
150 void DeclareOptions();
155 Bool_t fCalculateError;
157 Double_t fMvaEventError;
158 Double_t fMvaEventErrorUpper;
160 std::map<TString, IMethod*> fMethodMap;
162 std::vector<Float_t> fTmpEvalVec;
164 mutable MsgLogger* fLogger;
165 MsgLogger& Log()
const {
return *fLogger; }