]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliESDVertex.cxx
Changes for #81817: Fixes relatedto the trigger bits treatment in AliReconstruction
[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
de04aa35 21// Origin: A.Dainese, andrea.dainese@lnl.infn.it
c5f0f3c1 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//--------------------------------------------------------------------------
90e48c0c 36AliESDVertex::AliESDVertex() :
8a553be2 37 AliVertex(),
90e48c0c 38 fCovXX(0.005*0.005),
39 fCovXY(0),
40 fCovYY(0.005*0.005),
41 fCovXZ(0),
42 fCovYZ(0),
43 fCovZZ(5.3*5.3),
6dc21f57 44 fChi2(0),
45 fID(-1) // ID=-1 means the vertex with the biggest number of contributors
90e48c0c 46{
47 //
48 // Default Constructor, set everything to 0
49 //
0fc5cc25 50 SetToZero();
c5f0f3c1 51}
90e48c0c 52
c5f0f3c1 53//--------------------------------------------------------------------------
d681bb2d 54AliESDVertex::AliESDVertex(Double_t positionZ,Double_t sigmaZ,
90e48c0c 55 Int_t nContributors,const Char_t *vtxName) :
8a553be2 56 AliVertex(),
90e48c0c 57 fCovXX(0.005*0.005),
58 fCovXY(0),
59 fCovYY(0.005*0.005),
60 fCovXZ(0),
61 fCovYZ(0),
62 fCovZZ(sigmaZ*sigmaZ),
6dc21f57 63 fChi2(0),
64 fID(-1) // ID=-1 means the vertex with the biggest number of contributors
90e48c0c 65{
0fc5cc25 66 //
67 // Constructor for vertex Z from pixels
68 //
c5f0f3c1 69
0fc5cc25 70 SetToZero();
c5f0f3c1 71
0fc5cc25 72 fPosition[2] = positionZ;
8a553be2 73 SetName(vtxName);
74 SetNContributors(nContributors);
c5f0f3c1 75
c5f0f3c1 76}
90e48c0c 77
c5f0f3c1 78//-------------------------------------------------------------------------
d681bb2d 79AliESDVertex::AliESDVertex(Double_t position[3],Double_t covmatrix[6],
90e48c0c 80 Double_t chi2,Int_t nContributors,
81 const Char_t *vtxName) :
8a553be2 82 AliVertex(position,0.,nContributors),
90e48c0c 83 fCovXX(covmatrix[0]),
84 fCovXY(covmatrix[1]),
85 fCovYY(covmatrix[2]),
86 fCovXZ(covmatrix[3]),
87 fCovYZ(covmatrix[4]),
88 fCovZZ(covmatrix[5]),
6dc21f57 89 fChi2(chi2),
90 fID(-1) // ID=-1 means the vertex with the biggest number of contributors
90e48c0c 91{
92 //
93 // Constructor for vertex in 3D from tracks
94 //
0fc5cc25 95
96 SetToZero();
8a553be2 97 SetName(vtxName);
c5f0f3c1 98
cd77595e 99}
c5f0f3c1 100//--------------------------------------------------------------------------
d681bb2d 101AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
90e48c0c 102 const Char_t *vtxName) :
8a553be2 103 AliVertex(position,0.,0),
90e48c0c 104 fCovXX(sigma[0]*sigma[0]),
105 fCovXY(0),
106 fCovYY(sigma[1]*sigma[1]),
107 fCovXZ(0),
108 fCovYZ(0),
109 fCovZZ(sigma[2]*sigma[2]),
6dc21f57 110 fChi2(0),
111 fID(-1) // ID=-1 means the vertex with the biggest number of contributors
90e48c0c 112{
113 //
114 // Constructor for smearing of true position
115 //
0fc5cc25 116
117 SetToZero();
8a553be2 118 SetName(vtxName);
c5f0f3c1 119
c5f0f3c1 120}
121//--------------------------------------------------------------------------
d681bb2d 122AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
90e48c0c 123 Double_t snr[3], const Char_t *vtxName) :
8a553be2 124 AliVertex(position,0.,0),
90e48c0c 125 fCovXX(sigma[0]*sigma[0]),
126 fCovXY(0),
127 fCovYY(sigma[1]*sigma[1]),
128 fCovXZ(0),
129 fCovYZ(0),
130 fCovZZ(sigma[2]*sigma[2]),
6dc21f57 131 fChi2(0),
132 fID(-1) // ID=-1 means the vertex with the biggest number of contributors
90e48c0c 133{
0fc5cc25 134 //
135 // Constructor for Pb-Pb
136 //
137
138 SetToZero();
8a553be2 139 SetName(vtxName);
0fc5cc25 140
141 fSNR[0] = snr[0];
142 fSNR[1] = snr[1];
143 fSNR[2] = snr[2];
144
0fc5cc25 145}
de04aa35 146//--------------------------------------------------------------------------
147AliESDVertex::AliESDVertex(const AliESDVertex &source):
148 AliVertex(source),
149 fCovXX(source.fCovXX),
150 fCovXY(source.fCovXY),
151 fCovYY(source.fCovYY),
152 fCovXZ(source.fCovXZ),
153 fCovYZ(source.fCovYZ),
154 fCovZZ(source.fCovZZ),
6dc21f57 155 fChi2(source.fChi2),
156 fID(source.fID)
de04aa35 157{
158 //
159 // Copy constructor
160 //
161 for(Int_t i=0;i<3;i++) {
162 fSNR[i] = source.fSNR[i];
de04aa35 163 }
164}
165//--------------------------------------------------------------------------
166AliESDVertex &AliESDVertex::operator=(const AliESDVertex &source){
167 //
168 // assignment operator
169 //
316c6cd9 170 if(&source != this){
171 AliVertex::operator=(source);
172 for(Int_t i=0;i<3;++i)fSNR[i] = source.fSNR[i];
173 fCovXX = source.fCovXX;
174 fCovXY = source.fCovXY;
175 fCovYY = source.fCovYY;
176 fCovXZ = source.fCovXZ;
177 fCovYZ = source.fCovYZ;
178 fCovZZ = source.fCovZZ;
179 fChi2 = source.fChi2;
6dc21f57 180 fID = source.fID;
de04aa35 181 }
182 return *this;
183}
bdd011d6 184//--------------------------------------------------------------------------
732a24fe 185void AliESDVertex::Copy(TObject &obj) const {
186
187 // this overwrites the virtual TOBject::Copy()
188 // to allow run time copying without casting
189 // in AliESDEvent
190
191 if(this==&obj)return;
192 AliESDVertex *robj = dynamic_cast<AliESDVertex*>(&obj);
193 if(!robj)return; // not an AliESDVertex
194 *robj = *this;
195
196}
0fc5cc25 197//--------------------------------------------------------------------------
d681bb2d 198void AliESDVertex::SetToZero() {
0fc5cc25 199 //
90e48c0c 200 // Set the content of arrays to 0. Used by constructors
0fc5cc25 201 //
202 for(Int_t i=0; i<3; i++){
0fc5cc25 203 fSNR[i] = 0.;
204 }
c5f0f3c1 205}
206//--------------------------------------------------------------------------
d681bb2d 207void AliESDVertex::GetSigmaXYZ(Double_t sigma[3]) const {
de04aa35 208 //
209 // Return errors on vertex position in thrust frame
210 //
c5f0f3c1 211 sigma[0] = TMath::Sqrt(fCovXX);
212 sigma[1] = TMath::Sqrt(fCovYY);
213 sigma[2] = TMath::Sqrt(fCovZZ);
214
215 return;
cd77595e 216}
c5f0f3c1 217//--------------------------------------------------------------------------
d681bb2d 218void AliESDVertex::GetCovMatrix(Double_t covmatrix[6]) const {
de04aa35 219 //
220 // Return covariance matrix of the vertex
221 //
c5f0f3c1 222 covmatrix[0] = fCovXX;
223 covmatrix[1] = fCovXY;
224 covmatrix[2] = fCovYY;
225 covmatrix[3] = fCovXZ;
226 covmatrix[4] = fCovYZ;
227 covmatrix[5] = fCovZZ;
228
229 return;
cd77595e 230}
8a553be2 231
c5f0f3c1 232//--------------------------------------------------------------------------
d681bb2d 233void AliESDVertex::GetSNR(Double_t snr[3]) const {
de04aa35 234 //
235 // Return S/N ratios
236 //
c5f0f3c1 237 for(Int_t i=0;i<3;i++) snr[i] = fSNR[i];
238
239 return;
240}
241//--------------------------------------------------------------------------
5f7789fc 242void AliESDVertex::Print(Option_t* /*option*/) const {
de04aa35 243 //
244 // Print out information on all data members
245 //
5f7789fc 246 printf("ESD vertex position:\n");
c5f0f3c1 247 printf(" x = %f +- %f\n",fPosition[0],TMath::Sqrt(fCovXX));
248 printf(" y = %f +- %f\n",fPosition[1],TMath::Sqrt(fCovYY));
249 printf(" z = %f +- %f\n",fPosition[2],TMath::Sqrt(fCovZZ));
250 printf(" Covariance matrix:\n");
251 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);
252 printf(" S/N = (%f, %f, %f)\n",fSNR[0],fSNR[1],fSNR[2]);
253 printf(" chi2 = %f\n",fChi2);
254 printf(" # tracks (or tracklets) = %d\n",fNContributors);
255
256 return;
257}
258
259
260
6b88f180 261