Back to home page

EIC code displayed by LXR

 
 

    


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

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_MnFcn
0011 #define ROOT_Minuit2_MnFcn
0012 
0013 #include "Minuit2/MnConfig.h"
0014 #include "Minuit2/MnMatrix.h"
0015 
0016 namespace ROOT {
0017 
0018 namespace Minuit2 {
0019 
0020 class FCNBase;
0021 /**
0022    Wrapper class to FCNBase interface used internally by Minuit.
0023    Apply conversion from calling the function from a Minuit Vector (MnAlgebraicVector) to a std::vector  for
0024    the function coordinates.
0025    The class counts also the number of function calls. By default counter start from zero, but a different value
0026    might be given if the class is  instantiated later on, for example for a set of different minimizaitons
0027    Normally the derived class MnUserFCN should be instantiated with performs in addition the transformatiopn
0028    internal-> external parameters
0029  */
0030 class MnFcn {
0031 
0032 public:
0033    /// constructor of
0034    explicit MnFcn(const FCNBase &fcn, int ncall = 0) : fFCN(fcn), fNumCall(ncall) {}
0035 
0036    virtual ~MnFcn();
0037 
0038    virtual double operator()(const MnAlgebraicVector &) const;
0039    unsigned int NumOfCalls() const { return fNumCall; }
0040 
0041    //
0042    // forward interface
0043    //
0044    double ErrorDef() const;
0045    double Up() const;
0046 
0047    const FCNBase &Fcn() const { return fFCN; }
0048 
0049 private:
0050    const FCNBase &fFCN;
0051 
0052 protected:
0053    mutable int fNumCall;
0054 };
0055 
0056 } // namespace Minuit2
0057 
0058 } // namespace ROOT
0059 
0060 #endif // ROOT_Minuit2_MnFcn