MINT2
FitComplexCart.h
Go to the documentation of this file.
1 #ifndef FIT_COMPLEX_CART_HH
2 #define FIT_COMPLEX_CART_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:17:55 GMT
5 
6 #include <string>
7 #include <iostream>
8 #include <complex>
9 #include <string>
10 
12 #include "Mint/NamedParameter.h"
13 #include "Mint/FitParameter.h"
14 #include "Mint/Phase.h"
15 
16 #include "Mint/FitComplex.h"
17 #include "Mint/IFitParRegister.h"
18 #include "Mint/FitParDependent.h"
19 
20 
21 namespace MINT{
22  class FitComplexCart : public FitComplex{
23  // FitComplexCart(const FitComplexCart& ){};
24  // no copying for now.
25  // dangerous because for each
26  // FitParameter, a pointer
27  // is held in MinuitParametSet.
28  // Anyway, what would the copied parameter
29  // mean?
30  protected:
32 
33  void defaultInit();
34 
35  static double _degFac;
36  static double degFac();
37  public:
38  inline const FitParameter& real() const{return _real;}
39  inline const FitParameter& imag() const{return _imag;}
40 
41  FitParameter& real(){return _real;}
42  FitParameter& imag(){return _imag;}
43 
45 
46  virtual FitParameter& p1(){return _real;}
47  virtual FitParameter& p2(){return _imag;}
48  virtual const FitParameter& p1() const{return _real;}
49  virtual const FitParameter& p2() const{return _imag;}
50 
51  static std::string makeRealName(const std::string& varName);
52  static std::string makeImagName(const std::string& varName);
53 
54  virtual void set(std::complex<double> z);
55 
56  FitComplexCart(const std::string& varName
57  , const char* fname=0
58  , MinuitParameterSet* pset=0
59  , MINT::IFitParRegister* daddy=0
62  );
63  FitComplexCart(const std::string& varName
64  , MinuitParameterSet* pset
65  , MINT::IFitParRegister* daddy=0
68  );
69 
70  virtual ~FitComplexCart();
71 
72  virtual std::complex<double> getVal() const;
73  virtual std::complex<double> getValInit() const;
74  virtual bool gotInitialised()const;
75  virtual void print(std::ostream& os = std::cout) const;
76 
77  virtual operator std::complex<double>() const{
78  return getVal();
79  }
80 
81  virtual bool isZero()const{
82  return (0.0 == real() && 0.0 == imag());
83  }
84 };
85 }//namespace MINT
86 #endif
87 //
static double degFac()
virtual FitParameter & p2()
static std::string makeImagName(const std::string &varName)
static double _degFac
FitComplexCart(const std::string &varName, const char *fname=0, MinuitParameterSet *pset=0, MINT::IFitParRegister *daddy=0, FitParameter::FIX_OR_WHAT fow=FitParameter::FIX, NamedParameterBase::VERBOSITY vb=NamedParameterBase::VERBOSE)
static std::string makeRealName(const std::string &varName)
virtual void print(std::ostream &os=std::cout) const
FitParameter & imag()
const FitParameter & real() const
virtual FitParameter & p1()
FitParameter & real()
virtual const FitParameter & p1() const
virtual std::complex< double > getVal() const
virtual std::complex< double > getValInit() const
virtual bool isZero() const
virtual FitComplex::TYPE type() const
virtual const FitParameter & p2() const
const FitParameter & imag() const
virtual bool gotInitialised() const
virtual void set(std::complex< double > z)