Fixing coverity 17918
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 14:00:03 +0000 (14:00 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 14:00:03 +0000 (14:00 +0000)
STEER/ESD/AliESDtrack.cxx

index 9575e49..b6d565e 100644 (file)
@@ -1839,7 +1839,7 @@ Double_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{
     if (idx>0)    found++;
   }
   Float_t density=0.5;
-  if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good);
+  if (good>TMath::Max((row1-row0)*0.5,0.0)) density = Float_t(found)/Float_t(good);
   return density;
 }