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

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: TrkSimpTraj.h,v 1.2 2006/03/28 01:02:36 zhangy Exp $
00004 //
00005 // Description:  TrkSimpTraj is an abstract class for trajectories that 
00006 //     contain a simple set of parameters (i.e. it's not a composite 
00007 //     trajectory).  It is a base class for things like HelixTraj and 
00008 //     LineTraj, and inherits from TrkDifTraj.  The reference point (what
00009 //     the parameters implicitly use to relate to BaBar 3-space) is now
00010 //     an explicit member, as opposed to being implicitly set to 0,0,0.
00011 //
00012 // Note: the HP compiler is too stupid to process the default ctor, so instead
00013 // the origin will be hard-coded to 0,0,0 for the HP (only).  This could
00014 // well cause problems for HP users someday, but complaints should be addressed
00015 // to the manufacturer of those boxes, not me.
00016 //
00017 //
00018 // Environment:
00019 //      Software developed for the BaBar Detector at the SLAC B-Factory.
00020 //
00021 // Author(s): Steve Schaffner, Dave Brown
00022 //
00023 //------------------------------------------------------------------------
00024 
00025 #ifndef TRKSIMPTRAJ_HH
00026 #define TRKSIMPTRAJ_HH
00027 
00028 #include "TrkBase/TrkDifTraj.h"
00029 #include "TrkBase/TrkKalDeriv.h"
00030 #include "TrkBase/TrkParams.h"
00031 #include "CLHEP/Geometry/Point3D.h"
00032 #ifndef ENABLE_BACKWARDS_COMPATIBILITY
00033 typedef HepGeom::Point3D<double> HepPoint3D;
00034 #endif
00035 #include "CLHEP/Matrix/Vector.h"
00036 #include "CLHEP/Matrix/SymMatrix.h"
00037 
00038 #include <vector>
00039 
00040 class TrkVisitor;
00041 using CLHEP::HepVector;
00042 using CLHEP::HepSymMatrix;
00043 #include <iosfwd>
00044 
00045 //  Prototype the point translation functions.  This is kind of ugly
00046 typedef void (*TranslateParams)(const HepPoint3D& oldpoint,
00047                                 const HepPoint3D& newpoint,
00048                                 const HepVector& oldpar,
00049                                 const HepSymMatrix& oldcov,
00050                                 HepVector& newpar,
00051                                 HepSymMatrix& newcov,
00052                                 double fltlen);
00053 
00054 // Class interface //
00055 class TrkSimpTraj : public TrkDifTraj, public TrkKalDeriv {
00056 
00057 public:
00058 
00059   static HepPoint3D _theOrigin; // define the origin as a HepPoint3D
00060 
00061 
00062 public:
00063 
00064   //-----------------------
00065   // Constructors and such
00066   //-----------------------
00067   TrkSimpTraj(const HepVector& params, const HepSymMatrix& cov,
00068               const double startRange = -99999.,const double endRange =99999.,
00069               const HepPoint3D& refpoint = _theOrigin);
00070   TrkSimpTraj(const TrkParams& params,
00071               const double startRange = -99999.,const double endRange =99999.,
00072               const HepPoint3D& refpoint = _theOrigin);
00073   virtual ~TrkSimpTraj();
00074 
00075   virtual TrkSimpTraj* clone() const = 0;
00076 
00077   //--------------------------------------------------
00078   //  Access to parameters, errors and reference point
00079   //--------------------------------------------------
00080   TrkParams*                 parameters()                   {return &_dtparams;}
00081   const TrkParams*           parameters() const             {return &_dtparams;}
00082   virtual const TrkSimpTraj* localTrajectory(double fltLen, double& localFlt)
00083     const;
00084   const HepPoint3D&            referencePoint() const         {return _refpoint;}
00085   virtual void               print(std::ostream& os) const;
00086   virtual                    void printAll(std::ostream& os) const;
00087   //yzhang
00088   virtual   int             nPar() const {return parameters()->nPar();} 
00089   //zhangy
00090   //--------------------------------------------------
00091   // Change contents
00092   //--------------------------------------------------
00093   // Change the reference point and the parameters
00094   void           changePoint(const HepPoint3D& newpoint,double& fltlen);
00095   // Set the ref point and don't change the params
00096   void           setPoint(const HepPoint3D& newpoint)    {_refpoint = newpoint;}
00097   // inversion function: this inverts both the flight range and the parameters
00098   // so that the same traj is described but going in the opposite direction.
00099   TrkSimpTraj& invert();
00100   // invert the track parameters passed in newparams.
00101   // Returns true in flags if the inversion requires a sign change in the
00102   // covariance matrix as well.
00103   virtual void invertParams(TrkParams* newparams, std::vector<bool>& flags) const = 0;
00104   // Provide function which translates the reference point of parameters
00105   virtual TranslateParams paramFunction() const = 0;
00106 
00107   //--------------------------------------------------
00108   // Visitor access for momentum functions
00109   //--------------------------------------------------
00110 
00111   virtual void visitAccept(TrkVisitor* vis) const = 0;
00112 
00113   bool operator==(const TrkSimpTraj&) const; // return equivalence, not identy
00114 
00115 
00116 protected:
00117   TrkParams _dtparams;
00118   HepPoint3D _refpoint; // reference point for parameters
00119 private:
00120   // Preempt 
00121   TrkSimpTraj(const TrkSimpTraj &);
00122   TrkSimpTraj&   operator= (const TrkSimpTraj&);
00123 };
00124 #endif

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