#ifndef ROOT_TMVA_Factory
#define ROOT_TMVA_Factory
#include <string>
#include <vector>
#include <map>
#include "TCut.h"
#ifndef ROOT_TMVA_Configurable
#include "TMVA/Configurable.h"
#endif
#ifndef ROOT_TMVA_Types
#include "TMVA/Types.h"
#endif
#ifndef ROOT_TMVA_DataSet
#include "TMVA/DataSet.h"
#endif
#ifndef ROOT_TMVA_MsgLogger
#include "TMVA/MsgLogger.h"
#endif
class TFile;
class TTree;
class TNtuple;
class TTreeFormula;
class TDirectory;
namespace TMVA {
class IMethod;
class Factory : public Configurable {
public:
Factory( TString theJobName, TFile* theTargetFile, TString theOption = "" );
virtual ~Factory();
virtual const char* GetName() const { return "Factory"; }
Bool_t SetInputTrees(TString signalFileName, TString backgroundFileName,
Double_t signalWeight=1.0, Double_t backgroundWeight=1.0 );
Bool_t SetInputTrees(TTree* inputTree, TCut SigCut, TCut BgCut = "");
Bool_t SetInputTrees(TTree* signal, TTree* background,
Double_t signalWeight=1.0, Double_t backgroundWeight=1.0);
void SetSignalTree(TTree* signal, Double_t weight=1.0);
void AddSignalTree(TTree* signal, Double_t weight=1.0);
void SetBackgroundTree(TTree* background, Double_t weight=1.0);
void AddBackgroundTree(TTree* background, Double_t weight=1.0);
void SetInputVariables( std::vector<TString>* theVariables );
void AddVariable( const TString& expression, char type='F',
Double_t min = 0, Double_t max = 0 ) {
Data().AddVariable( expression, min, max, type );
}
void SetWeightExpression( const TString& variable ) {
SetSignalWeightExpression ( variable );
SetBackgroundWeightExpression( variable );
}
void SetSignalWeightExpression( const TString& variable ) {
Data().SetSignalWeightExpression(variable);
}
void SetBackgroundWeightExpression( const TString& variable ) {
Data().SetBackgroundWeightExpression(variable);
}
void PrepareTrainingAndTestTree( TCut cut,
Int_t Ntrain, Int_t Ntest = -1 );
void PrepareTrainingAndTestTree( TCut cut,
Int_t NsigTrain, Int_t NbkgTrain, Int_t NsigTest, Int_t NbkgTest,
const TString& otherOpt="SplitMode=Random:!V" );
void PrepareTrainingAndTestTree( TCut cut,
const TString& splitOpt="NsigTrain=3000:NbkgTrain=3000:SplitMode=Random" );
void PrepareTrainingAndTestTree( TCut sigcut, TCut bkgcut,
const TString& splitOpt="NsigTrain=3000:NbkgTrain=3000:SplitMode=Random" );
Bool_t BookMethod( TString theMethodName, TString methodTitle, TString theOption = "" );
Bool_t BookMethod( Types::EMVA theMethod, TString methodTitle, TString theOption = "" );
Bool_t BookMethod( TMVA::Types::EMVA theMethod, TString methodTitle, TString methodOption,
TMVA::Types::EMVA theCommittee, TString committeeOption = "" );
void TrainAllMethods( void );
void TestAllMethods( void );
void EvaluateAllMethods( void );
void EvaluateAllVariables( TString options = "");
void DeleteAllMethods( void );
IMethod* GetMethod( const TString& title ) const;
Bool_t Verbose( void ) const { return fVerbose; }
void SetVerbose( Bool_t v=kTRUE ) { fVerbose = v; Data().SetVerbose(Verbose()); }
virtual void MakeClass( const TString& methodTitle = "" ) const;
void PrintHelpMessage( const TString& methodTitle = "" ) const;
protected:
DataSet& Data() const { return *fDataSet; }
DataSet& Data() { return *fDataSet; }
private:
void Greetings();
DataSet* fDataSet;
TFile* fTargetFile;
TString fOptions;
Bool_t fVerbose;
Bool_t fColor;
Bool_t fSilent;
std::vector<TTreeFormula*> fInputVarFormulas;
std::vector<IMethod*> fMethods;
TString fJobName;
TDirectory* fLocalTDir;
protected:
ClassDef(Factory,0)
};
}
#endif
Last update: Thu Jan 17 08:58:50 2008
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.