laura is hosted by Hepforge, IPPP Durham
Laura++  v3r4
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauFitter.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2005 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 
29 #include <iostream>
30 
31 #include "LauFitter.hh"
32 #include "LauAbsFitter.hh"
33 #include "LauMinuit.hh"
34 
37 
39 {
40  if ( theInstance_ != 0 ) {
41  std::cerr << "ERROR in LauFitter::setFitterType : The fitter has already been created, cannot change the type now." << std::endl;
42  return;
43  }
44 
45  fitterType_ = type;
46 }
47 
49 {
50  // Returns a pointer to a singleton LauAbsFitter object.
51  // Creates the object the first time it is called.
52 
53  if ( theInstance_ == 0 ) {
54  if ( fitterType_ == Minuit ) {
55  theInstance_ = new LauMinuit();
56  }
57  }
58 
59  return theInstance_;
60 }
61 
static LauAbsFitter * theInstance_
Pointer to the singleton fitter instance.
Definition: LauFitter.hh:77
File containing declaration of LauAbsFitter class.
The interface to the Minuit fitter.
Definition: LauMinuit.hh:50
File containing declaration of LauFitter class.
The abstract interface to the fitter.
Definition: LauAbsFitter.hh:48
static LauAbsFitter * fitter()
Method that provides access to the singleton fitter.
Definition: LauFitter.cc:48
static Type fitterType_
The fitter type.
Definition: LauFitter.hh:80
Type
The types of fitter available.
Definition: LauFitter.hh:47
File containing declaration of LauMinuit class.
static void setFitterType(Type type)
Set the type of the fitter.
Definition: LauFitter.cc:38