Logo ROOT   6.12/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 #include "TObject.h"
41 #include "TString.h"
42 
43 #include "TMVA/Configurable.h"
44 
45 namespace TMVA {
46 
47  class Interval;
48  class IFitterTarget;
49  class MsgLogger;
50 
51  class FitterBase : public Configurable {
52 
53  public:
54 
55  FitterBase( IFitterTarget& target, const TString& name, const std::vector<TMVA::Interval*> ranges,
56  const TString& theOption );
57 
58  virtual ~FitterBase() {}
59 
60  Double_t Run();
61  virtual Double_t Run( std::vector<Double_t>& pars ) = 0;
62 
63  Double_t EstimatorFunction( std::vector<Double_t>& parameters );
65 
66  // accessor
67  Int_t GetNpars() const { return fNpars; }
68 
69  // remove namespace in name
70  const char* GetName() const { return fClassName; }
71 
72  // setting up variables for JsMVA interactive training
73  void SetIPythonInteractive(bool* ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_){
74  fExitFromTraining = ExitFromTraining;
75  fIPyMaxIter = fIPyMaxIter_;
76  fIPyCurrentIter = fIPyCurrentIter_;
77  }
78 
79  protected:
80 
81  // need to implement option declaration
82  virtual void DeclareOptions() = 0;
83 
84  IFitterTarget& fFitterTarget; // pointer to target of fitting procedure
85  const std::vector<TMVA::Interval*> fRanges; // allowed intervals
86  Int_t fNpars; // number of parameters
87 
88  mutable MsgLogger* fLogger; // message logger
89  MsgLogger& Log() const { return *fLogger; }
90 
91  TString fClassName; // remove TMVA:: from TObject name
92 
93  // variables needed by JsMVA
94  UInt_t *fIPyCurrentIter = nullptr, *fIPyMaxIter = nullptr;
95  bool* fExitFromTraining = nullptr;
96 
97  ClassDef(FitterBase,0); // Baseclass for fitters
98  };
99 
100 } // namespace TMVA
101 
102 #endif
const std::vector< TMVA::Interval * > fRanges
Definition: FitterBase.h:85
UInt_t * fIPyCurrentIter
Definition: FitterBase.h:94
MsgLogger & Log() const
Definition: FitterBase.h:89
Base class for TMVA fitters.
Definition: FitterBase.h:51
virtual void DeclareOptions()=0
bool * fExitFromTraining
Definition: FitterBase.h:95
virtual ~FitterBase()
Definition: FitterBase.h:58
Basic string class.
Definition: TString.h:125
int Int_t
Definition: RtypesCore.h:41
UInt_t * fIPyMaxIter
Definition: FitterBase.h:94
IFitterTarget & GetFitterTarget() const
Definition: FitterBase.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:320
Double_t Run()
estimator function interface for fitting
Definition: FitterBase.cxx:74
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_)
Definition: FitterBase.h:73
Int_t GetNpars() const
Definition: FitterBase.h:67
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval *> ranges, const TString &theOption)
constructor
Definition: FitterBase.cxx:56
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
Definition: FitterBase.cxx:88
unsigned int UInt_t
Definition: RtypesCore.h:42
TString fClassName
Definition: FitterBase.h:91
double Double_t
Definition: RtypesCore.h:55
IFitterTarget & fFitterTarget
Definition: FitterBase.h:84
MsgLogger * fLogger
Definition: FitterBase.h:88
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:59
Abstract ClassifierFactory template that handles arbitrary types.
const char * GetName() const
Returns name of object.
Definition: FitterBase.h:70
Interface for a fitter &#39;target&#39;.
Definition: IFitterTarget.h:44
char name[80]
Definition: TGX11.cxx:109