Bug fixed to avoid an infinite loop when no proper TH2 histogram found.
authorpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Mar 2008 11:19:09 +0000 (11:19 +0000)
committerpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Mar 2008 11:19:09 +0000 (11:19 +0000)
PHOS/AliPHOSPreprocessor.cxx

index 32777508f4a0a6de0e50b54d3cde4650c934136c..9ce681a77ce86411d05534de203d9cf4bb923402 100644 (file)
@@ -361,13 +361,15 @@ Bool_t AliPHOSPreprocessor::CalibrateEmc()
          hRef->SetBins(1000,0.,1000.); // to cut off saturation peak at 1023
          // Check if the reference histogram has too little statistics
          if(hRef->GetEntries()>2) ok=kTRUE;
-         if(!ok && counter > nkeys){
-           Log("No histogram with enough statistics for reference.");
-           return 1;
-         }
        }
       }
+      
       counter++;
+      
+      if(!ok && counter > nkeys){
+       Log("No histogram with enough statistics for reference. Exit.");
+       return 1;
+      }
     }
     
     Log(Form("reference histogram %s, %.1f entries, mean=%.3f, rms=%.3f.",