ROOT  6.06/09
Reference Guide
GaussFcn.h
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #ifndef MN_GaussFcn_H_
11 #define MN_GaussFcn_H_
12 
13 #include "Minuit2/FCNBase.h"
14 
15 #include <vector>
16 
17 namespace ROOT {
18 
19  namespace Minuit2 {
20 
21 
22 class GaussFcn : public FCNBase {
23 
24 public:
25 
26  GaussFcn(const std::vector<double>& meas,
27  const std::vector<double>& pos,
28  const std::vector<double>& mvar) : fMeasurements(meas),
29  fPositions(pos),
30  fMVariances(mvar),
31  fErrorDef(1.) {}
32 
33  ~GaussFcn() {}
34 
35  virtual double Up() const {return fErrorDef;}
36  virtual double operator()(const std::vector<double>&) const;
37 
38  std::vector<double> Measurements() const {return fMeasurements;}
39  std::vector<double> Positions() const {return fPositions;}
40  std::vector<double> Variances() const {return fMVariances;}
41 
42  void SetErrorDef(double def) {fErrorDef = def;}
43 
44 private:
45 
46 
47  std::vector<double> fMeasurements;
48  std::vector<double> fPositions;
49  std::vector<double> fMVariances;
50  double fErrorDef;
51 };
52 
53  } // namespace Minuit2
54 
55 } // namespace ROOT
56 
57 #endif //MN_GaussFcn_H_
virtual double operator()(const std::vector< double > &) const
The meaning of the vector of parameters is of course defined by the user, who uses the values of thos...
Definition: GaussFcn.cxx:20
virtual double Up() const
Error definition of the function.
Definition: GaussFcn.h:35
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
std::vector< double > fMeasurements
Definition: GaussFcn.h:47
std::vector< double > fMVariances
Definition: GaussFcn.h:49
std::vector< double > Positions() const
Definition: GaussFcn.h:39
Interface (abstract class) defining the function to be minimized, which has to be implemented by the ...
Definition: FCNBase.h:47
GaussFcn(const std::vector< double > &meas, const std::vector< double > &pos, const std::vector< double > &mvar)
Definition: GaussFcn.h:26
std::vector< double > fPositions
Definition: GaussFcn.h:48
void SetErrorDef(double def)
add interface to set dynamically a new error definition Re-implement this function if needed...
Definition: GaussFcn.h:42
std::vector< double > Measurements() const
Definition: GaussFcn.h:38
std::vector< double > Variances() const
Definition: GaussFcn.h:40