Logo ROOT  
Reference Guide
FumiliStandardMaximumLikelihoodFCN.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 ROOT_Minuit2_FumiliStandardMaximumLikelihoodFCN
11#define ROOT_Minuit2_FumiliStandardMaximumLikelihoodFCN
12
13
16#include <vector>
17
18namespace ROOT {
19
20 namespace Minuit2 {
21
22
23
24
25/**
26
27Class implementing the Elements member function for the standard
28maximum likelihood method.
29
30@author Andras Zsenei and Lorenzo Moneta, Creation date: 4 Sep 2004
31
32@see FumiliMaximumLikelihoodFCN
33
34@ingroup Minuit
35
36*/
37
39
40public:
41
42
43 /**
44
45 Constructor which initializes the measurement points for the one dimensional model function.
46
47 @param modelFCN the model function used for describing the data.
48
49 @param pos vector containing the x values corresponding to the
50 measurements
51
52 */
53
55 const std::vector<double>& pos)
56 {
57 this->SetModelFunction(modelFCN);
58 unsigned int n = pos.size();
59 fPositions.reserve( n );
60 std::vector<double> x(1);
61 for (unsigned int i = 0; i < n; ++i) {
62 x[0] = pos[i];
63 fPositions.push_back(x);
64 }
65 }
66
67
68
69 /**
70
71 Constructor which initializes the measurement points for the multi dimensional model function.
72
73 @param modelFCN the model function used for describing the data.
74
75 @param pos vector containing the x values corresponding to the
76 measurements
77
78 */
79
81 const std::vector<std::vector<double> >& pos) {
82 this->SetModelFunction(modelFCN);
83 fPositions = pos;
84
85 }
86
87
88
89
91
92
93
94
95 /**
96
97 Evaluates the model function for the different measurement points and
98 the Parameter values supplied.
99
100 @param par vector of Parameter values to feed to the model function.
101
102 @return A vector containing the model function evaluated
103 for each measurement point.
104
105 */
106
107 std::vector<double> Elements(const std::vector<double>& par) const;
108
109
110
111
112 /**
113
114 Accessor to the position of the measurement (x coordinate).
115
116 @param Index Index of the measuerement the position of which to return.
117
118 @return the position of the measurement.
119
120 */
121
122 virtual const std::vector<double> & GetMeasurement(int Index) const;
123
124
125 /**
126
127 Accessor to the number of measurements used for calculating
128 the maximum likelihood.
129
130 @return the number of measurements.
131
132 */
133
134 virtual int GetNumberOfMeasurements() const;
135
136 /**
137
138 Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p
139 The resul is cached inside and is return from the FumiliFCNBase::Value , FumiliFCNBase::Gradient and
140 FumiliFCNBase::Hessian methods
141
142 @param par vector of parameters
143
144 **/
145
146 virtual void EvaluateAll( const std::vector<double> & par );
147
148
149 private:
150
151 std::vector<std::vector<double> > fPositions;
152};
153
154 } // namespace Minuit2
155
156} // namespace ROOT
157
158#endif // ROOT_Minuit2_FumiliStandardMaximumLikelihoodFCN
Extension of the FCNBase for the Fumili method.
void SetModelFunction(const ParametricFunction &modelFCN)
Sets the model function for the data (for example gaussian+linear for a peak)
Class implementing the Elements member function for the standard maximum likelihood method.
virtual int GetNumberOfMeasurements() const
Accessor to the number of measurements used for calculating the maximum likelihood.
std::vector< double > Elements(const std::vector< double > &par) const
Evaluates the model function for the different measurement points and the Parameter values supplied.
virtual void EvaluateAll(const std::vector< double > &par)
Evaluate function Value, Gradient and Hessian using Fumili approximation, for values of parameters p ...
virtual const std::vector< double > & GetMeasurement(int Index) const
Accessor to the position of the measurement (x coordinate).
FumiliStandardMaximumLikelihoodFCN(const ParametricFunction &modelFCN, const std::vector< std::vector< double > > &pos)
Constructor which initializes the measurement points for the multi dimensional model function.
FumiliStandardMaximumLikelihoodFCN(const ParametricFunction &modelFCN, const std::vector< double > &pos)
Constructor which initializes the measurement points for the one dimensional model function.
Function which has parameters.
RooCmdArg Index(RooCategory &icat)
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: StringConv.hxx:21