1 |
econte |
1.1 |
#ifndef _Tracker_TwoTrackMinimumDistanceHelixLine_H_
|
2 |
|
|
#define _Tracker_TwoTrackMinimumDistanceHelixLine_H_
|
3 |
|
|
|
4 |
|
|
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
|
5 |
|
|
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
|
6 |
|
|
#include <utility>
|
7 |
|
|
/** \class TwoTrackMinimumDistanceHelixLine
|
8 |
|
|
* This is a helper class for TwoTrackMinimumDistance, for the
|
9 |
|
|
* case where one of the tracks is charged and the other not.
|
10 |
|
|
* No user should need direct access to this class.
|
11 |
|
|
* It implements a Newton method
|
12 |
|
|
* for finding the minimum distance between two tracks.
|
13 |
|
|
*/
|
14 |
|
|
|
15 |
|
|
class GlobalTrajectoryParameters;
|
16 |
|
|
|
17 |
|
|
class TwoTrackMinimumDistanceHelixLine {
|
18 |
|
|
|
19 |
|
|
public:
|
20 |
|
|
|
21 |
|
|
TwoTrackMinimumDistanceHelixLine(): theH(0), theL(0), themaxiter(12),
|
22 |
|
|
pointsUpdated(false){}
|
23 |
|
|
~TwoTrackMinimumDistanceHelixLine() {}
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
/**
|
27 |
|
|
* Calculates the PCA between a charged particle (helix) and a neutral
|
28 |
|
|
* particle (line). The order of the trajectories (helix-line or line-helix)
|
29 |
|
|
* is irrelevent, and will be conserved.
|
30 |
|
|
*/
|
31 |
|
|
|
32 |
|
|
bool calculate( const GlobalTrajectoryParameters &,
|
33 |
|
|
const GlobalTrajectoryParameters &,
|
34 |
|
|
const float qual=.0001 ); // retval=true? error occured.
|
35 |
|
|
|
36 |
|
|
/**
|
37 |
|
|
* Returns the PCA's on the two trajectories. The first point lies on the
|
38 |
|
|
* first trajectory, the second point on the second trajectory.
|
39 |
|
|
*/
|
40 |
|
|
|
41 |
|
|
std::pair <GlobalPoint, GlobalPoint> points() const;
|
42 |
|
|
std::pair <double, double> pathLength() const;
|
43 |
|
|
|
44 |
|
|
double firstAngle() const;
|
45 |
|
|
double secondAngle() const;
|
46 |
|
|
|
47 |
|
|
private:
|
48 |
|
|
GlobalTrajectoryParameters *theH, *theL, *firstGTP, *secondGTP;
|
49 |
|
|
GlobalVector posDiff;
|
50 |
|
|
GlobalVector theLp;
|
51 |
|
|
double X, Y, Z, px, py, pz, px2, py2, pz2, baseFct, baseDer;
|
52 |
|
|
double theh, thePhiH0, thesinPhiH0, thecosPhiH0, thetanlambdaH;
|
53 |
|
|
double thePhiH;
|
54 |
|
|
double Hn, Ln;
|
55 |
|
|
double aa,bb,cc,dd,ee,ff;
|
56 |
|
|
|
57 |
|
|
int themaxiter;
|
58 |
|
|
bool updateCoeffs();
|
59 |
|
|
void finalPoints() const;
|
60 |
|
|
bool oneIteration(double & thePhiH, double & fct, double & derivative ) const;
|
61 |
|
|
mutable GlobalPoint helixPoint, linePoint;
|
62 |
|
|
mutable double tL, linePath, helixPath;
|
63 |
|
|
mutable bool pointsUpdated;
|
64 |
|
|
|
65 |
|
|
};
|
66 |
|
|
#endif
|