]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/AliRoot/Tracker.hpp
Also dropping references to AliMUONTriggerCircuit which are depricated. This is a...
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliRoot / Tracker.hpp
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Author: Artur Szostak
4 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
5 //
6 ////////////////////////////////////////////////////////////////////////////////
7
8 #ifndef ALIHLTMUONDUMMYTRACKER_H
9 #define ALIHLTMUONDUMMYTRACKER_H
10
11 #ifndef __CINT__
12 #include "AliRoot/Point.hpp"
13 #include "AliRoot/TriggerRecord.hpp"
14 #include "AliRoot/Track.hpp"
15 #include "AliRoot/TrackerCallback.hpp"
16 #endif // __CINT__
17
18
19 class AliHLTMUONDummyTracker
20 {
21 public:
22
23         AliHLTMUONDummyTracker() : fInterface(this), fCallback(NULL) {};
24
25         AliHLTMUONDummyTracker(const AliHLTMUONDummyTracker& t)
26                 : fInterface(this), fCallback(t.fCallback)
27         {};
28
29         AliHLTMUONDummyTracker& operator = (const AliHLTMUONDummyTracker& t)
30         {
31                 fCallback = t.fCallback;
32                 return *this;
33         }
34
35         virtual ~AliHLTMUONDummyTracker() {};
36
37         /* Methods required to be implemented by the tracker.
38            These correspond to the AliHLTMUONCoreTracker specification, refer to that
39            class for more information.
40          */
41         virtual void FindTrack(const AliHLTMUONTriggerRecord& trigger) = 0;
42         virtual void ReturnClusters(void* tag, const AliHLTMUONPoint* clusters, const UInt_t count) = 0;
43         virtual void EndOfClusters(void* tag) = 0;
44         virtual void FillTrackData(AliHLTMUONTrack& track) = 0;
45         virtual void Reset() = 0;
46
47         /* Set the callback for the tracker, so that the tracker can communicate
48            with the framework.
49          */
50         void SetCallback(AliHLTMUONTrackerCallback* callback)
51         {
52                 fCallback = callback;
53         };
54         
55         /* Returns the TrackerInterface object to this tracker.
56            This is required by the MicrodHLT object.
57          */
58         AliHLTMUONTrackerInterface* Interface()
59         {
60                 return &fInterface;
61         };
62
63
64 protected:
65
66         void RequestClusters(
67                         const Float_t left, const Float_t right, const Float_t bottom, const Float_t top,
68                         const Int_t chamber, const void* tag
69                 )
70         {
71                 if (left > right)
72                         Error("RequestClusters", "The parameter left (%f) is larger than right (%f).",
73                                 left, right
74                         );
75                 else if (bottom > top)
76                         Error("RequestClusters", "The parameter bottom (%f) is larger than top (%f).",
77                                 bottom, top
78                         );
79                 else if (chamber < 0 or 9 < chamber)
80                         Error("RequestClusters", "The chamber parameter is out of range. Got: %d, expected a value in [0..9]",
81                                 chamber
82                         );
83                 else if (fCallback != NULL)
84                         fCallback->RequestClusters(left, right, bottom, top, chamber, tag);
85                 else
86                         Error("RequestClusters", "Callback not set.");
87         };
88
89
90         void EndOfClusterRequests()
91         {
92                 if (fCallback != NULL)
93                         fCallback->EndOfClusterRequests();
94                 else
95                         Error("EndOfClusterRequests", "Callback not set.");
96         };
97
98
99         void FoundTrack()
100         {
101                 if (fCallback != NULL)
102                         fCallback->FoundTrack();
103                 else
104                         Error("FoundTrack", "Callback not set.");
105         };
106
107
108         void NoTrackFound()
109         {
110                 if (fCallback != NULL)
111                         fCallback->NoTrackFound();
112                 else
113                         Error("NoTrackFound", "Callback not set.");
114         };
115
116
117 private:
118
119         AliHLTMUONTrackerInterface fInterface;  // The interface via which compiled code communicates with this object.
120         AliHLTMUONTrackerCallback* fCallback;   // Callback interface to framework.
121 };
122
123
124 // Implementation of the TrackerInterface:
125 // This must come here so that it gets interpreted together with the rest
126 // of the AliMUONHLTTracker.
127
128 void AliHLTMUONTrackerInterface::FindTrack(const AliHLTMUONTriggerRecord& trigger)
129 {
130         fTracker->FindTrack(trigger);
131 };
132
133 void AliHLTMUONTrackerInterface::ReturnClusters(void* tag, const AliHLTMUONPoint* clusters, const UInt_t count)
134 {
135         fTracker->ReturnClusters(tag, clusters, count);
136 };
137
138 void AliHLTMUONTrackerInterface::EndOfClusters(void* tag)
139 {
140         fTracker->EndOfClusters(tag);
141 };
142
143 void AliHLTMUONTrackerInterface::FillTrackData(AliHLTMUONTrack& track)
144 {
145         fTracker->FillTrackData(track);
146 };
147
148 void AliHLTMUONTrackerInterface::Reset()
149 {
150         fTracker->Reset();
151 };
152
153 void AliHLTMUONTrackerInterface::SetCallback(AliHLTMUONTrackerCallback* callback)
154 {
155         fTracker->SetCallback(callback);
156 };
157
158
159 // Implementation of the SetTracker method which is undefined in MicrodHLT.
160 void AliHLTMUONMicrodHLT::SetTracker(AliHLTMUONDummyTracker* tracker)
161 {
162         SetTracker(tracker->Interface());
163 };
164
165
166 #endif // ALIHLTMUONDUMMYTRACKER_H