Logo ROOT   6.08/07
Reference Guide
IMethod.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : IMethod *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Interface for all concrete MVA method implementations *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
16  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
17  * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada *
18  * *
19  * Copyright (c) 2005: *
20  * CERN, Switzerland *
21  * U. of Victoria, Canada *
22  * MPI-K Heidelberg, Germany *
23  * LAPP, Annecy, France *
24  * *
25  * Redistribution and use in source and binary forms, with or without *
26  * modification, are permitted according to the terms listed in LICENSE *
27  * (http://tmva.sourceforge.net/LICENSE) *
28  **********************************************************************************/
29 
30 #ifndef ROOT_TMVA_IMethod
31 #define ROOT_TMVA_IMethod
32 
33 //////////////////////////////////////////////////////////////////////////
34 // //
35 // IMethod //
36 // //
37 // Interface for all concrete MVA method implementations //
38 // //
39 //////////////////////////////////////////////////////////////////////////
40 
41 #ifndef ROOT_TObject
42 #include "TObject.h"
43 #endif
44 #ifndef ROOT_TString
45 #include "TString.h"
46 #endif
47 #include <iosfwd>
48 #ifndef ROOT_Rtypes
49 #include "Rtypes.h"
50 #endif
51 #ifndef ROOT_TMVA_Types
52 #include "TMVA/Types.h"
53 #endif
54 
55 class TString;
56 
57 namespace TMVA {
58 
59  class Ranking;
60  class MethodBoost;
61 
62  class IMethod {
63 
64  public:
65 
66  // default constructur
67  IMethod() {}
68 
69  // default destructur
70  virtual ~IMethod() {}
71 
72  // ------- virtual member functions to be implemented by each MVA method
73  // the name of the method
74  virtual const char *GetName() const = 0;
75 
76  // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
77  virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ) = 0;
78 
79  // training method
80  virtual void Train( void ) = 0;
81 
82  // read weights from output stream
83  virtual void ReadWeightsFromStream( std::istream& ) = 0;
84 
85  // write method specific monitoring histograms to target file
86  virtual void WriteMonitoringHistosToFile( void ) const = 0;
87 
88  // make ROOT-independent C++ class for classifier response
89  virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;
90 
91  // create ranking
92  virtual const Ranking* CreateRanking() = 0;
93 
94  // print help message
95  virtual void PrintHelpMessage() const = 0;
96 
97  virtual void Init() = 0;
98  virtual void DeclareOptions() = 0;
99  virtual void ProcessOptions() = 0;
100 
101  virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;
102 
103  protected:
104 
105  // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
106  virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;
107 
108  // get specific help message from classifer
109  virtual void GetHelpMessage() const = 0;
110 
111  ClassDef(IMethod,0); // Method Interface
112 
113  };
114 } // namespace TMVA
115 
116 #endif
virtual void ProcessOptions()=0
virtual void MakeClassSpecific(std::ostream &, const TString &) const =0
EAnalysisType
Definition: Types.h:129
virtual void MakeClass(const TString &classFileName=TString("")) const =0
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
virtual void DeclareOptions()=0
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)=0
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual const char * GetName() const =0
virtual void Init()=0
virtual Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)=0
virtual const Ranking * CreateRanking()=0
unsigned int UInt_t
Definition: RtypesCore.h:42
double Double_t
Definition: RtypesCore.h:55
virtual void PrintHelpMessage() const =0
int type
Definition: TGX11.cxx:120
virtual void GetHelpMessage() const =0
Abstract ClassifierFactory template that handles arbitrary types.
virtual void Train(void)=0
virtual ~IMethod()
Definition: IMethod.h:70
virtual void ReadWeightsFromStream(std::istream &)=0
virtual void WriteMonitoringHistosToFile(void) const =0