1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Artur Szostak
4 // Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
6 ////////////////////////////////////////////////////////////////////////////////
8 #ifndef ALIHLTMUONDUMMYTRACKER_H
9 #define ALIHLTMUONDUMMYTRACKER_H
12 #include "AliRoot/Point.hpp"
13 #include "AliRoot/TriggerRecord.hpp"
14 #include "AliRoot/Track.hpp"
15 #include "AliRoot/TrackerCallback.hpp"
19 class AliHLTMUONDummyTracker
23 AliHLTMUONDummyTracker() : fInterface(this), fCallback(NULL) {};
25 AliHLTMUONDummyTracker(const AliHLTMUONDummyTracker& t)
26 : fInterface(this), fCallback(t.fCallback)
29 AliHLTMUONDummyTracker& operator = (const AliHLTMUONDummyTracker& t)
31 fCallback = t.fCallback;
35 virtual ~AliHLTMUONDummyTracker() {};
37 /* Methods required to be implemented by the tracker.
38 These correspond to the AliHLTMUONCoreTracker specification, refer to that
39 class for more information.
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;
47 /* Set the callback for the tracker, so that the tracker can communicate
50 void SetCallback(AliHLTMUONTrackerCallback* callback)
55 /* Returns the TrackerInterface object to this tracker.
56 This is required by the MicrodHLT object.
58 AliHLTMUONTrackerInterface* Interface()
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
72 Error("RequestClusters", "The parameter left (%f) is larger than right (%f).",
75 else if (bottom > top)
76 Error("RequestClusters", "The parameter bottom (%f) is larger than top (%f).",
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]",
83 else if (fCallback != NULL)
84 fCallback->RequestClusters(left, right, bottom, top, chamber, tag);
86 Error("RequestClusters", "Callback not set.");
90 void EndOfClusterRequests()
92 if (fCallback != NULL)
93 fCallback->EndOfClusterRequests();
95 Error("EndOfClusterRequests", "Callback not set.");
101 if (fCallback != NULL)
102 fCallback->FoundTrack();
104 Error("FoundTrack", "Callback not set.");
110 if (fCallback != NULL)
111 fCallback->NoTrackFound();
113 Error("NoTrackFound", "Callback not set.");
119 AliHLTMUONTrackerInterface fInterface; // The interface via which compiled code communicates with this object.
120 AliHLTMUONTrackerCallback* fCallback; // Callback interface to framework.
124 // Implementation of the TrackerInterface:
125 // This must come here so that it gets interpreted together with the rest
126 // of the AliMUONHLTTracker.
128 void AliHLTMUONTrackerInterface::FindTrack(const AliHLTMUONTriggerRecord& trigger)
130 fTracker->FindTrack(trigger);
133 void AliHLTMUONTrackerInterface::ReturnClusters(void* tag, const AliHLTMUONPoint* clusters, const UInt_t count)
135 fTracker->ReturnClusters(tag, clusters, count);
138 void AliHLTMUONTrackerInterface::EndOfClusters(void* tag)
140 fTracker->EndOfClusters(tag);
143 void AliHLTMUONTrackerInterface::FillTrackData(AliHLTMUONTrack& track)
145 fTracker->FillTrackData(track);
148 void AliHLTMUONTrackerInterface::Reset()
153 void AliHLTMUONTrackerInterface::SetCallback(AliHLTMUONTrackerCallback* callback)
155 fTracker->SetCallback(callback);
159 // Implementation of the SetTracker method which is undefined in MicrodHLT.
160 void AliHLTMUONMicrodHLT::SetTracker(AliHLTMUONDummyTracker* tracker)
162 SetTracker(tracker->Interface());
166 #endif // ALIHLTMUONDUMMYTRACKER_H