]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AOD/AliAODVertex.cxx
Fix Coverity 24835
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODVertex.cxx
index e55f10d4a6bb7f4adb95b10fdccf3ed8d1a8176a..50d011ae62899d5e4910ebde5e653ad9a8aad032 100644 (file)
@@ -205,6 +205,14 @@ AliAODVertex* AliAODVertex::CloneWithoutRefs() const
                                      fType,
                                      0);
   
+  v->SetName(GetName());
+  // NOTE title is not allowed to be set, as GetNContributors 
+  // relies on the title to use the references which are not copied here
+  
+  // to insure the main vertex retains the ncontributors information
+  // (which is otherwise computed dynamically from
+  // references to tracks, which is not kept in the returned object)
+  // we set it here
   v->SetNContributors(fNContributors);  
   
   return v;
@@ -297,7 +305,8 @@ Int_t AliAODVertex::GetNContributors() const
   Int_t cont  = 0;
 
   TString vtitle = GetTitle();
-  if (!vtitle.Contains("VertexerTracks") || vtitle.Contains("TracksNoConstraint")) {
+  if (!vtitle.Contains("VertexerTracks") || vtitle.Contains("TracksNoConstraint") || fType==kPileupTracks
+      ) {
     cont = fNContributors;
   } else {
     for (Int_t iDaug = 0; iDaug < GetNDaughters(); iDaug++) {