MINT2
FitComplexCart.cpp
Go to the documentation of this file.
1 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
2 // status: Mon 9 Feb 2009 19:17:55 GMT
3 #include <cmath>
4 #include <string>
5 
7 
8 #include "Mint/FitComplexCart.h"
9 #include "Mint/IFitParRegister.h"
10 
11 
12 using namespace std;
13 using namespace MINT;
14 
15 std::string FitComplexCart::makeRealName(const std::string& varName){
16  return varName + "_Re";
17 }
18 std::string FitComplexCart::makeImagName(const std::string& varName){
19  return varName + "_Im";
20 }
21 
22 FitComplexCart::FitComplexCart(const std::string& varName
23  , const char* fname
24  , MinuitParameterSet* pset
25  , MINT::IFitParRegister* daddy
28  )
29  : FitComplex(daddy)
30  , _real(makeRealName(varName), fname, pset, fow, vb)
31  , _imag(makeImagName(varName), fname, pset, fow, vb)
32 {
33  // cout << "pset pointer in FitComplexCart " << pset << endl;
34 }
35 FitComplexCart::FitComplexCart(const std::string& varName
36  , MinuitParameterSet* pset
37  , MINT::IFitParRegister* daddy
40  )
41  : FitComplex(daddy)
42  , _real(makeRealName(varName), pset, fow, vb)
43  , _imag(makeImagName(varName), pset, fow, vb)
44 {
45 }
46 
48 }
49 /*
50 FitComplexCart::FitComplexCart(const FitComplexCart& other){
51  : _real(makeRealName(varName), fname, pset)
52  , _imag(makeImagName(varName), fname, pset)
53 {
54 }
55 */
56 
57 std::complex<double> FitComplexCart::getVal()const{
58  return complex<double>((double)real(), (double) imag() );
59 }
60 std::complex<double> FitComplexCart::getValInit()const{
61  return complex<double>( real().meanInit(), imag().meanInit());
62 }
63 
65  return real().gotInitialised() && imag().gotInitialised();
66 }
67 
69  real().defaultInit();
70  imag().defaultInit();
71 }
72 void FitComplexCart::print(std::ostream& os) const{
73  os << real() << "\n"
74  << imag();
75 }
76 
77 void FitComplexCart::set(std::complex<double> z){
78  _real = z.real();
79  _imag = z.imag();
80 }
81 
82 
83 //
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)
virtual void print(std::ostream &os=std::cout) const
const FitParameter & real() const
virtual std::complex< double > getVal() const
virtual std::complex< double > getValInit() const
const FitParameter & imag() const
virtual bool gotInitialised() const
virtual void set(std::complex< double > z)