Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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 * (see tmva/doc/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
45namespace 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
double Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
char name[80]
Definition TGX11.cxx:110
Base class for TMVA fitters.
Definition FitterBase.h:51
UInt_t * fIPyCurrentIter
Definition FitterBase.h:94
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyMaxIter_, UInt_t *fIPyCurrentIter_)
Definition FitterBase.h:73
IFitterTarget & GetFitterTarget() const
Definition FitterBase.h:64
bool * fExitFromTraining
Definition FitterBase.h:95
IFitterTarget & fFitterTarget
Definition FitterBase.h:84
MsgLogger * fLogger
Definition FitterBase.h:88
virtual void DeclareOptions()=0
virtual ~FitterBase()
Definition FitterBase.h:58
const char * GetName() const
Returns name of object.
Definition FitterBase.h:70
Int_t GetNpars() const
Definition FitterBase.h:67
MsgLogger & Log() const
message logger
Definition FitterBase.h:89
UInt_t * fIPyMaxIter
Definition FitterBase.h:94
Double_t Run()
estimator function interface for fitting
virtual Double_t Run(std::vector< Double_t > &pars)=0
TString fClassName
Definition FitterBase.h:91
const std::vector< TMVA::Interval * > fRanges
Definition FitterBase.h:85
Interface for a fitter 'target'.
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
Basic string class.
Definition TString.h:139
create variable transformations