]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
floating point check (Marta)
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Sep 2013 10:02:35 +0000 (10:02 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Sep 2013 10:02:35 +0000 (10:02 +0000)
PWG/EMCAL/AliAnalysisTaskEmcal.cxx

index d797628b47ccbb4ff622decd54dd2d0f2f97b5d7..f5558b081e62c8dd208fd521b7f3a50a9f68f65e 100644 (file)
@@ -839,7 +839,12 @@ Bool_t AliAnalysisTaskEmcal::RetrieveEventObjects()
       }
       else {
        Double_t centWidth = (fMaxCent-fMinCent)/(Double_t)fNcentBins;
-       fCentBin = TMath::FloorNint(fCent/centWidth);
+       if(centWidth>0.)
+          fCentBin = TMath::FloorNint(fCent/centWidth);
+       else {
+         fCentBin = fNcentBins-1;
+         AliWarning(Form("%s: Centrality range not set. Setting fCentBin to %d", GetName(),fCentBin));
+       }
        if(fCentBin>=fNcentBins) {
          AliWarning(Form("%s: fCentBin too large: cent = %f fCentBin = %d. Assuming 99", GetName(),fCent,fCentBin));
          fCentBin = fNcentBins-1;