]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix coverity
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Nov 2011 10:46:50 +0000 (10:46 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Nov 2011 10:46:50 +0000 (10:46 +0000)
STAT/TKDInterpolator.cxx
STAT/TKDInterpolatorBase.cxx
STAT/TKDPDF.cxx

index 31d846a0c68c14356a76ae7c6a2779fdad487037..1ada84395d93eafdae648fe0e2982e870e52f2bb 100644 (file)
@@ -76,7 +76,7 @@ Bool_t TKDInterpolator::SetNode(Int_t inode, const TKDNodeInfo &ref)
     return kFALSE;
   }
   if(inode >= GetNTNodes()){
-    Warning("TKDInterpolator::SetNode()", Form("Node array defined up to %d.", GetNTNodes()));
+    Warning("TKDInterpolator::SetNode()", "Node array defined up to %d.", GetNTNodes());
     return kFALSE;
   }
   TKDNodeInfo *node = (TKDNodeInfo*)(*fNodes)[inode];
index b4a2cc4bb64ec21a169a273dc8688fad7460078d..531035e53dfe8f0aae45a8b650bd714373d97802 100644 (file)
@@ -51,7 +51,7 @@ Bool_t TKDInterpolatorBase::Build(Int_t n)
 {
   // allocate memory for data
   if(Int_t((1.+fAlpha)*fLambda) > n){ // check granularity
-    Error("TKDInterpolatorBase::Build()", Form("Minimum number of points [%d] needed for interpolation exceeds number of evaluation points [%d]. Please increase granularity.", Int_t((1.+fAlpha)*fLambda), n));
+    Error("TKDInterpolatorBase::Build()", "Minimum number of points [%d] needed for interpolation exceeds number of evaluation points [%d]. Please increase granularity.", Int_t((1.+fAlpha)*fLambda), n);
     return kFALSE;
   }
 
@@ -78,7 +78,7 @@ Bool_t TKDInterpolatorBase::Bootstrap()
   Int_t in = GetNTNodes(); TKDNodeInfo *n(NULL);
   while(in--){ 
     if(!(n=(TKDNodeInfo*)(*fNodes)[in])){
-      Error("TKDInterpolatorBase::Bootstrap()", Form("Node @ %d missing.", in));
+      Error("TKDInterpolatorBase::Bootstrap()", "Node @ %d missing.", in);
       return kFALSE;
     }
     n->Bootstrap();
@@ -209,7 +209,7 @@ Double_t TKDInterpolatorBase::Eval(const Double_t *point, Double_t &result, Doub
       fRefPoints[id] = new Float_t[GetNTNodes()];
       for(int in=0; in<GetNTNodes(); in++) fRefPoints[id][in] = ((TKDNodeInfo*)(*fNodes)[in])->Data()[id];
     }
-    Info("TKDInterpolatorBase::Eval()", Form("Build TKDTree(%d, %d, %d)", GetNTNodes(), fNSize, kNhelper));
+    Info("TKDInterpolatorBase::Eval()", "Build TKDTree(%d, %d, %d)", GetNTNodes(), fNSize, kNhelper);
     fKDhelper = new TKDTreeIF(GetNTNodes(), fNSize, kNhelper, fRefPoints);
     fKDhelper->Build();
     fKDhelper->MakeBoundariesExact();
@@ -234,10 +234,10 @@ Double_t TKDInterpolatorBase::Eval(const Double_t *point, Double_t &result, Doub
   Bool_t kDOWN = kFALSE;
   do{
     if(npoints){
-      Info("TKDInterpolatorBase::Eval()", Form("Interpolation failed. Trying to increase the number of interpolation points from %d to %d.", npoints, npoints_new));
+      Info("TKDInterpolatorBase::Eval()", "Interpolation failed. Trying to increase the number of interpolation points from %d to %d.", npoints, npoints_new);
     }
     if(npoints == npoints_new){
-      Error("TKDInterpolatorBase::Eval()", Form("Interpolation failed and number of interpolation points (%d) Can not be increased further.", npoints));
+      Error("TKDInterpolatorBase::Eval()", "Interpolation failed and number of interpolation points (%d) Can not be increased further.", npoints);
       result = 0.;
       error = 1.E10;
       // clean memory
@@ -245,7 +245,7 @@ Double_t TKDInterpolatorBase::Eval(const Double_t *point, Double_t &result, Doub
       return 0.;
     } else npoints = npoints_new;
     if(npoints > GetNTNodes()){
-      Warning("TKDInterpolatorBase::Eval()", Form("The number of interpolation points requested (%d) exceeds number of PDF values (%d). Downscale.", npoints, GetNTNodes()));
+      Warning("TKDInterpolatorBase::Eval()", "The number of interpolation points requested (%d) exceeds number of PDF values (%d). Downscale.", npoints, GetNTNodes());
       npoints = GetNTNodes();
       kDOWN = kTRUE;
     }
@@ -367,8 +367,8 @@ void TKDInterpolatorBase::SetAlpha(Float_t a)
   // check value
   if(Int_t((a+1.)*fLambda) > GetNTNodes()){
     fAlpha = TMath::Max(0.5, Float_t(GetNTNodes())/fLambda-1.);
-    Warning("TKDInterpolatorBase::SetAlpha()", Form("Interpolation neighborhood  exceeds number of evaluation points. Downscale alpha to %f", fAlpha));
-    printf("n[%d] nodes[%d]\n", Int_t((fAlpha+1.)*fLambda), GetNTNodes());
+    Warning("TKDInterpolatorBase::SetAlpha()", "Interpolation neighborhood  exceeds number of evaluation points. Downscale alpha to %f", fAlpha);
+    //printf("n[%d] nodes[%d]\n", Int_t((fAlpha+1.)*fLambda), GetNTNodes());
     return;
   }
   fAlpha = a;
index c4c49c84837c90c7aa087e3998e129c84d0da1a3..c99d1c20760595951fbb46b2bf27f3178fa99124 100644 (file)
@@ -48,14 +48,14 @@ TKDPDF::TKDPDF(TTree *t, const Char_t *var, const Char_t *cut, UInt_t bsize, Lon
   TObjArray *vars = TString(var).Tokenize(":");
   fNDim = vars->GetEntriesFast(); fNDimm = 2*fNDim;
   fNSize = fNDim;
-  if(fNDim > 6/*kDimMax*/) Warning("TKDPDF(TTree*, const Char_t, const Char_t, UInt_t)", Form("Variable number exceed maximum dimension %d. Results are unpredictable.", 6/*kDimMax*/));
+  if(fNDim > 6/*kDimMax*/) Warning("TKDPDF(TTree*, const Char_t, const Char_t, UInt_t)", "Variable number exceed maximum dimension %d. Results are unpredictable.", 6/*kDimMax*/);
   fBucketSize = bsize;
 
   Int_t np;
   Double_t *v;
   for(int idim=0; idim<fNDim; idim++){
     if(!(np = t->Draw(((TObjString*)(*vars)[idim])->GetName(), cut, "goff", nentries, firstentry))){
-      Warning("TKDPDF(TTree*, const Char_t, const Char_t, UInt_t)", Form("Can not access data for keys %s. Key defined on tree :", ((TObjString*)(*vars)[idim])->GetName() ));
+      Warning("TKDPDF(TTree*, const Char_t, const Char_t, UInt_t)", "Can not access data for keys %s. Key defined on tree :", ((TObjString*)(*vars)[idim])->GetName());
       TIterator *it = (t->GetListOfLeaves())->MakeIterator();
       TObject *o;
       while((o = (*it)())) printf("\t%s\n", o->GetName());
@@ -125,7 +125,7 @@ Bool_t TKDPDF::Build(Int_t)
   for(int idim=0; idim<fNDim; idim++){ 
     Float_t dx = bounds[2*idim+1]-bounds[2*idim];
     if(dx < 1.e-30){
-      Warning("TKDPDF::Build()", Form("Terminal bucket index[%d] too narrow on the %d dimension.", inode, idim));
+      Warning("TKDPDF::Build()", "Terminal bucket index[%d] too narrow on the %d dimension.", inode, idim);
       continue;
     }
     node->Val()[0] /= (bounds[2*idim+1] - bounds[2*idim]);
@@ -158,7 +158,7 @@ void TKDPDF::DrawNode(Int_t tnode, UInt_t ax1, UInt_t ax2)
 // but don't delete it. Abusing this function may cause memory leaks !
 
   if(tnode < 0 || tnode >= GetNTNodes()){
-    Warning("DrawNode()", Form("Terminal node %d outside defined range.", tnode));
+    Warning("DrawNode()", "Terminal node %d outside defined range.", tnode);
     return;
   }