]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDVertex.cxx
Changes for #80800 following bugs #80687: commit to trunk + port to the release ...
[u/mrichter/AliRoot.git] / STEER / AliESDVertex.cxx
index 6a40928ab901822cd8aca7aa3abc2f8d6def3e07..e6750449f7266ebab470bf8e2d0abdc25d5987c9 100644 (file)
@@ -41,7 +41,8 @@ AliESDVertex::AliESDVertex() :
   fCovXZ(0),
   fCovYZ(0),
   fCovZZ(5.3*5.3),
-  fChi2(0)
+  fChi2(0),
+  fID(-1)   // ID=-1 means the vertex with the biggest number of contributors 
 {
   //
   // Default Constructor, set everything to 0
@@ -59,7 +60,8 @@ AliESDVertex::AliESDVertex(Double_t positionZ,Double_t sigmaZ,
   fCovXZ(0),
   fCovYZ(0),
   fCovZZ(sigmaZ*sigmaZ),
-  fChi2(0)
+  fChi2(0),
+  fID(-1)   // ID=-1 means the vertex with the biggest number of contributors 
 {
   //
   // Constructor for vertex Z from pixels
@@ -84,7 +86,8 @@ AliESDVertex::AliESDVertex(Double_t position[3],Double_t covmatrix[6],
   fCovXZ(covmatrix[3]),
   fCovYZ(covmatrix[4]),
   fCovZZ(covmatrix[5]),
-  fChi2(chi2)
+  fChi2(chi2),
+  fID(-1)   // ID=-1 means the vertex with the biggest number of contributors 
 {
   //
   // Constructor for vertex in 3D from tracks
@@ -104,7 +107,8 @@ AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
   fCovXZ(0),
   fCovYZ(0),
   fCovZZ(sigma[2]*sigma[2]),
-  fChi2(0)
+  fChi2(0),
+  fID(-1)   // ID=-1 means the vertex with the biggest number of contributors 
 {
   //
   // Constructor for smearing of true position
@@ -124,7 +128,8 @@ AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
   fCovXZ(0),
   fCovYZ(0),
   fCovZZ(sigma[2]*sigma[2]),
-  fChi2(0)
+  fChi2(0),
+  fID(-1)   // ID=-1 means the vertex with the biggest number of contributors 
 {
   //
   // Constructor for Pb-Pb
@@ -147,7 +152,8 @@ AliESDVertex::AliESDVertex(const AliESDVertex &source):
   fCovXZ(source.fCovXZ),
   fCovYZ(source.fCovYZ),
   fCovZZ(source.fCovZZ),
-  fChi2(source.fChi2)
+  fChi2(source.fChi2),
+  fID(source.fID)
 {
   //
   // Copy constructor
@@ -161,30 +167,34 @@ 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];
-    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;
+    fID = source.fID;
   }
   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