ROOT logo
// @(#)root/minuit2:$Id$
// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei   2003-2005  

/**********************************************************************
 *                                                                    *
 * Copyright (c) 2005 LCG ROOT Math team,  CERN/PH-SFT                *
 *                                                                    *
 **********************************************************************/

#ifndef ROOT_Minuit2_MnScan
#define ROOT_Minuit2_MnScan

#include "Minuit2/MnApplication.h"
#include "Minuit2/ScanMinimizer.h"

namespace ROOT {

   namespace Minuit2 {


class FCNBase;

//_______________________________________________________________________
/** 
    API class for minimization using a scan method to find the minimum;
    allows for user interaction: set/change parameters, do minimization,
    change parameters, re-do minimization etc.; 
    
 */

class MnScan : public MnApplication {

public:

   /// construct from FCNBase + std::vector for parameters and errors
   MnScan(const FCNBase& fcn, const std::vector<double>& par, const std::vector<double>& err, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par,err), MnStrategy(stra)), fMinimizer(ScanMinimizer()) {}

   /// construct from FCNBase + std::vector for parameters and covariance
   MnScan(const FCNBase& fcn, const std::vector<double>& par, unsigned int nrow, const std::vector<double>& cov,  unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov, nrow), MnStrategy(stra)), fMinimizer(ScanMinimizer()) {}

   /// construct from FCNBase + std::vector for parameters and MnUserCovariance
   MnScan(const FCNBase& fcn, const std::vector<double>& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(ScanMinimizer()) {}

   /// construct from FCNBase + MnUserParameters
   MnScan(const FCNBase& fcn, const MnUserParameters& par, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par), MnStrategy(stra)), fMinimizer(ScanMinimizer()) {}

   /// construct from FCNBase + MnUserParameters + MnUserCovariance
   MnScan(const FCNBase& fcn, const MnUserParameters& par, const MnUserCovariance& cov, unsigned int stra = 1) : MnApplication(fcn, MnUserParameterState(par, cov), MnStrategy(stra)), fMinimizer(ScanMinimizer()) {}

   /// construct from FCNBase + MnUserParameterState + MnStrategy
   MnScan(const FCNBase& fcn, const MnUserParameterState& par, const MnStrategy& str) : MnApplication(fcn, MnUserParameterState(par), str), fMinimizer(ScanMinimizer()) {}

   MnScan(const MnScan& migr) : MnApplication(migr.Fcnbase(), migr.State(), migr.Strategy(), migr.NumOfCalls()), fMinimizer(migr.fMinimizer) {}  

   ~MnScan() {}

   const ModularFunctionMinimizer& Minimizer() const {return fMinimizer;}

   std::vector<std::pair<double, double> > Scan(unsigned int par, unsigned int maxsteps = 41, double low = 0., double high = 0.);

private:

   ScanMinimizer fMinimizer;

private:

   /// forbidden assignment (const FCNBase& = )
   MnScan& operator=(const MnScan&) {return *this;}
};

  }  // namespace Minuit2

}  // namespace ROOT

#endif  // ROOT_Minuit2_MnScan
 MnScan.h:1
 MnScan.h:2
 MnScan.h:3
 MnScan.h:4
 MnScan.h:5
 MnScan.h:6
 MnScan.h:7
 MnScan.h:8
 MnScan.h:9
 MnScan.h:10
 MnScan.h:11
 MnScan.h:12
 MnScan.h:13
 MnScan.h:14
 MnScan.h:15
 MnScan.h:16
 MnScan.h:17
 MnScan.h:18
 MnScan.h:19
 MnScan.h:20
 MnScan.h:21
 MnScan.h:22
 MnScan.h:23
 MnScan.h:24
 MnScan.h:25
 MnScan.h:26
 MnScan.h:27
 MnScan.h:28
 MnScan.h:29
 MnScan.h:30
 MnScan.h:31
 MnScan.h:32
 MnScan.h:33
 MnScan.h:34
 MnScan.h:35
 MnScan.h:36
 MnScan.h:37
 MnScan.h:38
 MnScan.h:39
 MnScan.h:40
 MnScan.h:41
 MnScan.h:42
 MnScan.h:43
 MnScan.h:44
 MnScan.h:45
 MnScan.h:46
 MnScan.h:47
 MnScan.h:48
 MnScan.h:49
 MnScan.h:50
 MnScan.h:51
 MnScan.h:52
 MnScan.h:53
 MnScan.h:54
 MnScan.h:55
 MnScan.h:56
 MnScan.h:57
 MnScan.h:58
 MnScan.h:59
 MnScan.h:60
 MnScan.h:61
 MnScan.h:62
 MnScan.h:63
 MnScan.h:64
 MnScan.h:65
 MnScan.h:66
 MnScan.h:67
 MnScan.h:68
 MnScan.h:69
 MnScan.h:70
 MnScan.h:71
 MnScan.h:72
 MnScan.h:73
 MnScan.h:74
 MnScan.h:75