00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TrkBase/TrkFitStatus.h"
00017
00018 #include <iostream>
00019 #include <iterator>
00020 using std::endl;
00021 using std::ostream;
00022
00023 TrkFitStatus::TrkFitStatus() :
00024 _fitValid(false),
00025 _fitCurrent(false),
00026 _is2d(false),
00027 _multScat(false)
00028 {}
00029
00030 TrkFitStatus::~TrkFitStatus()
00031 {
00032 }
00033
00034
00035 TrkFitStatus::TrkFitStatus(const TrkFitStatus& right) :
00036 _history(right._history),
00037 _fitValid(right._fitValid),
00038 _fitCurrent(right._fitCurrent),
00039 _is2d(right._is2d),
00040 _multScat(right._multScat)
00041 {}
00042
00043 TrkFitStatus&
00044 TrkFitStatus::operator= (const TrkFitStatus& right)
00045 {
00046 if(&right != this){
00047 _is2d = right._is2d;
00048 _multScat = right._multScat;
00049 _fitValid = right._fitValid;
00050 _fitCurrent = right._fitCurrent;
00051 _history = right._history;
00052 }
00053 return *this;
00054 }
00055
00056 void
00057 TrkFitStatus::setValid(bool v)
00058 {
00059 _fitValid = v;
00060 if (!v) setCurrent(false);
00061 }
00062
00063 ostream& operator<<( ostream& os, const TrkFitStatus& s )
00064 {
00065 return s.printStatus(os);
00066 }
00067
00068 ostream&
00069 TrkFitStatus::printStatus(ostream& os) const
00070 {
00071 os << " 3-d: " << (is2d() == 0) << " ";
00072 return printHistory(os);
00073 }
00074
00075 void
00076 TrkFitStatus::addHistory(const TrkErrCode& status,
00077 const char* modulename)
00078 {
00079
00080 _history.push_back(TrkHistory(status,modulename));
00081 }
00082
00083 ostream&
00084 TrkFitStatus::printHistory(ostream& os) const
00085 {
00086
00087
00088
00089 for(history_iterator i=_history.begin();i!=_history.end();++i)
00090 os << *i << endl;
00091 return os;
00092 }