BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/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 "CLHEP/Geometry/Point3D.h"
29#include "TrkBase/TrkDifTraj.h"
30#include "TrkBase/TrkKalDeriv.h"
31#include "TrkBase/TrkParams.h"
32#ifndef ENABLE_BACKWARDS_COMPATIBILITY
33typedef HepGeom::Point3D<double> HepPoint3D;
34#endif
35#include "CLHEP/Matrix/SymMatrix.h"
36#include "CLHEP/Matrix/Vector.h"
37
38#include <vector>
39
40class TrkVisitor;
41using CLHEP::HepSymMatrix;
42using CLHEP::HepVector;
43#include <iosfwd>
44
45// Prototype the point translation functions. This is kind of ugly
46typedef void ( *TranslateParams )( const HepPoint3D& oldpoint, const HepPoint3D& newpoint,
47 const HepVector& oldpar, const HepSymMatrix& oldcov,
48 HepVector& newpar, HepSymMatrix& newcov, double fltlen );
49
50// Class interface //
51class TrkSimpTraj : public TrkDifTraj, public TrkKalDeriv {
52
53public:
54 static HepPoint3D _theOrigin; // define the origin as a HepPoint3D
55
56public:
57 //-----------------------
58 // Constructors and such
59 //-----------------------
60 TrkSimpTraj( const HepVector& params, const HepSymMatrix& cov,
61 const double startRange = -99999., const double endRange = 99999.,
62 const HepPoint3D& refpoint = _theOrigin );
63 TrkSimpTraj( const TrkParams& params, const double startRange = -99999.,
64 const double endRange = 99999., const HepPoint3D& refpoint = _theOrigin );
65 virtual ~TrkSimpTraj();
66
67 virtual TrkSimpTraj* clone() const = 0;
68
69 //--------------------------------------------------
70 // Access to parameters, errors and reference point
71 //--------------------------------------------------
73 const TrkParams* parameters() const { return &_dtparams; }
74 virtual const TrkSimpTraj* localTrajectory( double fltLen, double& localFlt ) const;
75 const HepPoint3D& referencePoint() const { return _refpoint; }
76 virtual void print( std::ostream& os ) const;
77 virtual void printAll( std::ostream& os ) const;
78 // yzhang
79 virtual int nPar() const { return parameters()->nPar(); }
80 // zhangy
81 //--------------------------------------------------
82 // Change contents
83 //--------------------------------------------------
84 // Change the reference point and the parameters
85 void changePoint( const HepPoint3D& newpoint, double& fltlen );
86 // Set the ref point and don't change the params
87 void setPoint( const HepPoint3D& newpoint ) { _refpoint = newpoint; }
88 // inversion function: this inverts both the flight range and the parameters
89 // so that the same traj is described but going in the opposite direction.
91 // invert the track parameters passed in newparams.
92 // Returns true in flags if the inversion requires a sign change in the
93 // covariance matrix as well.
94 virtual void invertParams( TrkParams* newparams, std::vector<bool>& flags ) const = 0;
95 // Provide function which translates the reference point of parameters
96 virtual TranslateParams paramFunction() const = 0;
97
98 //--------------------------------------------------
99 // Visitor access for momentum functions
100 //--------------------------------------------------
101
102 virtual void visitAccept( TrkVisitor* vis ) const = 0;
103
104 bool operator==( const TrkSimpTraj& ) const; // return equivalence, not identy
105
106protected:
108 HepPoint3D _refpoint; // reference point for parameters
109private:
110 // Preempt
111 TrkSimpTraj( const TrkSimpTraj& );
112 TrkSimpTraj& operator=( const TrkSimpTraj& );
113};
114#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(const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)
virtual ~TrkSimpTraj()
TrkSimpTraj & invert()
bool operator==(const TrkSimpTraj &) const
void changePoint(const HepPoint3D &newpoint, double &fltlen)
virtual void print(std::ostream &os) const
virtual void printAll(std::ostream &os) const
virtual void visitAccept(TrkVisitor *vis) const =0
virtual const TrkSimpTraj * localTrajectory(double fltLen, double &localFlt) const
virtual void invertParams(TrkParams *newparams, std::vector< bool > &flags) const =0
virtual TrkSimpTraj * clone() const =0
TrkSimpTraj(const TrkParams &params, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)