laura is hosted by Hepforge, IPPP Durham
Laura++  v3r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauMinuit.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2013 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
21 #ifndef LAU_MINUIT
22 #define LAU_MINUIT
23 
24 #include <utility>
25 #include <vector>
26 
27 #include "Rtypes.h"
28 #include "TMatrixD.h"
29 
30 #include "LauAbsFitter.hh"
31 
32 class LauParameter;
33 class TVirtualFitter;
34 
35 
36 class LauMinuit : public LauAbsFitter {
37 
38  public:
40  virtual ~LauMinuit();
41 
43 
47  virtual void initialise( LauFitObject* fitObj, const std::vector<LauParameter*>& parameters );
48 
50  virtual LauFitObject* getFitObject();
51 
53  virtual UInt_t nParameters() const { return nParams_; }
54 
56  virtual UInt_t nFreeParameters() const { return nFreeParams_; }
57 
59  virtual Bool_t twoStageFit() const {return twoStageFit_;}
60 
62 
72  virtual void twoStageFit(Bool_t doTwoStageFit) {twoStageFit_ = doTwoStageFit;}
73 
75  virtual Bool_t useAsymmFitErrors() const {return useAsymmFitErrors_;}
76 
78 
81  virtual void useAsymmFitErrors(Bool_t useAsymmErrors) {useAsymmFitErrors_ = useAsymmErrors;}
82 
84 
87  virtual std::pair<Int_t,Double_t> minimise();
88 
90  virtual void fixSecondStageParameters();
91 
93  virtual void releaseSecondStageParameters();
94 
96  virtual void updateParameters();
97 
99  virtual const TMatrixD& covarianceMatrix() const { return covMatrix_; }
100 
101 
102  private:
104  friend class LauFitter;
105 
107  explicit LauMinuit( Int_t maxPar = 100 );
108 
110  LauMinuit( const LauMinuit& );
111 
113  LauMinuit& operator=( const LauMinuit& rhs );
114 
116  TVirtualFitter* minuit_;
117 
119  const UInt_t maxPar_;
120 
122  std::vector<LauParameter*> params_;
123 
125  UInt_t nParams_;
126 
128  UInt_t nFreeParams_;
129 
131  Bool_t twoStageFit_;
132 
135 
137  Int_t fitStatus_;
138 
140  Double_t NLL_;
141 
143  TMatrixD covMatrix_;
144 
145  ClassDef(LauMinuit,0);
146 };
147 
148 #endif
149 
UInt_t nParams_
The total number of parameters.
Definition: LauMinuit.hh:125
virtual UInt_t nParameters() const
Get the total number of fit parameters.
Definition: LauMinuit.hh:53
Bool_t twoStageFit_
Option to perform a two stage fit.
Definition: LauMinuit.hh:131
Double_t NLL_
The negative log-likelihood.
Definition: LauMinuit.hh:140
const UInt_t maxPar_
The maximum number of parameters.
Definition: LauMinuit.hh:119
virtual void releaseSecondStageParameters()
Release parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:228
virtual std::pair< Int_t, Double_t > minimise()
Perform the minimisation of the fit function.
Definition: LauMinuit.cc:132
virtual void updateParameters()
Update the values and errors of the parameters based on the fit minimum.
Definition: LauMinuit.cc:241
Int_t fitStatus_
The status of the fit.
Definition: LauMinuit.hh:137
Factory class for creating and providing access to the fitter.
Definition: LauFitter.hh:29
virtual UInt_t nFreeParameters() const
Get the number of floating fit parameters.
Definition: LauMinuit.hh:56
virtual void initialise(LauFitObject *fitObj, const std::vector< LauParameter * > &parameters)
Initialise the fitter, setting the information on the parameters.
Definition: LauMinuit.cc:54
virtual ~LauMinuit()
Destructor.
Definition: LauMinuit.cc:50
LauMinuit(Int_t maxPar=100)
Constructor.
Definition: LauMinuit.cc:36
File containing declaration of LauAbsFitter class.
The interface to the Minuit fitter.
Definition: LauMinuit.hh:36
LauMinuit & operator=(const LauMinuit &rhs)
Copy assignment operator - private and not implemented.
virtual void useAsymmFitErrors(Bool_t useAsymmErrors)
Turn on or off the computation of asymmetric errors (i.e. the MINOS routine)
Definition: LauMinuit.hh:81
ClassDef(LauMinuit, 0)
virtual void twoStageFit(Bool_t doTwoStageFit)
Turn on or off the two stage fit.
Definition: LauMinuit.hh:72
The abstract interface to the fitter.
Definition: LauAbsFitter.hh:35
virtual Bool_t twoStageFit() const
Determine whether the two-stage fit is enabled.
Definition: LauMinuit.hh:59
TMatrixD covMatrix_
The covariance matrix.
Definition: LauMinuit.hh:143
Class for defining the fit parameter objects.
Definition: LauParameter.hh:35
Bool_t useAsymmFitErrors_
Option to use asymmetric errors.
Definition: LauMinuit.hh:134
virtual const TMatrixD & covarianceMatrix() const
Retrieve the fit covariance matrix.
Definition: LauMinuit.hh:99
UInt_t nFreeParams_
The number of free parameters.
Definition: LauMinuit.hh:128
virtual Bool_t useAsymmFitErrors() const
Determine whether calculation of asymmetric errors is enabled.
Definition: LauMinuit.hh:75
TVirtualFitter * minuit_
The interface to Minuit.
Definition: LauMinuit.hh:116
virtual void fixSecondStageParameters()
Fix parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:215
virtual LauFitObject * getFitObject()
Get the object that controls the calculation of the likelihood.
Definition: LauMinuit.cc:127
std::vector< LauParameter * > params_
The fit parameters.
Definition: LauMinuit.hh:122
The abstract interface for the objects that control the calculation of the likelihood.
Definition: LauFitObject.hh:26