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

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkFitStatus.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
00004 //
00005 // Description:
00006 //     Describes the status of a track fit.  Designed to be inherited by 
00007 // TrkReps, and can be used to present one facet of them to Trk users.
00008 //
00009 // Environment:
00010 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00011 //
00012 // Author(s): Steve Schaffner
00013 //
00014 //------------------------------------------------------------------------
00015 
00016 #ifndef TRKFITSTATUS_HH
00017 #define TRKFITSTATUS_HH
00018 
00019 #include "TrkBase/TrkHistory.h"
00020 #include <vector>
00021 #include <utility>
00022 #include <functional>
00023 #include <iostream>
00024 
00025 // Class interface //
00026 class TrkFitStatus {
00027   typedef std::vector<TrkHistory>::const_iterator history_iterator;
00028   typedef std::vector<TrkHistory>::const_reverse_iterator history_riterator;
00029 
00030 public:
00031   typedef std::unary_function<TrkFitStatus,bool> predicate_type;
00032   bool is2d()       const      {return _is2d;}
00033   bool fitCurrent() const      {return _fitCurrent;}
00034   bool fitValid()   const      {return _fitValid;}
00035   bool multScat()   const      {return _multScat;}      
00036   std::ostream& printStatus(std::ostream& os=std::cout) const;
00037 
00038   void setValid(bool v);
00039   void setCurrent(bool c) { _fitCurrent = c; }
00040   void set2d(bool d) { _is2d = d; };
00041   void setMultScat(bool m) { _multScat = m; };
00042 // here's the error code returned by the most recent fit
00043   const TrkErrCode& fitStatus() const { return _history.back().status(); }
00044 // a complete history of how the track was created/modified
00045 //
00046   history_iterator beginHistory() const { return _history.begin(); }
00047   history_iterator endHistory() const   { return _history.end(); }
00048   history_riterator reverseBeginHistory() const { return _history.rbegin(); }
00049   history_riterator reverseEndHistory() const   { return _history.rend(); }
00050   std::pair<history_iterator,history_iterator> history() const {
00051           return std::pair<history_iterator,history_iterator>(beginHistory(),endHistory());
00052   }
00053   const std::vector<TrkHistory>& historyVector() const { return _history; }
00054 // add to the tracks history.  Provide the module name, please!
00055   virtual void addHistory(const TrkErrCode& status,const char* modulename);
00056   template <class T>
00057   void addHistory(T begin, T end) { _history.insert(_history.end(),begin,end); }
00058   template <class T>
00059   void addHistory(std::pair<T,T> p) { addHistory(p.first,p.second); }
00060   std::ostream& printHistory(std::ostream& os=std::cout) const;
00061 protected:
00062   virtual ~TrkFitStatus();
00063   TrkFitStatus();
00064   TrkFitStatus&   operator= (const TrkFitStatus&);
00065   TrkFitStatus(const TrkFitStatus &);
00066 private:
00067   std::vector<TrkHistory> _history;
00068   bool _fitValid;
00069   bool _fitCurrent;
00070   bool _is2d;
00071   bool _multScat;
00072 };
00073 
00074 std::ostream& operator<<( std::ostream& os, const TrkFitStatus& s );
00075 
00076 
00077 #endif
00078 

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