Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:23

0001 // @(#)root/minuit2:$Id$
0002 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005
0003 
0004 /**********************************************************************
0005  *                                                                    *
0006  * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
0007  *                                                                    *
0008  **********************************************************************/
0009 
0010 #ifndef ROOT_Minuit2_FCNBase
0011 #define ROOT_Minuit2_FCNBase
0012 
0013 #include "Minuit2/MnConfig.h"
0014 
0015 #include <vector>
0016 
0017 #include "Minuit2/GenericFunction.h"
0018 
0019 namespace ROOT {
0020 
0021 namespace Minuit2 {
0022 
0023 /**
0024 
0025   \defgroup Minuit Minuit2 Minimization Library
0026 
0027   New Object-oriented implementation of the MINUIT minimization package.
0028   More information is available at the home page of the \ref Minuit2Page "Minuit2" minimization package".
0029 
0030   \ingroup Math
0031 */
0032 
0033 //______________________________________________________________________________
0034 /**
0035 
0036 
0037 Interface (abstract class) defining the function to be minimized, which has to be implemented by the user.
0038 
0039 @author Fred James and Matthias Winkler; modified by Andras Zsenei and Lorenzo Moneta
0040 
0041 \ingroup Minuit
0042 
0043  */
0044 
0045 class FCNBase : public GenericFunction {
0046 
0047 public:
0048    ~FCNBase() override {}
0049 
0050    /**
0051 
0052       The meaning of the vector of parameters is of course defined by the user,
0053       who uses the values of those parameters to calculate their function Value.
0054       The order and the position of these parameters is strictly the one specified
0055       by the user when supplying the starting values for minimization. The starting
0056       values must be specified by the user, either via an std::vector<double> or the
0057       MnUserParameters supplied as input to the MINUIT minimizers such as
0058       VariableMetricMinimizer or MnMigrad. Later values are determined by MINUIT
0059       as it searches for the Minimum or performs whatever analysis is requested by
0060       the user.
0061 
0062       @param v function parameters as defined by the user.
0063 
0064       @return the Value of the function.
0065 
0066       @see MnUserParameters
0067       @see VariableMetricMinimizer
0068       @see MnMigrad
0069 
0070    */
0071 
0072    double operator()(const std::vector<double> &v) const override = 0;
0073 
0074    /**
0075 
0076       Error definition of the function. MINUIT defines Parameter errors as the
0077       change in Parameter Value required to change the function Value by up. Normally,
0078       for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5.
0079       If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4,
0080       as Chi2(x+n*sigma) = Chi2(x) + n*n.
0081 
0082       Comment a little bit better with links!!!!!!!!!!!!!!!!!
0083 
0084    */
0085 
0086    virtual double ErrorDef() const { return Up(); }
0087 
0088    /**
0089 
0090       Error definition of the function. MINUIT defines Parameter errors as the
0091       change in Parameter Value required to change the function Value by up. Normally,
0092       for chisquared fits it is 1, and for negative log likelihood, its Value is 0.5.
0093       If the user wants instead the 2-sigma errors for chisquared fits, it becomes 4,
0094       as Chi2(x+n*sigma) = Chi2(x) + n*n.
0095 
0096       \todo Comment a little bit better with links!!!!!!!!!!!!!!!!! Idem for ErrorDef()
0097 
0098    */
0099 
0100    virtual double Up() const = 0;
0101 
0102    /**
0103        add interface to set dynamically a new error definition
0104        Re-implement this function if needed.
0105    */
0106    virtual void SetErrorDef(double){};
0107 };
0108 
0109 } // namespace Minuit2
0110 
0111 } // namespace ROOT
0112 
0113 #endif // ROOT_Minuit2_FCNBase