#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 = "" );
void AddSignalTrainingEvent ( std::vector<Double_t>& event, Double_t weight = 1.0 );
void AddBackgroundTrainingEvent( std::vector<Double_t>& event, Double_t weight = 1.0 );
void AddSignalTestEvent ( std::vector<Double_t>& event, Double_t weight = 1.0 );
void AddBackgroundTestEvent ( std::vector<Double_t>& event, Double_t weight = 1.0 );
Bool_t SetInputTrees( TTree* signal, TTree* background,
Double_t signalWeight=1.0, Double_t backgroundWeight=1.0 );
void AddSignalTree( TTree* signal, Double_t weight=1.0, Types::ETreeType treetype = Types::kMaxTreeType );
void AddSignalTree( TTree* signal, Double_t weight, const TString& treetype );
void SetSignalTree( TTree* signal, Double_t weight=1.0 );
void AddBackgroundTree( TTree* background, Double_t weight=1.0, Types::ETreeType treetype = Types::kMaxTreeType );
void AddBackgroundTree( TTree* background, Double_t weight, const TString & treetype );
void SetBackgroundTree( 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( const TCut& cut,
Int_t Ntrain, Int_t Ntest = -1 );
void PrepareTrainingAndTestTree( const TCut& cut,
Int_t NsigTrain, Int_t NbkgTrain, Int_t NsigTest, Int_t NbkgTest,
const TString& otherOpt );
void PrepareTrainingAndTestTree( const TCut& cut, const TString& splitOpt );
void PrepareTrainingAndTestTree( const TCut& sigcut, const TCut& bkgcut, const TString& splitOpt );
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;
std::vector<TTreeFormula*> fInputVarFormulas;
std::vector<IMethod*> fMethods;
TString fJobName;
enum DataAssignType { kUndefined = 0, kAssignTrees, kAssignEvents };
DataAssignType fDataAssignType;
Bool_t fSuspendDATVerification;
Bool_t VerifyDataAssignType ( DataAssignType );
void CreateEventAssignTrees( TTree*&, const TString& name );
void SetInputTreesFromEventAssignTrees();
TTree* fTrainSigAssignTree;
TTree* fTrainBkgAssignTree;
TTree* fTestSigAssignTree;
TTree* fTestBkgAssignTree;
Int_t fATreeType;
Float_t fATreeWeight;
Float_t* fATreeEvent;
TDirectory* fLocalTDir;
protected:
ClassDef(Factory,0)
};
}
#endif
Last change: Sat Nov 1 10:21:34 2008
Last generated: 2008-11-01 10:21
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.