library: libTMVA
#include "Reader.h"

TMVA::Reader


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

class TMVA::Reader: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
virtual~Reader()
voidTObject::AbstractMethod(const char* method) const
voidAddVariable(const TString& expression, float*)
voidAddVariable(const TString& expression, int*)
virtual voidTObject::AppendPad(Option_t* option = "")
TMVA::IMethod*BookMVA(TString methodName, TString weightfile)
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
const TMVA::DataSet&Data() const
TMVA::DataSet&Data()
virtual voidTObject::Delete(Option_t* option = "")
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
Double_tEvaluateMVA(TMVA::IMethod* method, Double_t aux = 0)
Double_tEvaluateMVA(TString methodName, Double_t aux = 0)
Double_tEvaluateMVA(const vector<Float_t>&, TString methodName, Double_t aux = 0)
Double_tEvaluateMVA(const vector<Double_t>&, TString methodName, Double_t aux = 0)
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)
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
virtual const char*TObject::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
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()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
TMVA::ReaderReader(Bool_t verbose = 0)
TMVA::ReaderReader(vector<std::string>& varNames, Bool_t verbose = 0)
TMVA::ReaderReader(const string varNames, Bool_t verbose = 0)
TMVA::ReaderReader(vector<TString>& varNames, Bool_t verbose = 0)
TMVA::ReaderReader(const TString varNames, Bool_t verbose = 0)
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 = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVerbose(Bool_t v)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
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:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
TMVA::IMethod*BookMVA(TMVA::Types::EMVA method, TString weightfile)
voidDecodeVarNames(const string varNames)
voidDecodeVarNames(const TString varNames)
voidInit()

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
private:
TMVA::DataSet*fDataSetthe data set
Bool_tfVerboseverbosity
map<TString,IMethod*>fMethodMapmap of methods
TMVA::MsgLoggerfLoggermessage logger

Class Description


  The Reader class serves to use the MVAs in a specific analysis context.
  Within an event loop, a vector is filled that corresponds to the variables
  that were used to train the MVA(s) during the training stage. This vector
  is transfered to the Reader, who takes care of interpreting the weight 
  file of the MVA of choice, and to return the MVA's output. This is then 
  used by the user for further analysis.

  ---------------------------------------------------------------------
  Usage:
           
    // ------ before starting the event loop (eg, in the initialisation step)

    
    // create TMVA::Reader object
    
    TMVA::Reader *reader = new TMVA::Reader();    

    // create a set of variables and declare them to the reader
    // - the variable names must corresponds in name and type to 
    // those given in the weight file(s) that you use
    Float_t var1, var2, var3, var4;
    reader->AddVariable( "var1", &var1 );
    reader->AddVariable( "var2", &var2 );
    reader->AddVariable( "var3", &var3 );
    reader->AddVariable( "var4", &var4 );
      
    // book the MVA of your choice (prior training of these methods, ie, 
    // existence of the weight files is required)
    reader->BookMVA( "Fisher method",  "weights/Fisher.weights.txt"   );
    reader->BookMVA( "MLP method",     "weights/MLP.weights.txt" );
    // ... etc
    
    // ------- start your event loop

    for (Long64_t ievt=0; ievt<myTree->GetEntries();ievt++) {

      // fill vector with values of variables computed from those in the tree
      var1 = myvar1;
      var2 = myvar2;
      var3 = myvar3;
      var4 = myvar4;
            
      // retrieve the corresponding MVA output
      double mvaFi = reader->EvaluateMVA( "Fisher method" );
      double mvaNN = reader->EvaluateMVA( "MLP method"    );

      // do something with these ...., e.g., fill them into your ntuple

    } // end of event loop

    delete reader;
  ---------------------------------------------------------------------

  An example application of the Reader can be found in TMVA/macros/TMVApplication.C.
_______________________________________________________________________
Reader( Bool_t verbose )
 constructor
Reader( vector<TString>& inputVars, Bool_t verbose )
 constructor
 arguments: names of input variables (vector)
            verbose flag
Reader( vector<string>& inputVars, Bool_t verbose )
 constructor
 arguments: names of input variables (vector)
            verbose flag
Reader( const string varNames, Bool_t verbose )
 constructor
 arguments: names of input variables given in form: "name1:name2:name3"
            verbose flag
Reader( const TString varNames, Bool_t verbose )
 constructor
 arguments: names of input variables given in form: "name1:name2:name3"
            verbose flag
~Reader( void )
 destructor
void Init( void )
 default initialisation (no member variables)
void AddVariable( const TString& expression, float* datalink)
 Add a float variable or expression to the reader
void AddVariable( const TString& expression, int* datalink)
 Add a integer variable or expression to the reader
TMVA::IMethod* BookMVA( TString methodName, TString weightfile )
 read method name from weight file
TMVA::IMethod* BookMVA( TMVA::Types::EMVA methodType, TString weightfile )
 books MVA method from weightfile
Double_t EvaluateMVA( const std::vector<Float_t>& inputVec, TString methodName, Double_t aux )
 Evaluate a vector<float> of input data for a given method
 The parameter aux is obligatory for the cuts method where it represents the efficiency cutoff
Double_t EvaluateMVA( const std::vector<Double_t>& inputVec, TString methodName, Double_t aux )
 Evaluate a vector<double> of input data for a given method
 The parameter aux is obligatory for the cuts method where it represents the efficiency cutoff
Double_t EvaluateMVA( TString methodName, Double_t aux )
 evaluates MVA for given set of input variables
Double_t EvaluateMVA( IMethod* method, Double_t aux )
 evaluates the MVA
void DecodeVarNames( const string varNames )
 decodes "name1:name2:..." form
void DecodeVarNames( const TString varNames )
 decodes "name1:name2:..." form
Bool_t Verbose( void )
 accessors 
{ return fVerbose; }
void SetVerbose( Bool_t v )
{ fVerbose = v; }
const DataSet& Data()
{ return *fDataSet; }
DataSet& Data()
{ return *fDataSet; }

Author: Andreas Hoecker, Joerg Stelzer, Helge Voss
Last update: root/tmva $Id: Reader.cxx,v 1.12 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.