Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include "TMinuit.h"
37#include "TMVA/IFitterTarget.h"
38#include <vector>
39
40class TMinuit;
41
42namespace TMVA {
43
44 class IFitterTarget;
45
46 class MinuitWrapper : public TMinuit {
47
48 public:
49
50 MinuitWrapper( IFitterTarget& target, Int_t maxpar);
51 virtual ~MinuitWrapper() {}
52
54 void SetFitterTarget( IFitterTarget& target ) { fFitterTarget = target; }
55
56 Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
57 void Clear(Option_t * = 0);
58 Int_t GetStats (Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx);
59 Int_t GetErrors (Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc);
60 Int_t SetParameter(Int_t ipar,const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh);
61 TObject *Clone(char const*) const;
62
63 private:
64
65 IFitterTarget& fFitterTarget; // fitter Target
66 std::vector<Double_t> fParameters; // vector holding the current parameters
67 Int_t fNumPar; // number of parameters
68
69 ClassDef(MinuitWrapper,0); // Wrapper around TMinuit
70 };
71
72} // namespace TMVA
73
74#endif
75
76
double Double_t
Definition RtypesCore.h:59
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
Interface for a fitter 'target'.
Wrapper around MINUIT.
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.
IFitterTarget & fFitterTarget
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
void Clear(Option_t *=0)
reset the fitter environment
Int_t Eval(Int_t, Double_t *, Double_t &, Double_t *, Int_t)
std::vector<Double_t> parameters( npar );
std::vector< Double_t > fParameters
void SetFitterTarget(IFitterTarget &target)
TObject * Clone(char const *) const
produces a clone of this MinuitWrapper
Int_t GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx)
return global fit parameters
Int_t GetErrors(Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc)
return current errors for a parameter
Implementation in C++ of the Minuit package written by Fred James.
Definition TMinuit.h:27
Mother of all ROOT objects.
Definition TObject.h:41
create variable transformations