Fixes in order to avoid compilation problems.
[u/mrichter/AliRoot.git] / HLT / MUON / src / AliRoot / ClusterFinder.hpp
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Author: Artur Szostak
4 // Email:  artur@alice.phy.uct.ac.za | artursz@iafrica.com
5 //
6 ////////////////////////////////////////////////////////////////////////////////
7
8 #ifndef dHLT_CLUSTERING_CLUSTER_FINDER_HPP
9 #define dHLT_CLUSTERING_CLUSTER_FINDER_HPP
10
11 #ifndef __CINT__
12 #include "BasicTypes.hpp"
13 #include "Cluster.hpp"
14 #include "ADCStream.hpp"
15 #include "Utils.hpp"
16 #endif // __CINT__
17
18 namespace AliMUONHLT
19 {
20         class ClusterFinder {
21           public:
22
23           ClusterFinder() :fInterface(this)
24             {
25                 fCallback = NULL;
26             };
27
28             /* This is the starting point of the cluster finding algorithm.
29                Deriving cluster finders should implement all processing in this method
30                to find clusters in the specified ADC stream. When all clusters are found
31                the FoundClusters method should be called to indicate that processing is
32                complete. If no clusters could be found then call NoClustersFound instead.
33              */
34             virtual void FindClusters(const ADCStream * stream) = 0;
35
36             /* After a call to FoundClusters this method will be called to retreive the
37                cluster points. The clusters array should be filled consecutively with 
38                the points that were found. However no more than 'arraysize' number of 
39                points should be written to the clusters array.
40                This method should also return the actual number of cluster points written
41                to the array.
42                If the number of clusters written is less that the number specified in the
43                'numberfound' parameter of the FoundClusters method, then this method will
44                be called again by the framework. Thus on successive calls to this method,
45                the cluster finder must resume writing clusters at the point it stopped at
46                in the previous call to FillClusterData.
47              */
48             virtual UInt_t FillClusterData(Point * clusters, UInt_t arraysize) = 0;
49
50             /* This is called when the cluster finder should be reset to an initial state.
51                All extra internal memory allocated during processing should be released.
52              */
53             virtual void Reset() = 0;
54
55             /* Sets the ClusterFinderCallback callback interface.
56              */
57             inline void SetCallback(ClusterFinderCallback * callback) {
58                 this->fCallback = callback;
59             };
60
61             ClusterFinderInterface* Interface()
62             {
63                 return &fInterface;
64             };
65
66           private:
67
68             ClusterFinderInterface fInterface;
69             ClusterFinderCallback * fCallback;
70         };
71
72 void ClusterFinderInterface::FindClusters(const ADCStream * stream)
73 {
74         fClusterFinder->FindClusters(stream);
75 };
76
77 UInt_t ClusterFinderInterface::FillClusterData(Point * clusters, UInt_t arraysize)
78 {
79         return fClusterFinder->FillClusterData(clusters,arraysize);
80 };
81
82 void ClusterFinderInterface::Reset()
83 {
84         fClusterFinder->Reset();
85 };
86
87 void ClusterFinderInterface::SetCallback(ClusterFinderCallback* callback)
88 {
89         fClusterFinder->SetCallback(callback);
90 };
91
92 void MicrodHLT::SetClusterFinder(ClusterFinder* clusterfinder)
93 {
94         SetClusterFinder(clusterfinder->Interface());
95 };
96
97 }                               // AliMUONHLT
98
99 #endif                          // dHLT_CLUSTERING_CLUSTER_FINDER_HPP