]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMCEvent.cxx
fixed coding violations
[u/mrichter/AliRoot.git] / STEER / AliMCEvent.cxx
index cb81de01e5376e738293d0d8b6aebb73972d4b3c..896f7d4ee083ca3bf4408c374be155dff70e55f7 100644 (file)
@@ -181,11 +181,6 @@ void AliMCEvent::Clean()
        delete fTRBuffer;
        fTRBuffer = 0;
     }
-    if (fVertex) {
-       delete fVertex;
-       fVertex = 0;
-    }
-    
 }
 
 void AliMCEvent::FinishEvent()
@@ -687,12 +682,13 @@ void AliMCEvent::PreReadAll()
 const AliVVertex * AliMCEvent::GetPrimaryVertex() const 
 {
     // Create a MCVertex object from the MCHeader information
+    TArrayF v;
+    GenEventHeader()->PrimaryVertex(v) ;
     if (!fVertex) {
-       TArrayF v;
-       GenEventHeader()->PrimaryVertex(v) ;
        fVertex = new AliMCVertex(v[0], v[1], v[2]);
+    } else {
+       ((AliMCVertex*) fVertex)->SetPosition(v[0], v[1], v[2]);
     }
-    
     return fVertex;
 }