+
class TMVA::Factory
-
library: libTMVA
#include "Factory.h"
Display options:
Show inherited
Show non-public

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
voidAddBackgroundTree(TTree* background, Double_t weight = 1.0)
voidAddSignalTree(TTree* signal, Double_t weight = 1.0)
voidAddVariable(const TString& expression, char type = 'F', Double_t min = 0, Double_t max = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
Bool_tBookMethod(TString theMethodName, TString methodTitle, TString theOption = "")
Bool_tBookMethod(TMVA::Types::EMVA theMethod, TString methodTitle, TString theOption = "")
Bool_tBookMethod(TMVA::Types::EMVA theMethod, TString methodTitle, TString methodOption, TMVA::Types::EMVA theCommittee, TString committeeOption = "")
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
virtual voidTObject::Delete(Option_t* option = "")
voidDeleteAllMethods()
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
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
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*TMVA::Configurable::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() const
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()
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)
virtual voidTObject::Paint(Option_t* option = "")
voidTMVA::Configurable::ParseOptions(Bool_t verbose = kTRUE)
virtual voidTObject::Pop()
voidPrepareTrainingAndTestTree(TCut cut, const TString& splitOpt = "NsigTrain=3000:NbkgTrain=3000:SplitMode=Random")
voidPrepareTrainingAndTestTree(TCut cut, Int_t Ntrain, Int_t Ntest = -1)
voidPrepareTrainingAndTestTree(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)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetBackgroundTree(TTree* background, Double_t weight = 1.0)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
Bool_tSetInputTrees(TTree* inputTree, TCut SigCut, TCut BgCut = "")
Bool_tSetInputTrees(TString signalFileName, TString backgroundFileName, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
Bool_tSetInputTrees(TTree* signal, TTree* background, Double_t signalWeight = 1.0, Double_t backgroundWeight = 1.0)
voidSetInputVariables(vector<TString>* theVariables)
voidTMVA::Configurable::SetName(const char* n)
static voidTObject::SetObjectStat(Bool_t stat)
voidTMVA::Configurable::SetOptions(const TString& s)
voidSetSignalTree(TTree* signal, Double_t weight = 1.0)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVerbose(Bool_t v = kTRUE)
voidSetWeightExpression(const TString& variable)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& 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()
virtual voidTObject::UseCurrentStyle()
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
protected:
TMVA::DataSet&Data() const
TMVA::DataSet&Data()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTMVA::Configurable::EnableLooseOptions(Bool_t b = kTRUE)
Bool_tTMVA::Configurable::LooseOptionCheckingEnabled() const
voidTObject::MakeZombie()
voidTMVA::Configurable::ReadOptionsFromStream(istream& istr)
voidTMVA::Configurable::ResetSetFlag()
voidTMVA::Configurable::WriteOptionsToStream(ostream& o, const TString& prefix) const
private:
voidGreetings()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TMVA::MsgLoggerfLoggermessage logger
private:
Bool_tfColorcolor mode
TMVA::DataSet*fDataSetthe dataset
vector<TTreeFormula*>fInputVarFormulaslocal forulas of the same
TStringfJobNamejobname, used as extension in weight file names
TDirectory*fLocalTDir
vector<IMethod*>fMethodsall MVA methods
TStringfOptionsoption string given by construction (presently only "V")
TFile*fTargetFileROOT output file
Bool_tfVerboseverbose mode

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 )
 default destructor

 *** segmentation fault occurs when deleting this object :-( ***
   fTrainingTree->Delete();

 *** cannot delete: need to clarify ownership :-( ***
   fSignalTree->Delete();
   fBackgTree->Delete();
void DeleteAllMethods( void )
 delete methods
void SetInputVariables(vector<TString>* theVariables)
 fill input variables in data set
Bool_t SetInputTrees(TTree* signal, TTree* background, Double_t signalWeight, Double_t backgroundWeight)
 define the input trees for signal and background; no cuts are applied
Bool_t SetInputTrees(TTree* inputTree, TCut SigCut, 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
Bool_t SetInputTrees( TString datFileS, TString datFileB, Double_t signalWeight, Double_t backgroundWeight )
 create trees from these ascii files
void PrepareTrainingAndTestTree(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(TCut cut, Int_t Ntrain, Int_t Ntest = -1)
 prepare the training and test trees
 possible user settings for Ntrain and Ntest:

   |              |              |        |             |

                                                        # input signal events
                                          # input signal events after cuts

   |              |              |             |       |

    \/  \/                      # input bg events
                                               # input bg events after cuts
      Ntrain/2       Ntest/2

 definitions:

         nsigTot = all signal events
         nbkgTot = all bkg events
         nTot    = nsigTot + nbkgTot
         i.g.: nsigTot != nbkgTot
         N:M     = use M events after event N (distinct event sample)
                   (read as: "from event N to event M")

 assumptions:

         a) equal number of signal and background events is used for training
         b) any numbers of signal and background events are used for testing
         c) an explicit syntax can violate a)

 cases (in order of importance)

 1)
      user gives         : N1
      PrepareTree does   : nsig_train=nbkg_train=min(N1,nsigTot,nbkgTot)
                           nsig_test =nsig_train:nsigTot, nbkg_test =nsig_train:nbkgTot
      -> give warning if nsig_test<=0 || nbkg_test<=0

 2)
      user gives         : N1, N2
      PrepareTree does   : nsig_train=nbkg_train=min(N1,nsigTot,nbkgTot)
                           nsig_test =nsig_train:min(N2,nsigTot-nsig_train),
                           nbkg_test =nsig_train:min(N2,nbkgTot-nbkg_train)
      -> give warning if nsig(bkg)_train != N1, or
                      if nsig_test<N2 || nbkg_test<N2

 3)
      user gives         : -1
      PrepareTree does   : nsig_train=nbkg_train=min(nsigTot,nbkgTot)
                           nsig_test =nsigTot, nbkg_test=nbkgTot
      -> give warning that same samples are used for testing and training

 4)
      user gives         : -1, -1
      PrepareTree does   : nsig_train=nsigTot, nbkg_train=nbkgTot
                           nsig_test =nsigTot, nbkg_test =nbkgTot
      -> give warning that same samples are used for testing and training,
         and, if nsig_train != nbkg_train, that an unequal number of
         signal and background events are used in training


 Give in any case the number of signal and background events that are
 used for testing and training, and tell whether there are overlaps between
 the samples.

