1 /**************************************************************************
2 * Copyright(c) 2006-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //-----------------------------------------------------------------
17 // Implementation of the base Vertex class
18 // This class contains the Secondary Vertex
20 // And it is the base class for primary vertices
21 // Origin: F.Prino, Torino, prino@to.infn.it
22 //-----------------------------------------------------------------
24 #include "AliVertex.h"
29 //--------------------------------------------------------------------------
30 AliVertex::AliVertex() :
36 // Default Constructor, set everything to 0
38 for(Int_t k=0;k<3;k++) fPosition[k] = 0;
41 //--------------------------------------------------------------------------
42 AliVertex::AliVertex(Double_t position[3],Double_t dispersion,
46 fNContributors(nContributors)
49 // Standard Constructor
52 for(Int_t k=0;k<3;k++) fPosition[k] = position[k];
53 SetName("BaseVertex");
57 //--------------------------------------------------------------------------
58 AliVertex::AliVertex(const AliVertex &source):
60 fSigma(source.GetDispersion()),
61 fNContributors(source.GetNContributors())
66 for(Int_t i=0;i<3;i++)fPosition[i] = source.fPosition[i];
69 //--------------------------------------------------------------------------
70 AliVertex &AliVertex::operator=(const AliVertex &source){
72 // assignment operator
74 if(&source == this) return *this;
75 this->SetName(source.GetName());
76 this->SetTitle(source.GetTitle());
77 for(Int_t i=0;i<3;i++)fPosition[i] = source.fPosition[i];
78 fSigma = source.GetDispersion();
79 fNContributors = source.GetNContributors();
84 //--------------------------------------------------------------------------
85 AliVertex::~AliVertex() {
91 //--------------------------------------------------------------------------
92 void AliVertex::GetXYZ(Double_t position[3]) const {
94 // Return position of the vertex in global frame
96 position[0] = fPosition[0];
97 position[1] = fPosition[1];
98 position[2] = fPosition[2];
102 //--------------------------------------------------------------------------
103 void AliVertex::Print(Option_t* /*option*/) const {
105 // Print out information on all data members
107 printf("Vertex position:\n");
108 printf(" x = %f\n",fPosition[0]);
109 printf(" y = %f\n",fPosition[1]);
110 printf(" z = %f\n",fPosition[2]);
111 printf(" Dispersion = %f\n",fSigma);
112 printf(" # tracks = %d\n",fNContributors);