MINT2
FitComplexPolar.h
Go to the documentation of this file.
1 #ifndef FIT_COMPLEX_POLAR_HH
2 #define FIT_COMPLEX_POLAR_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/FitParDependent.h"
18 #include "Mint/IFitParRegister.h"
19 
20 namespace MINT{
21 
22  class FitComplexPolar : public FitComplex{
23  // FitComplexPolar(const FitComplexPolar& ){};
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:
33 
34  void defaultInit();
35 
36  static double _degFac;
37  static void calculateDegFac();
38  public:
39  inline const FitParameter& amp() const{return _amp;}
40  inline const FitParameter& phase() const{return _phase;}
41 
42  FitParameter& amp(){return _amp;}
44  static double degFac(){
45  if(_degFac < 0) calculateDegFac();
46  return _degFac;
47  }
48 
49  virtual FitComplex::TYPE type()const{return FitComplex::POLAR;}
50 
51  virtual FitParameter& p1(){return _amp;}
52  virtual FitParameter& p2(){return _phase;}
53  virtual const FitParameter& p1() const{return _amp;}
54  virtual const FitParameter& p2() const{return _phase;}
55 
56  static std::string makeAmpName(const std::string& varName);
57  static std::string makePhaseName(const std::string& varName);
58 
59  virtual void set(std::complex<double> z);
60 
61  FitComplexPolar(const std::string& varName
62  , const char* fname=0
63  , MinuitParameterSet* pset=0
64  , MINT::IFitParRegister* daddy=0
67  );
68  FitComplexPolar(const std::string& varName
69  , MinuitParameterSet* pset
70  , MINT::IFitParRegister* daddy=0
73  );
74  virtual ~FitComplexPolar();
75 
76  virtual std::complex<double> getVal() const;
77  virtual std::complex<double> getValInit() const;
78  virtual void print(std::ostream& os = std::cout) const;
79  virtual bool gotInitialised() const;
80 
81  virtual operator std::complex<double>() const{
82  return getVal();
83  }
84 
85  virtual bool isZero()const{
86  return (0.0 == amp());
87  }
88 
89 };
90 }//namespace MINT
91 #endif
92 //
virtual void set(std::complex< double > z)
virtual const FitParameter & p1() const
const FitParameter & phase() const
FitParameter & phase()
FitParameter & amp()
FitComplexPolar(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 void calculateDegFac()
virtual FitParameter & p2()
static std::string makeAmpName(const std::string &varName)
const FitParameter & amp() const
virtual void print(std::ostream &os=std::cout) const
virtual FitComplex::TYPE type() const
virtual FitParameter & p1()
virtual bool isZero() const
virtual std::complex< double > getValInit() const
static double degFac()
virtual std::complex< double > getVal() const
virtual bool gotInitialised() const
virtual const FitParameter & p2() const
static std::string makePhaseName(const std::string &varName)