IMethod.h

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: IMethod.h 36966 2010-11-26 09:50:13Z evt $
00002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
00003 
00004 /**********************************************************************************
00005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00006  * Package: TMVA                                                                  *
00007  * Class  : IMethod                                                               *
00008  * Web    : http://tmva.sourceforge.net                                           *
00009  *                                                                                *
00010  * Description:                                                                   *
00011  *      Interface for all concrete MVA method implementations                     *
00012  *                                                                                *
00013  * Authors (alphabetical):                                                        *
00014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
00015  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
00016  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
00017  *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
00018  *                                                                                *
00019  * Copyright (c) 2005:                                                            *
00020  *      CERN, Switzerland                                                         *
00021  *      U. of Victoria, Canada                                                    *
00022  *      MPI-K Heidelberg, Germany                                                 *
00023  *      LAPP, Annecy, France                                                      *
00024  *                                                                                *
00025  * Redistribution and use in source and binary forms, with or without             *
00026  * modification, are permitted according to the terms listed in LICENSE           *
00027  * (http://tmva.sourceforge.net/LICENSE)                                          *
00028  **********************************************************************************/
00029 
00030 #ifndef ROOT_TMVA_IMethod
00031 #define ROOT_TMVA_IMethod
00032 
00033 //////////////////////////////////////////////////////////////////////////
00034 //                                                                      //
00035 // IMethod                                                              //
00036 //                                                                      //
00037 // Interface for all concrete MVA method implementations                //
00038 //                                                                      //
00039 //////////////////////////////////////////////////////////////////////////
00040 
00041 #ifndef ROOT_TObject
00042 #include "TObject.h"
00043 #endif
00044 #ifndef ROOT_TString
00045 #include "TString.h"
00046 #endif
00047 #include <iosfwd>
00048 #ifndef ROOT_Rtypes
00049 #include "Rtypes.h"
00050 #endif
00051 #ifndef ROOT_TMVA_Types
00052 #include "TMVA/Types.h"
00053 #endif
00054 
00055 class TString;
00056 
00057 namespace TMVA {
00058 
00059    class Ranking;
00060    class MethodBoost;
00061 
00062    class IMethod {
00063 
00064    public:
00065 
00066       // default constructur
00067       IMethod() {}
00068 
00069       // default destructur
00070       virtual ~IMethod() {}
00071 
00072       // ------- virtual member functions to be implemented by each MVA method
00073       // the name of the method
00074       virtual const char *GetName() const = 0;
00075 
00076       // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
00077       virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ) = 0;
00078 
00079       // training method
00080       virtual void Train( void ) = 0;
00081 
00082       // read weights from output stream
00083       virtual void ReadWeightsFromStream( std::istream& ) = 0;
00084 
00085       // write method specific monitoring histograms to target file
00086       virtual void WriteMonitoringHistosToFile( void ) const = 0;
00087 
00088       // make ROOT-independent C++ class for classifier response
00089       virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;
00090 
00091       // create ranking
00092       virtual const Ranking* CreateRanking() = 0;
00093 
00094       // print help message
00095       virtual void PrintHelpMessage() const = 0;
00096 
00097       // perfrom extra actions during the boosting at different stages
00098       virtual Bool_t MonitorBoost( MethodBoost* boost) = 0;
00099 
00100       virtual void Init() = 0;
00101       virtual void DeclareOptions() = 0;
00102       virtual void ProcessOptions() = 0;
00103 
00104       virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;
00105 
00106    protected:
00107 
00108       // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
00109       virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;
00110 
00111       // get specific help message from classifer
00112       virtual void GetHelpMessage() const = 0;
00113 
00114       ClassDef(IMethod,0) // Method Interface
00115 
00116    };
00117 } // namespace TMVA
00118 
00119 #endif

Generated on Tue Jul 5 14:27:30 2011 for ROOT_528-00b_version by  doxygen 1.5.1