laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauMinuit.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2013 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
35 #ifndef LAU_MINUIT
36 #define LAU_MINUIT
37 
38 #include <utility>
39 #include <vector>
40 
41 #include "Rtypes.h"
42 #include "TMatrixD.h"
43 
44 #include "LauAbsFitter.hh"
45 
46 class LauParameter;
47 class TVirtualFitter;
48 
49 
50 class LauMinuit : public LauAbsFitter {
51 
52  public:
54  virtual ~LauMinuit();
55 
57 
61  virtual void initialise( LauFitObject* fitObj, const std::vector<LauParameter*>& parameters );
62 
64  virtual LauFitObject* getFitObject();
65 
67  virtual UInt_t nParameters() const { return nParams_; }
68 
70  virtual UInt_t nFreeParameters() const { return nFreeParams_; }
71 
73  virtual Bool_t twoStageFit() const {return twoStageFit_;}
74 
76 
86  virtual void twoStageFit(Bool_t doTwoStageFit) {twoStageFit_ = doTwoStageFit;}
87 
89  virtual Bool_t useAsymmFitErrors() const {return useAsymmFitErrors_;}
90 
92 
95  virtual void useAsymmFitErrors(Bool_t useAsymmErrors) {useAsymmFitErrors_ = useAsymmErrors;}
96 
98 
101  virtual const FitStatus& minimise();
102 
104  virtual void fixSecondStageParameters();
105 
107  virtual void releaseSecondStageParameters();
108 
110  virtual void updateParameters();
111 
113  virtual const TMatrixD& covarianceMatrix() const { return covMatrix_; }
114 
115 
116  private:
118  friend class LauFitter;
119 
121  explicit LauMinuit( Int_t maxPar = 100 );
122 
124  LauMinuit( const LauMinuit& );
125 
127  LauMinuit& operator=( const LauMinuit& rhs );
128 
130  TVirtualFitter* minuit_;
131 
133  const UInt_t maxPar_;
134 
136  std::vector<LauParameter*> params_;
137 
139  UInt_t nParams_;
140 
142  UInt_t nFreeParams_;
143 
145  Bool_t twoStageFit_;
146 
149 
152 
154  TMatrixD covMatrix_;
155 
156  ClassDef(LauMinuit,0);
157 };
158 
159 #endif
160 
UInt_t nParams_
The total number of parameters.
Definition: LauMinuit.hh:139
virtual UInt_t nParameters() const
Get the total number of fit parameters.
Definition: LauMinuit.hh:67
Bool_t twoStageFit_
Option to perform a two stage fit.
Definition: LauMinuit.hh:145
const UInt_t maxPar_
The maximum number of parameters.
Definition: LauMinuit.hh:133
virtual void releaseSecondStageParameters()
Release parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:240
FitStatus fitStatus_
The status of the fit.
Definition: LauMinuit.hh:151
virtual void updateParameters()
Update the values and errors of the parameters based on the fit minimum.
Definition: LauMinuit.cc:253
Factory class for creating and providing access to the fitter.
Definition: LauFitter.hh:43
virtual UInt_t nFreeParameters() const
Get the number of floating fit parameters.
Definition: LauMinuit.hh:70
virtual void initialise(LauFitObject *fitObj, const std::vector< LauParameter * > &parameters)
Initialise the fitter, setting the information on the parameters.
Definition: LauMinuit.cc:69
virtual ~LauMinuit()
Destructor.
Definition: LauMinuit.cc:65
LauMinuit(Int_t maxPar=100)
Constructor.
Definition: LauMinuit.cc:52
File containing declaration of LauAbsFitter class.
The interface to the Minuit fitter.
Definition: LauMinuit.hh:50
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:95
ClassDef(LauMinuit, 0)
virtual void twoStageFit(Bool_t doTwoStageFit)
Turn on or off the two stage fit.
Definition: LauMinuit.hh:86
The abstract interface to the fitter.
Definition: LauAbsFitter.hh:48
virtual Bool_t twoStageFit() const
Determine whether the two-stage fit is enabled.
Definition: LauMinuit.hh:73
TMatrixD covMatrix_
The covariance matrix.
Definition: LauMinuit.hh:154
Struct to store fit status information.
Definition: LauAbsFitter.hh:55
Class for defining the fit parameter objects.
Definition: LauParameter.hh:49
Bool_t useAsymmFitErrors_
Option to use asymmetric errors.
Definition: LauMinuit.hh:148
virtual const TMatrixD & covarianceMatrix() const
Retrieve the fit covariance matrix.
Definition: LauMinuit.hh:113
UInt_t nFreeParams_
The number of free parameters.
Definition: LauMinuit.hh:142
virtual Bool_t useAsymmFitErrors() const
Determine whether calculation of asymmetric errors is enabled.
Definition: LauMinuit.hh:89
virtual const FitStatus & minimise()
Perform the minimisation of the fit function.
Definition: LauMinuit.cc:147
TVirtualFitter * minuit_
The interface to Minuit.
Definition: LauMinuit.hh:130
virtual void fixSecondStageParameters()
Fix parameters marked as &quot;second stage&quot;.
Definition: LauMinuit.cc:227
virtual LauFitObject * getFitObject()
Get the object that controls the calculation of the likelihood.
Definition: LauMinuit.cc:142
std::vector< LauParameter * > params_
The fit parameters.
Definition: LauMinuit.hh:136
The abstract interface for the objects that control the calculation of the likelihood.
Definition: LauFitObject.hh:44