FunctionProjector.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _FunctionProjector_H_
15 #define _FunctionProjector_H_
16 
17 #include "ProjectorBase.h"
18 
19 namespace hippodraw {
20 
21 class BinsFunction;
22 class Fitter;
23 class FunctionBase;
24 class TupleCut;
25 
34 {
35 
36 private:
37 
40  mutable std::vector< std::vector < double > > m_covariance;
41 
44  mutable std::vector< double > m_principleErrors;
45 
47  static std::string s_x_label;
48 
53  std::vector< double > m_save_parms;
54 
56  std::string m_z_label;
57 
62 
65 
71 
73  virtual void addPointReps ();
74 
75 public:
76 
80  FunctionProjector ( FunctionBase * function,
81  ProjectorBase * targetProjector );
82 
85 
88  virtual ~FunctionProjector();
89 
90  virtual ProjectorBase * clone();
91 
93  virtual bool isEmpty () const;
94 
97  double objectiveValue () const;
98 
101  const std::vector < std::vector < double > > & covariance ( ) const;
102 
105  void calcPrincipleErrors() const;
106 
108  const std::vector< double > & principleErrors () const;
109 
114  void setPrincipleErrors ( std::vector < double > ::const_iterator first,
115  std::vector < double > ::const_iterator last );
116 
119  void setFitter ( Fitter * fitter );
120 
123  Fitter * getFitter ( ) const;
124 
126  int degreesOfFreedom () const;
127 
129  FunctionBase * function () const;
130 
132  bool hasSavedParameters () const;
133 
135  void saveParameters ();
136 
139  void restoreParameters ();
140 
143  void initializeFunction ( ProjectorBase * projector );
144 
149  bool fitFunction ( );
150 
151  virtual Range valueRange() const;
152 
153  virtual const std::string & getTitle() const;
154 
155  virtual void setRange( hippodraw::Axes::Type, bool );
156  virtual double getPosOn ( hippodraw::Axes::Type ) const;
157 
161  virtual const std::string & getXLabel() const;
162 
168  virtual const std::string & getYLabel ( bool density = false ) const;
169 
173  int getNumberOfEntries () const;
174 
176  int getUnderflow () const;
177 
179  int getOverflow () const;
180 
181 
182  virtual Range dataRangeOn ( hippodraw::Axes::Type ) const;
183 
185  const std::string & getZLabel() const;
186 
189  virtual DataSource * createNTuple () const;
190 
192  void setParameters( const std::vector<double> &params );
193 
196  virtual void setFitCut ( TupleCut * cut );
197 
200  virtual void setFitRange ( bool yes = true );
201 
202 protected:
203 
206  virtual void fillProjectedValues ( DataSource * ntuple,
207  bool in_range = false ) const;
208 
209 };
210 
211 } // namespace hippodraw
212 
213 #endif // _FunctionProjector_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
ProjectorBase * m_target
The ProjectorBase object containing the data points for the function and fitter.
std::vector< double > m_principleErrors
The principle errors of the errors associated with the parameters of the function.
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43
return yes
Definition: CanvasView.cxx:883
The base class for fitters.
Definition: Fitter.h:33
std::vector< double > m_save_parms
A vector used to save parameters so that they can be restored.
std::vector< std::vector< double > > m_covariance
The error covariance matrix of the errors associated with the parameters of the function.
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
static std::string s_x_label
An X label that might be used.
hippodraw::ProjectorBase class interface.
std::string m_z_label
Dummy member so getZLabel member can return reference.
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
A function that can be added to a DataRep and used in a fitter.
Definition: FunctionBase.h:90
Fitter * m_fitter
A fitter object for the function.
Expresses a range of values.
Definition: Range.h:33
Type
Axes constants.
Definition: AxesType.h:31
A projector that plots one function.
FunctionBase * m_function
The list of function objects to be projected.
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen