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