Logo ROOT  
Reference Guide
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"
14 #include "Minuit2/MinimumState.h"
15 #include "Minuit2/MnFcn.h"
16 #include <cmath>
17 
18 namespace ROOT {
19 
20 namespace 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
27  MnAlgebraicVector x = seed.Parameters().Vec();
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
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::MnFcn
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:30
ROOT::Minuit2::MnFcn::NumOfCalls
unsigned int NumOfCalls() const
Definition: MnFcn.h:39
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
ROOT::Minuit2::LAVector
Definition: LAVector.h:32
FunctionMinimum.h
MinimumSeed.h
ROOT::Minuit2::MinimumParameters::Vec
const MnAlgebraicVector & Vec() const
Definition: MinimumParameters.h:38
ROOT::Minuit2::MnParameterScan::Parameters
const MnUserParameters & Parameters() const
Definition: MnParameterScan.h:42
x
Double_t x[n]
Definition: legend1.C:17
ROOT::Minuit2::MnParameterScan
Scans the values of FCN as a function of one Parameter and retains the best function and Parameter va...
Definition: MnParameterScan.h:29
MnFcn.h
ROOT::Minuit2::MinimumParameters
Definition: MinimumParameters.h:21
ROOT::Minuit2::MnFcn::Up
double Up() const
Definition: MnFcn.cxx:39
ROOT::Minuit2::ScanBuilder::Minimum
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const
Definition: ScanBuilder.cxx:22
ROOT::Minuit2::MnUserParameters::Value
double Value(unsigned int) const
Definition: MnUserParameters.cxx:122
ROOT::Minuit2::MinimumSeed::Error
const MinimumError & Error() const
Definition: MinimumSeed.h:41
ROOT::Minuit2::MnUserTransformation::VariableParameters
unsigned int VariableParameters() const
Definition: MnUserTransformation.h:110
ROOT::Minuit2::MnFcn::Fcn
const FCNBase & Fcn() const
Definition: MnFcn.h:47
sqrt
double sqrt(double)
ROOT::Minuit2::MnUserTransformation::Ext2int
double Ext2int(unsigned int, double) const
Definition: MnUserTransformation.cxx:174
MnParameterScan.h
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:33
ROOT::Minuit2::MnUserParameterState
class which holds the external user and/or internal Minuit representation of the parameters and error...
Definition: MnUserParameterState.h:33
ROOT::Minuit2::MnUserParameterState::Parameters
const MnUserParameters & Parameters() const
Definition: MnUserParameterState.h:89
ScanBuilder.h
ROOT::Minuit2::MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
ROOT::Minuit2::MnParameterScan::Fval
double Fval() const
Definition: MnParameterScan.h:43
ROOT::Minuit2::MinimumSeed::Parameters
const MinimumParameters & Parameters() const
Definition: MinimumSeed.h:40
ROOT::Minuit2::MinimumError::InvHessian
const MnAlgebraicSymMatrix & InvHessian() const
Definition: MinimumError.h:61
ROOT::Minuit2::GradientCalculator
interface class for gradient calculators
Definition: GradientCalculator.h:23
ROOT::Minuit2::MnUserTransformation::ExtOfInt
unsigned int ExtOfInt(unsigned int internal) const
Definition: MnUserTransformation.h:102
ROOT::Minuit2::MinimumSeed::Fval
double Fval() const
Definition: MinimumSeed.h:45
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
MinimumState.h
ROOT::Minuit2::MinimumSeed
MinimumSeed contains the starting values for the minimization produced by the SeedGenerator.
Definition: MinimumSeed.h:31
ROOT::Minuit2::MinimumSeed::State
const MinimumState & State() const
Definition: MinimumSeed.h:39
ROOT::Minuit2::MinimumSeed::Trafo
const MnUserTransformation & Trafo() const
Definition: MinimumSeed.h:43