]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDVertex.cxx
silvermy@ornl.gov - SMcalib - directory with tools for SuperModule calibrations at...
[u/mrichter/AliRoot.git] / STEER / AliESDVertex.cxx
index a6cbf07c31ca49eef2a667c8adf1dc0c1d2e820f..bc65501a5161c191f20f7352902c4a6df85ee835 100644 (file)
@@ -154,7 +154,6 @@ AliESDVertex::AliESDVertex(const AliESDVertex &source):
   //
   for(Int_t i=0;i<3;i++) {
     fSNR[i] = source.fSNR[i];
-    fTruePos[i] = source.fTruePos[i];
   }
 }
 //--------------------------------------------------------------------------
@@ -162,37 +161,40 @@ AliESDVertex &AliESDVertex::operator=(const AliESDVertex &source){
   //
   // assignment operator
   //
-  if(&source == this) return *this;
-  this->SetName(source.GetName());
-  this->SetTitle(source.GetTitle());
-  for(Int_t i=0;i<3;i++) {
-    fPosition[i] = source.fPosition[i];
-    fTruePos[i] = source.fTruePos[i];
-    fSNR[i] = source.fSNR[i];
-  }
-  fCovXX = source.fCovXX;
-  fCovXY = source.fCovXY;
-  fCovYY = source.fCovYY;
-  fCovXZ = source.fCovXZ;
-  fCovYZ = source.fCovYZ;
-  fCovZZ = source.fCovZZ;
-  fChi2 = source.fChi2;
-  fSigma = source.GetDispersion();
-  fNContributors = source.GetNContributors();
-  fNIndices = source.GetNIndices();
-  if(source.fNIndices>0) {
-    fIndices = new UShort_t[fNIndices];
-    memcpy(fIndices,source.fIndices,fNIndices*sizeof(UShort_t));
+  if(&source != this){
+    AliVertex::operator=(source);
+    for(Int_t i=0;i<3;++i)fSNR[i] = source.fSNR[i];
+    fCovXX = source.fCovXX;
+    fCovXY = source.fCovXY;
+    fCovYY = source.fCovYY;
+    fCovXZ = source.fCovXZ;
+    fCovYZ = source.fCovYZ;
+    fCovZZ = source.fCovZZ;
+    fChi2 = source.fChi2;
   }
   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() {
   //
   // Set the content of arrays to 0. Used by constructors
   //
   for(Int_t i=0; i<3; i++){
-    fTruePos[i] = 0;
     fSNR[i] = 0.;
   }
 }
@@ -246,8 +248,6 @@ void AliESDVertex::Print(Option_t* /*option*/) const {
   printf(" chi2 = %f\n",fChi2);
   printf(" # tracks (or tracklets) = %d\n",fNContributors);
 
-  printf(" True vertex position - for comparison: %12.10f  %12.10f  %12.10f\n ",fTruePos[0],fTruePos[1],fTruePos[2]);
-
   return;
 }