MINT2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
MINT::FitComplexPolar Class Reference

#include <FitComplexPolar.h>

Inheritance diagram for MINT::FitComplexPolar:
MINT::FitComplex MINT::IReturnComplex MINT::FitParDependent MINT::IFitParRegister MINT::PolymorphVector< FitParRef > MINT::IFitParDependent

Public Member Functions

const FitParameteramp () const
 
const FitParameterphase () const
 
FitParameteramp ()
 
FitParameterphase ()
 
virtual FitComplex::TYPE type () const
 
virtual FitParameterp1 ()
 
virtual FitParameterp2 ()
 
virtual const FitParameterp1 () const
 
virtual const FitParameterp2 () const
 
virtual void set (std::complex< double > z)
 
 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)
 
 FitComplexPolar (const std::string &varName, MinuitParameterSet *pset, MINT::IFitParRegister *daddy=0, FitParameter::FIX_OR_WHAT fow=FitParameter::FIX, NamedParameterBase::VERBOSITY vb=NamedParameterBase::VERBOSE)
 
virtual ~FitComplexPolar ()
 
virtual std::complex< double > getVal () const
 
virtual std::complex< double > getValInit () const
 
virtual void print (std::ostream &os=std::cout) const
 
virtual bool gotInitialised () const
 
virtual operator std::complex< double > () const
 
virtual bool isZero () const
 
- Public Member Functions inherited from MINT::FitComplex
bool gotInitialised () const
 
double getReal () const
 
double getImag () const
 
double getAmp () const
 
double getPhase () const
 
bool isConstant () const
 
virtual std::complex< double > ComplexVal ()
 
 FitComplex (IFitParRegister *daddy=0)
 
virtual ~FitComplex ()
 
void setParameterSet (MinuitParameterSet *pset)
 
std::complex< double > operator- () const
 
- Public Member Functions inherited from MINT::IReturnComplex
virtual ~IReturnComplex ()
 
- Public Member Functions inherited from MINT::FitParDependent
virtual unsigned int size () const
 
virtual const FitParRefoperator[] (unsigned int i) const
 
virtual FitParRefoperator[] (unsigned int i)
 
virtual bool changedSinceLastCall () const
 
virtual void rememberFitParValues ()
 
virtual bool registerFitParDependence (const IFitParDependent &fpd)
 
bool registerFitParDependence (const FitParRef &fpr)
 
void removeAllFitParDependencies ()
 
 FitParDependent (IFitParRegister *daddy=0)
 
 FitParDependent (const FitParDependent &other, IFitParRegister *newDaddy=0)
 
void listFitParDependencies (std::ostream &os=std::cout) const
 
- Public Member Functions inherited from MINT::PolymorphVector< FitParRef >
 PolymorphVector ()
 
 PolymorphVector (unsigned int N)
 
 PolymorphVector (unsigned int N, const FitParRef &c)
 
 PolymorphVector (const PolymorphVector &other)
 
 PolymorphVector (const typename std::vector< FitParRef > &other)
 
virtual ~PolymorphVector ()
 
std::vector< FitParRef > & theVector ()
 
const std::vector< FitParRef > & theVector () const
 
FitParRefoperator[] (unsigned int i)
 
const FitParRefoperator[] (unsigned int i) const
 
FitParRefat (unsigned int i)
 
const FitParRefat (unsigned int i) const
 
std::vector< FitParRef >::iterator begin ()
 
std::vector< FitParRef >::const_iterator begin () const
 
std::vector< FitParRef >::iterator end ()
 
std::vector< FitParRef >::const_iterator end () const
 
std::vector< FitParRef >::iterator find (const FitParRef &c)
 
std::vector< FitParRef >::const_iterator find (const FitParRef &c) const
 
FitParReffront ()
 
const FitParReffront () const
 
FitParRefback ()
 
const FitParRefback () const
 
unsigned int size () const
 
bool empty () const
 
void push_back (const FitParRef &c)
 
void pop_back ()
 
void erase (typename std::vector< FitParRef >::iterator pos)
 
void erase (typename std::vector< FitParRef >::iterator first, typename std::vector< FitParRef >::iterator last)
 
PolymorphVector< FitParRef > & operator= (const PolymorphVector< FitParRef > &other)
 
void clear ()
 
void resize (unsigned int N)
 
void resize (unsigned int N, const FitParRef &c)
 
 operator const typename std::vector< FitParRef > & () const
 
 operator typename std::vector< FitParRef > & ()
 
