1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Artur Szostak
4 // Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
6 ////////////////////////////////////////////////////////////////////////////////
8 #ifndef ALIHLTMUONDUMMYCLUSTERFINDER_H
9 #define ALIHLTMUONDUMMYCLUSTERFINDER_H
12 #include "AliRoot/Point.hpp"
13 #include "AliRoot/ADCStream.hpp"
17 class AliHLTMUONDummyClusterFinder
21 AliHLTMUONDummyClusterFinder() : fInterface(this)
26 virtual ~AliHLTMUONDummyClusterFinder() {};
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.
34 virtual void FindClusters(const AliHLTMUONADCStream * stream) = 0;
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
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.
48 virtual UInt_t FillClusterData(AliHLTMUONPoint* clusters, UInt_t arraysize) = 0;
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.
53 virtual void Reset() = 0;
55 /* Sets the ClusterFinderCallback callback interface.
57 inline void SetCallback(AliHLTMUONClusterFinderCallback * callback) {
58 this->fCallback = callback;
61 AliHLTMUONClusterFinderInterface* Interface()
68 AliHLTMUONClusterFinderInterface fInterface;
69 AliHLTMUONClusterFinderCallback * fCallback;
73 void AliHLTMUONClusterFinderInterface::FindClusters(const AliHLTMUONADCStream* stream)
75 fClusterFinder->FindClusters(stream);
78 UInt_t AliHLTMUONClusterFinderInterface::FillClusterData(AliHLTMUONPoint* clusters, UInt_t arraysize)
80 return fClusterFinder->FillClusterData(clusters, arraysize);
83 void AliHLTMUONClusterFinderInterface::Reset()
85 fClusterFinder->Reset();
88 void AliHLTMUONClusterFinderInterface::SetCallback(AliHLTMUONClusterFinderCallback* callback)
90 fClusterFinder->SetCallback(callback);
93 void AliHLTMUONMicrodHLT::SetClusterFinder(AliHLTMUONDummyClusterFinder* clusterfinder)
95 SetClusterFinder(clusterfinder->Interface());
99 #endif // ALIHLTMUONDUMMYCLUSTERFINDER_H