ROOT logo
ROOT » TMVA » TMVA::Factory

class TMVA::Factory: public TMVA::Configurable


 This is the main MVA steering class: it creates all MVA methods,
 and guides them through the training, testing and evaluation
 phases

Function Members (Methods)

public:
virtual~Factory()
voidTObject::AbstractMethod(const char* method) const
voidAddBackgroundTestEvent(const vector<Double_t>& event, Double_t weight = 1.0)
voidAddBackgroundTrainingEvent(const vector<Double_t>& event, Double_t weight = 1.0)
voidAddBackgroundTree(TTree* background, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
voidAddBackgroundTree(TString datFileB, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
voidAddBackgroundTree(TTree* background, Double_t weight, const TString& treetype)
voidAddCut(const TString& cut, const TString& className = "")
voidAddCut(const TCut& cut, const TString& className = "")
TMVA::DataSetInfo&AddDataSet(TMVA::DataSetInfo&)
TMVA::DataSetInfo&AddDataSet(const TString&)
voidAddEvent(const TString& className, TMVA::Types::ETreeType tt, const vector<Double_t>& event, Double_t weight)
voidTMVA::Configurable::AddOptionsXMLTo(void* parent) const
voidAddRegressionTarget(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
voidAddRegressionTree(TTree* tree, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
voidAddSignalTestEvent(const vector<Double_t>& event, Double_t weight = 1.0)
voidAddSignalTrainingEvent(const vector<Double_t>& event, Double_t weight = 1.0)
voidAddSignalTree(TTree* signal, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
voidAddSignalTree(TString datFileS, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
voidAddSignalTree(TTree* signal, Double_t weight, const TString& treetype)
voidAddSpectator(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
voidAddTarget(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
voidAddTestEvent(const TString& className, const vector<Double_t>& event, Double_t weight)
voidAddTrainingEvent(const TString& className, const vector<Double_t>& event, Double_t weight)
voidAddTree(TTree* tree, const TString& className, Double_t weight = 1.0, const TCut& cut = "", TMVA::Types::ETreeType tt = Types::kMaxTreeType)
voidAddTree(TTree* tree, const TString& className, Double_t weight, const TCut& cut, const TString& treeType)
voidAddVariable(const TString& expression, char type = 'F', Double_t min = 0, Double_t max = 0)
voidAddVariable(const TString& expression, const TString& title, const TString& unit, char type = 'F', Double_t min = 0, Double_t max = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
TMVA::MethodBase*BookMethod(TString theMethodName, TString methodTitle, TString theOption = "")
TMVA::MethodBase*BookMethod(TMVA::Types::EMVA theMethod, TString methodTitle, TString theOption = "")
TMVA::MethodBase*BookMethod(TMVA::Types::EMVA, TString, TString, TMVA::Types::EMVA, TString)
virtual voidTObject::Browse(TBrowser* b)
voidTMVA::Configurable::CheckForUnusedOptions() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
TMVA::ConfigurableTMVA::Configurable::Configurable(const TString& theOption = "")
virtual voidTObject::Copy(TObject& object) const
TTree*CreateEventAssignTrees(const TString& name)
virtual voidTObject::Delete(Option_t* option = "")MENU
voidDeleteAllMethods()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
voidEvaluateAllMethods()
voidEvaluateAllVariables(TString options = "")
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
TMVA::FactoryFactory(TString theJobName, TFile* theTargetFile, TString theOption = "")
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
const char*TMVA::Configurable::GetConfigDescription() const
const char*TMVA::Configurable::GetConfigName() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TMVA::IMethod*GetMethod(const TString& title) const
virtual const char*GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
const TString&TMVA::Configurable::GetOptions() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
virtual voidMakeClass(const TString& methodTitle = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TObject&TObject::operator=(const TObject& rhs)
voidOptimizeAllMethods(TString fomType = "ROCIntegral", TString fitType = "FitGA")
voidOptimizeAllMethodsForClassification(TString fomType = "ROCIntegral", TString fitType = "FitGA")
voidOptimizeAllMethodsForRegression(TString fomType = "ROCIntegral", TString fitType = "FitGA")
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTMVA::Configurable::ParseOptions()
virtual voidTObject::Pop()
voidPrepareTrainingAndTestTree(const TCut& cut, const TString& splitOpt)
voidPrepareTrainingAndTestTree(TCut sigcut, TCut bkgcut, const TString& splitOpt)
voidPrepareTrainingAndTestTree(const TCut& cut, Int_t Ntrain, Int_t Ntest = -1)
voidPrepareTrainingAndTestTree(const TCut& cut, Int_t NsigTrain, Int_t NbkgTrain, Int_t NsigTest, Int_t NbkgTest, const TString& otherOpt = "SplitMode=Random:!V")
virtual voidTObject::Print(Option_t* option = "") const
voidPrintHelpMessage(const TString& methodTitle = "") const
voidTMVA::Configurable::PrintOptions() const
virtual Int_tTObject::Read(const char* name)
voidTMVA::Configurable::ReadOptionsFromStream(istream& istr)
voidTMVA::Configurable::ReadOptionsFromXML(void* node)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
static TDirectory*RootBaseDir()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetBackgroundTree(TTree* background, Double_t weight = 1.0)
voidSetBackgroundWeightExpression(const TString& variable)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidTMVA::Configurable::SetConfigDescription(const char* d)
voidTMVA::Configurable::SetConfigName(const char* n)
voidSetCut(const TString& cut, const TString& className = "")
voidSetCut(const TCut& cut, const TString& className = "")
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetInputTrees(TTree* inputTree, const TCut& SigCut, const TCut& BgCut)
voidSetInputTrees(const TString& signalFileName, const TString& backgroundFileName, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
voidSetInputTrees(TTree* signal, TTree* background, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
voidSetInputVariables(vector<TString>* theVariables)
voidTMVA::Configurable::SetMsgType(TMVA::EMsgType t)
static voidTObject::SetObjectStat(Bool_t stat)
voidTMVA::Configurable::SetOptions(const TString& s)
voidSetSignalTree(TTree* signal, Double_t weight = 1.0)
voidSetSignalWeightExpression(const TString& variable)
voidSetTree(TTree* tree, const TString& className, Double_t weight)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVerbose(Bool_t v = kTRUE)
voidSetWeightExpression(const TString& variable, const TString& className = "")
virtual voidShowMembers(TMemberInspector&)
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
voidTestAllMethods()
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidTrainAllMethods()
voidTrainAllMethodsForClassification()
voidTrainAllMethodsForRegression()
virtual voidTObject::UseCurrentStyle()
Bool_tUserAssignEvents(UInt_t clIndex)
Bool_tVerbose() const
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
voidTMVA::Configurable::WriteOptionsToStream(ostream& o, const TString& prefix) const
private:
TMVA::DataInputHandler&DataInput()
TMVA::DataSetInfo&DefaultDataSetInfo()
voidGreetings()
voidSetInputTreesFromEventAssignTrees()
voidWriteDataInformation()

Data Members

public:
enum DataAssignType { kUndefined
kAssignTrees
kAssignEvents
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
Float_t*fATreeEventevent variables
Int_tfATreeTypetype of event (=classIndex)
Float_tfATreeWeightweight of the event
TMVA::Types::EAnalysisTypefAnalysisType! the training type
TMVA::Factory::DataAssignTypefDataAssignType! flags for data assigning
TMVA::DataInputHandler*fDataInputHandler
TMVA::DataSetManager*fDataSetManagerDSMTEST
vector<TMVA::VariableTransformBase*>fDefaultTrfs! list of transformations on default DataSet
TStringfJobName! jobname, used as extension in weight file names
TMVA::Factory::MVectorfMethods! all MVA methods
TStringfOptions! option string given by construction (presently only "V")
vector<TTree*>fTestAssignTree! for each class: tmp tree if user wants to assign the events directly
vector<TTree*>fTrainAssignTree! for each class: tmp tree if user wants to assign the events directly
TStringfTransformations! List of transformations to test
Bool_tfVerbose! verbose mode
static TFile*fgTargetFile! ROOT output file

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Factory(TString theJobName, TFile* theTargetFile, TString theOption = "")
 standard constructor
   jobname       : this name will appear in all weight file names produced by the MVAs
   theTargetFile : output ROOT file; the test tree and all evaluation plots
                   will be stored here
   theOption     : option string; currently: "V" for verbose
void Greetings()
 print welcome message
 options are: kLogoWelcomeMsg, kIsometricWelcomeMsg, kLeanWelcomeMsg
~Factory( void )
 destructor
   delete fATreeEvent;
void DeleteAllMethods( void )
 delete methods
void SetVerbose(Bool_t v = kTRUE)
TMVA::DataSetInfo& AddDataSet( DataSetInfo &dsi )
TMVA::DataSetInfo& AddDataSet(const TString& )
TTree* CreateEventAssignTrees(const TString& name)
 create the data assignment tree (for event-wise data assignment by user)
void AddSignalTrainingEvent(const vector<Double_t>& event, Double_t weight = 1.0)
 add signal training event
void AddSignalTestEvent(const vector<Double_t>& event, Double_t weight = 1.0)
 add signal testing event
void AddBackgroundTrainingEvent(const vector<Double_t>& event, Double_t weight = 1.0)
 add signal training event
void AddBackgroundTestEvent(const vector<Double_t>& event, Double_t weight = 1.0)
 add signal training event
void AddTrainingEvent(const TString& className, const vector<Double_t>& event, Double_t weight)
 add signal training event
void AddTestEvent(const TString& className, const vector<Double_t>& event, Double_t weight)
 add signal test event
void AddEvent(const TString& className, TMVA::Types::ETreeType tt, const vector<Double_t>& event, Double_t weight)
 add event
 vector event : the order of values is: variables + targets + spectators
Bool_t UserAssignEvents(UInt_t clIndex)
void SetInputTreesFromEventAssignTrees()
 assign event-wise local trees to data set
void AddTree(TTree* tree, const TString& className, Double_t weight, const TCut& cut, const TString& treeType)
 number of signal events (used to compute significance)
void AddTree(TTree* tree, const TString& className, Double_t weight = 1.0, const TCut& cut = "", TMVA::Types::ETreeType tt = Types::kMaxTreeType)
void AddSignalTree( TTree* signal, Double_t weight, Types::ETreeType treetype )
 number of signal events (used to compute significance)
void AddSignalTree(TString datFileS, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
 add signal tree from text file
void AddSignalTree(TTree* signal, Double_t weight, const TString& treetype)
void AddBackgroundTree( TTree* signal, Double_t weight, Types::ETreeType treetype )
 number of signal events (used to compute significance)
void AddBackgroundTree(TString datFileB, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
 add background tree from text file
void AddBackgroundTree(TTree* background, Double_t weight, const TString& treetype)
void SetSignalTree(TTree* signal, Double_t weight = 1.0)
void SetBackgroundTree(TTree* background, Double_t weight = 1.0)
void SetTree(TTree* tree, const TString& className, Double_t weight)
 set background tree
void SetInputTrees(TTree* signal, TTree* background, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
 define the input trees for signal and background; no cuts are applied
void SetInputTrees(const TString& signalFileName, const TString& backgroundFileName, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
void SetInputTrees(TTree* inputTree, const TCut& SigCut, const TCut& BgCut)
 define the input trees for signal and background from single input tree,
 containing both signal and background events distinguished by the type
 identifiers: SigCut and BgCut
void AddVariable(const TString& expression, const TString& title, const TString& unit, char type = 'F', Double_t min = 0, Double_t max = 0)
 user inserts discriminating variable in data set info
void AddVariable(const TString& expression, char type = 'F', Double_t min = 0, Double_t max = 0)
 user inserts discriminating variable in data set info
void AddTarget(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
 user inserts target in data set info
void AddSpectator(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
 user inserts target in data set info
TMVA::DataSetInfo& DefaultDataSetInfo()
 default creation
void SetInputVariables(vector<TString>* theVariables)
 fill input variables in data set
void SetSignalWeightExpression(const TString& variable)
void SetBackgroundWeightExpression(const TString& variable)
void SetWeightExpression(const TString& variable, const TString& className = "")
Log() << kWarning << DefaultDataSetInfo().GetNClasses() /*fClasses.size()*/ << Endl;
void SetCut(const TString& cut, const TString& className = "")
void SetCut(const TCut& cut, const TString& className = "")
void AddCut(const TString& cut, const TString& className = "")
void AddCut(const TCut& cut, const TString& className = "")
void PrepareTrainingAndTestTree(const TCut& cut, Int_t NsigTrain, Int_t NbkgTrain, Int_t NsigTest, Int_t NbkgTest, const TString& otherOpt = "SplitMode=Random:!V")
 prepare the training and test trees
void PrepareTrainingAndTestTree(const TCut& cut, Int_t Ntrain, Int_t Ntest = -1)
 prepare the training and test trees
 kept for backward compatibility
void PrepareTrainingAndTestTree(const TCut& cut, const TString& splitOpt)
 prepare the training and test trees
 -> same cuts for signal and background
void PrepareTrainingAndTestTree(TCut sigcut, TCut bkgcut, const TString& splitOpt)
 prepare the training and test trees
TMVA::MethodBase* BookMethod(TString theMethodName, TString methodTitle, TString theOption = "")
 Book a classifier or regression method
TMVA::MethodBase* BookMethod(TMVA::Types::EMVA theMethod, TString methodTitle, TString theOption = "")
 books MVA method; the option configuration string is custom for each MVA
 the TString field "theNameAppendix" serves to define (and distinguish)
 several instances of a given MVA, eg, when one wants to compare the
 performance of various configurations
TMVA::IMethod* GetMethod(const TString& title) const
 returns pointer to MVA that corresponds to given method title
void WriteDataInformation()
 put correlations of input data and a few (default + user
 selected) transformations into the root file
void OptimizeAllMethods(TString fomType = "ROCIntegral", TString fitType = "FitGA")
 iterates through all booked methods and sees if they use parameter tuning and if so..
 does just that  i.e. calls "Method::Train()" for different parameter setttings and
 keeps in mind the "optimal one"... and that's the one that will later on be used
 in the main training loop.
void TrainAllMethods()
 iterates through all booked methods and calls training
void TestAllMethods()
void MakeClass(const TString& methodTitle = "") const
 Print predefined help message of classifier
 iterate over methods and test
void PrintHelpMessage(const TString& methodTitle = "") const
 Print predefined help message of classifier
 iterate over methods and test
void EvaluateAllVariables(TString options = "")
 iterates over all MVA input varables and evaluates them
void EvaluateAllMethods( void )
 iterates over all MVAs that have been booked, and calls their evaluation methods
const char* GetName() const
{ return "Factory"; }
void AddRegressionTree(TTree* tree, Double_t weight = 1.0, TMVA::Types::ETreeType treetype = Types::kMaxTreeType)
 special case: regression
void AddRegressionTarget(const TString& expression, const TString& title = "", const TString& unit = "", Double_t min = 0, Double_t max = 0)
MethodBase* BookMethod(TString theMethodName, TString methodTitle, TString theOption = "")
void OptimizeAllMethodsForClassification(TString fomType = "ROCIntegral", TString fitType = "FitGA")
{ OptimizeAllMethods(fomType,fitType); }
void OptimizeAllMethodsForRegression(TString fomType = "ROCIntegral", TString fitType = "FitGA")
{ OptimizeAllMethods(fomType,fitType); }
void TrainAllMethodsForClassification( void )
void TrainAllMethodsForRegression( void )
Bool_t Verbose( void )
{ return fVerbose; }
TDirectory* RootBaseDir()
{ return (TDirectory*)fgTargetFile; }