#ifndef ROOT_TMVA_Reader
#define ROOT_TMVA_Reader
#ifndef ROOT_TMVA_Configurable
#include "TMVA/Configurable.h"
#endif
#ifndef ROOT_TMVA_Types
#include "TMVA/Types.h"
#endif
#ifndef ROOT_TMVA_DataSetInfo
#include "TMVA/DataSetInfo.h"
#endif
#ifndef ROOT_TMVA_DataInputHandler
#include "TMVA/DataInputHandler.h"
#endif
#ifndef ROOT_TMVA_DataSetManager
#include "TMVA/DataSetManager.h"
#endif
#include <vector>
#include <map>
#include <stdexcept>
namespace TMVA {
class IMethod;
class MethodBase;
class DataSetInfo;
class MethodCuts;
class Reader : public Configurable {
public:
Reader( const TString& theOption="", Bool_t verbose = 0 );
Reader( std::vector<std::string>& varNames, const TString& theOption = "", Bool_t verbose = 0 );
Reader( const std::string& varNames, const TString& theOption, Bool_t verbose = 0 );
Reader( std::vector<TString>& varNames, const TString& theOption = "", Bool_t verbose = 0 );
Reader( const TString& varNames, const TString& theOption, Bool_t verbose = 0 );
virtual ~Reader( void );
IMethod* BookMVA( const TString& methodTag, const TString& weightfile );
IMethod* FindMVA( const TString& methodTag );
MethodCuts* FindCutsMVA( const TString& methodTag );
Double_t EvaluateMVA( const std::vector<Float_t> &, const TString& methodTag, Double_t aux = 0 );
Double_t EvaluateMVA( const std::vector<Double_t>&, const TString& methodTag, Double_t aux = 0 );
Double_t EvaluateMVA( MethodBase* method, Double_t aux = 0 );
Double_t EvaluateMVA( const TString& methodTag, Double_t aux = 0 );
Double_t GetMVAError() const { return fMvaEventError; }
const std::vector< Float_t >& EvaluateRegression( const TString& methodTag, Double_t aux = 0 );
const std::vector< Float_t >& EvaluateRegression( MethodBase* method, Double_t aux = 0 );
Float_t EvaluateRegression( UInt_t tgtNumber, const TString& methodTag, Double_t aux = 0 );
Double_t GetProba ( const TString& methodTag, Double_t ap_sig=0.5, Double_t mvaVal=-9999999 );
Double_t GetRarity( const TString& methodTag, Double_t mvaVal=-9999999 );
virtual const char* GetName() const { return "Reader"; }
Bool_t Verbose( void ) const { return fVerbose; }
void SetVerbose( Bool_t v ) { fVerbose = v; }
const DataSetInfo& DataInfo() const { return fDataSetInfo; }
DataSetInfo& DataInfo() { return fDataSetInfo; }
void AddVariable( const TString& expression, Float_t* );
void AddVariable( const TString& expression, Int_t* );
void AddSpectator( const TString& expression, Float_t* );
void AddSpectator( const TString& expression, Int_t* );
private:
TString GetMethodTypeFromFile( const TString& filename );
IMethod* BookMVA( Types::EMVA method, const TString& weightfile );
DataSetInfo fDataSetInfo;
DataInputHandler fDataInputHandler;
void Init( void );
void DecodeVarNames( const std::string& varNames );
void DecodeVarNames( const TString& varNames );
void DeclareOptions();
Bool_t fVerbose;
Bool_t fSilent;
Bool_t fColor;
Double_t fMvaEventError;
std::map<TString, IMethod*> fMethodMap;
mutable MsgLogger* fLogger;
MsgLogger& Log() const { return *fLogger; }
ClassDef(Reader,0)
};
}
#endif