1 |
#ifndef _TwoTrackMinimumDistance_H_
|
2 |
#define _TwoTrackMinimumDistance_H_
|
3 |
|
4 |
#include "TrackingTools/PatternTools/interface/ClosestApproachOnHelices.h"
|
5 |
#include "TrackingTools/PatternTools/interface/ClosestApproachInRPhi.h"
|
6 |
#include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixHelix.h"
|
7 |
#include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceLineLine.h"
|
8 |
#include "TrackingTools/PatternTools/interface/TwoTrackMinimumDistanceHelixLine.h"
|
9 |
|
10 |
/**
|
11 |
* General interface to calculate the PCA of two tracks.
|
12 |
* According to the charge of the tracks, the correct algorithm is used:<ul>
|
13 |
* <li> charged-charged: TwoTrackMinimumDistanceHelixHelix
|
14 |
* <li> charged-neutral: TwoTrackMinimumDistanceHelixLine
|
15 |
* <li> neutral-neutral: TwoTrackMinimumDistanceLineLine
|
16 |
* </ul>
|
17 |
*/
|
18 |
|
19 |
class TwoTrackMinimumDistance : public ClosestApproachOnHelices {
|
20 |
|
21 |
public:
|
22 |
|
23 |
enum Mode { FastMode=0, SlowMode=1 };
|
24 |
|
25 |
TwoTrackMinimumDistance( const Mode m=FastMode ) { theModus=m; status_ = false;};
|
26 |
|
27 |
virtual bool calculate(const TrajectoryStateOnSurface & sta,
|
28 |
const TrajectoryStateOnSurface & stb);
|
29 |
|
30 |
virtual bool calculate(const FreeTrajectoryState & sta,
|
31 |
const FreeTrajectoryState & stb);
|
32 |
|
33 |
virtual bool calculate(const GlobalTrajectoryParameters & sta,
|
34 |
const GlobalTrajectoryParameters & stb);
|
35 |
|
36 |
virtual bool status() const {return status_;}
|
37 |
|
38 |
/**
|
39 |
* Returns the two PCA on the trajectories.
|
40 |
*/
|
41 |
|
42 |
virtual std::pair<GlobalPoint, GlobalPoint> points() const;
|
43 |
|
44 |
/** arithmetic mean of the two points of closest approach */
|
45 |
virtual GlobalPoint crossingPoint() const;
|
46 |
|
47 |
/** distance between the two points of closest approach in 3D */
|
48 |
virtual float distance() const;
|
49 |
|
50 |
|
51 |
/**
|
52 |
* Clone method
|
53 |
*/
|
54 |
virtual TwoTrackMinimumDistance * clone() const {
|
55 |
return new TwoTrackMinimumDistance(* this);
|
56 |
}
|
57 |
|
58 |
double firstAngle() const;
|
59 |
double secondAngle() const;
|
60 |
std::pair <double, double> pathLength() const;
|
61 |
|
62 |
private:
|
63 |
enum Charge { hh, hl, ll };
|
64 |
Mode theModus;
|
65 |
mutable Charge theCharge;
|
66 |
ClosestApproachInRPhi theIniAlgo;
|
67 |
mutable TwoTrackMinimumDistanceHelixHelix theTTMDhh;
|
68 |
mutable TwoTrackMinimumDistanceLineLine theTTMDll;
|
69 |
mutable TwoTrackMinimumDistanceHelixLine theTTMDhl;
|
70 |
bool status_;
|
71 |
std::pair<GlobalPoint, GlobalPoint> points_;
|
72 |
|
73 |
bool pointsLineLine(const GlobalTrajectoryParameters & sta,
|
74 |
const GlobalTrajectoryParameters & stb);
|
75 |
bool pointsHelixLine(const GlobalTrajectoryParameters & sta,
|
76 |
const GlobalTrajectoryParameters & stb);
|
77 |
bool pointsHelixHelix(const GlobalTrajectoryParameters & sta,
|
78 |
const GlobalTrajectoryParameters & stb);
|
79 |
};
|
80 |
|
81 |
#endif
|