laura is hosted by Hepforge, IPPP Durham
Laura++  v2r2p1
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 fixFirstStageParameters();
91 
93  virtual void releaseFirstStageParameters();
94 
96  virtual void fixSecondStageParameters();
97 
99  virtual void releaseSecondStageParameters();
100 
102  virtual void updateParameters();
103 
105  virtual const TMatrixD& covarianceMatrix() const { return covMatrix_; }
106 
107 
108  private:
110  friend class LauFitter;
111 
113  explicit LauMinuit( Int_t maxPar = 100 );
114 
116  LauMinuit( const LauMinuit& );
117 
119  LauMinuit& operator=( const LauMinuit& rhs );
120 
122  TVirtualFitter* minuit_;
123 
125  const UInt_t maxPar_;
126 
128  std::vector<LauParameter*> params_;
129 
131  UInt_t nParams_;
132 
134  UInt_t nFreeParams_;
135 
137  Bool_t twoStageFit_;
138 
141 
143  Int_t fitStatus_;
144 
146  Double_t NLL_;
147 
149  TMatrixD covMatrix_;
150 
151  ClassDef(LauMinuit,0);
152 };
153 
154 #endif
155 
UInt_t nParams_
The total number of parameters.
Definition: LauMinuit.hh:131
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:137
Double_t NLL_
The negative log-likelihood.
Definition: LauMinuit.hh:146
const UInt_t maxPar_
The maximum number of parameters.
Definition: LauMinuit.hh:125
virtual void releaseSecondStageParameters()
Release parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:251
virtual std::pair< Int_t, Double_t > minimise()
Perform the minimisation of the fit function.
Definition: LauMinuit.cc:129
virtual void updateParameters()
Update the values and errors of the parameters based on the fit minimum.
Definition: LauMinuit.cc:264
Int_t fitStatus_
The status of the fit.
Definition: LauMinuit.hh:143
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 releaseFirstStageParameters()
Release parameters marked as &quot;first stage&quot;.
Definition: LauMinuit.cc:225
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:149
Class for defining the fit parameter objects.
Definition: LauParameter.hh:33
Bool_t useAsymmFitErrors_
Option to use asymmetric errors.
Definition: LauMinuit.hh:140
virtual const TMatrixD & covarianceMatrix() const
Retrieve the fit covariance matrix.
Definition: LauMinuit.hh:105
UInt_t nFreeParams_
The number of free parameters.
Definition: LauMinuit.hh:134
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:122
virtual void fixFirstStageParameters()
Fix parameters marked as &quot;first stage&quot;.
Definition: LauMinuit.cc:212
virtual void fixSecondStageParameters()
Fix parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:238
virtual LauFitObject * getFitObject()
Get the object that controls the calculation of the likelihood.
Definition: LauMinuit.cc:124
std::vector< LauParameter * > params_
The fit parameters.
Definition: LauMinuit.hh:128
The abstract interface for the objects that control the calculation of the likelihood.
Definition: LauFitObject.hh:26