]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderMLEM.cxx
Clear up a confusion between HV channel alias and name (where there is a -1 offset...
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderMLEM.cxx
index 6596734d2fdf9fa140729e5c963498029965a391..55b4799033a70fb80509733a05f408fea81b6242 100644 (file)
@@ -47,6 +47,8 @@
 #include <TMath.h>
 #include "AliCodeTimer.h"
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONClusterFinderMLEM)
 /// \endcond
@@ -106,7 +108,7 @@ AliMUONClusterFinderMLEM::~AliMUONClusterFinderMLEM()
 //_____________________________________________________________________________
 Bool_t 
 AliMUONClusterFinderMLEM::Prepare(Int_t detElemId,
-                                  TClonesArray* pads[2],
+                                  TObjArray* pads[2],
                                   const AliMpArea& area,
                                   const AliMpVSegmentation* seg[2])
 {
@@ -156,7 +158,14 @@ AliMUONClusterFinderMLEM::NextCluster()
 //  AliCodeTimerAuto("",0)
   
   // if the list of clusters is not void, pick one from there
-  TObject* o = fClusterList.At(++fClusterNumber);
+  TObject* o(0x0);
+  
+  // do we have clusters in our list ?
+  if ( fClusterNumber < fClusterList.GetLast() )
+  {
+    o = fClusterList.At(++fClusterNumber);
+  }
+  
   if ( o != 0x0 ) return static_cast<AliMUONCluster*>(o);
   
   //FIXME : at this point, must check whether we've used all the digits
@@ -745,20 +754,20 @@ void AliMUONClusterFinderMLEM::PadOverHist(Int_t idir, Int_t ix0, Int_t iy0, Ali
 
 //_____________________________________________________________________________
 void
-AliMUONClusterFinderMLEM::Plot(const char* basename)
+AliMUONClusterFinderMLEM::Plot(const char* /*basename*/)
 {
   /// Make a plot and save it as png
   
   return; //AZ
-  if (!fPlot) return;
-  
-  TCanvas* c = new TCanvas("MLEM","MLEM",800,600);
-  c->Draw();
-  Draw();
-  c->Modified();
-  c->Update();
-  c->Print(Form("%s.EVT%d.DE%d.CLU%d.png",basename,fEventNumber,
-                fDetElemId,fClusterNumber));
+//  if (!fPlot) return;
+//  
+//  TCanvas* c = new TCanvas("MLEM","MLEM",800,600);
+//  c->Draw();
+//  Draw();
+//  c->Modified();
+//  c->Update();
+//  c->Print(Form("%s.EVT%d.DE%d.CLU%d.png",basename,fEventNumber,
+//                fDetElemId,fClusterNumber));
 }
 
 //_____________________________________________________________________________
@@ -1387,6 +1396,9 @@ Int_t AliMUONClusterFinderMLEM::FindLocalMaxima(TObjArray *pixArray, Int_t *loca
   Double_t xylim[4] = {999, 999, 999, 999};
 
   Int_t nPix = pixArray->GetEntriesFast();
+  
+  if ( nPix <= 0 ) return 0;
+  
   AliMUONPad *pixPtr = 0;
   for (Int_t ipix = 0; ipix < nPix; ++ipix) {
     pixPtr = (AliMUONPad*) pixArray->UncheckedAt(ipix);