BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
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
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
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
HepGeom::Point3D< double > HepPoint3D
Definition: HelixTraj.h:14
XmlRpcServer s
Definition: HelloServer.cpp:11
deflectDirection
Definition: TrkKalDeriv.h:24
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
Definition: TrkSimpTraj.h:46
HepVector & parameter()
Definition: DifIndepPar.h:51
double curvature(double fltLen) const
Definition: HelixTraj.cxx:499
virtual ~HelixTraj()
Definition: HelixTraj.cxx:82
virtual void printAll(std::ostream &os) const
Definition: HelixTraj.cxx:637
HepMatrix derivDeflect(double fltlen, deflectDirection) const
Definition: HelixTraj.cxx:365
HelixTraj * clone() const
Definition: HelixTraj.cxx:66
virtual void getDFInfo2(double fltLen, DifPoint &pos, DifVector &dir) const
Definition: HelixTraj.cxx:207
TranslateParams paramFunction() const
Definition: HelixTraj.h:69
HepMatrix derivPFract(double fltlen) const
Definition: HelixTraj.cxx:460
int nPar() const
Definition: HelixTraj.h:75
double omega() const
Definition: HelixTraj.h:81
virtual HepPoint3D position(double fltLen) const
Definition: HelixTraj.cxx:93
@ phi0Index
Definition: HelixTraj.h:30
@ omegaIndex
Definition: HelixTraj.h:30
@ tanDipIndex
Definition: HelixTraj.h:30
void invertParams(TrkParams *params, std::vector< bool > &flags) const
Definition: HelixTraj.cxx:598
virtual Hep3Vector delDirect(double) const
Definition: HelixTraj.cxx:123
HelixTraj & operator=(const HelixTraj &)
Definition: HelixTraj.cxx:72
virtual double distTo2ndError(double s, double tol, int pathDir) const
Definition: HelixTraj.cxx:140
HepMatrix derivDisplace(double fltlen, deflectDirection idir) const
Definition: HelixTraj.cxx:413
virtual void getDFInfo(double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
Definition: HelixTraj.cxx:280
virtual void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
Definition: HelixTraj.cxx:181
double d0() const
Definition: HelixTraj.h:79
double phi0() const
Definition: HelixTraj.cxx:510
virtual double distTo1stError(double s, double tol, int pathDir) const
Definition: HelixTraj.cxx:133
double z0() const
Definition: HelixTraj.h:82
virtual void print(std::ostream &os) const
Definition: HelixTraj.cxx:649
virtual void visitAccept(TrkVisitor *vis) const
Definition: HelixTraj.cxx:591
virtual Hep3Vector direction(double fltLen) const
Definition: HelixTraj.cxx:110
double tanDip() const
Definition: HelixTraj.h:83
TrkParams * parameters()
Definition: TrkSimpTraj.h:80
static HepPoint3D _theOrigin
Definition: TrkSimpTraj.h:59