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 3277750..9ce681a 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.",