BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/TrkBase/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 "TrkBase/TrkPocaBase.h"
24#include "MdcRecoUtil/DifNumber.h"
25#include "CLHEP/Matrix/Vector.h"
26using CLHEP::HepVector;
27
28class TrkDifTraj;
29
30// Class interface //
31class TrkDifPoca : public TrkPocaBase {
32
33public:
34 TrkDifPoca(const TrkDifTraj& traj1, double flt1,
35 const Trajectory& traj2, double flt2,
36 double precision=1.e-5);
37 TrkDifPoca(const TrkDifTraj& traj, double flt,
38 const HepPoint3D& pt, double precision=1.e-5);
40
41 inline const DifNumber& difDoca() const; // distance of closest approach
42 inline double doca() const; // ditto
43 inline const HepVector derivs() const; //deriv of doca w/r/t track params
44 inline void fetchDerivs(HepVector&) const; // faster version
45
46 // The following inherited functions are also available:
47 //const TrkErrCode& status() const; // did the calculation succeed?
48 //double flt1() const; // path length on traj 1 @ poca
49 //double flt2() const;
50 //double precision(); // In case anyone wants to know:
51
52private:
53 DifNumber _doca;
54
55 void calcDist(const TrkDifTraj& traj1, const Trajectory& traj2);
56 void calcDist(const TrkDifTraj& , const HepPoint3D& );
57
58 // Preempt
59 // TrkDifPoca& operator= (const TrkDifPoca&);
60 // TrkDifPoca(const TrkDifPoca &);
61};
62
63// Inlined functions
64double TrkDifPoca::doca() const {return _doca.number();}
65const DifNumber& TrkDifPoca::difDoca() const {return _doca;}
66const HepVector TrkDifPoca::derivs() const {return _doca.derivatives();}
67void TrkDifPoca::fetchDerivs(HepVector& dv) const {_doca.fetchDerivatives(dv);}
68#endif
void fetchDerivatives(HepVector &v) const
Definition: DifNumber.cxx:41
HepVector derivatives() const
Definition: DifNumber.cxx:46