]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterFinderPeakFit.cxx
fix error in dEdx slice calculation for LQ method (Alex Wilk)
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterFinderPeakFit.cxx
index 54c1ba97a67d9020590a735ce20fe6adf3e60cba..7a370a1bfa349a3af0b7aa335f93e614fbe2e6cf 100644 (file)
@@ -185,7 +185,8 @@ AliMUONClusterFinderPeakFit::Prepare(Int_t detElemId, TClonesArray* pads[2],
   fDetElemId = detElemId;
   
   // find out current event number, and reset the cluster number
-  fEventNumber = AliRunLoader::GetRunLoader()->GetEventNumber();
+  AliRunLoader *runLoader = AliRunLoader::GetRunLoader();
+  fEventNumber = runLoader ? runLoader->GetEventNumber() : 0;
   fClusterNumber = -1;
   fClusterList.Delete();
   
@@ -278,7 +279,7 @@ AliMUONClusterFinderPeakFit::WorkOnPreCluster()
   //  AliCodeTimerAuto("")     
 
   if (fDebug) {
-    cout << " *** Event # " << AliRunLoader::GetRunLoader()->GetEventNumber() 
+    cout << " *** Event # " << fEventNumber
         << " det. elem.: " << fDetElemId << endl;
     for (Int_t j = 0; j < fPreCluster->Multiplicity(); ++j) {
       AliMUONPad* pad = fPreCluster->Pad(j);
@@ -842,9 +843,13 @@ Int_t AliMUONClusterFinderPeakFit::FindLocalMaxima(TObjArray *pixArray, Int_t *l
       if (isLocalMax[indx+j-1] > 0) { 
        localMax[nMax] = indx + j - 1; 
        maxVal[nMax++] = fHistAnode->GetCellContent(j,i);
-       if (nMax > 99) AliFatal(" Too many local maxima !!!");
+       if (nMax > 99) break;
       }
     }
+    if (nMax > 99) {
+      AliError(" Too many local maxima !!!");
+      break;
+    }
   }
   if (fDebug) cout << " Local max: " << nMax << endl;
   delete [] isLocalMax;