Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ScanBuilder.cxx
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#include "Minuit2/ScanBuilder.h"
13#include "Minuit2/MinimumSeed.h"
15#include "Minuit2/MnFcn.h"
16#include <cmath>
17
18namespace ROOT {
19
20namespace Minuit2 {
21
23 const MnStrategy &, unsigned int, double) const
24{
25 // find the function minimum performing a parameter scan (using MnParameterScan class)
26 // function gradient is not used
28 MnUserParameterState upst(seed.State(), mfcn.Up(), seed.Trafo());
29 MnParameterScan scan(mfcn.Fcn(), upst.Parameters(), seed.Fval());
30 double amin = scan.Fval();
31 unsigned int n = seed.Trafo().VariableParameters();
32 MnAlgebraicVector dirin(n);
33 for (unsigned int i = 0; i < n; i++) {
34 unsigned int ext = seed.Trafo().ExtOfInt(i);
35 scan(ext);
36 if (scan.Fval() < amin) {
37 amin = scan.Fval();
38 x(i) = seed.Trafo().Ext2int(ext, scan.Parameters().Value(ext));
39 }
40 dirin(i) = std::sqrt(2. * mfcn.Up() * seed.Error().InvHessian()(i, i));
41 }
42
43 MinimumParameters mp(x, dirin, amin);
44 MinimumState st(mp, 0., mfcn.NumOfCalls());
45
46 return FunctionMinimum(seed, std::vector<MinimumState>(1, st), mfcn.Up());
47}
48
49} // namespace Minuit2
50
51} // namespace ROOT
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
interface class for gradient calculators
const MnAlgebraicSymMatrix & InvHessian() const
const MnAlgebraicVector & Vec() const
const MinimumError & Error() const
Definition MinimumSeed.h:30
const MnUserTransformation & Trafo() const
Definition MinimumSeed.h:32
const MinimumParameters & Parameters() const
Definition MinimumSeed.h:29
const MinimumState & State() const
Definition MinimumSeed.h:28
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Wrapper class to FCNBase interface used internally by Minuit.
Definition MnFcn.h:30
double Up() const
Definition MnFcn.cxx:39
const FCNBase & Fcn() const
Definition MnFcn.h:47
unsigned int NumOfCalls() const
Definition MnFcn.h:39
Scans the values of FCN as a function of one Parameter and retains the best function and Parameter va...
const MnUserParameters & Parameters() const
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition MnStrategy.h:27
class which holds the external user and/or internal Minuit representation of the parameters and error...
const MnUserParameters & Parameters() const
double Value(unsigned int) const
double Ext2int(unsigned int, double) const
unsigned int ExtOfInt(unsigned int internal) const
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...