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 
42 namespace hippodraw {
43 
44 class DataSource;
45 class FunctionBase;
46 class TupleCut;
47 
66 #ifdef HAVE_MINUIT2
67 class MDL_HIPPOPLOT_API StatedFCN : public ROOT::Minuit2::FCNBase
68 #else
70 #endif
71 
72 {
73 
74 private:
75 
82  std::vector < int > m_fixed_flags;
83 
84 protected:
85 
90 
95 
99  StatedFCN ();
100 
104  StatedFCN ( const StatedFCN & );
105 
106  public:
107 
110  virtual StatedFCN * clone ( ) const = 0;
111 
116  virtual void copyFrom ( const StatedFCN * other );
117 
121  bool hasFunction () const;
122 
126  void setFunction ( FunctionBase * function );
127 
131  virtual void setDataSource ( const DataSource * source ) = 0;
132 
141  virtual void setDataSource ( const DataSource * source,
142  int dimension,
143  const std::vector < int > & ) = 0;
144 
148  virtual bool setUseErrors ( bool yes = true ) = 0;
149 
152  virtual bool getUseErrors () const = 0;
153 
156  const std::vector < std::string > & getParmNames () const;
157 
160  const std::vector < double > & getParameters () const;
161 
164  void setParameters ( const std::vector < double > & parms );
165 
168  void fillFreeParameters ( std::vector < double > & free_parms ) const;
169 
172  unsigned int getNumberFreeParms () const;
173 
178  const std::vector < int > & getFixedFlags () const;
179 
183  virtual void setFixedFlags ( const std::vector < int > & flags );
184 
187  virtual void setFreeParameters ( const std::vector < double > & parms );
188 
192  void fillFreeDerivatives ( std::vector < double > &, double x );
193 
197  virtual double operator () ( const std::vector < double > & parms ) const;
198 
205  virtual double objectiveValue () const = 0;
206 
209  virtual int degreesOfFreedom() const = 0;
210 
211  virtual void calcAlphaBeta ( std::vector < std::vector < double > > & alpha,
212  std::vector < double > & beta ) = 0;
213 
218  virtual bool needsIntegrated () const = 0;
219 
222  virtual void setFitCut ( TupleCut * cut ) = 0;
223 
226  virtual void setFitRange ( bool yes = true ) = 0;
227 
232  void setNeedsDerivatives ( bool yes );
233 
240  bool isCompatible ( const FunctionBase * ) const;
241 
242 };
243 
244 } // namespace hippodraw
245 
246 #endif // _StatedFCN_H_

Generated for HippoDraw Class Library by doxygen