Logo ROOT   6.08/07
Reference Guide
FitterBase.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : FitterBase *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Base class for TMVA fitters *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
18  * *
19  * Copyright (c) 2005: *
20  * CERN, Switzerland *
21  * MPI-K Heidelberg, Germany *
22  * *
23  * Redistribution and use in source and binary forms, with or without *
24  * modification, are permitted according to the terms listed in LICENSE *
25  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_FitterBase
29 #define ROOT_TMVA_FitterBase
30 
31 //////////////////////////////////////////////////////////////////////////
32 // //
33 // FitterBase //
34 // //
35 // Baseclass for TMVA fitters //
36 // //
37 //////////////////////////////////////////////////////////////////////////
38 
39 #include<vector>
40 #ifndef ROOT_TObject
41 #include "TObject.h"
42 #endif
43 #ifndef ROOT_TString
44 #include "TString.h"
45 #endif
46 
47 #ifndef ROOT_TMVA_Configurable
48 #include "TMVA/Configurable.h"
49 #endif
50 
51 namespace TMVA {
52 
53  class Interval;
54  class IFitterTarget;
55  class MsgLogger;
56 
57  class FitterBase : public Configurable {
58 
59  public:
60 
61  FitterBase( IFitterTarget& target, const TString& name, const std::vector<TMVA::Interval*> ranges,
62  const TString& theOption );
63 
64  virtual ~FitterBase() {}
65 
66  Double_t Run();
67  virtual Double_t Run( std::vector<Double_t>& pars ) = 0;
68 
69  Double_t EstimatorFunction( std::vector<Double_t>& parameters );
71 
72  // accessor
73  Int_t GetNpars() const { return fNpars; }
74 
75  // remove namespace in name
76  const char* GetName() const { return fClassName; }
77 
78  // setting up variables for JsMVA interactive training
79  void SetIPythonInteractive(bool* ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_){
80  fExitFromTraining = ExitFromTraining;
81  fIPyMaxIter = fIPyMaxIter_;
82  fIPyCurrentIter = fIPyCurrentIter_;
83  }
84 
85  protected:
86 
87  // need to implement option declaration
88  virtual void DeclareOptions() = 0;
89 
90  IFitterTarget& fFitterTarget; // pointer to target of fitting procedure
91  const std::vector<TMVA::Interval*> fRanges; // allowed intervals
92  Int_t fNpars; // number of parameters
93 
94  mutable MsgLogger* fLogger; // message logger
95  MsgLogger& Log() const { return *fLogger; }
96 
97  TString fClassName; // remove TMVA:: from TObject name
98 
99  // variables needed by JsMVA
100  UInt_t *fIPyCurrentIter = nullptr, *fIPyMaxIter = nullptr;
101  bool* fExitFromTraining = nullptr;
102 
103  ClassDef(FitterBase,0); // Baseclass for fitters
104  };
105 
106 } // namespace TMVA
107 
108 #endif
const std::vector< TMVA::Interval * > fRanges
Definition: FitterBase.h:91
UInt_t * fIPyCurrentIter
Definition: FitterBase.h:100
MsgLogger & Log() const
Definition: FitterBase.h:95
virtual void DeclareOptions()=0
bool * fExitFromTraining
Definition: FitterBase.h:101
virtual ~FitterBase()
Definition: FitterBase.h:64
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
UInt_t * fIPyMaxIter
Definition: FitterBase.h:100
IFitterTarget & GetFitterTarget() const
Definition: FitterBase.h:70
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t Run()
estimator function interface for fitting
Definition: FitterBase.cxx:80
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_)
Definition: FitterBase.h:79
Int_t GetNpars() const
Definition: FitterBase.h:73
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval *> ranges, const TString &theOption)
constructor
Definition: FitterBase.cxx:62
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
Definition: FitterBase.cxx:94
unsigned int UInt_t
Definition: RtypesCore.h:42
TString fClassName
Definition: FitterBase.h:97
double Double_t
Definition: RtypesCore.h:55
IFitterTarget & fFitterTarget
Definition: FitterBase.h:90
MsgLogger * fLogger
Definition: FitterBase.h:94
Abstract ClassifierFactory template that handles arbitrary types.
const char * GetName() const
Returns name of object.
Definition: FitterBase.h:76
char name[80]
Definition: TGX11.cxx:109