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_MnFumiliMinimize
0011 #define ROOT_Minuit2_MnFumiliMinimize
0012 
0013 #include "Minuit2/MnApplication.h"
0014 #include "Minuit2/FumiliMinimizer.h"
0015 #include "Minuit2/FumiliFCNBase.h"
0016 
0017 #include <vector>
0018 
0019 namespace ROOT {
0020 
0021 namespace Minuit2 {
0022 
0023 // class FumiliFCNBase;
0024 // class FCNBase;
0025 
0026 //___________________________________________________________________________
0027 /**
0028 
0029 
0030 API class for minimization using Fumili technology;
0031 allows for user interaction: set/change parameters, do minimization,
0032 change parameters, re-do minimization etc.;
0033 also used by MnMinos and MnContours;
0034 
0035 
0036  */
0037 
0038 class MnFumiliMinimize : public MnApplication {
0039 
0040 public:
0041    /// construct from FumiliFCNBase + std::vector for parameters and errors
0042    MnFumiliMinimize(const FumiliFCNBase &fcn, const std::vector<double> &par, const std::vector<double> &err,
0043                     unsigned int stra = 1)
0044       : MnApplication(fcn, MnUserParameterState(par, err), MnStrategy(stra)), fMinimizer(FumiliMinimizer()), fFCN(fcn)
0045    {
0046    }
0047 
0048    /// construct from FumiliFCNBase + std::vector for parameters and covariance
0049    MnFumiliMinimize(const FumiliFCNBase &fcn, const std::vector<double> &par, unsigned int nrow,
0050                     const std::vector<double> &cov, unsigned int stra = 1)
0051       : MnApplication(fcn, MnUserParameterState(par, cov, nrow), MnStrategy(stra)), fMinimizer(FumiliMinimizer()),
0052         fFCN(fcn)
0053    {
0054    }
0055 
0056    /// construct from FumiliFCNBase + std::vector for parameters and MnUserCovariance
0057    MnFumiliMinimize(const FumiliFCNBase &fcn, const std::vector<double> &par, const MnUserCovariance &cov,
0058                     unsigned int stra = 1)
0059       : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(FumiliMinimizer()), fFCN(fcn)
0060    {
0061    }
0062 
0063    /// construct from FumiliFCNBase + MnUserParameters
0064    MnFumiliMinimize(const FumiliFCNBase &fcn, const MnUserParameters &par, unsigned int stra = 1)
0065       : MnApplication(fcn, MnUserParameterState(par), MnStrategy(stra)), fMinimizer(FumiliMinimizer()), fFCN(fcn)
0066    {
0067    }
0068 
0069    /// construct from FumiliFCNBase + MnUserParameters + MnUserCovariance
0070    MnFumiliMinimize(const FumiliFCNBase &fcn, const MnUserParameters &par, const MnUserCovariance &cov,
0071                     unsigned int stra = 1)
0072       : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(FumiliMinimizer()), fFCN(fcn)
0073    {
0074    }
0075 
0076    /// construct from FumiliFCNBase + MnUserParameterState + MnStrategy
0077    MnFumiliMinimize(const FumiliFCNBase &fcn, const MnUserParameterState &par, const MnStrategy &str)
0078       : MnApplication(fcn, MnUserParameterState(par), str), fMinimizer(FumiliMinimizer()), fFCN(fcn)
0079    {
0080    }
0081 
0082    MnFumiliMinimize(const MnFumiliMinimize &migr)
0083       : MnApplication(migr.Fcnbase(), migr.State(), migr.Strategy(), migr.NumOfCalls()), fMinimizer(migr.fMinimizer),
0084         fFCN(migr.Fcnbase())
0085    {
0086    }
0087 
0088    ~MnFumiliMinimize() override {}
0089 
0090    FumiliMinimizer &Minimizer() override { return fMinimizer; }
0091    const FumiliMinimizer &Minimizer() const override { return fMinimizer; }
0092 
0093    const FumiliFCNBase &Fcnbase() const override { return fFCN; }
0094 
0095    /// overwrite Minimize to use FumiliFCNBase
0096    FunctionMinimum operator()(unsigned int = 0, double = 0.1) override;
0097 
0098 private:
0099    FumiliMinimizer fMinimizer;
0100    const FumiliFCNBase &fFCN;
0101 
0102 private:
0103    // forbidden assignment of migrad (const FumiliFCNBase& = )
0104    MnFumiliMinimize &operator=(const MnFumiliMinimize &) { return *this; }
0105 };
0106 
0107 } // namespace Minuit2
0108 
0109 } // namespace ROOT
0110 
0111 #endif // ROOT_Minuit2_MnFumiliMinimize