BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkFitter/include/TrkFitter/TrkDifLineTraj.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkDifLineTraj.h,v 1.3 2010/03/25 09:56:53 zhangy Exp $
4//
5// Description:
6// Trajectory subclass that implements a 3-d line, suitable for use in
7// a track.
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author(s): Steve Schaffner
13//------------------------------------------------------------------------
14#ifndef TRKDIFLINETRAJ_H
15#define TRKDIFLINETRAJ_H
16#include "CLHEP/Geometry/Point3D.h"
17#include "TrkBase/TrkSimpTraj.h"
18#ifndef ENABLE_BACKWARDS_COMPATIBILITY
19typedef HepGeom::Point3D<double> HepPoint3D;
20#endif
21#include "CLHEP/Vector/ThreeVector.h"
22
23class TrkVisitor;
24class TrkExchangePar;
25class TrkDifLineTraj : public TrkSimpTraj {
26public:
27 // Define the parameters
28 enum { d0Ind = 0, phi0Ind, z0Ind, tanDipInd };
29 enum { NLINPRM = 4 };
30
31 TrkDifLineTraj( const HepVector&, const HepSymMatrix&, double lowlim = -99999.,
32 double hilim = 99999., const HepPoint3D& refpoint = _theOrigin );
33 TrkDifLineTraj( const TrkExchangePar&, double lowlim = -99999., double hilim = 99999.,
34 const HepPoint3D& refpoint = _theOrigin );
35 TrkDifLineTraj( const TrkDifLineTraj& ); // copy ctor
39
40 virtual HepPoint3D position( double fltLen ) const;
41 virtual Hep3Vector direction( double fltLen ) const;
42 virtual Hep3Vector delDirect( double ) const;
43 virtual void getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& dir ) const;
44 virtual void getInfo( double fltLen, HepPoint3D&, Hep3Vector& dir,
45 Hep3Vector& delDir ) const;
46 virtual void getDFInfo( double fltLen, DifPoint&, DifVector& dir, DifVector& delDir ) const;
47 virtual double curvature( double fltLen ) const;
48
49 double cosDip() const { return 1. / sqrt( 1. + tanDip() * tanDip() ); }
50 double d0() const { return parameters()->parameter()[d0Index()]; }
51 double z0() const { return parameters()->parameter()[z0Index()]; }
52 double tanDip() const { return parameters()->parameter()[tanDipIndex()]; }
53 double phi0() const;
54 // yzhang
55 int nPar() const { return NLINPRM; }
56 // zhangy
57 // How far can you go using given approximation before error > tolerance,
58 // in direction pathDir?
59 virtual double distTo1stError( double flt, double tol, int pathDir ) const;
60 virtual double distTo2ndError( double flt, double tol, int pathDir ) const;
61
62 // Real versions of the base class derivative functions
63 HepMatrix derivDeflect( double fltlen, deflectDirection ) const;
64 HepMatrix derivDisplace( double fltlen, deflectDirection ) const;
65 HepMatrix derivPFract( double fltlen ) const;
66 // PointTraj functions
67 TranslateParams paramFunction() const { return TrkDifLineTraj::paramFunc; }
68 // Invert the parameter. Returns true in flags if the inversion
69 // requires a change of sign in the covariance matrix.
70 void invertParams( TrkParams* params, std::vector<bool>& flags ) const;
71
72 //--------------------------------------------------
73 // Visitor access
74 //--------------------------------------------------
75
76 virtual void visitAccept( TrkVisitor* vis ) const;
77
78private:
79 // Private functions (data members are part of the base class)
80 double x( const double& ) const;
81 double y( const double& ) const;
82 double z( const double& ) const;
83 int d0Index() const { return d0Ind; }
84 int phi0Index() const { return phi0Ind; }
85 int z0Index() const { return z0Ind; }
86 int tanDipIndex() const { return tanDipInd; }
87 int nLinPrm() const { return NLINPRM; }
88
89 // the real point translation function
90 static void paramFunc( const HepPoint3D& oldpoint, const HepPoint3D& newpoint,
91 const HepVector& oldpar, const HepSymMatrix& oldcov,
92 HepVector& newpar, HepSymMatrix& newcov, double fltlen );
93};
94
95// Inline functions:
96
97#endif
HepGeom::Point3D< double > HepPoint3D
Double_t x[10]
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
virtual double distTo2ndError(double flt, double tol, int pathDir) const
virtual HepPoint3D position(double fltLen) const
TrkDifLineTraj(const TrkExchangePar &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
virtual void getInfo(double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
virtual void getDFInfo(double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
virtual Hep3Vector delDirect(double) const
TrkDifLineTraj(const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
TrkDifLineTraj * clone() const
double phi0() const
virtual Hep3Vector direction(double fltLen) const
virtual void visitAccept(TrkVisitor *vis) const
void invertParams(TrkParams *params, std::vector< bool > &flags) const
virtual double distTo1stError(double flt, double tol, int pathDir) const
virtual double curvature(double fltLen) const
HepMatrix derivDeflect(double fltlen, deflectDirection) const
TrkDifLineTraj & operator=(const TrkDifLineTraj &)
HepMatrix derivDisplace(double fltlen, deflectDirection) const
HepMatrix derivPFract(double fltlen) const
TrkDifLineTraj(const TrkDifLineTraj &)