]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDVertex.cxx
Preparation to use ITS tracking in HLT (C.Cheshkov)
[u/mrichter/AliRoot.git] / STEER / AliESDVertex.cxx
CommitLineData
c5f0f3c1 1/**************************************************************************
0fc5cc25 2 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
c5f0f3c1 3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16//-----------------------------------------------------------------
17// Implementation of the Primary Vertex class
af7ba10c 18// for the Event Data Summary class
19// This class contains the Primary Vertex
20// of the event coming from reconstruction
c5f0f3c1 21// Origin: A.Dainese, Padova, andrea.dainese@pd.infn.it
22//-----------------------------------------------------------------
23
24//---- standard headers ----
8ba665e9 25#include "Riostream.h"
c5f0f3c1 26//---- Root headers --------
504de69b 27#include <TMath.h>
504de69b 28#include <TROOT.h>
c5f0f3c1 29//---- AliRoot headers -----
d681bb2d 30#include "AliESDVertex.h"
504de69b 31
32
d681bb2d 33ClassImp(AliESDVertex)
504de69b 34
c5f0f3c1 35//--------------------------------------------------------------------------
d681bb2d 36AliESDVertex::AliESDVertex() {
c5f0f3c1 37//
38// Default Constructor, set everything to 0
39//
0fc5cc25 40 SetToZero();
c5f0f3c1 41}
42//--------------------------------------------------------------------------
d681bb2d 43AliESDVertex::AliESDVertex(Double_t positionZ,Double_t sigmaZ,
a27d7b02 44 Int_t nContributors,const Char_t *vtxName) {
0fc5cc25 45 //
46 // Constructor for vertex Z from pixels
47 //
c5f0f3c1 48
0fc5cc25 49 SetToZero();
c5f0f3c1 50
0fc5cc25 51 fPosition[2] = positionZ;
52 fCovZZ = sigmaZ*sigmaZ;
53 fNContributors = nContributors;
54 SetName(vtxName);
c5f0f3c1 55
c5f0f3c1 56}
57//-------------------------------------------------------------------------
d681bb2d 58AliESDVertex::AliESDVertex(Double_t position[3],Double_t covmatrix[6],
a27d7b02 59 Double_t chi2,Int_t nContributors, const Char_t *vtxName) {
c5f0f3c1 60//
61// Constructor for vertex in 3D from tracks
62//
0fc5cc25 63
64 SetToZero();
c5f0f3c1 65 fPosition[0] = position[0];
66 fPosition[1] = position[1];
67 fPosition[2] = position[2];
68 fCovXX = covmatrix[0];
69 fCovXY = covmatrix[1];
70 fCovYY = covmatrix[2];
71 fCovXZ = covmatrix[3];
72 fCovYZ = covmatrix[4];
73 fCovZZ = covmatrix[5];
74
c5f0f3c1 75
c5f0f3c1 76 fChi2 = chi2;
77 fNContributors = nContributors;
78
79 SetName(vtxName);
80
cd77595e 81}
c5f0f3c1 82//--------------------------------------------------------------------------
d681bb2d 83AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
a27d7b02 84 const Char_t *vtxName) {
c5f0f3c1 85//
86// Constructor for smearing of true position
87//
0fc5cc25 88
89 SetToZero();
c5f0f3c1 90 fPosition[0] = position[0];
91 fPosition[1] = position[1];
92 fPosition[2] = position[2];
93 fCovXX = sigma[0]*sigma[0];
94 fCovXY = 0;
95 fCovYY = sigma[1]*sigma[1];
96 fCovXZ = 0;
97 fCovYZ = 0;
98 fCovZZ = sigma[2]*sigma[2];
99
c5f0f3c1 100
101 SetName(vtxName);
102
c5f0f3c1 103}
104//--------------------------------------------------------------------------
d681bb2d 105AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
a27d7b02 106 Double_t snr[3], const Char_t *vtxName) {
0fc5cc25 107 //
108 // Constructor for Pb-Pb
109 //
110
111 SetToZero();
112 fPosition[0] = position[0];
113 fPosition[1] = position[1];
114 fPosition[2] = position[2];
115 fCovXX = sigma[0]*sigma[0];
116 fCovXY = 0;
117 fCovYY = sigma[1]*sigma[1];
118 fCovXZ = 0;
119 fCovYZ = 0;
120 fCovZZ = sigma[2]*sigma[2];
121
122 fSNR[0] = snr[0];
123 fSNR[1] = snr[1];
124 fSNR[2] = snr[2];
125
126 SetName(vtxName);
c5f0f3c1 127
0fc5cc25 128}
129//--------------------------------------------------------------------------
d681bb2d 130void AliESDVertex::SetToZero() {
0fc5cc25 131 //
132 // Set some data members to 0. Used by constructors
133 //
134 for(Int_t i=0; i<3; i++){
135 fPosition[i] = 0.;
136 fTruePos[i] = 0;
137 fSNR[i] = 0.;
138 }
2257f27e 139 fCovXX = 0.005*0.005;
0fc5cc25 140 fCovXY = 0;
2257f27e 141 fCovYY = 0.005*0.005;
0fc5cc25 142 fCovXZ = 0;
143 fCovYZ = 0;
2257f27e 144 fCovZZ = 5.3*5.3;
0fc5cc25 145
0fc5cc25 146 fChi2 = 0;
147 fNContributors = 0;
c5f0f3c1 148}
149//--------------------------------------------------------------------------
d681bb2d 150AliESDVertex::~AliESDVertex() {
c5f0f3c1 151//
152// Default Destructor
153//
0fc5cc25 154
c5f0f3c1 155}
156//--------------------------------------------------------------------------
d681bb2d 157void AliESDVertex::GetXYZ(Double_t position[3]) const {
c5f0f3c1 158//
159// Return position of the vertex in global frame
c5f0f3c1 160//
161 position[0] = fPosition[0];
162 position[1] = fPosition[1];
163 position[2] = fPosition[2];
164
165 return;
166}
167//--------------------------------------------------------------------------
d681bb2d 168void AliESDVertex::GetSigmaXYZ(Double_t sigma[3]) const {
c5f0f3c1 169//
c5f0f3c1 170// Return errors on vertex position in thrust frame
171//
172 sigma[0] = TMath::Sqrt(fCovXX);
173 sigma[1] = TMath::Sqrt(fCovYY);
174 sigma[2] = TMath::Sqrt(fCovZZ);
175
176 return;
cd77595e 177}
c5f0f3c1 178//--------------------------------------------------------------------------
d681bb2d 179void AliESDVertex::GetCovMatrix(Double_t covmatrix[6]) const {
c5f0f3c1 180//
181// Return covariance matrix of the vertex
c5f0f3c1 182//
183 covmatrix[0] = fCovXX;
184 covmatrix[1] = fCovXY;
185 covmatrix[2] = fCovYY;
186 covmatrix[3] = fCovXZ;
187 covmatrix[4] = fCovYZ;
188 covmatrix[5] = fCovZZ;
189
190 return;
cd77595e 191}
c5f0f3c1 192//--------------------------------------------------------------------------
d681bb2d 193Double_t AliESDVertex::GetXv() const {
c5f0f3c1 194//
195// Return global x
196//
11ba84a4 197 return fPosition[0];
c5f0f3c1 198}
199//--------------------------------------------------------------------------
d681bb2d 200Double_t AliESDVertex::GetYv() const {
c5f0f3c1 201//
202// Return global y
203//
11ba84a4 204 return fPosition[1];
c5f0f3c1 205}
206//--------------------------------------------------------------------------
d681bb2d 207Double_t AliESDVertex::GetZv() const {
c5f0f3c1 208//
209// Return global z
210//
211 return fPosition[2];
212}
213//--------------------------------------------------------------------------
d681bb2d 214Double_t AliESDVertex::GetXRes() const {
c5f0f3c1 215//
216// Return error on global x
217//
11ba84a4 218 return TMath::Sqrt(fCovXX);
c5f0f3c1 219}
220//--------------------------------------------------------------------------
d681bb2d 221Double_t AliESDVertex::GetYRes() const {
c5f0f3c1 222//
223// Return error on global y
224//
11ba84a4 225 return TMath::Sqrt(fCovYY);
c5f0f3c1 226}
227//--------------------------------------------------------------------------
d681bb2d 228Double_t AliESDVertex::GetZRes() const {
c5f0f3c1 229//
230// Return error on global z
231//
11ba84a4 232 return TMath::Sqrt(fCovZZ);
c5f0f3c1 233}
234//--------------------------------------------------------------------------
d681bb2d 235void AliESDVertex::GetSNR(Double_t snr[3]) const {
c5f0f3c1 236//
237// Return S/N ratios
238//
239 for(Int_t i=0;i<3;i++) snr[i] = fSNR[i];
240
241 return;
242}
243//--------------------------------------------------------------------------
5f7789fc 244void AliESDVertex::Print(Option_t* /*option*/) const {
c5f0f3c1 245//
246// Print out information on all data members
247//
5f7789fc 248 printf("ESD vertex position:\n");
c5f0f3c1 249 printf(" x = %f +- %f\n",fPosition[0],TMath::Sqrt(fCovXX));
250 printf(" y = %f +- %f\n",fPosition[1],TMath::Sqrt(fCovYY));
251 printf(" z = %f +- %f\n",fPosition[2],TMath::Sqrt(fCovZZ));
252 printf(" Covariance matrix:\n");
253 printf(" %12.10f %12.10f %12.10f\n %12.10f %12.10f %12.10f\n %12.10f %12.10f %12.10f\n",fCovXX,fCovXY,fCovXZ,fCovXY,fCovYY,fCovYZ,fCovXZ,fCovYZ,fCovZZ);
254 printf(" S/N = (%f, %f, %f)\n",fSNR[0],fSNR[1],fSNR[2]);
255 printf(" chi2 = %f\n",fChi2);
256 printf(" # tracks (or tracklets) = %d\n",fNContributors);
257
0fc5cc25 258 printf(" True vertex position - for comparison: %12.10f %12.10f %12.10f\n ",fTruePos[0],fTruePos[1],fTruePos[2]);
259
c5f0f3c1 260 return;
261}
262
263
264
6b88f180 265