]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDVertex.cxx
Implemented Copy() function for all esd objects to allow for assignment of AliESDEven...
[u/mrichter/AliRoot.git] / STEER / AliESDVertex.cxx
index a2a320b598cb94890e76ee04a8206713d6994905..bc65501a5161c191f20f7352902c4a6df85ee835 100644 (file)
@@ -174,6 +174,21 @@ AliESDVertex &AliESDVertex::operator=(const AliESDVertex &source){
   }
   return *this;
 }
+
+void AliESDVertex::Copy(TObject &obj) const {
+  
+  // this overwrites the virtual TOBject::Copy()
+  // to allow run time copying without casting
+  // in AliESDEvent
+
+  if(this==&obj)return;
+  AliESDVertex *robj = dynamic_cast<AliESDVertex*>(&obj);
+  if(!robj)return; // not an AliESDVertex
+  *robj = *this;
+
+}
+
+
 //--------------------------------------------------------------------------
 void AliESDVertex::SetToZero() {
   //