]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity bugs corrected.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Oct 2010 20:15:00 +0000 (20:15 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 9 Oct 2010 20:15:00 +0000 (20:15 +0000)
EVGEN/AliGenHIJINGpara.cxx
THijing/AliGenHijing.cxx
THijing/THijing.cxx

index 20cabde512d1f314a33e46c6629dc1a81cdc1158..3596b4deb8b27d9ca3a4b1b52b6965ea4df7dfa5 100644 (file)
@@ -428,7 +428,7 @@ void AliGenHIJINGpara::DecayPi0(Float_t* orig, Float_t * p)
     Float_t polar[3] = {0., 0., 0.};
     Int_t np = fDecayer->ImportParticles(particles);
     fNpartProd += (np-1);
-    Int_t nt;    
+    Int_t nt = 0;    
     for (Int_t i = 1; i < np; i++)
     {
        TParticle* iParticle =  (TParticle *) particles->At(i);
index d6b87a172954764624284ebeca4a96cbf419e3b0..425e062e3541a19c10e3d5ce0dc9b168ac781268 100644 (file)
@@ -280,7 +280,6 @@ void AliGenHijing::Generate()
       
 //      Get event vertex
 //
-      TParticle *  iparticle = (TParticle *) fParticles.At(0);
       fVertex[0] = origin0[0];
       fVertex[1] = origin0[1]; 
       fVertex[2] = origin0[2];
@@ -288,7 +287,7 @@ void AliGenHijing::Generate()
 //
 //      First select parent particles
 //
-
+      TParticle *  iparticle = 0;
       for (i = 0; i < np; i++) {
          iparticle = (TParticle *) fParticles.At(i);
 
@@ -445,7 +444,12 @@ void AliGenHijing::EvaluateCrossSections()
     Float_t* b   = new Float_t[kMax];
     Float_t* si1 = new Float_t[kMax];    
     Float_t* si2 = new Float_t[kMax];    
-    
+    for (i = 0; i < kMax; i++){
+      b[i] = 0.;
+      si1[i] = 0.;
+      si2[i] = 0.;
+    }
+
     for (i = 0; i < kMax; i++)
     {
        Float_t xb  = bMin+i*kdib;
index 58130406a1f148a27beca03f4411748b1c542050..c95e483f71c9e9e3c0cf2275ac4f620c737f3274 100644 (file)
@@ -1129,9 +1129,9 @@ void THijing::SetPARJ(Int_t key, Float_t parm)
     if ( key < 1 || key > 200) {
        printf("ERROR in THijing::SetPARJ(key,parm):\n");
        printf("      key=%i is out of range [1..200]\n",key);
+    } else {
+      LUDAT1_HIJING.parj[key-1] = parm;
     }
-    
-    LUDAT1_HIJING.parj[key-1] = parm;
 }
 
 
@@ -1141,9 +1141,9 @@ void THijing::SetMSTJ(Int_t key, Int_t parm)
     if ( key < 1 || key > 200) {
        printf("ERROR in THijing::SetMSTJ(key,parm):\n");
        printf("      key=%i is out of range [1..200]\n",key);
+    } else {
+      LUDAT1_HIJING.mstj[key-1] = parm;
     }
-    
-    LUDAT1_HIJING.mstj[key-1] = parm;
 }