MINT2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MINT::FitParRef Class Reference

#include <FitParRef.h>

Inheritance diagram for MINT::FitParRef:
MINT::IFitParDependent

Public Member Functions

 FitParRef (const FitParameter &fipa, IFitParRegister *daddyPtr=0)
 
 FitParRef (const FitParRef &other, IFitParRegister *newDaddyPtr=0)
 
virtual bool changedSinceLastCall () const
 
virtual void rememberFitParValues ()
 
virtual unsigned int size () const
 
virtual const FitParRefoperator[] (unsigned int) const
 
 operator double () const
 
const FitParametertheFitParameter () const
 
double lastValue () const
 
virtual void listFitParDependencies (std::ostream &os=std::cout) const
 
FitParRefoperator= (const FitParRef &rhs)
 
virtual ~FitParRef ()
 

Private Member Functions

const FitParameterfp () const
 
double returnFPVal () const
 

Private Attributes

double _lastValue
 
const FitParameter_fp
 

Detailed Description

Definition at line 12 of file FitParRef.h.

Constructor & Destructor Documentation

◆ FitParRef() [1/2]

FitParRef::FitParRef ( const FitParameter fipa,
IFitParRegister daddyPtr = 0 
)

Definition at line 7 of file FitParRef.cpp.

8  : _lastValue( (-9999. != ((double) fipa) ? -9999.0 : -9998.0 ))
9  , _fp(&fipa){
10  /*
11  cout << "hello from FitParRef::FitParRef with..." << endl;
12  cout << "_lastValue = " << _lastValue << endl;
13  cout << "_fp " << _fp << endl;
14  cout << "daddyPtr = " << daddyPtr << endl;
15  */
16  if(0 != daddyPtr) daddyPtr->registerFitParDependence(*this);
17 }
const FitParameter * _fp
Definition: FitParRef.h:16
double _lastValue
Definition: FitParRef.h:14
virtual bool registerFitParDependence(const IFitParDependent &fpd)=0

◆ FitParRef() [2/2]

FitParRef::FitParRef ( const FitParRef other,
IFitParRegister newDaddyPtr = 0 
)

Definition at line 19 of file FitParRef.cpp.

20  : _lastValue( (-9999. != ((double) other) ? -9999.0 : -9998.0 ))
21 // : _lastValue(other._lastValue)
22  , _fp(other._fp){
23  /*
24  cout << "hello from FitParRef::FitParRef with..." << endl;
25  cout << "_lastValue = " << _lastValue << endl;
26  cout << "_fp " << _fp << endl;
27  cout << "daddyPtr = " << daddyPtr << endl;
28  */
29  //cout << "FitParRef copy constructor called" << endl;
30  if(0 != newDaddyPtr) newDaddyPtr->registerFitParDependence(*this);
31 }
const FitParameter * _fp
Definition: FitParRef.h:16
double _lastValue
Definition: FitParRef.h:14
virtual bool registerFitParDependence(const IFitParDependent &fpd)=0

◆ ~FitParRef()

virtual MINT::FitParRef::~FitParRef ( )
inlinevirtual

Definition at line 52 of file FitParRef.h.

52 {}

Member Function Documentation

◆ changedSinceLastCall()

virtual bool MINT::FitParRef::changedSinceLastCall ( ) const
inlinevirtual

Implements MINT::IFitParDependent.

Definition at line 29 of file FitParRef.h.

29  {
30  return ( ((double) fp()) != _lastValue);
31  }
double _lastValue
Definition: FitParRef.h:14
const FitParameter & fp() const
Definition: FitParRef.h:17

◆ fp()

const FitParameter& MINT::FitParRef::fp ( ) const
inlineprivate

Definition at line 17 of file FitParRef.h.

17 {return *_fp;}
const FitParameter * _fp
Definition: FitParRef.h:16

◆ lastValue()

double MINT::FitParRef::lastValue ( ) const
inline

Definition at line 46 of file FitParRef.h.

46 { return _lastValue;}
double _lastValue
Definition: FitParRef.h:14

◆ listFitParDependencies()

void FitParRef::listFitParDependencies ( std::ostream &  os = std::cout) const
virtual

Implements MINT::IFitParDependent.

Definition at line 56 of file FitParRef.cpp.

56  {
57  bool ch = changedSinceLastCall();
58  os << fp() << ", prev: " << _lastValue << (ch ? "changed" : "") << endl;
59 }
virtual bool changedSinceLastCall() const
Definition: FitParRef.h:29
double _lastValue
Definition: FitParRef.h:14
const FitParameter & fp() const
Definition: FitParRef.h:17

◆ operator double()

MINT::FitParRef::operator double ( ) const
inline

Definition at line 41 of file FitParRef.h.

41  {
42  return returnFPVal();
43  }
double returnFPVal() const
Definition: FitParRef.h:18

◆ operator=()

FitParRef & FitParRef::operator= ( const FitParRef rhs)

Definition at line 34 of file FitParRef.cpp.

34  {
35  // we seem to need the assignment operator for
36  // compatibility with some implementations of
37  // std::vector. Annoying. Forces us to use ptr
38  // instead of refererence for FitParameter.
39  _fp = rhs._fp;
40  _lastValue = -9999;
41  if( -9999 == (double) fp()) _lastValue=-9998;
42  return *this;
43 }
const FitParameter * _fp
Definition: FitParRef.h:16
double _lastValue
Definition: FitParRef.h:14
const FitParameter & fp() const
Definition: FitParRef.h:17

◆ operator[]()

virtual const FitParRef& MINT::FitParRef::operator[] ( unsigned int  ) const
inlinevirtual

Implements MINT::IFitParDependent.

Definition at line 38 of file FitParRef.h.

38  {
39  return *this;}

◆ rememberFitParValues()

virtual void MINT::FitParRef::rememberFitParValues ( )
inlinevirtual

Implements MINT::IFitParDependent.

Definition at line 33 of file FitParRef.h.

33  {
34  _lastValue = (double) fp();
35  }
double _lastValue
Definition: FitParRef.h:14
const FitParameter & fp() const
Definition: FitParRef.h:17

◆ returnFPVal()

double MINT::FitParRef::returnFPVal ( ) const
inlineprivate

Definition at line 18 of file FitParRef.h.

18  {
19  return (double) fp(); // (_lastValue = (double) fp());}
20  }
const FitParameter & fp() const
Definition: FitParRef.h:17

◆ size()

virtual unsigned int MINT::FitParRef::size ( ) const
inlinevirtual

Implements MINT::IFitParDependent.

Definition at line 37 of file FitParRef.h.

37 {return 1;}

◆ theFitParameter()

const FitParameter& MINT::FitParRef::theFitParameter ( ) const
inline

Definition at line 45 of file FitParRef.h.

45 { return fp();}
const FitParameter & fp() const
Definition: FitParRef.h:17

Member Data Documentation

◆ _fp

const FitParameter* MINT::FitParRef::_fp
private

Definition at line 16 of file FitParRef.h.

◆ _lastValue

double MINT::FitParRef::_lastValue
private

Definition at line 14 of file FitParRef.h.


The documentation for this class was generated from the following files: