StatedFCN.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _StatedFCN_H_
15 #define _StatedFCN_H_
16 
17 #ifdef _MSC_VER
18 #pragma warning(disable:4275) // non dll 9nterface coming from Minuit's FCNBase
19 #endif
20 
21 // for have minuit
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25 
26 #ifdef HAVE_MINUIT
27 #include "pattern/libhippo.h"
28 #include "Minuit/FCNBase.h"
29 #else
30 
31 #ifdef HAVE_MINUIT2
32 #include "pattern/libhippo.h"
33 #include "Minuit2/FCNBase.h"
34 #else
35 #include "FCNBase.h"
36 #endif
37 
38 #endif
39 
40 #include <string>
41 #include <vector>
42 
43 namespace hippodraw {
44 
45 class DataSource;
46 class FunctionBase;
47 class TupleCut;
48 
67 #ifdef HAVE_MINUIT2
68 class MDL_HIPPOPLOT_API StatedFCN : public ROOT::Minuit2::FCNBase
69 #else
71 #endif
72 
73 {
74 
75 // private:
76 
77 // /** The flags to indicated which parameters are to be held fixed
78 // during minimization of this objective function.
79 
80 // @note The flags are held as int because it is more space and
81 // time efficient for the expected number of parameters.
82 // */
83 // std::vector < int > m_fixed_flags;
84 
85 protected:
86 
91 
96 
100  StatedFCN ();
101 
105  StatedFCN ( const StatedFCN & );
106 
107  public:
108 
111  virtual StatedFCN * clone ( ) const = 0;
112 
117  virtual void copyFrom ( const StatedFCN * other );
118 
122  bool hasFunction () const;
123 
127  void setFunction ( FunctionBase * function );
128 
132  virtual void setDataSource ( const DataSource * source ) = 0;
133 
142  virtual void setDataSource ( const DataSource * source,
143  int dimension,
144  const std::vector < int > & ) = 0;
145 
149  virtual bool setUseErrors ( bool yes = true ) = 0;
150 
153  virtual bool getUseErrors () const = 0;
154 
157  const std::vector < std::string > & getParmNames () const;
158 
161  const std::vector < double > & getParameters () const;
162 
165  void setParameters ( const std::vector < double > & parms );
166 
169  void fillFreeParameters ( std::vector < double > & free_parms ) const;
170 
173  unsigned int getNumberFreeParms () const;
174 
179 // const std::vector < int > & getFixedFlags () const;
180 
184  virtual void setFixedFlags ( const std::vector < int > & flags );
185 
188  virtual void setFreeParameters ( const std::vector < double > & parms );
189 
193  void fillFreeDerivatives ( std::vector < double > &, double x );
194 
198  virtual double operator () ( const std::vector < double > & parms ) const;
199 
206  virtual double objectiveValue () const = 0;
207 
210  virtual int degreesOfFreedom() const = 0;
211 
212  virtual void calcAlphaBeta ( std::vector < std::vector < double > > & alpha,
213  std::vector < double > & beta ) = 0;
214 
219  virtual bool needsIntegrated () const = 0;
220 
223  virtual void setFitCut ( TupleCut * cut ) = 0;
224 
227  virtual void setFitRange ( bool yes = true ) = 0;
228 
233  void setNeedsDerivatives ( bool yes );
234 
241  bool isCompatible ( const FunctionBase * ) const;
242 
245  const std::vector < int > & getFixedFlags() const;
246 
247 };
248 
249 } // namespace hippodraw
250 
251 #endif // _StatedFCN_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
FunctionBase * m_function
The flags to indicated which parameters are to be held fixed during minimization of this object...
Definition: StatedFCN.h:90
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43
return yes
Definition: CanvasView.cxx:883
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
bool m_needs_derivs
Needs derivatives flag.
Definition: StatedFCN.h:95
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
A derived class for FCNBase class.
Definition: StatedFCN.h:70
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen