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

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkRep.h,v 1.2 2006/03/28 01:02:36 zhangy Exp $
00004 //
00005 // Description: Base class for internal track representation classes -- e.g. 
00006 //   HelixRep, KalRep.  Owns and maintains a TrkHotList; and keeps a 
00007 //   pointer to the track that owns the Rep.
00008 //
00009 // Environment:
00010 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00011 //
00012 // Authors: Steve Schaffner
00013 //
00014 //------------------------------------------------------------------------
00015 
00016 #ifndef TRKREP_HH
00017 #define TRKREP_HH
00018 #include <memory>
00019 #include "MdcRecoUtil/PdtPid.h"
00020 #include "TrkBase/TrkDirection.h"
00021 #include "TrkBase/TrkFitStatus.h"
00022 #include "TrkBase/TrkFit.h"
00023 #include "TrkBase/TrkHotList.h"
00024 #include "TrkBase/TrkHitOnTrkUpdater.h"
00025 // These 3 are needed for the OSF compiler:
00026 #include "MdcRecoUtil/BesVectorErr.h"
00027 #include "MdcRecoUtil/BesPointErr.h"
00028 #include "CLHEP/Vector/ThreeVector.h"
00029 // the following is needed by the Sun compiler
00030 #include "ProbTools/ChisqConsistency.h"
00031 
00032 class TrkHitOnTrk;
00033 #include <iosfwd>
00034 class TrkDifTraj;
00035 class TrkErrCode;
00036 class TrkExchangePar;
00037 class TrkRecoTrk;
00038 class TrkVolume;
00039 class IfdKey;
00040 class TrkContext;
00041 
00042 // Class interface //
00043 class TrkRep : public TrkFitStatus, public TrkFit, public TrkHitOnTrkUpdater {
00044   
00045 public:
00046   //******************************************
00047   // Constructors and such
00048   //******************************************
00049 // construct from a hotlist -- The rep will not take ownership of anything passed
00050 //                          -- it will _clone_ the hots passed on inHots
00051   TrkRep(const TrkHotList& inHots, TrkRecoTrk* trk,
00052          PdtPid::PidType hypo);
00053   TrkRep(TrkHotList& inHots, TrkRecoTrk* trk,
00054          PdtPid::PidType hypo, bool stealHots=false);
00055 // construct from a hotlist -- The rep will always _TAKE OWNERSHIP_ of the hots
00056 //                             and if takeownership==true, ALSO of the list.
00057   TrkRep(const TrkHotList* inHots, TrkRecoTrk* trk,
00058          PdtPid::PidType hypo);
00059   TrkRep(TrkHotList* inHots, TrkRecoTrk* trk,
00060          PdtPid::PidType hypo, bool takeownership=false);
00061   // For reps w/o hits stored
00062   TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, int nAct, int nSvt,
00063          int nMdc, double startFoundRange, double endFoundRange);
00064 // rep without explicit hotlist
00065   TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, bool createHotList=false);
00066   // copy ctor
00067   TrkRep(const TrkRep& oldRep, TrkRecoTrk* trk, PdtPid::PidType hypo);
00068   virtual ~TrkRep();
00069   // clone() used to copy tracks; cloneNewHypo() for new hypos within track
00070   virtual TrkRep* clone(TrkRecoTrk* newTrack) const = 0;
00071   virtual TrkRep* cloneNewHypo(PdtPid::PidType hypo) = 0;
00072   bool operator== (const TrkRep&);
00073 
00074   //******************************************
00075   // Global quantities:
00076   //******************************************
00077   virtual ChisqConsistency    chisqConsistency() const;
00078   virtual int               nActive()      const;
00079   virtual int               nSvt()         const;
00080   virtual int               nMdc()         const;
00081   virtual PdtPid::PidType   particleType() const;
00082   TrkRecoTrk*               parentTrack()                {return _parentTrack;}
00083   const TrkRecoTrk*         parentTrack()  const         {return _parentTrack;}
00084   double                    startValidRange() const;
00085   double                    endValidRange()   const;
00086   virtual double            startFoundRange() const;
00087   virtual double            endFoundRange()   const;
00088   virtual const IfdKey&     myKey()           const;
00089   double                    trackT0()         const; 
00090 
00091   //******************************************
00092   // Information about track at a given position
00093   //******************************************
00094   virtual HepPoint3D                position(double fltL)         const;
00095   virtual Hep3Vector                direction(double fltL)        const;
00096   virtual double                    arrivalTime(double fltL)      const;
00097   virtual BesPointErr               positionErr(double fltL)      const;
00098   virtual BesVectorErr              directionErr(double fltL)     const;
00099 
00100   //******************************************
00101   // Hit (list) handling
00102   //******************************************
00103   // Simple implementations of these are present in the base class; 
00104   //   complicated reps (e.g. Kalman) may wish to override.
00105   virtual void            addHot(TrkHitOnTrk *theHot);
00106   virtual void            removeHot(TrkHitOnTrk *theHot);
00107   virtual void            activateHot(TrkHitOnTrk *theHot);
00108   virtual void            deactivateHot(TrkHitOnTrk *theHot);
00109   virtual TrkHotList*             hotList()                 {return _hotList.get();}
00110   virtual const TrkHotList*       hotList() const           {return _hotList.get();}
00111   virtual void            updateHots();
00112   virtual bool            resid(const TrkHitOnTrk *theHot,
00113                                 double &residual, double &residErr,
00114                                 bool exclude=false) const;
00115 
00116   // Distinguishes hotLists that actually hold hits from those that just hold 
00117   //   info (e.g. nActive) about the hits used to create the fit
00118   bool hitCapable() const                     {return hotList()->hitCapable();}
00119 
00120 
00121   //****************************************** 
00122   // Fitting stuff
00123   //******************************************
00124   virtual TrkErrCode fit() = 0;
00125 
00126 protected:
00127   TrkRep&   operator= (const TrkRep&);
00128   const TrkContext& trkContext() const;
00129 
00130   //protected, not private, so derived classes can create in copy ctor
00131   std::auto_ptr<TrkHotList>  _hotList;
00132 
00133 private:
00134   void init(TrkRecoTrk* trk, PdtPid::PidType hypo);
00135 
00136   PdtPid::PidType  _partHypo;
00137   TrkRecoTrk*      _parentTrack;
00138   mutable double   _betainv;   // cache for arrivalTime
00139 };
00140 
00141 #endif

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