Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/tmva $Id$
0002 // Author: Peter Speckmayer
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : MinuitWrapper                                                         *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *       Wrapper around MINUIT                                                    *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Peter Speckmayer <peter.speckmayer@cern.ch> - CERN, Switzerland           *
0015  *                                                                                *
0016  * Copyright (c) 2005:                                                            *
0017  *      CERN, Switzerland                                                         *
0018  *      MPI-K Heidelberg, Germany                                                 *
0019  *                                                                                *
0020  * Redistribution and use in source and binary forms, with or without             *
0021  * modification, are permitted according to the terms listed in LICENSE           *
0022  * (see tmva/doc/LICENSE)                                          *
0023  **********************************************************************************/
0024 
0025 #ifndef ROOT_TMVA_MinuitWrapper
0026 #define ROOT_TMVA_MinuitWrapper
0027 
0028 //////////////////////////////////////////////////////////////////////////
0029 //                                                                      //
0030 // MinuitWrapper                                                        //
0031 //                                                                      //
0032 // Wrapper around MINUIT                                                //
0033 //                                                                      //
0034 //////////////////////////////////////////////////////////////////////////
0035 
0036 #include "TMinuit.h"
0037 #include "TMVA/IFitterTarget.h"
0038 #include <vector>
0039 
0040 class TMinuit;
0041 
0042 namespace TMVA {
0043 
0044    class IFitterTarget;
0045 
0046    class MinuitWrapper : public TMinuit {
0047 
0048    public:
0049 
0050       MinuitWrapper( IFitterTarget& target, Int_t maxpar);
0051       virtual ~MinuitWrapper() {}
0052 
0053       Int_t Eval(Int_t, Double_t*, Double_t&, Double_t*, Int_t);
0054       void SetFitterTarget( IFitterTarget& target ) { fFitterTarget = target; }
0055 
0056       Int_t ExecuteCommand(const char *command, Double_t *args, Int_t nargs);
0057       void  Clear(Option_t * = nullptr);
0058       Int_t GetStats    (Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx);
0059       Int_t GetErrors   (Int_t ipar, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc);
0060       Int_t SetParameter(Int_t ipar,const char *parname, Double_t value, Double_t verr, Double_t vlow, Double_t vhigh);
0061       TObject *Clone(char const*) const;
0062 
0063    private:
0064 
0065       IFitterTarget&        fFitterTarget; ///< fitter Target
0066       std::vector<Double_t> fParameters;   ///< vector holding the current parameters
0067       Int_t                 fNumPar;       ///< number of parameters
0068 
0069       ClassDef(MinuitWrapper,0); // Wrapper around TMinuit
0070    };
0071 
0072 } // namespace TMVA
0073 
0074 #endif
0075 
0076