]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TUHKMgen/UHKM/DecayChannel.cxx
Coverity deffects fixed; MC event vertex rotated around beam axis with a random angle...
[u/mrichter/AliRoot.git] / TUHKMgen / UHKM / DecayChannel.cxx
index d04ce52e12de59f8ffdc4d9935f10d9513ba9f4a..28464c61082c6bd43d505c466bf8fafcbc225ca2 100644 (file)
@@ -37,7 +37,7 @@ DecayChannel::DecayChannel(const DecayChannel &copy):
   //
   // copy constructor
   //
-  for(Int_t i=0; i<fNDaughters; i++)
+  for(Int_t i=0; i<kMaxDaughters; i++)
     fDaughtersPDG[i] = copy.fDaughtersPDG[i];
 }
 
@@ -50,12 +50,15 @@ DecayChannel::DecayChannel(Int_t mother, Double_t branching, Int_t nDaughters, c
   //
   // constructor
   //
-  for(Int_t i=0; i<nDaughters; i++) {
+  for(Int_t i=0; i<kMaxDaughters; i++) {
     if(i >= kMaxDaughters) {
       cout << "ERROR in DecayChannel explicit constructor: " << endl;
       cout << "Number of daughters bigger than the maximum allowed one (" << kMaxDaughters << ") !!" << endl;
     }
-    fDaughtersPDG[fNDaughters++] = *(daughters+i);
+    if(i<nDaughters)
+      fDaughtersPDG[fNDaughters++] = *(daughters+i);
+    else
+      fDaughtersPDG[i] = kNonsensePDG;
   }
 }