void PrepareTrainingAndTestTree(TCut cut, const TString& splitOpt = "NsigTrain=3000:NbkgTrain=3000:SplitMode=Random")
 prepare the training and test trees
void SetSignalTree(TTree* signal, Double_t weight = 1.0)
 number of signal events (used to compute significance)
void AddSignalTree(TTree* signal, Double_t weight = 1.0)
 number of signal events (used to compute significance)
void SetBackgroundTree(TTree* background, Double_t weight = 1.0)
 number of background events (used to compute significance)
void AddBackgroundTree(TTree* background, Double_t weight = 1.0)
 number of background events (used to compute significance)
Bool_t BookMethod( TString theMethodName, TString methodTitle, TString theOption )
 booking via name; the names are translated into enums and the
 corresponding overloaded BookMethod is called
Bool_t BookMethod( 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 distringuish)
 several instances of a given MVA, eg, when one wants to compare the
 performance of various configurations
Bool_t BookMethod(TMVA::Types::EMVA theMethod, TString methodTitle, TString methodOption, TMVA::Types::EMVA theCommittee, TString committeeOption = "")
 books MVA method; the option configuration string is custom for each MVA
 the TString field "theNameAppendix" serves to define (and distringuish)
 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 TrainAllMethods( void )
 iterates over all MVAs that have been booked, and calls their training methods
void TestAllMethods( void )
 iterates over all MVAs that have been booked, and calls their testing methods
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
void AddVariable(const TString& expression, char type = 'F', Double_t min = 0, Double_t max = 0)
void SetWeightExpression(const TString& variable)
{ Data().SetWeightExpression(variable); }
Bool_t Verbose( void )
{ return fVerbose; }
void SetVerbose(Bool_t v = kTRUE)
{ fVerbose = v; Data().SetVerbose(Verbose()); }

Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
Last update: root/tmva $Id: Factory.cxx,v 1.17 2007/06/20 09:41:24 brun Exp $
Copyright (c) 2005: *

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.