* *
**********************************************************************************/
#ifndef ROOT_TMVA_MethodBase
#define ROOT_TMVA_MethodBase
#include "Riostream.h"
#ifndef ROOT_TMVA_PDF
#include "TMVA/PDF.h"
#endif
#ifndef ROOT_TMVA_TSpline1
#include "TMVA/TSpline1.h"
#endif
#ifndef ROOT_TMVA_Event
#include "TMVA/Event.h"
#endif
#ifndef ROOT_TMVA_Types
#include "TMVA/Types.h"
#endif
class TTree;
class TDirectory;
namespace TMVA {
class MethodBase : public TObject {
public:
MethodBase( TString jobName,
vector<TString>* theVariables,
TTree* theTree = 0,
TString theOption = "",
TDirectory* theBaseDir = 0 );
MethodBase( vector<TString> *theVariables,
TString weightFile,
TDirectory* theBaseDir = NULL );
virtual ~MethodBase( void );
virtual void Train( void ) = 0;
virtual void WriteWeightsToFile( void ) = 0;
virtual void ReadWeightsFromFile( void ) = 0;
virtual void PrepareEvaluationTree( TTree* theTestTree );
virtual Double_t GetMvaValue( Event *e ) = 0;
virtual void TestInit(TTree* theTestTree);
virtual void TestInitLocal(TTree * ) {
return ;
}
virtual void Test( TTree * theTestTree );
virtual void WriteHistosToFile( void ) = 0;
TString GetMethodName( void ) const { return fMethodName; }
Types::MVA GetMethod ( void ) const { return fMethod; }
TString GetOptions ( void ) const { return fOptions; }
void SetMethodName( TString methodName ) { fMethodName = methodName; }
void AppendToMethodName( TString methodNameSuffix );
TString GetJobName ( void ) const { return fJobName; }
void SetJobName ( TString jobName ) { fJobName = jobName; }
TString GetWeightFileExtension( void ) const { return fFileExtension; }
void SetWeightFileExtension( TString fileExtension ) { fFileExtension = fileExtension; }
TString GetWeightFileDir( void ) const { return fFileDir; }
void SetWeightFileDir( TString fileDir );
vector<TString>* GetInputVars( void ) const { return fInputVars; }
void SetInputVars( vector<TString>* theInputVars ) { fInputVars = theInputVars; }
void SetWeightFileName( void );
void SetWeightFileName( TString );
TString GetWeightFileName( void );
TTree* GetTrainingTree ( void ) const { return fTrainingTree; }
Int_t GetNvar ( void ) const { return fNvar; }
virtual Double_t GetEfficiency ( TString , TTree *);
virtual Double_t GetSignificance ( void );
virtual Double_t GetOptimalSignificance( Double_t SignalEvents, Double_t BackgroundEvents,
Double_t & optimal_significance_value ) const;
virtual Double_t GetSeparation ( void );
virtual Double_t GetmuTransform ( TTree * );
virtual void InitNorm( TTree* theTree );
Double_t GetXminNorm( Int_t ivar ) const { return (*fXminNorm)[ivar]; }
Double_t GetXmaxNorm( Int_t ivar ) const { return (*fXmaxNorm)[ivar]; }
Double_t GetXminNorm( TString var ) const;
Double_t GetXmaxNorm( TString var ) const;
void SetXminNorm( Int_t ivar, Double_t x ) { (*fXminNorm)[ivar] = x; }
void SetXmaxNorm( Int_t ivar, Double_t x ) { (*fXmaxNorm)[ivar] = x; }
void SetXminNorm( TString var, Double_t x );
void SetXmaxNorm( TString var, Double_t x );
void UpdateNorm ( Int_t ivar, Double_t x );
Double_t Norm ( Int_t ivar, Double_t x ) const;
Double_t Norm ( TString var, Double_t x ) const;
Bool_t IsOK ( void ) const { return fIsOK; }
void WriteHistosToFile( TDirectory* targetDir );
enum CutOrientation { kNegative = -1, kPositive = +1 };
CutOrientation GetCutOrientation() { return fCutOrientation; }
enum Type { kSignal = 1, kBackground = 0 };
Bool_t Verbose( void ) const { return fVerbose; }
void SetVerbose( Bool_t v = kTRUE ) { fVerbose = v; }
public:
static MethodBase* GetThisBase( void ) { return fgThisBase; }
protected:
void ResetThisBase( void ) { fgThisBase = this; }
protected:
TString fJobName;
TString fMethodName;
Types::MVA fMethod;
TTree* fTrainingTree;
TString fTestvar;
TString fTestvarPrefix;
vector<TString>* fInputVars;
TString fOptions;
TDirectory* fBaseDir;
TDirectory* fLocalTDir;
Bool_t CheckSanity( TTree* theTree = 0 );
Int_t fNvar;
private:
TString fFileExtension;
TString fFileDir;
TString fWeightFile;
protected:
Bool_t fIsOK;
TH1* fHistS_plotbin;
TH1* fHistB_plotbin;
TH1* fHistS_highbin;
TH1* fHistB_highbin;
TH1* fEffS;
TH1* fEffB;
TH1* fEffBvsS;
TH1* fRejBvsS;
TH1* fHistBhatS;
TH1* fHistBhatB;
TH1* fHistMuS;
TH1* fHistMuB;
Double_t fX;
Double_t fMode;
TGraph* fGraphS;
TGraph* fGraphB;
TGraph* fGrapheffBvsS;
PDF* fSplS;
PDF* fSplB;
TSpline* fSpleffBvsS;
private:
Double_t fMeanS;
Double_t fMeanB;
Double_t fRmsS;
Double_t fRmsB;
Double_t fXmin;
Double_t fXmax;
Bool_t fVerbose;
protected:
Int_t fNbins;
Int_t fNbinsH;
CutOrientation fCutOrientation;
TSpline1* fSplRefS;
TSpline1* fSplRefB;
public:
static Double_t IGetEffForRoot( Double_t );
Double_t GetEffForRoot( Double_t );
private:
vector<Double_t>* fXminNorm;
vector<Double_t>* fXmaxNorm;
static MethodBase* fgThisBase;
void Init( void );
ClassDef(MethodBase,0)
};
}
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.