library: libTMVA
#include "Factory.h"

TMVA::Factory


class description - header file - source file
viewCVS header - viewCVS source

class TMVA::Factory: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
virtual~Factory()
voidTObject::AbstractMethod(const char* method) const
voidAddVariable(const TString& expression, char type = F)
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 = )
voidBookMultipleMVAs(TString theVariable, Int_t nbins, Double_t* array)
virtual voidTObject::Browse(TBrowser* b)
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
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(TFile* theTargetFile)
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*GetMVA(TString method)
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
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
voidGreeting(TString = )
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
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 = "")
virtual voidTObject::Pop()
voidPrepareTrainingAndTestTree(TCut cut = , Int_t Ntrain = 0, Int_t Ntest = 0, TString TreeName = )
virtual voidTObject::Print(Option_t* option = "") const
voidProcessMultipleMVA()
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)
static voidTObject::SetObjectStat(Bool_t stat)
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
voidTObject::MakeZombie()

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:
TMVA::DataSet*fDataSetthe dataset
TFile*fTargetFileROOT output file
TStringfOptionsoption string given by construction (presently only "V")
Bool_tfVerboseverbose mode
vector<TTreeFormula*>fInputVarFormulaslocal forulas of the same
vector<IMethod*>fMethodsall MVA methods
TStringfJobNamejobname, used as extension in weight file names
Bool_tfMultipleMVAsmulti-cut mode ?
Bool_tfMultipleStoredOptionsmulti-cut driving flag
Bool_tfMultiTrainmulti-cut driving flag
Bool_tfMultiTestmulti-cut driving flag
Bool_tfMultiEvalVarmulti-cut driving flag
Bool_tfMultiEvalmulti-cut driving flag
Int_tfMultiNtrainnumber of training events
Int_tfMultiNtestnumber of testing events
map<TString,std::pair<TString,TCut> >fMultipleMVAnamesmap of MVA names
map<TString,std::pair<TString,TString> >fMultipleMVAMethodOptionsmap of option strings
TDirectory*fLocalTDir

Class Description

                                                                      
 This is the main MVA steering class: it creates all MVA methods,     
 and guides them through the training, testing and evaluation         
 phases. It also manages multiple MVA handling in case of distinct    
 phase space requirements (cuts).                                     
_______________________________________________________________________
Factory( TString jobName, 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, "NoPreprocessing" to switch of preproc.
Factory( TFile* theTargetFile)
 depreciated constructor
void Greeting( TString op )
 print greeting message
~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 BookMultipleMVAs(TString theVariable, Int_t nbins, Double_t *array)
 books multiple MVAs according to the variable, number of bins and 
 the cut array given
void PrepareTrainingAndTestTree( TCut cut, Int_t Ntrain, Int_t Ntest, TString TreeName )
 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 SetSignalTree(TTree* signal, Double_t weight)
 number of signal events (used to compute significance)
void SetBackgroundTree(TTree* background, Double_t weight)
 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( 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 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* GetMVA( TString method )
 returns pointer to MVA that corresponds to "method"
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 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 ProcessMultipleMVA( void )
 multiple MVAs in different phase space regions are trained and tested
const char* GetName()
 modified name (remove TMVA::)
{ return TString(TObject::GetName()).ReplaceAll( "TMVA::", "" ).Data(); }
void AddVariable( const TString& expression, char type='F' )
{ Data().AddVariable(expression, type); }
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()); }
DataSet& Data()
{ return *fDataSet; }
DataSet& Data()
{ return *fDataSet; }

Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
Last update: root/tmva $Id: Factory.cxx,v 1.11 2006/11/20 15:35:28 brun Exp $
Copyright (c) 2005: *


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.