1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // track parameters in "external" format //
22 // The track parameters are: //
23 // - local y coordinate //
24 // - local z coordinate //
25 // - sin of azimutal angle //
26 // - tan of dip angle //
28 // The parametrisation is given at the local x coordinate fX and the //
29 // azimuthal angle fAlpha. //
31 // The external parametrisation can be used to exchange track parameters //
32 // between different detectors. //
34 ///////////////////////////////////////////////////////////////////////////////
39 #include "AliExternalTrackParam.h"
40 #include "AliKalmanTrack.h"
42 ClassImp(AliExternalTrackParam)
45 //_____________________________________________________________________________
46 AliExternalTrackParam::AliExternalTrackParam() :
52 // default constructor
54 for (Int_t i = 0; i < 5; i++) fParam[i] = 0;
55 for (Int_t i = 0; i < 15; i++) fCovar[i] = 0;
58 //_____________________________________________________________________________
59 AliExternalTrackParam::AliExternalTrackParam(Double_t x, Double_t alpha,
60 const Double_t param[5],
61 const Double_t covar[15]) :
67 // create external track parameters from given arguments
69 for (Int_t i = 0; i < 5; i++) fParam[i] = param[i];
70 for (Int_t i = 0; i < 15; i++) fCovar[i] = covar[i];
73 //_____________________________________________________________________________
74 AliExternalTrackParam::AliExternalTrackParam(const AliKalmanTrack& track) :
76 fAlpha(track.GetAlpha())
80 track.GetExternalParameters(fX,fParam);
81 track.GetExternalCovariance(fCovar);
84 //_____________________________________________________________________________
85 const Double_t* AliExternalTrackParam::GetParameter() const
87 // get a pointer to the array of track parameters
92 //_____________________________________________________________________________
93 const Double_t* AliExternalTrackParam::GetCovariance() const
95 // get a pointer to the array of the track parameter covariance matrix
100 //_____________________________________________________________________________
101 AliExternalTrackParam* AliExternalTrackParam::CreateExternalParam() const
103 // copy this instance
105 return new AliExternalTrackParam(fX, fAlpha, fParam, fCovar);
108 //_____________________________________________________________________________
109 void AliExternalTrackParam::ResetCovariance(Double_t factor,
110 Bool_t clearOffDiagonal)
112 // reset the covariance matrix ("forget" track history)
115 for (Int_t i = 0; i < 5; i++) {
116 for (Int_t j = 0; j < i; j++) { // off diagonal elements
117 if (clearOffDiagonal) {
120 fCovar[k++] *= factor;
123 fCovar[k++] *= factor; // diagonal elements
128 //_____________________________________________________________________________
129 Bool_t AliExternalTrackParam::PropagateTo(Double_t /*x*/, Double_t* /*length*/)
131 // Propagate the track parameters to the given x coordinate assuming vacuum.
132 // If length is not NULL, the change of track length is added to it.
134 // NOT IMPLEMENTED for this class
139 //_____________________________________________________________________________
140 Bool_t AliExternalTrackParam::RotateTo(Double_t /*alpha*/)
142 // Rotate the reference axis for the parametrisation to the given angle.
144 // NOT IMPLEMENTED for this class
149 //_____________________________________________________________________________
150 Bool_t AliExternalTrackParam::CorrectForMaterial(Double_t /*dAngle*/,
153 // Take into account material effects assuming:
154 // dAngle2: mean multiple scattering angle in rad squared
155 // dPrel : mean relative momentum gain (if > 0) or loss (if < 0)
157 // NOT IMPLEMENTED for this class
162 //_____________________________________________________________________________
163 Bool_t AliExternalTrackParam::GetProlongationAt(Double_t /*x*/,
165 Double_t& /*z*/) const
167 // Get the local y and z coordinates at the given x value
169 // NOT IMPLEMENTED for this class
174 //_____________________________________________________________________________
175 Double_t AliExternalTrackParam::GetXAtVertex(Double_t /*x*/,
176 Double_t /*y*/) const
178 // Get the x coordinate at the given vertex (x,y)
180 // NOT IMPLEMENTED for this class
186 //_____________________________________________________________________________
187 Double_t AliExternalTrackParam::GetPredictedChi2(const AliCluster* /*cluster*/)
189 // calculate the chi2 contribution of the given cluster
191 // NOT IMPLEMENTED for this class
196 //_____________________________________________________________________________
197 Bool_t AliExternalTrackParam::Update(const AliCluster* /*cluster*/)
199 // update the track parameters using the position and error
200 // of the given cluster
202 // NOT IMPLEMENTED for this class
208 //_____________________________________________________________________________
209 Double_t AliExternalTrackParam::SigmaPhi() const
211 // get the error of the azimuthal angle
213 return TMath::Sqrt(TMath::Abs(fCovar[5] / (1. - fParam[2]*fParam[2])));
216 //_____________________________________________________________________________
217 Double_t AliExternalTrackParam::SigmaTheta() const
219 // get the error of the polar angle
221 return TMath::Sqrt(TMath::Abs(fCovar[9])) / (1. + fParam[3]*fParam[3]);
224 //_____________________________________________________________________________
225 Double_t AliExternalTrackParam::SigmaPt() const
227 // get the error of the transversal component of the momentum
229 return TMath::Sqrt(fCovar[14]) / TMath::Abs(fParam[4]);
232 //_____________________________________________________________________________
233 TVector3 AliExternalTrackParam::Momentum() const
235 // get the momentum vector
237 Double_t phi = TMath::ASin(fParam[2]) + fAlpha;
238 Double_t pt = 1. / TMath::Abs(fParam[4]);
239 return TVector3(pt * TMath::Cos(phi),
240 pt * TMath::Sin(phi),
244 //_____________________________________________________________________________
245 TVector3 AliExternalTrackParam::Position() const
247 // get the current spatial position in global coordinates
249 return TVector3(fX * TMath::Cos(fAlpha) - fParam[0] * TMath::Sin(fAlpha),
250 fX * TMath::Sin(fAlpha) + fParam[0] * TMath::Cos(fAlpha),
255 //_____________________________________________________________________________
256 void AliExternalTrackParam::Print(Option_t* /*option*/) const
258 // print the parameters and the covariance matrix
260 printf("AliExternalTrackParam: x = %-12g alpha = %-12g\n", fX, fAlpha);
261 printf(" parameters: %12g %12g %12g %12g %12g\n",
262 fParam[0], fParam[1], fParam[2], fParam[3], fParam[4]);
263 printf(" covariance: %12g\n", fCovar[0]);
264 printf(" %12g %12g\n", fCovar[1], fCovar[2]);
265 printf(" %12g %12g %12g\n", fCovar[3], fCovar[4], fCovar[5]);
266 printf(" %12g %12g %12g %12g\n",
267 fCovar[6], fCovar[7], fCovar[8], fCovar[9]);
268 printf(" %12g %12g %12g %12g %12g\n",
269 fCovar[10], fCovar[11], fCovar[12], fCovar[13], fCovar[14]);