BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkBase/TrkBase/TrkSimpTraj.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkSimpTraj.h,v 1.2 2006/03/28 01:02:36 zhangy Exp $
4//
5// Description: TrkSimpTraj is an abstract class for trajectories that
6// contain a simple set of parameters (i.e. it's not a composite
7// trajectory). It is a base class for things like HelixTraj and
8// LineTraj, and inherits from TrkDifTraj. The reference point (what
9// the parameters implicitly use to relate to BaBar 3-space) is now
10// an explicit member, as opposed to being implicitly set to 0,0,0.
11//
12// Note: the HP compiler is too stupid to process the default ctor, so instead
13// the origin will be hard-coded to 0,0,0 for the HP (only). This could
14// well cause problems for HP users someday, but complaints should be addressed
15// to the manufacturer of those boxes, not me.
16//
17//
18// Environment:
19// Software developed for the BaBar Detector at the SLAC B-Factory.
20//
21// Author(s): Steve Schaffner, Dave Brown
22//
23//------------------------------------------------------------------------
24
25#ifndef TRKSIMPTRAJ_HH
26#define TRKSIMPTRAJ_HH
27
28#include "TrkBase/TrkDifTraj.h"
29#include "TrkBase/TrkKalDeriv.h"
30#include "TrkBase/TrkParams.h"
31#include "CLHEP/Geometry/Point3D.h"
32#ifndef ENABLE_BACKWARDS_COMPATIBILITY
34#endif
35#include "CLHEP/Matrix/Vector.h"
36#include "CLHEP/Matrix/SymMatrix.h"
37
38#include <vector>
39
40class TrkVisitor;
41using CLHEP::HepVector;
42using CLHEP::HepSymMatrix;
43#include <iosfwd>
44
45// Prototype the point translation functions. This is kind of ugly
46typedef void (*TranslateParams)(const HepPoint3D& oldpoint,
47 const HepPoint3D& newpoint,
48 const HepVector& oldpar,
49 const HepSymMatrix& oldcov,
50 HepVector& newpar,
51 HepSymMatrix& newcov,
52 double fltlen);
53
54// Class interface //
55class TrkSimpTraj : public TrkDifTraj, public TrkKalDeriv {
56
57public:
58
59 static HepPoint3D _theOrigin; // define the origin as a HepPoint3D
60
61
62public:
63
64 //-----------------------
65 // Constructors and such
66 //-----------------------
67 TrkSimpTraj(const HepVector& params, const HepSymMatrix& cov,
68 const double startRange = -99999.,const double endRange =99999.,
69 const HepPoint3D& refpoint = _theOrigin);
70 TrkSimpTraj(const TrkParams& params,
71 const double startRange = -99999.,const double endRange =99999.,
72 const HepPoint3D& refpoint = _theOrigin);
73 virtual ~TrkSimpTraj();
74
75 virtual TrkSimpTraj* clone() const = 0;
76
77 //--------------------------------------------------
78 // Access to parameters, errors and reference point
79 //--------------------------------------------------
81 const TrkParams* parameters() const {return &_dtparams;}
82 virtual const TrkSimpTraj* localTrajectory(double fltLen, double& localFlt)
83 const;
84 const HepPoint3D& referencePoint() const {return _refpoint;}
85 virtual void print(std::ostream& os) const;
86 virtual void printAll(std::ostream& os) const;
87 //yzhang
88 virtual int nPar() const {return parameters()->nPar();}
89 //zhangy
90 //--------------------------------------------------
91 // Change contents
92 //--------------------------------------------------
93 // Change the reference point and the parameters
94 void changePoint(const HepPoint3D& newpoint,double& fltlen);
95 // Set the ref point and don't change the params
96 void setPoint(const HepPoint3D& newpoint) {_refpoint = newpoint;}
97 // inversion function: this inverts both the flight range and the parameters
98 // so that the same traj is described but going in the opposite direction.
100 // invert the track parameters passed in newparams.
101 // Returns true in flags if the inversion requires a sign change in the
102 // covariance matrix as well.
103 virtual void invertParams(TrkParams* newparams, std::vector<bool>& flags) const = 0;
104 // Provide function which translates the reference point of parameters
105 virtual TranslateParams paramFunction() const = 0;
106
107 //--------------------------------------------------
108 // Visitor access for momentum functions
109 //--------------------------------------------------
110
111 virtual void visitAccept(TrkVisitor* vis) const = 0;
112
113 bool operator==(const TrkSimpTraj&) const; // return equivalence, not identy
114
115
116protected:
118 HepPoint3D _refpoint; // reference point for parameters
119private:
120 // Preempt
121 TrkSimpTraj(const TrkSimpTraj &);
122 TrkSimpTraj& operator= (const TrkSimpTraj&);
123};
124#endif
HepGeom::Point3D< double > HepPoint3D
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
virtual TranslateParams paramFunction() const =0
TrkSimpTraj & invert()
bool operator==(const TrkSimpTraj &) const
void changePoint(const HepPoint3D &newpoint, double &fltlen)
Definition: TrkSimpTraj.cxx:70
virtual void print(std::ostream &os) const
virtual void printAll(std::ostream &os) const
virtual void visitAccept(TrkVisitor *vis) const =0
virtual ~TrkSimpTraj()
Definition: TrkSimpTraj.cxx:53
virtual const TrkSimpTraj * localTrajectory(double fltLen, double &localFlt) const
Definition: TrkSimpTraj.cxx:59
const HepPoint3D & referencePoint() const
virtual void invertParams(TrkParams *newparams, std::vector< bool > &flags) const =0
virtual TrkSimpTraj * clone() const =0
void setPoint(const HepPoint3D &newpoint)