+//_____________________________________________________________________________
+AliMUONPad*
+AliMUONPreClusterFinder::GetNextPad(Int_t cathode) const
+{
+/// Return the next unused pad of given cathode, which is within fArea
+
+ TIter next(fPads[cathode]);
+
+ if ( !fArea.IsValid() )
+ {
+ return static_cast<AliMUONPad*>(next());
+ }
+ else
+ {
+ AliMUONPad* pad;
+ while ( ( pad = static_cast<AliMUONPad*>(next())) )
+ {
+ AliMpArea padArea(pad->X(), pad->Y(), pad->DX(), pad->DY());
+
+ if (fArea.Overlap(padArea)) return pad;
+
+ }
+ return 0x0;
+ }
+}
+
+//_____________________________________________________________________________
+AliMUONCluster*
+AliMUONPreClusterFinder::NewCluster()
+{
+ /// Create a new (empty) cluster
+ Int_t id = fClusters.GetLast()+1;
+ AliMUONCluster* cluster = new (fClusters[id]) AliMUONCluster;
+ cluster->SetUniqueID(id);
+ return cluster;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONPreClusterFinder::RemoveCluster(AliMUONCluster* cluster)
+{
+ /// Remove a cluster
+ /// Note that we are *not* releasing the pads, so they won't be used further on
+ fClusters.Remove(cluster);
+ fClusters.Compress();
+}
+