Revision: | 1.3 |
Committed: | Mon Jul 20 03:12:22 2009 UTC (15 years, 9 months ago) by loizides |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, V07-05-00, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, ConvRejection-10-06-09, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a, Mit_011, Mit_010a, Mit_010, Mit_008, HEAD |
Branch point for: | Mit_025c_branch |
Changes since 1.2: | +13 -6 lines |
Log Message: | Changes for docu. |
# | User | Rev | Content |
---|---|---|---|
1 | loizides | 1.1 | //-------------------------------------------------------------------------------------------------- |
2 | loizides | 1.3 | // $Id: HelixIntersector.h,v 1.2 2009/03/20 13:33:19 loizides Exp $ |
3 | loizides | 1.1 | // |
4 | // Class HelixIntersector | ||
5 | // | ||
6 | loizides | 1.3 | // Finds the intersection of two tracks. |
7 | // If they do not intersect it finds the point of closest approach. | ||
8 | loizides | 1.1 | // |
9 | loizides | 1.2 | // Author List: C.Paus (stolen from CDF implementation of E. Lipeles, |
10 | // therefore not all our coding conventions fulfilled) | ||
11 | loizides | 1.1 | //-------------------------------------------------------------------------------------------------- |
12 | |||
13 | #ifndef MITCOMMON_MATHTOOLS_HELIXINTERSECTOR_H | ||
14 | #define MITCOMMON_MATHTOOLS_HELIXINTERSECTOR_H | ||
15 | |||
16 | #include <iostream> | ||
17 | #include "MitCommon/MathTools/interface/Helix.h" | ||
18 | |||
19 | namespace mithep | ||
20 | { | ||
21 | class HelixIntersector { | ||
22 | |||
23 | public: | ||
24 | //-------------------------------------------------------------------------------------------- | ||
25 | // Class for track properties at intersection | ||
26 | //-------------------------------------------------------------------------------------------- | ||
27 | class Intersection; | ||
28 | class TrackParams : public Helix | ||
29 | { | ||
30 | friend class HelixIntersector; | ||
31 | friend class HelixIntersector::Intersection; | ||
32 | |||
33 | public: | ||
34 | // Sets the track and calculates center | ||
35 | TrackParams(const TVectorD *params, const TVector3 *momentum); | ||
36 | |||
37 | loizides | 1.2 | const TVector3 &Momentum () const { return fMomentum; } |
38 | const TVector3 &Center () const { return fCenter; } | ||
39 | loizides | 1.1 | double ArcLengthToInterection() const { return fArcLen; } |
40 | double ZAtIntersection () const { return fZAtISec; } | ||
41 | |||
42 | private: | ||
43 | // Make it illegal to copy or assign | ||
44 | TrackParams(const TrackParams &); | ||
45 | TrackParams & operator = (const TrackParams &); | ||
46 | |||
47 | // Calculates the location dependent quantities at the specified location | ||
48 | void SetLocation (TVector3 &location); | ||
49 | |||
50 | // Data | ||
51 | TVector3 fMomentum; | ||
52 | TVector3 fCenter; | ||
53 | double fArcLen; | ||
54 | double fZAtISec; | ||
55 | TVector3 fTrkMom; | ||
56 | loizides | 1.3 | |
57 | ClassDef(TrackParams, 0) // Track parameter class | ||
58 | loizides | 1.1 | }; |
59 | |||
60 | //-------------------------------------------------------------------------------------------- | ||
61 | loizides | 1.3 | // Class for Intersection results |
62 | loizides | 1.1 | //-------------------------------------------------------------------------------------------- |
63 | class Intersection | ||
64 | { | ||
65 | friend class HelixIntersector; | ||
66 | |||
67 | public: | ||
68 | // Properties of the vertex | ||
69 | const TVector3 &Location() const { return fLocation; } | ||
70 | double DeltaZ () const { return fDeltaZ; } | ||
71 | |||
72 | // Combined momenta of the two tracks | ||
73 | const TVector3 &Momentum() const { return fMomentum; } | ||
74 | |||
75 | // Properties of the vertex daughters | ||
76 | // i = 0 or 1 for the two daughters | ||
77 | const TrackParams &TrackParamsI(int i) const { return *(fTrks[i]); } | ||
78 | |||
79 | private: | ||
80 | Intersection(const TVectorD *tr1, const TVector3 *momentum1, | ||
81 | const TVectorD *tr2, const TVector3 *momentum2); | ||
82 | loizides | 1.3 | virtual ~Intersection() {} |
83 | |||
84 | loizides | 1.1 | void SetLocation(TVector3 &loc1, TVector3 &loc2); |
85 | |||
86 | double fDeltaZ; | ||
87 | TVector3 fLocation; | ||
88 | TVector3 fMomentum; | ||
89 | TrackParams *fTrks[2]; | ||
90 | TrackParams fTrk0; | ||
91 | TrackParams fTrk1; | ||
92 | loizides | 1.3 | |
93 | ClassDef(Intersection, 0) // Intersection result class | ||
94 | loizides | 1.1 | }; |
95 | |||
96 | //-------------------------------------------------------------------------------------------- | ||
97 | // HelixIntersector methods | ||
98 | //-------------------------------------------------------------------------------------------- | ||
99 | // Constructors, does intersection work | ||
100 | HelixIntersector(const TVectorD *tr1, const TVector3 *momentum1, | ||
101 | const TVectorD *tr2, const TVector3 *momentum2); | ||
102 | |||
103 | // Destructor | ||
104 | loizides | 1.3 | virtual ~HelixIntersector(); |
105 | loizides | 1.1 | |
106 | // Intersections or points of closest approach | ||
107 | // i = 0 or 1 (1 only if there are real intersections) | ||
108 | // ordered by deltaZ (so in general you only want i=0); | ||
109 | const Intersection& IntersectionI(int i) const { return *(fISecs[i]); } | ||
110 | |||
111 | // Has intersections | ||
112 | bool HasIntersections() const { return fHasIntersections; } | ||
113 | |||
114 | private: | ||
115 | // Make it illegal to copy or assign | ||
116 | HelixIntersector(const HelixIntersector &); | ||
117 | HelixIntersector &operator = (const HelixIntersector &); | ||
118 | |||
119 | bool fHasIntersections; | ||
120 | Intersection *fISecs[2]; | ||
121 | Intersection fISec0; | ||
122 | Intersection fISec1; | ||
123 | loizides | 1.3 | |
124 | ClassDef(HelixIntersector, 0) // Helix intersection finder class | ||
125 | loizides | 1.1 | }; |
126 | } | ||
127 | #endif |