ROOT logo
// @(#)root/tmva $Id$
// Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Class  : IMethod                                                               *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *      Interface for all concrete MVA method implementations                     *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
 *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
 *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
 *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
 *                                                                                *
 * Copyright (c) 2005:                                                            *
 *      CERN, Switzerland                                                         *
 *      U. of Victoria, Canada                                                    *
 *      MPI-K Heidelberg, Germany                                                 *
 *      LAPP, Annecy, France                                                      *
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://tmva.sourceforge.net/LICENSE)                                          *
 **********************************************************************************/

#ifndef ROOT_TMVA_IMethod
#define ROOT_TMVA_IMethod

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// IMethod                                                              //
//                                                                      //
// Interface for all concrete MVA method implementations                //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#include <iosfwd>
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#ifndef ROOT_TMVA_Types
#include "TMVA/Types.h"
#endif

class TString;

namespace TMVA {

   class Ranking;
   class MethodBoost;

   class IMethod {

   public:

      // default constructur
      IMethod() {}

      // default destructur
      virtual ~IMethod() {}

      // ------- virtual member functions to be implemented by each MVA method
      // the name of the method
      virtual const char *GetName() const = 0;

      // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
      virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ) = 0;

      // training method
      virtual void Train( void ) = 0;

      // read weights from output stream
      virtual void ReadWeightsFromStream( std::istream& ) = 0;

      // write method specific monitoring histograms to target file
      virtual void WriteMonitoringHistosToFile( void ) const = 0;

      // make ROOT-independent C++ class for classifier response
      virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;

      // create ranking
      virtual const Ranking* CreateRanking() = 0;

      // print help message
      virtual void PrintHelpMessage() const = 0;

      virtual void Init() = 0;
      virtual void DeclareOptions() = 0;
      virtual void ProcessOptions() = 0;

      virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;

   protected:

      // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
      virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;

      // get specific help message from classifer
      virtual void GetHelpMessage() const = 0;

      ClassDef(IMethod,0) // Method Interface

   };
} // namespace TMVA

#endif
 IMethod.h:1
 IMethod.h:2
 IMethod.h:3
 IMethod.h:4
 IMethod.h:5
 IMethod.h:6
 IMethod.h:7
 IMethod.h:8
 IMethod.h:9
 IMethod.h:10
 IMethod.h:11
 IMethod.h:12
 IMethod.h:13
 IMethod.h:14
 IMethod.h:15
 IMethod.h:16
 IMethod.h:17
 IMethod.h:18
 IMethod.h:19
 IMethod.h:20
 IMethod.h:21
 IMethod.h:22
 IMethod.h:23
 IMethod.h:24
 IMethod.h:25
 IMethod.h:26
 IMethod.h:27
 IMethod.h:28
 IMethod.h:29
 IMethod.h:30
 IMethod.h:31
 IMethod.h:32
 IMethod.h:33
 IMethod.h:34
 IMethod.h:35
 IMethod.h:36
 IMethod.h:37
 IMethod.h:38
 IMethod.h:39
 IMethod.h:40
 IMethod.h:41
 IMethod.h:42
 IMethod.h:43
 IMethod.h:44
 IMethod.h:45
 IMethod.h:46
 IMethod.h:47
 IMethod.h:48
 IMethod.h:49
 IMethod.h:50
 IMethod.h:51
 IMethod.h:52
 IMethod.h:53
 IMethod.h:54
 IMethod.h:55
 IMethod.h:56
 IMethod.h:57
 IMethod.h:58
 IMethod.h:59
 IMethod.h:60
 IMethod.h:61
 IMethod.h:62
 IMethod.h:63
 IMethod.h:64
 IMethod.h:65
 IMethod.h:66
 IMethod.h:67
 IMethod.h:68
 IMethod.h:69
 IMethod.h:70
 IMethod.h:71
 IMethod.h:72
 IMethod.h:73
 IMethod.h:74
 IMethod.h:75
 IMethod.h:76
 IMethod.h:77
 IMethod.h:78
 IMethod.h:79
 IMethod.h:80
 IMethod.h:81
 IMethod.h:82
 IMethod.h:83
 IMethod.h:84
 IMethod.h:85
 IMethod.h:86
 IMethod.h:87
 IMethod.h:88
 IMethod.h:89
 IMethod.h:90
 IMethod.h:91
 IMethod.h:92
 IMethod.h:93
 IMethod.h:94
 IMethod.h:95
 IMethod.h:96
 IMethod.h:97
 IMethod.h:98
 IMethod.h:99
 IMethod.h:100
 IMethod.h:101
 IMethod.h:102
 IMethod.h:103
 IMethod.h:104
 IMethod.h:105
 IMethod.h:106
 IMethod.h:107
 IMethod.h:108
 IMethod.h:109
 IMethod.h:110
 IMethod.h:111
 IMethod.h:112
 IMethod.h:113
 IMethod.h:114
 IMethod.h:115
 IMethod.h:116