]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing coverity 17919
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 13:56:22 +0000 (13:56 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 13:56:22 +0000 (13:56 +0000)
STEER/STEERBase/AliMathBase.cxx

index e4ae101c0e58df395e9c94dcb399d0b1aa41676b..1acb0613af5e68bd9580994dd1171b1fa9f7405d 100644 (file)
@@ -28,6 +28,7 @@
 #include "TH3.h"
 #include "TF1.h"
 #include "TLinearFitter.h"
+#include "AliLog.h"
 
 #include "AliExternalTrackParam.h"
 
@@ -71,7 +72,11 @@ void AliMathBase::EvaluateUni(Int_t nvectors, Double_t *data, Double_t &mean
   // sigma of this subset
   //
 
-  if (hh==0)
+  if (nvectors<2) {
+    AliErrorClass(Form("nvectors = %d, should be > 1",nvectors));
+    return;
+  }
+  if (hh<2)
     hh=(nvectors+2)/2;
   Double_t faclts[]={2.6477,2.5092,2.3826,2.2662,2.1587,2.0589,1.9660,1.879,1.7973,1.7203,1.6473};
   Int_t *index=new Int_t[nvectors];