Fixed Coverity defect (DIVIDE_BY_ZERO)
authorihrivnac <ihrivnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2012 14:50:59 +0000 (14:50 +0000)
committerihrivnac <ihrivnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 Dec 2012 14:50:59 +0000 (14:50 +0000)
(Diego)

MUON/AliMUONResponseTriggerV1.cxx

index 0a357c6..f77b228 100644 (file)
@@ -291,7 +291,9 @@ void AliMUONResponseTriggerV1::SetHV()
         voltage += (dcsValue->GetFloat())*(time2-time1);
       }
       
-      fHVvalues.AddAt(voltage/(timeend-timebegin)/1000,18*iPlane+iRPC); //voltage in kV, not in V
+      Double_t deltaTime = timeend - timebegin;
+      Double_t meanVoltage = ( deltaTime > 0 ) ? 0. : voltage/deltaTime/1000.;
+      fHVvalues.AddAt(meanVoltage,18*iPlane+iRPC); //voltage in kV, not in V
       
       voltage=0;
     }