]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPreClusterFinder.cxx
Adding some important comments (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUONPreClusterFinder.cxx
index 5f616d980b5415605ee80542d692909ccae163d2..05e2603412e89d7e0b30c9ed1f95a74fdcfe816e 100644 (file)
@@ -26,6 +26,7 @@
 #include "AliMUONPad.h"
 #include "AliMUONVDigit.h"
 #include "AliMUONVDigitStore.h"
+//#include "AliCodeTimer.h"
 
 /// \class AliMUONPreClusterFinder
 ///
@@ -135,7 +136,7 @@ AliMUONPreClusterFinder::Prepare(const AliMpVSegmentation* segmentations[2],
     // no pad at all, nothing to do...
     return kFALSE;
   }
-
+  
   return kTRUE;
 }
 
@@ -148,11 +149,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) )
@@ -192,6 +202,8 @@ AliMUONPreClusterFinder::NextCluster()
 {
   /// Builds the next cluster, and returns it.
   
+//  AliCodeTimerAuto("")
+  
   // Start a new cluster
   Int_t id = fClusters->GetLast()+1;
   AliMUONCluster* cluster = new ((*fClusters)[id]) AliMUONCluster;