From b8093789e50dbb04079ab9cb3018b09b4ba09f58 Mon Sep 17 00:00:00 2001 From: policheh Date: Wed, 19 Mar 2008 11:19:09 +0000 Subject: [PATCH] Bug fixed to avoid an infinite loop when no proper TH2 histogram found. --- PHOS/AliPHOSPreprocessor.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PHOS/AliPHOSPreprocessor.cxx b/PHOS/AliPHOSPreprocessor.cxx index 32777508f4a..9ce681a77ce 100644 --- a/PHOS/AliPHOSPreprocessor.cxx +++ b/PHOS/AliPHOSPreprocessor.cxx @@ -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.", -- 2.31.1