Logo ROOT   6.07/09
Reference Guide
MinuitWrapper.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Peter Speckmayer
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : MinuitWrapper *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Wrapper around MINUIT *
12  * *
13  * Authors (alphabetical): *
14  * Peter Speckmayer <peter.speckmayer@cern.ch> - CERN, Switzerland *
15  * *
16  * Copyright (c) 2005: *
17  * CERN, Switzerland *
18  * MPI-K Heidelberg, Germany *
19  * *
20  * Redistribution and use in source and binary forms, with or without *
21  * modification, are permitted according to the terms listed in LICENSE *
22  * (http://tmva.sourceforge.net/LICENSE) *
23  **********************************************************************************/
24 
25 #ifndef ROOT_TMVA_MinuitWrapper
26 #define ROOT_TMVA_MinuitWrapper
27 
28 //////////////////////////////////////////////////////////////////////////
29 // //
30 // MinuitWrapper //
31 // //
32 // Wrapper around MINUIT //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 #ifndef ROOT_TMinuit
37 #include "TMinuit.h"
38 #endif
39 #ifndef ROOT_TMVA_IFitterTarget
40 #include "TMVA/IFitterTarget.h"
41 #endif
42 
43 class TMinuit;
44 
45 namespace TMVA {
46 
47  class IFitterTarget;
48 
49  class MinuitWrapper : public TMinuit {
50 
51  public:
52 
53  MinuitWrapper( IFitterTarget& target, Int_t maxpar);
54  virtual ~MinuitWrapper() {}
55 
57  void SetFitterTarget( IFitterTarget& target ) { fFitterTarget = target; }
58 
59  Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
60  void Clear(Option_t * = 0);
61  Int_t GetStats (Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx);
62  Int_t GetErrors (Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc);
63  Int_t SetParameter(Int_t ipar,const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh);
64  TObject *Clone(char const*) const;
65 
66  private:
67 
68  IFitterTarget& fFitterTarget; // fitter Target
69  std::vector<Double_t> fParameters; // vector holding the current parameters
70  Int_t fNumPar; // number of parameters
71 
72  ClassDef(MinuitWrapper,0); // Wrapper around TMinuit
73  };
74 
75 } // namespace TMVA
76 
77 #endif
78 
79 
Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx)
return global fit parameters amin : chisquare edm : estimated distance to minimum errdef nvpar : numb...
Int_t SetParameter(Int_t ipar, const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh)
set initial values for a parameter ipar : parameter number parname : parameter name value : initial p...
Implementation in C++ of the Minuit package written by Fred James.
Definition: TMinuit.h:31
Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc)
return current errors for a parameter ipar : parameter number eplus : upper error eminus : lower erro...
const char Option_t
Definition: RtypesCore.h:62
IFitterTarget & fFitterTarget
Definition: MinuitWrapper.h:68
int Int_t
Definition: RtypesCore.h:41
Int_t Eval(Int_t, Double_t *, Double_t &, Double_t *, Int_t)
std::vector<Double_t> parameters( npar );
MinuitWrapper(IFitterTarget &target, Int_t maxpar)
constructor
#define ClassDef(name, id)
Definition: Rtypes.h:254
TObject * Clone(char const *) const
produces a clone of this MinuitWrapper
void Clear(Option_t *=0)
reset the fitter environment
void SetFitterTarget(IFitterTarget &target)
Definition: MinuitWrapper.h:57
std::vector< Double_t > fParameters
Definition: MinuitWrapper.h:69
double Double_t
Definition: RtypesCore.h:55
virtual ~MinuitWrapper()
Definition: MinuitWrapper.h:54
Mother of all ROOT objects.
Definition: TObject.h:44
Abstract ClassifierFactory template that handles arbitrary types.
Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs)
Execute a fitter command; command : command string args : list of nargs command arguments.