Nanga Parbat 1.1.0
A TMD fitting framework
fcnminuit.h
Go to the documentation of this file.
1//
2// Authors: Valerio Bertone: valerio.bertone@cern.ch
3//
4
5#pragma once
6
8
9#if MINUIT2_NOT_BUNDLED_WITH_ROOT
10#include <Minuit2/FCNBase.h>
11#include <Minuit2/FCNGradientBase.h>
12#else
13#include <root/Minuit2/FCNBase.h>
14#include <root/Minuit2/FCNGradientBase.h>
15#endif
16
17
18namespace NangaParbat
19{
25 class FcnMinuit: public ROOT::Minuit2::FCNBase
26 {
27 public:
32 FcnMinuit(ChiSquare const& chi2);
33
40 double operator()(std::vector<double> const& pars) const;
41
42 double Up() const { return 1. / (double) _chi2.GetDataPointNumber(); }
43
48 void SetParameters(std::vector<double> const& pars) { _chi2.SetParameters(pars); };
49
50 private:
51 mutable ChiSquare _chi2;
52 };
53
60 class FcnMinuitGrad: public ROOT::Minuit2::FCNGradientBase
61 {
62 public:
68
75 double operator()(std::vector<double> const& pars) const;
76
83 std::vector<double> Gradient(const std::vector<double>& pars) const;
84
85 double Up() const { return 1. / (double) _chi2.GetDataPointNumber(); }
86
91 void SetParameters(std::vector<double> const& pars) { _chi2.SetParameters(pars); };
92
93 private:
94 mutable ChiSquare _chi2;
95 };
96}
The "ChiSquare" class computes the χ2's given a set of "DataHandler" objects and the corresponding "C...
Definition: chisquare.h:22
virtual void SetParameters(std::vector< double > const &pars)
Function that sets the free parameters of the parameterisation.
Definition: chisquare.h:114
int GetDataPointNumber() const
Function that gets the number of data points that pass the qT / Q cut for the whole dataset.
Definition: chisquare.h:155
The "FcnMinuit" class is a derived class of of the "FCNGradientBase" mother class of Minuit that retu...
Definition: fcnminuit.h:61
ChiSquare _chi2
The "ChiSquare" object that returns the values of all chi2's.
Definition: fcnminuit.h:91
double operator()(std::vector< double > const &pars) const
Operator required by Minuit to compute the function to be minimised.
FcnMinuitGrad(ChiSquare const &chi2)
The "FcnMinuitGrad" default constructor.
double Up() const
Definition: fcnminuit.h:85
std::vector< double > Gradient(const std::vector< double > &pars) const
Function required by Minuit to compute the derivatives of the function to be minimised.
void SetParameters(std::vector< double > const &pars)
Function that sets the parameter of the "ChiSquare" object.
Definition: fcnminuit.h:91
The "FcnMinuit" class is a derived class of of the "FCNBase" mother class of Minuit that returns the ...
Definition: fcnminuit.h:26
double Up() const
Definition: fcnminuit.h:42
void SetParameters(std::vector< double > const &pars)
Function that sets the parameter of the "ChiSquare" object.
Definition: fcnminuit.h:48
FcnMinuit(ChiSquare const &chi2)
The "FcnMinuit" default constructor.
ChiSquare _chi2
The "ChiSquare" object that returns the values of all chi2's.
Definition: fcnminuit.h:48
double operator()(std::vector< double > const &pars) const
Operator required by Minuit to compute the function to be minimised.
Definition: bstar.h:12