]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPreClusterFinder.cxx
Init() method added.
[u/mrichter/AliRoot.git] / MUON / AliMUONPreClusterFinder.cxx
index 5f616d980b5415605ee80542d692909ccae163d2..7be9d5630695ac46aae2920be456c97c60b32f37 100644 (file)
@@ -26,7 +26,9 @@
 #include "AliMUONPad.h"
 #include "AliMUONVDigit.h"
 #include "AliMUONVDigitStore.h"
+//#include "AliCodeTimer.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONPreClusterFinder
 ///
 /// Implementation of AliMUONVClusterFinder
@@ -34,6 +36,7 @@
 /// This class simply find adjacent pads to form clusters
 ///
 /// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
 
 ClassImp(AliMUONPreClusterFinder)
 
@@ -127,7 +130,8 @@ AliMUONPreClusterFinder::Prepare(const AliMpVSegmentation* segmentations[2],
                     ix,iy,pad.Position().X(),pad.Position().Y(),
                     pad.Dimensions().X(),pad.Dimensions().Y(),
                     d->Charge());
-    if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE); 
+    if ( d->IsSaturated() ) mpad.SetSaturated(kTRUE);
+    mpad.SetUniqueID(d->GetUniqueID());
     new (padArray[padArray.GetLast()+1]) AliMUONPad(mpad);      
   }
   if ( fPads[0]->GetLast() < 0 && fPads[1]->GetLast() < 0 )
@@ -135,7 +139,7 @@ AliMUONPreClusterFinder::Prepare(const AliMpVSegmentation* segmentations[2],
     // no pad at all, nothing to do...
     return kFALSE;
   }
-
+  
   return kTRUE;
 }
 
@@ -148,11 +152,20 @@ AliMUONPreClusterFinder::AddPad(AliMUONCluster& cluster, AliMUONPad* pad)
   
   Int_t cathode = pad->Cathode();
   TClonesArray& padArray = *fPads[cathode];
+  // WARNING: this Remove method uses the AliMUONPad::IsEqual if that method is
+  // present (otherwise just compares pointers) : so that one must be correct
+  // if implemented !
   padArray.Remove(pad);
-  //AZ padArray.Compress();
+ // TObject* o = padArray.Remove(pad); 
+//  if (!o)
+//  {
+//    AliFatal("Oups. Could not remove pad from pads to consider. Aborting as anyway "
+//             " we'll get an infinite loop. Please check the AliMUONPad::IsEqual method"
+//             " as the first suspect for failed remove");
+//  }  
   TIter next(&padArray);
   AliMUONPad* testPad;
-  
+
   while ( ( testPad = static_cast<AliMUONPad*>(next())))
   {
     if ( AliMUONPad::AreNeighbours(*testPad,*pad) )
@@ -191,6 +204,7 @@ AliMUONCluster*
 AliMUONPreClusterFinder::NextCluster()
 {
   /// Builds the next cluster, and returns it.
+//  AliCodeTimerAuto("pre-clustering")
   
   // Start a new cluster
   Int_t id = fClusters->GetLast()+1;