]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/src/Tracking/MansoTracker.hpp
dHLT tracker now processes AliMUONLocalTrigger and AliMUONRawCluster objects.
[u/mrichter/AliRoot.git] / HLT / MUON / src / Tracking / MansoTracker.hpp
CommitLineData
8356cc1d 1////////////////////////////////////////////////////////////////////////////////
2//
3// Author: Artur Szostak
4// Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
5//
6////////////////////////////////////////////////////////////////////////////////
7
8#ifndef dHLT_TRACKING_MANSO_TRACKER_HPP
9#define dHLT_TRACKING_MANSO_TRACKER_HPP
10
11#include "BasicTypes.hpp"
12#include "Tracking/Tracker.hpp"
13#include "Buffers/List.hpp"
14#include "Buffers/CountedList.hpp"
15
16
17namespace dHLT
18{
19namespace Tracking
20{
21
22
23class MansoTracker : public Tracker
24{
25public:
26
27 MansoTracker();
28 virtual ~MansoTracker() {};
29
30
31 /* Note: Reset should be called for before calling FindTrack, for the
32 second or subsequent method calls to FindTrack.
33 */
34 virtual void FindTrack(const TriggerRecord& trigger);
35
e33f3609 36 virtual void ReturnClusters(void* tag, const ClusterPoint* clusters, UInt count);
8356cc1d 37 virtual void EndOfClusters(void* tag);
38 virtual void FillTrackData(Track& track);
39 virtual void Reset();
40
41
42 /* Get and set methods for the a and b parameters used to build the region
43 of interests. Refer to MansoFilter() for details about a and b parameters.
44 */
d6576e27 45 static Float GetA7() { return a7; };
12ab84fc 46 static void SetA7(Float value) { a7 = value; };
d6576e27 47 static Float GetA8() { return a8; };
e33f3609 48 static void SetA8(Float value) { a8 = value; };
d6576e27 49 static Float GetA9() { return a9; };
e33f3609 50 static void SetA9(Float value) { a9 = value; };
d6576e27 51 static Float GetA10() { return a10; };
e33f3609 52 static void SetA10(Float value) { a10 = value; };
8356cc1d 53
d6576e27 54 static Float GetB7() { return b7; };
e33f3609 55 static void SetB7(Float value) { b7 = value; };
d6576e27 56 static Float GetB8() { return b8; };
e33f3609 57 static void SetB8(Float value) { b8 = value; };
d6576e27 58 static Float GetB9() { return b9; };
e33f3609 59 static void SetB9(Float value) { b9 = value; };
d6576e27 60 static Float GetB10() { return b10; };
e33f3609 61 static void SetB10(Float value) { b10 = value; };
8356cc1d 62
d6576e27 63 static Float GetZ7() { return z7; };
e33f3609 64 static void SetZ7(Float value) { z7 = value; };
d6576e27 65 static Float GetZ8() { return z8; };
e33f3609 66 static void SetZ8(Float value) { z8 = value; };
d6576e27 67 static Float GetZ9() { return z9; };
e33f3609 68 static void SetZ9(Float value) { z9 = value; };
d6576e27 69 static Float GetZ10() { return z10; };
e33f3609 70 static void SetZ10(Float value) { z10 = value; };
d6576e27 71 static Float GetZ11() { return z11; };
e33f3609 72 static void SetZ11(Float value) { z11 = value; };
d6576e27 73 static Float GetZ13() { return z13; };
e33f3609 74 static void SetZ13(Float value) { z13 = value; };
8356cc1d 75
76
d6576e27 77//protected:
8356cc1d 78
79 class RegionOfInterest
80 {
81 public:
82
83 RegionOfInterest() {};
84
e33f3609 85 RegionOfInterest(Point p, Float a, Float b)
8356cc1d 86 {
87 Create(p, a, b);
88 };
89
90 /* Creates a region of interest. In this implementation it is a
91 circular disk.
92
93 The point p is the intersecting point of the track with the chamber.
94 For more details and for details about the parameters a and b refer to:
95 "A first algorithm for dimuon High Level Trigger"
96 Ref ID: ALICE-INT-2002-04 version 1.0
97 equation:
98 Rs = a * Rp + b
99 given on page 3 section 4.
100 */
e33f3609 101 void Create(Point p, Float a, Float b);
8356cc1d 102
103 /* Returns true if the point p is within the region of interest.
104 */
e33f3609 105 bool Contains(Point p) const;
8356cc1d 106
107 void GetBoundaryBox(Float& left, Float& right, Float& bottom, Float& top);
108
109 private:
110
111 Point centre; // The centre point of the region of interest.
112 Float Rs; // The redius of the region of interest around fcentre.
113 };
114
115
116 class Vertex
117 {
118 public:
119
120 Float x, y, z;
121
e33f3609 122 Vertex(Float x = 0.0, Float y = 0.0, Float z = 0.0);
123 Vertex(Point xy, Float z);
8356cc1d 124
125 Point AsXYPoint() const
126 {
127 return Point(x, y);
128 };
129 };
130
131
132 class Line
133 {
134 public:
135
136 /* Creates a vector line between points A and B.
137 Ax, Ay, Az are x, y and z coordinates for space point A respectively.
138 simmilarly for B.
139 */
140 Line(
e33f3609 141 Float Ax = 0.0, Float Ay = 0.0, Float Az = 0.0,
142 Float Bx = 0.0, Float By = 0.0, Float Bz = 0.0
8356cc1d 143 );
144
145 /* Creates a vector line between vertices A and B.
146 */
e33f3609 147 Line(Vertex A, Vertex B);
8356cc1d 148
149 /* Finds the intersection point with the xy plain specified by the z coordinate.
150 The z coordiante would be the distance of the n'th chamber to the interaction
151 vertex.
152 */
e33f3609 153 Point FindIntersectWithXYPlain(Float z) const;
8356cc1d 154
155 private:
156
157 // Parameters for the vector line: L = M*t + C
158 Float Mx, My, Mz, Cx, Cy, Cz;
159 };
160
161
162 struct TagData
163 {
164 ChamberID chamber; // The chamber on which the region of interest lies.
165 RegionOfInterest roi; // Region of interest on the next station.
166 Line line; // line between a cluster point and the previous station.
167 };
168
169 struct Station5Data
170 {
171 ClusterPoint clusterpoint; // Cluster point found on station 5.
172 TagData tag;
173 };
174
175 typedef Buffers::CountedList<Station5Data> Station5List;
d6576e27 176
177 struct Station4Data
178 {
179 ClusterPoint clusterpoint; // Cluster point found on station 4.
180 const TagData* st5tag; // Corresponding station 5 tag.
181 };
182
183 typedef Buffers::List<Station4Data> Station4List;
8356cc1d 184
185
e33f3609 186 void ReceiveClustersChamber7(const ClusterPoint* clusters, UInt count, const TagData* data);
187 void ReceiveClustersChamber8(const ClusterPoint* clusters, UInt count, const TagData* data);
188 void ReceiveClustersChamber9(const ClusterPoint* clusters, UInt count);
189 void ReceiveClustersChamber10(const ClusterPoint* clusters, UInt count);
8356cc1d 190 void EndOfClustersChamber7();
191 void EndOfClustersChamber8();
192 void EndOfClustersChamber9();
193 void EndOfClustersChamber10();
194
195 void ProjectToStation4(Station5Data* data, register Float station5z);
196 void ProcessClusters();
197
198DebugCode(
199public:
200)
201 // States for state machine 4 (SM4).
202 enum StatesSM4
203 {
204 SM4Idle,
205 WaitChamber8,
206 WaitMoreChamber8,
207 WaitChamber7,
208 WaitMoreChamber7
209 };
210
211 // States for state machine 5 (SM5).
212 enum StatesSM5
213 {
214 SM5Idle,
215 WaitChamber10,
216 WaitMoreChamber10,
217 WaitChamber9,
218 WaitMoreChamber9,
219 SM5Done
220 };
221
222protected:
223
224 StatesSM4 sm4state; // State of SM4 used for fetching clusters on chambers 7 and 8.
225 StatesSM5 sm5state; // State of SM5 used for fetching clusters on chambers 9 and 10.
226 UInt requests_completed; // Number of requests for station 4 that have completed.
227 ChamberID st4chamber; // The chamber on station 4 that data was retreived from.
228
229 Vertex v1; // The impact (hit) vertex for trigger station 1.
230 TagData mc1; // Trigger station 1 data.
231
232 Float st5z; // The z coordinate to use for station 5.
233 Station5List st5data; // List of found cluster points for station 5 and their tag data.
234 Float st4z; // The z coordinate to use for station 4.
235 Station4List st4points; // The found cluster points for station 4.
236
237 // Iterators used in the FoundTrack, FillTrackData methods.
238 Station5List::Iterator st5rec;
239 Station4List::Iterator foundpoint;
240
241private:
242
243 static Float a7, b7; // Parameters used to create a region of interest for the 7'th chamber.
244 static Float a8, b8; // Parameters used to create a region of interest for the 8'th chamber.
245 static Float a9, b9; // Parameters used to create a region of interest for the 9'th chamber.
246 static Float a10, b10; // Parameters used to create a region of interest for the 10'th chamber.
247 static Float z7, z8, z9, z10, z11, z13; // Z coordinates of chambers 7 to 10.
248
249};
250
251
252} // Tracking
253} // dHLT
254
255#endif // dHLT_TRACKING_MANSO_TRACKER_HPP
d6576e27 256