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