BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/TrkBase-00-01-12/TrkBase/HelixTraj.h
Go to the documentation of this file.
1// $Id: HelixTraj.h,v 1.3 2010/03/25 09:56:26 zhangy Exp $
2//
3// Trajectory subclass that implements a helix simple along the z axis
4// Author : Gautier Hamel de Monchenault, from TrkParms and other similar classes
5//
6#ifndef HELIXTRAJ_HH
7#define HELIXTRAJ_HH
8#include "TrkBase/TrkSimpTraj.h"
9#include "CLHEP/Matrix/Vector.h"
10#include "CLHEP/Matrix/Matrix.h"
11#include "CLHEP/Matrix/SymMatrix.h"
12#include "CLHEP/Geometry/Point3D.h"
13#ifndef ENABLE_BACKWARDS_COMPATIBILITY
15#endif
16
17
18#include <iosfwd>
19
20using CLHEP::Hep3Vector;
21using CLHEP::HepMatrix;
22using CLHEP::HepSymMatrix;
23
24class TrkVisitor;
25class TrkExchangePar;
26
27class HelixTraj : public TrkSimpTraj {
28public:
29// Define the parameters
31 enum {NHLXPRM = 5};
32 HelixTraj(const HepVector&,const HepSymMatrix&, double lowlim=-99999.,
33 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
34 HelixTraj(const TrkExchangePar&, double lowlim=-99999.,
35 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
36 HelixTraj(const TrkParams&, double lowlim=-99999.,
37 double hilim=99999., const HepPoint3D& refpoint = _theOrigin);
38 HelixTraj( const HelixTraj& );
39 HelixTraj* clone() const;
40
41 virtual ~HelixTraj();
42
43// operators
45 virtual HepPoint3D position(double fltLen) const;
46 virtual Hep3Vector direction(double fltLen) const;
47 virtual Hep3Vector delDirect(double) const;
48 virtual void getInfo(double fltLen, HepPoint3D& pos,
49 Hep3Vector& dir) const;
50 virtual void getInfo(double fltLen, HepPoint3D& , Hep3Vector& dir,
51 Hep3Vector& delDir) const;
52 virtual void getDFInfo(double fltLen, DifPoint& , DifVector& dir,
53 DifVector& delDir) const;
54 virtual void getDFInfo2(double fltLen, DifPoint& pos, DifVector&
55 dir) const;
56
57 // How far can you go using given approximation before error > tolerance,
58 // in direction pathDir?
59 virtual double distTo1stError(double s, double tol, int pathDir) const;
60 virtual double distTo2ndError(double s, double tol, int pathDir) const;
61
62
63// Real versions of the base class derrivative functions
64 double curvature( double fltLen) const;
65 HepMatrix derivDeflect(double fltlen,deflectDirection) const;
66 HepMatrix derivDisplace(double fltlen,deflectDirection idir) const;
67 HepMatrix derivPFract(double fltlen) const;
68// PointTraj functions
69 TranslateParams paramFunction() const { return HelixTraj::paramFunc; }
70 // Invert the parameters. Returns true in flags if the inversion
71 // requires a change of sign in the covariance matrix.
72 void invertParams(TrkParams* params, std::vector<bool>& flags) const;
73
74 //yzhang
75 int nPar() const { return NHLXPRM;}
76 //zhangy
77
78 // Helix-specific accessors
79 double d0() const {return parameters()->parameter()[d0Index];}
80 double phi0() const;
81 double omega() const {return parameters()->parameter()[omegaIndex]; }
82 double z0() const {return parameters()->parameter()[z0Index]; }
83 double tanDip() const { return parameters()->parameter()[tanDipIndex]; }
84
85 //--------------------------------------------------
86 // Visitor access
87 //--------------------------------------------------
88
89 virtual void visitAccept(TrkVisitor* vis) const;
90
91 virtual void print(std::ostream& os) const;
92 virtual void printAll(std::ostream& os) const;
93
94
95private:
96
97
98// Private functions (data members are part of the base class)
99
100 // double x( const double& ) const;
101 // double y( const double& ) const;
102 double z( const double& ) const;
103 double dip() const {return atan(tanDip());}
104// double cosDip() const {return 1./sqrt(1.+sqr(tanDip())); }
105 double cosDip() const {return 1./sqrt(1.+tanDip()*tanDip()); }
106 double sinDip() const {return tanDip()*cosDip(); }
107 double translen(const double& f) const {return cosDip()*f;}
108 double arc( const double& f) const {return translen(f)*omega();}
109 double angle(const double& f) const;
110// the real point translation function
111 static void paramFunc(const HepPoint3D& oldpoint,const HepPoint3D& newpoint,
112 const HepVector& oldpar,const HepSymMatrix& oldcov,
113 HepVector& newpar,HepSymMatrix& newcov,
114 double fltlen);
115};
116#endif
117
XmlRpcServer s
Definition: HelloServer.cpp:11
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
double curvature(double fltLen) const
HelixTraj(const HepVector &, const HepSymMatrix &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
HepMatrix derivDeflect(double fltlen, deflectDirection) const
virtual double distTo1stError(double s, double tol, int pathDir) const
HelixTraj * clone() const
HelixTraj(const TrkParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
HepMatrix derivPFract(double fltlen) const
virtual void print(std::ostream &os) const
virtual Hep3Vector direction(double fltLen) const
HelixTraj(const HelixTraj &)
void invertParams(TrkParams *params, std::vector< bool > &flags) const
virtual ~HelixTraj()
HelixTraj & operator=(const HelixTraj &)
virtual void printAll(std::ostream &os) const
HelixTraj(const TrkExchangePar &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
HepMatrix derivDisplace(double fltlen, deflectDirection idir) const
virtual void getDFInfo2(double fltLen, DifPoint &pos, DifVector &dir) const
virtual void visitAccept(TrkVisitor *vis) const
virtual Hep3Vector delDirect(double) const
double phi0() const
virtual double distTo2ndError(double s, double tol, int pathDir) const
virtual void getInfo(double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
virtual void getDFInfo(double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
virtual HepPoint3D position(double fltLen) const