Logo ROOT   6.08/07
Reference Guide
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  * Web : http://tmva.sourceforge.net *
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  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 ////////////////////////////////////////////////////////////////////////////////
29 
30 /*
31  FitterBase
32 
33  Baseclass for TMVA fitters. Also defines generalised fitting interface
34 */
35 //_______________________________________________________________________
36 
37 #include "TMVA/FitterBase.h"
38 #ifndef ROOT_TMVA_Interval
39 #include "TMVA/Interval.h"
40 #endif
41 #ifndef ROOT_TMVA_IFitterTarget
42 #include "TMVA/IFitterTarget.h"
43 #endif
44 
45 #include "TMVA/Configurable.h"
46 #include "TMVA/MsgLogger.h"
47 #include "TMVA/Types.h"
48 
49 #include "Rtypes.h"
50 #include "TString.h"
51 
53 
54 #ifdef _WIN32
55 /*Disable warning C4355: 'this' : used in base member initializer list*/
56 #pragma warning ( disable : 4355 )
57 #endif
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// constructor
61 
63  const TString& name,
64  const std::vector<Interval*> ranges,
65  const TString& theOption )
66 : Configurable( theOption ),
67  fFitterTarget( target ),
68  fRanges( ranges ),
69  fNpars( ranges.size() ),
70  fLogger( new MsgLogger("FitterBase", kINFO) ),
71  fClassName( name )
72 {
74  SetConfigDescription( "Configuration options for setup and tuning of specific fitter" );
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// estimator function interface for fitting
79 
81 {
82  std::vector<Double_t> pars;
83  for (std::vector<Interval*>::const_iterator parIt = fRanges.begin(); parIt != fRanges.end(); parIt++) {
84  pars.push_back( (*parIt)->GetMean() );
85  }
86 
87  // delete fLogger;
88  return this->Run( pars );
89 }
90 
91 ////////////////////////////////////////////////////////////////////////////////
92 /// estimator function interface for fitting
93 
94 Double_t TMVA::FitterBase::EstimatorFunction( std::vector<Double_t>& parameters )
95 {
96  return GetFitterTarget().EstimatorFunction( parameters );
97 }
98 
const std::vector< TMVA::Interval * > fRanges
Definition: FitterBase.h:91
virtual Double_t EstimatorFunction(std::vector< Double_t > &parameters)=0
Basic string class.
Definition: TString.h:137
IFitterTarget & GetFitterTarget() const
Definition: FitterBase.h:70
Double_t Run()
estimator function interface for fitting
Definition: FitterBase.cxx:80
FitterBase(IFitterTarget &target, const TString &name, const std::vector< TMVA::Interval *> ranges, const TString &theOption)
constructor
Definition: FitterBase.cxx:62
Double_t EstimatorFunction(std::vector< Double_t > &parameters)
estimator function interface for fitting
Definition: FitterBase.cxx:94
#define ClassImp(name)
Definition: Rtypes.h:279
double Double_t
Definition: RtypesCore.h:55
void SetConfigName(const char *n)
Definition: Configurable.h:69
const char * GetName() const
Returns name of object.
Definition: FitterBase.h:76
char name[80]
Definition: TGX11.cxx:109
void SetConfigDescription(const char *d)
Definition: Configurable.h:70