]> git.uio.no Git - u/mrichter/AliRoot.git/blame - 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
CommitLineData
8356cc1d 1////////////////////////////////////////////////////////////////////////////////
2//
3// Author: Artur Szostak
4// Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
5//
6////////////////////////////////////////////////////////////////////////////////
7
69d7cf2e 8#ifndef ALIHLTMUONDUMMYTRACKER_H
9#define ALIHLTMUONDUMMYTRACKER_H
8356cc1d 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
69d7cf2e 19class AliHLTMUONDummyTracker
8356cc1d 20{
21public:
22
77650318 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)
8356cc1d 30 {
77650318 31 fCallback = t.fCallback;
32 return *this;
33 }
8356cc1d 34
69d7cf2e 35 virtual ~AliHLTMUONDummyTracker() {};
d3a17842 36
8356cc1d 37 /* Methods required to be implemented by the tracker.
77650318 38 These correspond to the AliHLTMUONCoreTracker specification, refer to that
8356cc1d 39 class for more information.
40 */
69d7cf2e 41 virtual void FindTrack(const AliHLTMUONTriggerRecord& trigger) = 0;
42 virtual void ReturnClusters(void* tag, const AliHLTMUONPoint* clusters, const UInt_t count) = 0;
8356cc1d 43 virtual void EndOfClusters(void* tag) = 0;
69d7cf2e 44 virtual void FillTrackData(AliHLTMUONTrack& track) = 0;
8356cc1d 45 virtual void Reset() = 0;
46
47 /* Set the callback for the tracker, so that the tracker can communicate
48 with the framework.
49 */
69d7cf2e 50 void SetCallback(AliHLTMUONTrackerCallback* callback)
8356cc1d 51 {
52 fCallback = callback;
53 };
54
55 /* Returns the TrackerInterface object to this tracker.
56 This is required by the MicrodHLT object.
57 */
69d7cf2e 58 AliHLTMUONTrackerInterface* Interface()
8356cc1d 59 {
60 return &fInterface;
61 };
62
63
64protected:
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
117private:
118
69d7cf2e 119 AliHLTMUONTrackerInterface fInterface; // The interface via which compiled code communicates with this object.
120 AliHLTMUONTrackerCallback* fCallback; // Callback interface to framework.
8356cc1d 121};
122
123
124// Implementation of the TrackerInterface:
125// This must come here so that it gets interpreted together with the rest
77650318 126// of the AliMUONHLTTracker.
8356cc1d 127
69d7cf2e 128void AliHLTMUONTrackerInterface::FindTrack(const AliHLTMUONTriggerRecord& trigger)
8356cc1d 129{
130 fTracker->FindTrack(trigger);
131};
132
69d7cf2e 133void AliHLTMUONTrackerInterface::ReturnClusters(void* tag, const AliHLTMUONPoint* clusters, const UInt_t count)
8356cc1d 134{
135 fTracker->ReturnClusters(tag, clusters, count);
136};
137
69d7cf2e 138void AliHLTMUONTrackerInterface::EndOfClusters(void* tag)
8356cc1d 139{
140 fTracker->EndOfClusters(tag);
141};
142
69d7cf2e 143void AliHLTMUONTrackerInterface::FillTrackData(AliHLTMUONTrack& track)
8356cc1d 144{
145 fTracker->FillTrackData(track);
146};
147
69d7cf2e 148void AliHLTMUONTrackerInterface::Reset()
8356cc1d 149{
150 fTracker->Reset();
151};
152
69d7cf2e 153void AliHLTMUONTrackerInterface::SetCallback(AliHLTMUONTrackerCallback* callback)
8356cc1d 154{
155 fTracker->SetCallback(callback);
156};
157
158
159// Implementation of the SetTracker method which is undefined in MicrodHLT.
69d7cf2e 160void AliHLTMUONMicrodHLT::SetTracker(AliHLTMUONDummyTracker* tracker)
8356cc1d 161{
162 SetTracker(tracker->Interface());
163};
164
165
69d7cf2e 166#endif // ALIHLTMUONDUMMYTRACKER_H