/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/src/TrkFitStatus.cxx

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkFitStatus.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
00004 //
00005 // Description:
00006 //     
00007 //
00008 // Environment:
00009 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author(s): Steve Schaffner
00012 //
00013 // Revision History:
00014 //      20020502  Michael Kelsey -- Remove size argument from _history
00015 //------------------------------------------------------------------------
00016 #include "TrkBase/TrkFitStatus.h"
00017 //#include "ErrLogger/ErrLog.h"
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 // Copy ctor
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 // append the module name to the error code message
00080   _history.push_back(TrkHistory(status,modulename));
00081 }
00082 
00083 ostream&
00084 TrkFitStatus::printHistory(ostream& os) const
00085 {
00086   //FIXME: this doesn't work because ostream isn't a std::ostream, so 
00087   //       std::ostream_iterator doesn't like this...
00088   // std::copy(_history.begin(),_history.end(),std::ostream_iterator<TrkHistory>(os,"\n"));
00089   for(history_iterator i=_history.begin();i!=_history.end();++i)
00090           os << *i << endl;
00091   return os;
00092 }

Generated on Tue Nov 29 23:13:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7