Logo ROOT   6.18/05
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
11#include "Minuit2/MnPrint.h"
14#include <iomanip>
15
16namespace ROOT {
17
18 namespace Minuit2 {
19
20 void MnTraceObject::operator() (int iter, const MinimumState & state) {
21
22 MnPrint::PrintState(std::cout, state, "iteration # ",iter);
23 if (!fUserState) return;
24
25 // print also parameters and derivatives
26 std::cout << "\t" << std::setw(12) << " " << " "
27 << std::setw(12) << " ext value " << " "
28 << std::setw(12) << " int value " << " "
29 << std::setw(12) << " gradient " << std::endl;
30 int firstPar = 0;
31 int lastPar = state.Vec().size();
32 if (fParNumber >= 0 && fParNumber < lastPar) {
33 firstPar = fParNumber;
34 lastPar = fParNumber+1;
35 }
36 for (int ipar = firstPar; ipar <lastPar; ++ipar) {
37 int epar = fUserState->Trafo().ExtOfInt(ipar);
38 double eval = fUserState->Trafo().Int2ext(ipar, state.Vec()(ipar) );
39 std::cout << "\t" << std::setw(12) << fUserState->Name(epar) << " "
40 << std::setw(12) << eval << " "
41 << std::setw(12) << state.Vec()(ipar) << " "
42 << std::setw(12) << state.Gradient().Vec()(ipar) << std::endl;
43 }
44 }
45
46 } // namespace Minuit2
47
48} // namespace ROOT
49
const MnAlgebraicVector & Vec() const
unsigned int size() const
Definition: LAVector.h:198
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
Definition: MinimumState.h:29
const MnAlgebraicVector & Vec() const
Definition: MinimumState.h:59
const FunctionGradient & Gradient() const
Definition: MinimumState.h:63
static void PrintState(std::ostream &os, const MinimumState &state, const char *msg, int iter=-1)
Definition: MnPrint.cxx:58
virtual void operator()(int i, const MinimumState &state)
const MnUserParameterState * fUserState
Definition: MnTraceObject.h:42
const char * Name(unsigned int) const
const MnUserTransformation & Trafo() const
unsigned int ExtOfInt(unsigned int internal) const
double Int2ext(unsigned int, double) const
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21