bool operator== (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator!= (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator< (const MINT::PolymorphVector< FitParRef > &v2) const
 
bool operator> (const MINT::PolymorphVector< FitParRef > &v2) const
 

Static Public Member Functions

static double degFac ()
 
static std::string makeAmpName (const std::string &varName)
 
static std::string makePhaseName (const std::string &varName)
 

Protected Member Functions

void defaultInit ()
 
- Protected Member Functions inherited from MINT::IReturnComplex
 IReturnComplex ()
 

Static Protected Member Functions

static void calculateDegFac ()
 

Protected Attributes

FitParameter _amp
 
FitParameter _phase
 
- Protected Attributes inherited from MINT::PolymorphVector< FitParRef >
std::vector< FitParRef_vec
 

Static Protected Attributes

static double _degFac = -9999
 

Additional Inherited Members

- Public Types inherited from MINT::FitComplex
enum  TYPE { POLAR =0, CARTESIAN =1, UNDEFINED =2 }
 

Detailed Description

Definition at line 22 of file FitComplexPolar.h.

Constructor & Destructor Documentation

◆ FitComplexPolar() [1/2]

FitComplexPolar::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 
)

Definition at line 41 of file FitComplexPolar.cpp.

49  : FitComplex(daddy)
50  , _amp (makeAmpName( varName), fname, pset, fow, vb)
51  , _phase(makePhaseName(varName), fname, pset, fow, vb)
52 {
53  //cout << "FitComplexPolar, just made: " << _amp
54  // << " and " << _phase << endl;
55 }
static std::string makeAmpName(const std::string &varName)
static std::string makePhaseName(const std::string &varName)
FitComplex(IFitParRegister *daddy=0)
Definition: FitComplex.cpp:66

◆ FitComplexPolar() [2/2]

FitComplexPolar::FitComplexPolar ( const std::string &  varName,
MinuitParameterSet pset,
MINT::IFitParRegister daddy = 0,
FitParameter::FIX_OR_WHAT  fow = FitParameter::FIX,
NamedParameterBase::VERBOSITY  vb = NamedParameterBase::VERBOSE 
)

Definition at line 56 of file FitComplexPolar.cpp.

62  : FitComplex(daddy)
63  , _amp (makeAmpName( varName), pset, fow, vb)
64  , _phase(makePhaseName(varName), pset, fow, vb)
65 {
66 }
static std::string makeAmpName(const std::string &varName)
static std::string makePhaseName(const std::string &varName)
FitComplex(IFitParRegister *daddy=0)
Definition: FitComplex.cpp:66

◆ ~FitComplexPolar()

FitComplexPolar::~FitComplexPolar ( )
virtual

Definition at line 68 of file FitComplexPolar.cpp.

68  {
69 }

Member Function Documentation

◆ amp() [1/2]

const FitParameter& MINT::FitComplexPolar::amp ( ) const
inline

Definition at line 39 of file FitComplexPolar.h.

39 {return _amp;}

◆ amp() [2/2]

FitParameter& MINT::FitComplexPolar::amp ( )
inline

Definition at line 42 of file FitComplexPolar.h.

42 {return _amp;}

◆ calculateDegFac()

void FitComplexPolar::calculateDegFac ( )
staticprotected

Definition at line 16 of file FitComplexPolar.cpp.

16  {
17  NamedParameter<std::string> phaseOpt("Phases given in"
18  , (std::string) "degrees");
19  if(phaseOpt.getVal() == (std::string) "degrees"){
20  _degFac = pi/180.0;
21  }else if(phaseOpt.getVal() == (std::string) "rad"){
22  _degFac = 1.0;
23  }else{
24  cout << " ERROR in FitComplexPolar::calculateDegFac()"
25  << " Unknown option " << phaseOpt
26  << " Allowed values are are: \"degrees\" and \"rad\"."
27  << " Assuming you mean rad."
28  << endl;
29  _degFac=1.0;
30  }
31  return;
32 }
static const double pi

◆ defaultInit()

void FitComplexPolar::defaultInit ( )
protected

Definition at line 104 of file FitComplexPolar.cpp.

104  {
105  amp().defaultInit();
106  phase().defaultInit();
107 }
const FitParameter & phase() const
const FitParameter & amp() const

◆ degFac()

static double MINT::FitComplexPolar::degFac ( )
inlinestatic

Definition at line 44 of file FitComplexPolar.h.

44  {
45  if(_degFac < 0) calculateDegFac();
46  return _degFac;
47  }
static void calculateDegFac()

◆ getVal()

std::complex< double > FitComplexPolar::getVal ( ) const
virtual

Implements MINT::FitComplex.

Definition at line 82 of file FitComplexPolar.cpp.

82  {
83  double a(amp());
84  if(0.0 == a) return 0;
85  double p(phase());
86  p*=degFac();
87  return std::complex<double>(a*cos(p), a*sin(p));
88  /*
89  double a(amp());
90  if(0.0 == a) return 0;
91  double p(phase());
92  p*=degFac();
93  return std::polar(a,p);
94  */
95 }
const FitParameter & phase() const
const FitParameter & amp() const
static double degFac()

◆ getValInit()

std::complex< double > FitComplexPolar::getValInit ( ) const
virtual

Implements MINT::FitComplex.

Definition at line 96 of file FitComplexPolar.cpp.

96  {
97  double a=amp().meanInit();
98  double p = phase().meanInit() * degFac();
99 
100  return std::complex<double>(a*cos(p), a*sin(p));
101  // return std::polar( amp().meanInit(), phase().meanInit() * degFac());
102 }
const FitParameter & phase() const
double meanInit() const
const FitParameter & amp() const
static double degFac()

◆ gotInitialised()

bool FitComplexPolar::gotInitialised ( ) const
virtual

Definition at line 70 of file FitComplexPolar.cpp.

70  {
71  return amp().gotInitialised() && phase().gotInitialised();
72 }
const FitParameter & phase() const
const FitParameter & amp() const

◆ isZero()

virtual bool MINT::FitComplexPolar::isZero ( ) const
inlinevirtual

Reimplemented from MINT::FitComplex.

Definition at line 85 of file FitComplexPolar.h.

85  {
86  return (0.0 == amp());
87  }
const FitParameter & amp() const

◆ makeAmpName()

std::string FitComplexPolar::makeAmpName ( const std::string &  varName)
static

Definition at line 34 of file FitComplexPolar.cpp.

34  {
35  return varName + "_Amp";
36 }

◆ makePhaseName()

std::string FitComplexPolar::makePhaseName ( const std::string &  varName)
static

Definition at line 37 of file FitComplexPolar.cpp.

37  {
38  return varName + "_Phase";
39 }

◆ operator std::complex< double >()

virtual MINT::FitComplexPolar::operator std::complex< double > ( ) const
inlinevirtual

Reimplemented from MINT::FitComplex.

Definition at line 81 of file FitComplexPolar.h.

81  {
82  return getVal();
83  }
virtual std::complex< double > getVal() const

◆ p1() [1/2]

virtual FitParameter& MINT::FitComplexPolar::p1 ( )
inlinevirtual

Implements MINT::FitComplex.

Definition at line 51 of file FitComplexPolar.h.

51 {return _amp;}

◆ p1() [2/2]

virtual const FitParameter& MINT::FitComplexPolar::p1 ( ) const
inlinevirtual

Implements MINT::FitComplex.

Definition at line 53 of file FitComplexPolar.h.

53 {return _amp;}

◆ p2() [1/2]

virtual FitParameter& MINT::FitComplexPolar::p2 ( )
inlinevirtual

Implements MINT::FitComplex.

Definition at line 52 of file FitComplexPolar.h.

52 {return _phase;}

◆ p2() [2/2]

virtual const FitParameter& MINT::FitComplexPolar::p2 ( ) const
inlinevirtual

Implements MINT::FitComplex.

Definition at line 54 of file FitComplexPolar.h.

54 {return _phase;}

◆ phase() [1/2]

const FitParameter& MINT::FitComplexPolar::phase ( ) const
inline

Definition at line 40 of file FitComplexPolar.h.

40 {return _phase;}

◆ phase() [2/2]

FitParameter& MINT::FitComplexPolar::phase ( )
inline

Definition at line 43 of file FitComplexPolar.h.

43 {return _phase;}

◆ print()

void FitComplexPolar::print ( std::ostream &  os = std::cout) const
virtual

Reimplemented from MINT::FitComplex.

Definition at line 114 of file FitComplexPolar.cpp.

114  {
115  os << amp() << "\n"
116  << phase();
117 }
const FitParameter & phase() const
const FitParameter & amp() const

◆ set()

void FitComplexPolar::set ( std::complex< double >  z)
virtual

Implements MINT::FitComplex.

Definition at line 109 of file FitComplexPolar.cpp.

109  {
110  _amp = abs(z);
111  _phase = arg(z);
112 }

◆ type()

virtual FitComplex::TYPE MINT::FitComplexPolar::type ( ) const
inlinevirtual

Implements MINT::FitComplex.

Definition at line 49 of file FitComplexPolar.h.

Member Data Documentation

◆ _amp

FitParameter MINT::FitComplexPolar::_amp
protected

Definition at line 31 of file FitComplexPolar.h.

◆ _degFac

double FitComplexPolar::_degFac = -9999
staticprotected

Definition at line 36 of file FitComplexPolar.h.

◆ _phase

FitParameter MINT::FitComplexPolar::_phase
protected

Definition at line 32 of file FitComplexPolar.h.


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