laura is hosted by Hepforge, IPPP Durham
Laura++  v3r3
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 const FitStatus& 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 
138 
140  TMatrixD covMatrix_;
141 
142  ClassDef(LauMinuit,0);
143 };
144 
145 #endif
146 
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
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:224
FitStatus fitStatus_
The status of the fit.
Definition: LauMinuit.hh:137
virtual void updateParameters()
Update the values and errors of the parameters based on the fit minimum.
Definition: LauMinuit.cc:237
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:53
virtual ~LauMinuit()
Destructor.
Definition: LauMinuit.cc:49
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:34
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:140
Struct to store fit status information.
Definition: LauAbsFitter.hh:41
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
virtual const FitStatus & minimise()
Perform the minimisation of the fit function.
Definition: LauMinuit.cc:131
TVirtualFitter * minuit_
The interface to Minuit.
Definition: LauMinuit.hh:116
virtual void fixSecondStageParameters()
Fix parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:211
virtual LauFitObject * getFitObject()
Get the object that controls the calculation of the likelihood.
Definition: LauMinuit.cc:126
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:30