]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterSplitterMLEM.cxx
bugfix: correct range of DDL for specified detector
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterSplitterMLEM.cxx
index a758b3474a91c37a4c1e8baa1840d16aef29970c..c27028b281c5bc93aaee6ee091fce228c97cf87b 100644 (file)
@@ -48,6 +48,8 @@
 #include <TRandom.h>
 #include <Riostream.h>
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONClusterSplitterMLEM)
 /// \endcond
@@ -233,7 +235,11 @@ AliMUONClusterSplitterMLEM::Fcn1(const AliMUONCluster& cluster,
     delta /= pad->Charge(); 
     chi2 += delta;
   } // for (Int_t j=0;
-  if (iflag == 0) qAver = qTot / npads;
+  if (iflag == 0 && npads) qAver = qTot / npads;
+  if (!npads)
+  {
+    AliError(Form("Got npads=0. Please check"));
+  }
   f = chi2 / qAver;
 }
 
@@ -440,7 +446,7 @@ AliMUONClusterSplitterMLEM::Fit(const AliMUONCluster& cluster,
        param[j] = parOk[j]; 
       }
       param[fNpar] = 0.6;
-      parmin[fNpar] = 0
+      parmin[fNpar] = 1E-9
       parmax[fNpar++] = 1; 
     }
       
@@ -945,7 +951,7 @@ AliMUONClusterSplitterMLEM::Split(const AliMUONCluster& cluster,
         
         // Flag clusters for fit
         nForFit = 0;
-        while (minGroup[nForFit] >= 0 && nForFit < 3)
+        while (nForFit < 3 && minGroup[nForFit] >= 0)
         {
           if (fDebug) cout << clustNumb[minGroup[nForFit]] << " ";
           clustFit[nForFit] = clustNumb[minGroup[nForFit]];