]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/PubSub/TrackerCallback.hpp
This commit was generated by cvs2svn to compensate for changes in r11742,
[u/mrichter/AliRoot.git] / HLT / MUON / src / PubSub / TrackerCallback.hpp
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Author: Artur Szostak
4 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
5 //
6 // Author: Gareth de Vaux
7 // Email:  devaux@lhc.phy.uct.ac.za | dhlt@lordcow.org
8 //
9 ////////////////////////////////////////////////////////////////////////////////
10
11 #ifndef dHLT_PUBSUB_TRACKERCALLBACK_HPP
12 #define dHLT_PUBSUB_TRACKERCALLBACK_HPP
13
14 #include "Tracking/Tracker.hpp"  
15 #include "Tracking/MansoTracker.hpp" 
16 #include "Cluster.hpp"
17
18 #include <vector>
19
20 namespace dHLT
21 {
22 namespace PubSub
23 {
24
25
26 class TrackerCallback: public Tracking::TrackerCallback
27 {
28 public:
29
30         TrackerCallback();
31
32         virtual ~TrackerCallback() {}
33         
34         /* All clusters that fall within the specified boundary box on the specified
35            chamber should be returned the the tracker, by calling the ReturnClusters
36            method of the given tracker. The same tag parameter must be passed on the 
37            ReturnClusters method's parameter list.
38          */
39         virtual void RequestClusters(
40                         Tracking::Tracker* tracker, 
41                         const Float left, const Float right, const Float bottom, const Float top,
42                         const ChamberID chamber, const void* tag
43                 );
44
45         /* When this method is called then one knows no more RequestClusters method
46            calls are expected.
47          */
48         virtual void EndOfClusterRequests(Tracking::Tracker* tracker);
49
50         /* This method is called when the tracker has found a track. The FillTrackData
51            method of the given tracker should be called to received the track data.
52            At this point all cluster blocks can be released.
53          */
54         virtual void FoundTrack(Tracking::Tracker* tracker);
55         
56         /* When the tracker is finished with its work but no track was found then
57            this method is called. At this point no more work should be performed by
58            the tracker and all cluster blocks can be released.
59          */
60         virtual void NoTrackFound(Tracking::Tracker* tracker);
61
62         /* Store a pointer to cluster data
63         */
64         void AddClusterBlock(const ClusterPoint *clusters, const UInt size, const UInt chamber);
65
66         /* gives tracks access to the externally allocated output buffer
67         */
68         void SetTracks(Track* output) {tracks = output;}
69
70         UInt TrackCount() const {return trackcount;}
71
72 private:
73
74         struct ClusterBlock
75         {
76                 const ClusterPoint* data;
77                 UInt count;
78         };
79
80         std::vector<ClusterBlock> clusterblocks[10];  // cluster blocks for the 10 tracking chambers
81
82         Track* tracks;              // array of tracks
83         UInt trackcount;
84
85         UInt cyclic_count;          // TODO
86 };
87
88
89 } // PubSub
90 } // dHLT
91
92 #endif // dHLT_TRACKING_TRACKERCALLBACK_HPP