Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
18namespace Minuit2 {
19
20void 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
const MnAlgebraicVector & Vec() const
unsigned int size() const
Definition LAVector.h:231
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
const MnAlgebraicVector & Vec() const
const FunctionGradient & Gradient() const
void Debug(const Ts &... args)
Definition MnPrint.h:147
virtual void operator()(int i, const MinimumState &state)
const MnUserParameterState * fUserState
const char * Name(unsigned int) const
const MnUserTransformation & Trafo() const
unsigned int ExtOfInt(unsigned int internal) const
double Int2ext(unsigned int, double) const
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.