Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:59

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : IMethod                                                               *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Interface for all concrete MVA method implementations                     *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0016  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0017  *      Kai Voss        <Kai.Voss@cern.ch>       - U. of Victoria, Canada         *
0018  *                                                                                *
0019  * Copyright (c) 2005:                                                            *
0020  *      CERN, Switzerland                                                         *
0021  *      U. of Victoria, Canada                                                    *
0022  *      MPI-K Heidelberg, Germany                                                 *
0023  *      LAPP, Annecy, France                                                      *
0024  *                                                                                *
0025  * Redistribution and use in source and binary forms, with or without             *
0026  * modification, are permitted according to the terms listed in LICENSE           *
0027  * (see tmva/doc/LICENSE)                                          *
0028  **********************************************************************************/
0029 
0030 #ifndef ROOT_TMVA_IMethod
0031 #define ROOT_TMVA_IMethod
0032 
0033 //////////////////////////////////////////////////////////////////////////
0034 //                                                                      //
0035 // IMethod                                                              //
0036 //                                                                      //
0037 // Interface for all concrete MVA method implementations                //
0038 //                                                                      //
0039 //////////////////////////////////////////////////////////////////////////
0040 
0041 #include "TString.h"
0042 #include <iosfwd>
0043 #include "Rtypes.h"
0044 #include "TMVA/Types.h"
0045 
0046 class TString;
0047 
0048 namespace TMVA {
0049 
0050    class Ranking;
0051    class MethodBoost;
0052 
0053    class IMethod {
0054 
0055    public:
0056 
0057       // default constructor
0058       IMethod() {}
0059 
0060       // default destructor
0061       virtual ~IMethod() {}
0062 
0063       // ------- virtual member functions to be implemented by each MVA method
0064       // the name of the method
0065       virtual const char *GetName() const = 0;
0066 
0067       // calculate the MVA value - some methods may return a per-event error estimate (unless: *err = -1)
0068       virtual Double_t GetMvaValue( Double_t* err = nullptr, Double_t* errUpper = nullptr ) = 0;
0069 
0070       // training method
0071       virtual void Train( void ) = 0;
0072 
0073       // read weights from output stream
0074       virtual void ReadWeightsFromStream( std::istream& ) = 0;
0075 
0076       // write method specific monitoring histograms to target file
0077       virtual void WriteMonitoringHistosToFile( void ) const = 0;
0078 
0079       // make ROOT-independent C++ class for classifier response
0080       virtual void MakeClass( const TString& classFileName = TString("") ) const = 0;
0081 
0082       // create ranking
0083       virtual const Ranking* CreateRanking() = 0;
0084 
0085       // print help message
0086       virtual void PrintHelpMessage() const = 0;
0087 
0088       virtual void Init() = 0;
0089       virtual void DeclareOptions() = 0;
0090       virtual void ProcessOptions() = 0;
0091 
0092       virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets ) = 0;
0093 
0094    protected:
0095 
0096       // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
0097       virtual void MakeClassSpecific( std::ostream&, const TString& ) const = 0;
0098 
0099       // get specific help message from classifier
0100       virtual void GetHelpMessage() const = 0;
0101 
0102       ClassDef(IMethod,0); // Method Interface
0103 
0104    };
0105 } // namespace TMVA
0106 
0107 #endif