Logo ROOT  
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 #include "TString.h"
42 #include <iosfwd>
43 #include "Rtypes.h"
44 #include "TMVA/Types.h"
45 
46 class TString;
47 
48 namespace TMVA {
49 
50  class Ranking;
51  class MethodBoost;
52 
53  class IMethod {
54 
55  public:
56 
57  // default constructor
58  IMethod() {}
59 
60  // default destructor
61  virtual ~IMethod() {}
62 
63  // ------- virtual member functions to be implemented by each MVA method
64  // the name of the method
65  virtual const char *GetName() const = 0;
66 
67  // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
68  virtual Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 ) = 0;
69 
70  // training method
71  virtual void Train( void ) = 0;
72 
73  // read weights from output stream
74  virtual void ReadWeightsFromStream( std::istream& ) = 0;
75 
76  // write method specific monitoring histograms to target file
77  virtual void WriteMonitoringHistosToFile( void ) const = 0;
78 
79  // make ROOT-independent C++ class for classifier response
80  virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;
81 
82  // create ranking
83  virtual const Ranking* CreateRanking() = 0;
84 
85  // print help message
86  virtual void PrintHelpMessage() const = 0;
87 
88  virtual void Init() = 0;
89  virtual void DeclareOptions() = 0;
90  virtual void ProcessOptions() = 0;
91 
92  virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;
93 
94  protected:
95 
96  // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
97  virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;
98 
99  // get specific help message from classifier
100  virtual void GetHelpMessage() const = 0;
101 
102  ClassDef(IMethod,0); // Method Interface
103 
104  };
105 } // namespace TMVA
106 
107 #endif
TMVA::Ranking
Definition: Ranking.h:70
TMVA::IMethod::DeclareOptions
virtual void DeclareOptions()=0
TMVA::IMethod::CreateRanking
virtual const Ranking * CreateRanking()=0
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMVA::IMethod::Init
virtual void Init()=0
TMVA::IMethod::WriteMonitoringHistosToFile
virtual void WriteMonitoringHistosToFile(void) const =0
TString.h
TMVA::IMethod::ProcessOptions
virtual void ProcessOptions()=0
TMVA::IMethod::Train
virtual void Train(void)=0
TMVA::IMethod::~IMethod
virtual ~IMethod()
Definition: IMethod.h:61
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:150
TMVA::IMethod::IMethod
IMethod()
Definition: IMethod.h:58
TMVA::IMethod::MakeClass
virtual void MakeClass(const TString &classFileName=TString("")) const =0
TMVA::IMethod::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
Types.h
TMVA::IMethod
Definition: IMethod.h:53
TMVA::IMethod::GetName
virtual const char * GetName() const =0
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::IMethod::HasAnalysisType
virtual Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)=0
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::IMethod::GetMvaValue
virtual Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)=0
type
int type
Definition: TGX11.cxx:121
TMVA::IMethod::MakeClassSpecific
virtual void MakeClassSpecific(std::ostream &, const TString &) const =0
Rtypes.h
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
TMVA::IMethod::PrintHelpMessage
virtual void PrintHelpMessage() const =0
TMVA::IMethod::GetHelpMessage
virtual void GetHelpMessage() const =0