MINT2
FitParRef.h
Go to the documentation of this file.
1 #ifndef FIT_PAR_REF_HH
2 #define FIT_PAR_REF_HH
3 
5 #include "Mint/IFitParRegister.h"
6 #include "Mint/FitParameter.h"
7 #include "FitParameter.h"
8 
9 namespace MINT{
10  class IFitParDependent;
11 
12  class FitParRef : virtual public IFitParDependent{
13 
14  double _lastValue;
15 
16  const FitParameter* _fp;
17  const FitParameter& fp() const{return *_fp;}
18  double returnFPVal() const{
19  return (double) fp(); // (_lastValue = (double) fp());}
20  }
21 
22  // not entirely sure a copy constructor even makes sense.
23 
24  public:
25  FitParRef(const FitParameter& fipa, IFitParRegister* daddyPtr=0);
26  FitParRef(const FitParRef& other, IFitParRegister* newDaddyPtr=0);
27 
28 
29  virtual bool changedSinceLastCall() const{
30  return ( ((double) fp()) != _lastValue);
31  }
32 
33  virtual void rememberFitParValues(){
34  _lastValue = (double) fp();
35  }
36 
37  virtual unsigned int size() const{return 1;}
38  virtual const FitParRef& operator[](unsigned int ) const{
39  return *this;}
40 
41  operator double() const{
42  return returnFPVal();
43  }
44 
45  const FitParameter& theFitParameter() const{ return fp();}
46  double lastValue() const{ return _lastValue;}
47 
48  virtual void listFitParDependencies(std::ostream& os=std::cout)const;
49 
50  FitParRef& operator=(const FitParRef& rhs);
51 
52  virtual ~FitParRef(){}
53  };
54 }
55 #endif
56 //
virtual bool changedSinceLastCall() const
Definition: FitParRef.h:29
virtual void rememberFitParValues()
Definition: FitParRef.h:33
FitParRef & operator=(const FitParRef &rhs)
Definition: FitParRef.cpp:34
const FitParameter * _fp
Definition: FitParRef.h:16
virtual ~FitParRef()
Definition: FitParRef.h:52
double lastValue() const
Definition: FitParRef.h:46
double returnFPVal() const
Definition: FitParRef.h:18
double _lastValue
Definition: FitParRef.h:14
virtual void listFitParDependencies(std::ostream &os=std::cout) const
Definition: FitParRef.cpp:56
FitParRef(const FitParameter &fipa, IFitParRegister *daddyPtr=0)
Definition: FitParRef.cpp:7
virtual unsigned int size() const
Definition: FitParRef.h:37
virtual const FitParRef & operator[](unsigned int) const
Definition: FitParRef.h:38
const FitParameter & fp() const
Definition: FitParRef.h:17
const FitParameter & theFitParameter() const
Definition: FitParRef.h:45