File indexing completed on 2025-09-13 09:09:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef ROOT_Minuit2_MnFcn
0011 #define ROOT_Minuit2_MnFcn
0012
0013 #include "Minuit2/FCNBase.h"
0014 #include "Minuit2/MnMatrix.h"
0015
0016 #include <vector>
0017
0018 namespace ROOT {
0019
0020 namespace Minuit2 {
0021
0022 class MnUserTransformation;
0023
0024 class FCNBase;
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 class MnFcn {
0035
0036 public:
0037 explicit MnFcn(const FCNBase &fcn, int ncall = 0) : fFCN(fcn), fNumCall(ncall) {}
0038 explicit MnFcn(const FCNBase &fcn, const MnUserTransformation &trafo, int ncall = 0)
0039 : fFCN(fcn), fNumCall(ncall), fTransform(&trafo)
0040 {
0041 }
0042
0043 unsigned int NumOfCalls() const { return fNumCall; }
0044
0045 double ErrorDef() const
0046 {
0047 return fFCN.Up();
0048 }
0049
0050 double Up() const
0051 {
0052 return fFCN.Up();
0053 }
0054
0055 const FCNBase &Fcn() const { return fFCN; }
0056
0057
0058
0059 const MnUserTransformation *Trafo() const { return fTransform; }
0060
0061 double CallWithTransformedParams(std::vector<double> const &vpar) const;
0062 double CallWithoutDoingTrafo(const MnAlgebraicVector &) const;
0063
0064 private:
0065 const FCNBase &fFCN;
0066 mutable int fNumCall;
0067 const MnUserTransformation *fTransform = nullptr;
0068 };
0069
0070
0071 class MnFcnCaller {
0072 public:
0073 MnFcnCaller(const MnFcn &mfcn);
0074
0075 double operator()(const MnAlgebraicVector &v);
0076
0077 private:
0078 MnFcn const &fMfcn;
0079 bool fDoInt2ext = false;
0080 std::vector<double> fLastInput;
0081 std::vector<double> fVpar;
0082 };
0083
0084 }
0085
0086 }
0087
0088 #endif