Logo ROOT  
Reference Guide
CombinedMinimumBuilder.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 
12 #include "Minuit2/MnStrategy.h"
13 #include "Minuit2/MnPrint.h"
14 
15 namespace ROOT {
16 
17 namespace Minuit2 {
18 
20  const MnStrategy &strategy, unsigned int maxfcn, double edmval) const
21 {
22  // find minimum using combined method
23  // (Migrad then if fails try Simplex and then Migrad again)
24 
25  MnPrint print("CombinedMinimumBuilder");
26 
27  FunctionMinimum min = fVMMinimizer.Builder().Minimum(fcn, gc, seed, strategy, maxfcn, edmval);
28 
29  if (!min.IsValid()) {
30  print.Warn("Migrad method fails, will try with simplex method first");
31 
32  MnStrategy str(2);
33  FunctionMinimum min1 = fSimplexMinimizer.Builder().Minimum(fcn, gc, seed, str, maxfcn, edmval);
34  if (!min1.IsValid()) {
35  print.Warn("Both Migrad and Simplex methods failed");
36 
37  return min1;
38  }
39  MinimumSeed seed1 = fVMMinimizer.SeedGenerator()(fcn, gc, min1.UserState(), str);
40 
41  FunctionMinimum min2 = fVMMinimizer.Builder().Minimum(fcn, gc, seed1, str, maxfcn, edmval);
42  if (!min2.IsValid()) {
43 
44  print.Warn("Both migrad and method failed also at 2nd attempt; return simplex Minimum");
45  return min1;
46  }
47 
48  return min2;
49  }
50 
51  return min;
52 }
53 
54 } // namespace Minuit2
55 
56 } // namespace ROOT
ROOT::Minuit2::MnFcn
Wrapper class to FCNBase interface used internally by Minuit.
Definition: MnFcn.h:30
ROOT::Minuit2::CombinedMinimumBuilder::fSimplexMinimizer
SimplexMinimizer fSimplexMinimizer
Definition: CombinedMinimumBuilder.h:55
MnStrategy.h
ROOT::Minuit2::FunctionMinimum::IsValid
bool IsValid() const
Definition: FunctionMinimum.h:94
FunctionMinimum.h
ROOT::Minuit2::FunctionMinimum::UserState
const MnUserParameterState & UserState() const
Definition: FunctionMinimum.h:75
ROOT::Minuit2::SimplexMinimizer::Builder
const MinimumBuilder & Builder() const
Definition: SimplexMinimizer.h:36
ROOT::Minuit2::VariableMetricMinimizer::Builder
const MinimumBuilder & Builder() const
Definition: VariableMetricMinimizer.h:49
ROOT::Minuit2::MnPrint::Warn
void Warn(const Ts &... args)
Definition: MnPrint.h:126
ROOT::Minuit2::CombinedMinimumBuilder::fVMMinimizer
VariableMetricMinimizer fVMMinimizer
Definition: CombinedMinimumBuilder.h:54
CombinedMinimumBuilder.h
ROOT::Minuit2::VariableMetricMinimizer::SeedGenerator
const MinimumSeedGenerator & SeedGenerator() const
Definition: VariableMetricMinimizer.h:48
ROOT::Minuit2::FunctionMinimum
class holding the full result of the minimization; both internal and external (MnUserParameterState) ...
Definition: FunctionMinimum.h:36
ROOT::Minuit2::MnStrategy
API class for defining three levels of strategies: low (0), medium (1), high (>=2); acts on: Migrad (...
Definition: MnStrategy.h:27
MnPrint.h
ROOT::Minuit2::GradientCalculator
interface class for gradient calculators
Definition: GradientCalculator.h:23
ROOT::Minuit2::MinimumBuilder::Minimum
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const =0
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::Minuit2::CombinedMinimumBuilder::Minimum
virtual FunctionMinimum Minimum(const MnFcn &, const GradientCalculator &, const MinimumSeed &, const MnStrategy &, unsigned int, double) const
Definition: CombinedMinimumBuilder.cxx:19
ROOT::Minuit2::MinimumSeed
Definition: MinimumSeed.h:23
ROOT::Minuit2::MnPrint
Definition: MnPrint.h:73