ROOT  6.06/09
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  protected:
79 
80  // need to implement option declaration
81  virtual void DeclareOptions() = 0;
82 
83  IFitterTarget& fFitterTarget; // pointer to target of fitting procedure
84  const std::vector<TMVA::Interval*> fRanges; // allowed intervals
85  Int_t fNpars; // number of parameters
86 
87  mutable MsgLogger* fLogger; // message logger
88  MsgLogger& Log() const { return *fLogger; }
89 
90  TString fClassName; // remove TMVA:: from TObject name
91 
92  ClassDef(FitterBase,0) // Baseclass for fitters
93  };
94 
95 } // namespace TMVA
96 
97 #endif
const std::vector< TMVA::Interval * > fRanges
Definition: FitterBase.h:84
virtual void DeclareOptions()=0
MsgLogger & Log() const
Definition: FitterBase.h:88
virtual ~FitterBase()
Definition: FitterBase.h:64
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
#define ClassDef(name, id)
Definition: Rtypes.h:254
Double_t Run()
estimator function interface for fitting
Definition: FitterBase.cxx:73
const char * GetName() const
Returns name of object.
Definition: FitterBase.h:76
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
Definition: FitterBase.cxx:87
IFitterTarget & GetFitterTarget() const
Definition: FitterBase.h:70
TString fClassName
Definition: FitterBase.h:90
Int_t GetNpars() const
Definition: FitterBase.h:73
double Double_t
Definition: RtypesCore.h:55
IFitterTarget & fFitterTarget
Definition: FitterBase.h:83
MsgLogger * fLogger
Definition: FitterBase.h:87
#define name(a, b)
Definition: linkTestLib0.cpp:5
Abstract ClassifierFactory template that handles arbitrary types.
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval * > ranges, const TString &theOption)