BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/TrkBase/TrkDifPoca.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkDifPoca.h,v 1.2 2006/03/28 01:02:36 zhangy Exp $
4//
5// Description:
6// Calculate the point of closest approach between two trajectories.
7// Calculates (in ctor) the distance and the flight lengths alongs
8// the two trajectories; calculated values are obtained through accessors.
9// "Precision" is maximum allowed error on distance (in cm).
10// The input flightlengths are used as a starting point; the
11// code will find the point-of-closest-approach that is closest to that
12// point. (A good starting point also reduces CPU time.)
13// Note that distance is a signed quantity for two trajectories.
14//
15// Environment:
16// Software developed for the BaBar Detector at the SLAC B-Factory.
17//
18// Author(s): Steve Schaffner; core algorithm stolen from Art Snyder
19//
20//------------------------------------------------------------------------
21#ifndef TRKDIFPOCA_H
22#define TRKDIFPOCA_H
23#include "CLHEP/Matrix/Vector.h"
24#include "MdcRecoUtil/DifNumber.h"
25#include "TrkBase/TrkPocaBase.h"
26using CLHEP::HepVector;
27
28class TrkDifTraj;
29
30// Class interface //
31class TrkDifPoca : public TrkPocaBase {
32
33public:
34 TrkDifPoca( const TrkDifTraj& traj1, double flt1, const Trajectory& traj2, double flt2,
35 double precision = 1.e-5 );
36 TrkDifPoca( const TrkDifTraj& traj, double flt, const HepPoint3D& pt,
37 double precision = 1.e-5 );
39
40 inline const DifNumber& difDoca() const; // distance of closest approach
41 inline double doca() const; // ditto
42 inline const HepVector derivs() const; // deriv of doca w/r/t track params
43 inline void fetchDerivs( HepVector& ) const; // faster version
44
45 // The following inherited functions are also available:
46 // const TrkErrCode& status() const; // did the calculation succeed?
47 // double flt1() const; // path length on traj 1 @ poca
48 // double flt2() const;
49 // double precision(); // In case anyone wants to know:
50
51private:
52 DifNumber _doca;
53
54 void calcDist( const TrkDifTraj& traj1, const Trajectory& traj2 );
55 void calcDist( const TrkDifTraj&, const HepPoint3D& );
56
57 // Preempt
58 // TrkDifPoca& operator= (const TrkDifPoca&);
59 // TrkDifPoca(const TrkDifPoca &);
60};
61
62// Inlined functions
63double TrkDifPoca::doca() const { return _doca.number(); }
64const DifNumber& TrkDifPoca::difDoca() const { return _doca; }
65const HepVector TrkDifPoca::derivs() const { return _doca.derivatives(); }
66void TrkDifPoca::fetchDerivs( HepVector& dv ) const { _doca.fetchDerivatives( dv ); }
67#endif
HepGeom::Point3D< double > HepPoint3D
HepVector derivatives() const
Definition DifNumber.cxx:45
TrkDifPoca(const TrkDifTraj &traj, double flt, const HepPoint3D &pt, double precision=1.e-5)
double doca() const
const DifNumber & difDoca() const
void fetchDerivs(HepVector &) const
const HepVector derivs() const
TrkDifPoca(const TrkDifTraj &traj1, double flt1, const Trajectory &traj2, double flt2, double precision=1.e-5)