]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDVertex.cxx
The small angle absorber geometry "as built".
[u/mrichter/AliRoot.git] / STEER / AliESDVertex.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
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
18 //           for the Event Data Summary class
19 //           This class contains the Primary Vertex
20 //           of the event coming from reconstruction
21 // Origin: A.Dainese, Padova, andrea.dainese@pd.infn.it
22 //-----------------------------------------------------------------
23
24 //---- standard headers ----
25 #include "Riostream.h"
26 //---- Root headers --------
27 #include <TMath.h>
28 #include <TROOT.h>
29 //---- AliRoot headers -----
30 #include "AliESDVertex.h"
31
32
33 ClassImp(AliESDVertex)
34
35 //--------------------------------------------------------------------------
36 AliESDVertex::AliESDVertex() :
37   AliVertex(),
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),
44   fChi2(0)
45 {
46   //
47   // Default Constructor, set everything to 0
48   //
49   SetToZero();
50 }
51
52 //--------------------------------------------------------------------------
53 AliESDVertex::AliESDVertex(Double_t positionZ,Double_t sigmaZ,
54                            Int_t nContributors,const Char_t *vtxName) :
55   AliVertex(),
56   fCovXX(0.005*0.005),
57   fCovXY(0),
58   fCovYY(0.005*0.005),
59   fCovXZ(0),
60   fCovYZ(0),
61   fCovZZ(sigmaZ*sigmaZ),
62   fChi2(0)
63 {
64   //
65   // Constructor for vertex Z from pixels
66   //
67
68   SetToZero();
69
70   fPosition[2]   = positionZ;
71   SetName(vtxName);
72   SetNContributors(nContributors);
73
74 }
75
76 //------------------------------------------------------------------------- 
77 AliESDVertex::AliESDVertex(Double_t position[3],Double_t covmatrix[6],
78                            Double_t chi2,Int_t nContributors,
79                            const Char_t *vtxName) :
80   AliVertex(position,0.,nContributors),
81   fCovXX(covmatrix[0]),
82   fCovXY(covmatrix[1]),
83   fCovYY(covmatrix[2]),
84   fCovXZ(covmatrix[3]),
85   fCovYZ(covmatrix[4]),
86   fCovZZ(covmatrix[5]),
87   fChi2(chi2)
88 {
89   //
90   // Constructor for vertex in 3D from tracks
91   //
92
93   SetToZero();
94   SetName(vtxName);
95
96 }
97 //--------------------------------------------------------------------------
98 AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
99                            const Char_t *vtxName) :
100   AliVertex(position,0.,0),
101   fCovXX(sigma[0]*sigma[0]),
102   fCovXY(0),
103   fCovYY(sigma[1]*sigma[1]),
104   fCovXZ(0),
105   fCovYZ(0),
106   fCovZZ(sigma[2]*sigma[2]),
107   fChi2(0)
108 {
109   //
110   // Constructor for smearing of true position
111   //
112
113   SetToZero();
114   SetName(vtxName);
115
116 }
117 //--------------------------------------------------------------------------
118 AliESDVertex::AliESDVertex(Double_t position[3],Double_t sigma[3],
119                            Double_t snr[3], const Char_t *vtxName) :
120   AliVertex(position,0.,0),
121   fCovXX(sigma[0]*sigma[0]),
122   fCovXY(0),
123   fCovYY(sigma[1]*sigma[1]),
124   fCovXZ(0),
125   fCovYZ(0),
126   fCovZZ(sigma[2]*sigma[2]),
127   fChi2(0)
128 {
129   //
130   // Constructor for Pb-Pb
131   //
132
133   SetToZero();
134   SetName(vtxName);
135
136   fSNR[0]        = snr[0];
137   fSNR[1]        = snr[1];
138   fSNR[2]        = snr[2];
139
140 }
141
142 //--------------------------------------------------------------------------
143 void AliESDVertex::SetToZero() {
144   //
145   // Set the content of arrays to 0. Used by constructors
146   //
147   for(Int_t i=0; i<3; i++){
148     fTruePos[i] = 0;
149     fSNR[i] = 0.;
150   }
151 }
152 //--------------------------------------------------------------------------
153 void AliESDVertex::GetSigmaXYZ(Double_t sigma[3]) const {
154 //
155 // Return errors on vertex position in thrust frame
156 //
157   sigma[0] = TMath::Sqrt(fCovXX);
158   sigma[1] = TMath::Sqrt(fCovYY);
159   sigma[2] = TMath::Sqrt(fCovZZ);
160
161   return;
162 }
163 //--------------------------------------------------------------------------
164 void AliESDVertex::GetCovMatrix(Double_t covmatrix[6]) const {
165 //
166 // Return covariance matrix of the vertex
167 //
168   covmatrix[0] = fCovXX;
169   covmatrix[1] = fCovXY;
170   covmatrix[2] = fCovYY;
171   covmatrix[3] = fCovXZ;
172   covmatrix[4] = fCovYZ;
173   covmatrix[5] = fCovZZ;
174
175   return;
176 }
177
178 //--------------------------------------------------------------------------
179 void AliESDVertex::GetSNR(Double_t snr[3]) const {
180 //
181 // Return S/N ratios
182 //
183   for(Int_t i=0;i<3;i++) snr[i] = fSNR[i];
184
185   return;
186 }
187 //--------------------------------------------------------------------------
188 void AliESDVertex::Print(Option_t* /*option*/) const {
189 //
190 // Print out information on all data members
191 //
192   printf("ESD vertex position:\n");
193   printf("   x = %f +- %f\n",fPosition[0],TMath::Sqrt(fCovXX));
194   printf("   y = %f +- %f\n",fPosition[1],TMath::Sqrt(fCovYY));
195   printf("   z = %f +- %f\n",fPosition[2],TMath::Sqrt(fCovZZ));
196   printf(" Covariance matrix:\n");
197   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);
198   printf(" S/N = (%f, %f, %f)\n",fSNR[0],fSNR[1],fSNR[2]);
199   printf(" chi2 = %f\n",fChi2);
200   printf(" # tracks (or tracklets) = %d\n",fNContributors);
201
202   printf(" True vertex position - for comparison: %12.10f  %12.10f  %12.10f\n ",fTruePos[0],fTruePos[1],fTruePos[2]);
203
204   return;
205 }
206
207
208
209