Coverity
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Nov 2011 12:07:10 +0000 (12:07 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Nov 2011 12:07:10 +0000 (12:07 +0000)
ITS/AliITSOnlineSDDBase.cxx
ITS/AliITSOnlineSDDCMN.cxx

index 4dfdf52..15d619d 100644 (file)
@@ -104,8 +104,10 @@ void AliITSOnlineSDDBase::AddEvent(TH2F* hrawd){
       sumQ+=cbin*cbin;
       cnt++;
     }
-    sum[ian]/=(Float_t)cnt;
-    sumQ/=(Float_t)cnt;
+    if(cnt != 0){
+      sum[ian]/=(Float_t)cnt;
+      sumQ/=(Float_t)cnt;
+    }
     fSumBaseline[ian]+=sum[ian];
     fSumRawNoise[ian]+=sumQ;
   }
index 81de509..28d9ff1 100644 (file)
@@ -153,7 +153,7 @@ void AliITSOnlineSDDCMN::AddEvent(TH2F* hrawd){
       sumQ+=cntdiff*cntdiff;
       cnt++;    
     }
-    fSumCorrNoise[ian]+=TMath::Sqrt(sumQ/(Float_t)cnt);
+    if(cnt != 0)fSumCorrNoise[ian]+=TMath::Sqrt(sumQ/(Float_t)cnt);
   }
   delete hcorrd;
 }