Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
FitterBase.cxx
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 * Implementation *
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/*! \class TMVA::FitterBase
29\ingroup TMVA
30
31Base class for TMVA fitters. Also defines generalised fitting interface
32
33*/
34
35#include "TMVA/FitterBase.h"
36#include "TMVA/Interval.h"
37#include "TMVA/IFitterTarget.h"
38
39#include "TMVA/Configurable.h"
40#include "TMVA/MsgLogger.h"
41#include "TMVA/Types.h"
42
43#include "Rtypes.h"
44#include "TString.h"
45
46
47#ifdef _WIN32
48/*Disable warning C4355: 'this' : used in base member initializer list*/
49#pragma warning ( disable : 4355 )
50#endif
51
52////////////////////////////////////////////////////////////////////////////////
53/// constructor
54
56 const TString& name,
57 const std::vector<Interval*> ranges,
58 const TString& theOption )
59: Configurable( theOption ),
60 fFitterTarget( target ),
61 fRanges( ranges ),
62 fNpars( ranges.size() ),
63 fLogger( new MsgLogger("FitterBase", kINFO) ),
65{
67 SetConfigDescription( "Configuration options for setup and tuning of specific fitter" );
68}
69
70////////////////////////////////////////////////////////////////////////////////
71/// estimator function interface for fitting
72
74{
75 std::vector<Double_t> pars;
76 for (std::vector<Interval*>::const_iterator parIt = fRanges.begin(); parIt != fRanges.end(); ++parIt) {
77 pars.push_back( (*parIt)->GetMean() );
78 }
79
80 // delete fLogger;
81 return this->Run( pars );
82}
83
84////////////////////////////////////////////////////////////////////////////////
85/// estimator function interface for fitting
86
87Double_t TMVA::FitterBase::EstimatorFunction( std::vector<Double_t>& parameters )
88{
89 return GetFitterTarget().EstimatorFunction( parameters );
90}
91
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
char name[80]
Definition TGX11.cxx:148
void SetConfigDescription(const char *d)
void SetConfigName(const char *n)
Configurable(const TString &theOption="")
constructor
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval * > ranges, const TString &theOption)
constructor
IFitterTarget & GetFitterTarget() const
Definition FitterBase.h:64
IFitterTarget & fFitterTarget
Definition FitterBase.h:84
MsgLogger * fLogger
! message logger
Definition FitterBase.h:88
const char * GetName() const override
Returns name of object.
Definition FitterBase.h:70
Double_t Run()
estimator function interface for fitting
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:138