Logo ROOT  
Reference Guide
MnTraceObject.cxx
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Author: L. Moneta 2012
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2012 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #include "Minuit2/MnTraceObject.h"
11 #include "Minuit2/MnPrint.h"
13 #include "Minuit2/MinimumState.h"
14 #include <iomanip>
15 
16 namespace ROOT {
17 
18 namespace Minuit2 {
19 
20 void MnTraceObject::operator()(int iter, const MinimumState &state)
21 {
22  MnPrint print("MnTraceObject");
23 
24  print.Debug(MnPrint::Oneline(state, iter));
25  if (!fUserState)
26  return;
27 
28  print.Debug([&](std::ostream &os) {
29  // print also parameters and derivatives
30  os << "\n\t" << std::setw(12) << " "
31  << " " << std::setw(12) << " ext value "
32  << " " << std::setw(12) << " int value "
33  << " " << std::setw(12) << " gradient ";
34  int firstPar = 0;
35  int lastPar = state.Vec().size();
36  if (fParNumber >= 0 && fParNumber < lastPar) {
37  firstPar = fParNumber;
38  lastPar = fParNumber + 1;
39  }
40  for (int ipar = firstPar; ipar < lastPar; ++ipar) {
41  int epar = fUserState->Trafo().ExtOfInt(ipar);
42  double eval = fUserState->Trafo().Int2ext(ipar, state.Vec()(ipar));
43  os << "\n\t" << std::setw(12) << fUserState->Name(epar) << " " << std::setw(12) << eval << " "
44  << std::setw(12) << state.Vec()(ipar) << " " << std::setw(12) << state.Gradient().Vec()(ipar);
45  }
46  });
47 }
48 
49 } // namespace Minuit2
50 
51 } // namespace ROOT
ROOT::Minuit2::MnTraceObject::fParNumber
int fParNumber
Definition: MnTraceObject.h:39
ROOT::Minuit2::MnUserTransformation::Int2ext
double Int2ext(unsigned int, double) const
Definition: MnUserTransformation.cxx:99
ROOT::Minuit2::MnTraceObject::fUserState
const MnUserParameterState * fUserState
Definition: MnTraceObject.h:38
ROOT::Minuit2::MinimumState
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
ROOT::Minuit2::MnPrint::Debug
void Debug(const Ts &... args)
Definition: MnPrint.h:138
ROOT::Minuit2::MinimumState::Gradient
const FunctionGradient & Gradient() const
Definition: MinimumState.h:55
ROOT::Minuit2::MnPrint::Oneline
Definition: MnPrint.h:85
MnUserParameterState.h
ROOT::Minuit2::FunctionGradient::Vec
const MnAlgebraicVector & Vec() const
Definition: FunctionGradient.h:41
ROOT::Minuit2::MnUserParameterState::Name
const char * Name(unsigned int) const
Definition: MnUserParameterState.cxx:473
ROOT::Minuit2::MnUserParameterState::Trafo
const MnUserTransformation & Trafo() const
Definition: MnUserParameterState.h:104
ROOT::Minuit2::MnTraceObject::operator()
virtual void operator()(int i, const MinimumState &state)
Definition: MnTraceObject.cxx:20
MnTraceObject.h
ROOT::Minuit2::MinimumState::Vec
const MnAlgebraicVector & Vec() const
Definition: MinimumState.h:51
ROOT::Minuit2::LAVector::size
unsigned int size() const
Definition: LAVector.h:227
MnPrint.h
ROOT::Minuit2::MnUserTransformation::ExtOfInt
unsigned int ExtOfInt(unsigned int internal) const
Definition: MnUserTransformation.h:102
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::MnPrint
Definition: MnPrint.h:73