]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/MUON/src/AliRoot/ClusterFinder.hpp
Coding conventions (A.Szostak)
[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 ALIHLTMUONDUMMYCLUSTERFINDER_H
9 #define ALIHLTMUONDUMMYCLUSTERFINDER_H
10
11 #ifndef __CINT__
12 #include "AliRoot/Point.hpp"
13 #include "AliRoot/ADCStream.hpp"
14 #endif // __CINT__
15
16
17 class AliHLTMUONDummyClusterFinder
18 {
19 public:
20
21         AliHLTMUONDummyClusterFinder() : fInterface(this)
22         {
23                 fCallback = NULL;
24         };
25
26         virtual ~AliHLTMUONDummyClusterFinder() {};
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 AliHLTMUONADCStream * 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(AliHLTMUONPoint* 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(AliHLTMUONClusterFinderCallback * callback) {
58                 this->fCallback = callback;
59         };
60
61         AliHLTMUONClusterFinderInterface* Interface()
62         {
63                 return &fInterface;
64         };
65
66 private:
67
68         AliHLTMUONClusterFinderInterface fInterface;
69         AliHLTMUONClusterFinderCallback * fCallback;
70 };
71
72
73 void AliHLTMUONClusterFinderInterface::FindClusters(const AliHLTMUONADCStream* stream)
74 {
75         fClusterFinder->FindClusters(stream);
76 };
77
78 UInt_t AliHLTMUONClusterFinderInterface::FillClusterData(AliHLTMUONPoint* clusters, UInt_t arraysize)
79 {
80         return fClusterFinder->FillClusterData(clusters, arraysize);
81 };
82
83 void AliHLTMUONClusterFinderInterface::Reset()
84 {
85         fClusterFinder->Reset();
86 };
87
88 void AliHLTMUONClusterFinderInterface::SetCallback(AliHLTMUONClusterFinderCallback* callback)
89 {
90         fClusterFinder->SetCallback(callback);
91 };
92
93 void AliHLTMUONMicrodHLT::SetClusterFinder(AliHLTMUONDummyClusterFinder* clusterfinder)
94 {
95         SetClusterFinder(clusterfinder->Interface());
96 };
97
98
99 #endif // ALIHLTMUONDUMMYCLUSTERFINDER_H