Logo ROOT  
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 );
64  IFitterTarget& GetFitterTarget() const { return fFitterTarget; }
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
TMVA::FitterBase::fLogger
MsgLogger * fLogger
Definition: FitterBase.h:110
TMVA::FitterBase::fIPyCurrentIter
UInt_t * fIPyCurrentIter
Definition: FitterBase.h:116
TMVA::FitterBase::DeclareOptions
virtual void DeclareOptions()=0
TMVA::FitterBase::fFitterTarget
IFitterTarget & fFitterTarget
Definition: FitterBase.h:106
Int_t
int Int_t
Definition: RtypesCore.h:45
TMVA::FitterBase::GetName
const char * GetName() const
Returns name of object.
Definition: FitterBase.h:92
TString
Definition: TString.h:136
TMVA::FitterBase::GetNpars
Int_t GetNpars() const
Definition: FitterBase.h:89
TString.h
TMVA::FitterBase::fNpars
Int_t fNpars
Definition: FitterBase.h:108
TMVA::FitterBase::EstimatorFunction
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
Definition: FitterBase.cxx:88
TMVA::FitterBase::fClassName
TString fClassName
Definition: FitterBase.h:113
TMVA::FitterBase::Run
Double_t Run()
estimator function interface for fitting
Definition: FitterBase.cxx:74
TMVA::FitterBase::SetIPythonInteractive
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_)
Definition: FitterBase.h:95
TMVA::FitterBase::FitterBase
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval * > ranges, const TString &theOption)
constructor
Definition: FitterBase.cxx:56
Configurable.h
unsigned int
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::FitterBase::Log
MsgLogger & Log() const
Definition: FitterBase.h:111
TMVA::FitterBase::fRanges
const std::vector< TMVA::Interval * > fRanges
Definition: FitterBase.h:107
TMVA::MsgLogger
Definition: MsgLogger.h:83
TObject.h
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TMVA::IFitterTarget
Definition: IFitterTarget.h:64
TMVA::FitterBase::fIPyMaxIter
UInt_t * fIPyMaxIter
Definition: FitterBase.h:116
TMVA::FitterBase::~FitterBase
virtual ~FitterBase()
Definition: FitterBase.h:80
TMVA::FitterBase::fExitFromTraining
bool * fExitFromTraining
Definition: FitterBase.h:117
TMVA::FitterBase::GetFitterTarget
IFitterTarget & GetFitterTarget() const
Definition: FitterBase.h:86
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
int
TMVA::FitterBase
Definition: FitterBase.h:73