ROOT
v6-20
Reference Guide
MnUserFcn.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/MnUserFcn.h
"
11
#include "
Minuit2/FCNBase.h
"
12
#include "
Minuit2/MnUserTransformation.h
"
13
14
namespace
ROOT
{
15
16
namespace
Minuit2 {
17
18
19
double
MnUserFcn::operator()
(
const
MnAlgebraicVector
&
v
)
const
{
20
// call Fcn function transforming from a MnAlgebraicVector of internal values to a std::vector of external ones
21
fNumCall
++;
22
23
// calling fTransform() like here was not thread safe because it was using a cached vector
24
//return Fcn()( fTransform(v) );
25
// make a new thread-safe implementation creating a vector each time
26
// a bit slower few% in stressFit and 10% in Rosenbrock function but it is negligible in big fits
27
28
// get first initial values of parameter (in case some one is fixed)
29
std::vector<double> vpar(
fTransform
.
InitialParValues
().begin(),
fTransform
.
InitialParValues
().end() );
30
31
const
std::vector<MinuitParameter>& parameters =
fTransform
.
Parameters
();
32
unsigned
int
n
=
v
.size();
33
for
(
unsigned
int
i = 0; i <
n
; i++) {
34
int
ext =
fTransform
.
ExtOfInt
(i);
35
if
(parameters[ext].HasLimits()) {
36
vpar[ext] =
fTransform
.
Int2ext
(i,
v
(i));
37
}
38
else
{
39
vpar[ext] =
v
(i);
40
}
41
}
42
return
Fcn
()(vpar);
43
}
44
45
}
// namespace Minuit2
46
47
}
// namespace ROOT
FCNBase.h
MnUserFcn.h
MnUserTransformation.h
ROOT::Minuit2::LAVector
Definition:
LAVector.h:33
ROOT::Minuit2::MnFcn::fNumCall
int fNumCall
Definition:
MnFcn.h:59
ROOT::Minuit2::MnFcn::Fcn
const FCNBase & Fcn() const
Definition:
MnFcn.h:51
ROOT::Minuit2::MnUserFcn::fTransform
const MnUserTransformation & fTransform
Definition:
MnUserFcn.h:39
ROOT::Minuit2::MnUserFcn::operator()
virtual double operator()(const MnAlgebraicVector &) const
Definition:
MnUserFcn.cxx:19
ROOT::Minuit2::MnUserTransformation::ExtOfInt
unsigned int ExtOfInt(unsigned int internal) const
Definition:
MnUserTransformation.h:103
ROOT::Minuit2::MnUserTransformation::Parameters
const std::vector< MinuitParameter > & Parameters() const
Definition:
MnUserTransformation.h:108
ROOT::Minuit2::MnUserTransformation::Int2ext
double Int2ext(unsigned int, double) const
Definition:
MnUserTransformation.cxx:95
ROOT::Minuit2::MnUserTransformation::InitialParValues
const std::vector< double > & InitialParValues() const
Definition:
MnUserTransformation.h:115
n
const Int_t n
Definition:
legend1.C:16
ROOT
VSD Structures.
Definition:
StringConv.hxx:21
v
@ v
Definition:
rootcling_impl.cxx:3622
math
minuit2
src
MnUserFcn.cxx
ROOT v6-20 - Reference Guide Generated on Fri Apr 1 2022 00:22:22 (GVA Time) using Doxygen 1.9.4