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 ///////////////////////////////////////////////////////////////////////////////
37 #include "AliExternalTrackParam.h"
38 #include "AliKalmanTrack.h"
40 ClassImp(AliExternalTrackParam)
43 //_____________________________________________________________________________
44 AliExternalTrackParam::AliExternalTrackParam()
46 // default constructor
49 for (Int_t i = 0; i < 5; i++) fParam[i] = 0;
50 for (Int_t i = 0; i < 15; i++) fCovar[i] = 0;
53 //_____________________________________________________________________________
54 AliExternalTrackParam::AliExternalTrackParam(Double_t x, Double_t alpha,
55 const Double_t param[5],
56 const Double_t covar[15])
58 // create external track parameters from given arguments
62 for (Int_t i = 0; i < 5; i++) fParam[i] = param[i];
63 for (Int_t i = 0; i < 15; i++) fCovar[i] = covar[i];
66 AliExternalTrackParam::AliExternalTrackParam(const AliKalmanTrack& track)
70 track.GetExternalParameters(fX,fParam);
71 track.GetExternalCovariance(fCovar);
72 fAlpha = track.GetAlpha();
76 //_____________________________________________________________________________
77 const Double_t* AliExternalTrackParam::GetParameter() const
79 // get a pointer to the array of track parameters
84 //_____________________________________________________________________________
85 const Double_t* AliExternalTrackParam::GetCovariance() const
87 // get a pointer to the array of the track parameter covariance matrix
92 //_____________________________________________________________________________
93 AliExternalTrackParam* AliExternalTrackParam::CreateExternalParam() const
97 return new AliExternalTrackParam(fX, fAlpha, fParam, fCovar);
100 //_____________________________________________________________________________
101 void AliExternalTrackParam::ResetCovariance(Double_t factor,
102 Bool_t clearOffDiagonal)
104 // reset the covariance matrix ("forget" track history)
107 for (Int_t i = 0; i < 5; i++) {
108 for (Int_t j = 0; j < i; j++) { // off diagonal elements
109 if (clearOffDiagonal) {
112 fCovar[k++] *= factor;
115 fCovar[k++] *= factor; // diagonal elements
120 //_____________________________________________________________________________
121 Bool_t AliExternalTrackParam::PropagateTo(Double_t /*x*/, Double_t* /*length*/)
123 // Propagate the track parameters to the given x coordinate assuming vacuum.
124 // If length is not NULL, the change of track length is added to it.
126 // NOT IMPLEMENTED for this class
131 //_____________________________________________________________________________
132 Bool_t AliExternalTrackParam::RotateTo(Double_t /*alpha*/)
134 // Rotate the reference axis for the parametrisation to the given angle.
136 // NOT IMPLEMENTED for this class
141 //_____________________________________________________________________________
142 Bool_t AliExternalTrackParam::CorrectForMaterial(Double_t /*dAngle*/,
145 // Take into account material effects assuming:
146 // dAngle2: mean multiple scattering angle in rad squared
147 // dPrel : mean relative momentum gain (if > 0) or loss (if < 0)
149 // NOT IMPLEMENTED for this class
154 //_____________________________________________________________________________
155 Bool_t AliExternalTrackParam::GetProlongationAt(Double_t /*x*/,
157 Double_t& /*z*/) const
159 // Get the local y and z coordinates at the given x value
161 // NOT IMPLEMENTED for this class
166 //_____________________________________________________________________________
167 Double_t AliExternalTrackParam::GetXAtVertex(Double_t /*x*/,
168 Double_t /*y*/) const
170 // Get the x coordinate at the given vertex (x,y)
172 // NOT IMPLEMENTED for this class
178 //_____________________________________________________________________________
179 Double_t AliExternalTrackParam::GetPredictedChi2(const AliCluster* /*cluster*/)
181 // calculate the chi2 contribution of the given cluster
183 // NOT IMPLEMENTED for this class
188 //_____________________________________________________________________________
189 Bool_t AliExternalTrackParam::Update(const AliCluster* /*cluster*/)
191 // update the track parameters using the position and error
192 // of the given cluster
194 // NOT IMPLEMENTED for this class
200 //_____________________________________________________________________________
201 Double_t AliExternalTrackParam::SigmaPhi() const
203 // get the error of the azimuthal angle
205 return TMath::Sqrt(TMath::Abs(fCovar[5] / (1. - fParam[2]*fParam[2])));
208 //_____________________________________________________________________________
209 Double_t AliExternalTrackParam::SigmaTheta() const
211 // get the error of the polar angle
213 return TMath::Sqrt(TMath::Abs(fCovar[9])) / (1. + fParam[3]*fParam[3]);
216 //_____________________________________________________________________________
217 Double_t AliExternalTrackParam::SigmaPt() const
219 // get the error of the transversal component of the momentum
221 return TMath::Sqrt(fCovar[14]) / TMath::Abs(fParam[4]);
224 //_____________________________________________________________________________
225 TVector3 AliExternalTrackParam::Momentum() const
227 // get the momentum vector
229 Double_t phi = TMath::ASin(fParam[2]) + fAlpha;
230 Double_t pt = 1. / TMath::Abs(fParam[4]);
231 return TVector3(pt * TMath::Cos(phi),
232 pt * TMath::Sin(phi),
236 //_____________________________________________________________________________
237 TVector3 AliExternalTrackParam::Position() const
239 // get the current spatial position in global coordinates
241 return TVector3(fX * TMath::Cos(fAlpha) - fParam[0] * TMath::Sin(fAlpha),
242 fX * TMath::Sin(fAlpha) + fParam[0] * TMath::Cos(fAlpha),
247 //_____________________________________________________________________________
248 void AliExternalTrackParam::Print(Option_t* /*option*/) const
250 // print the parameters and the covariance matrix
252 printf("AliExternalTrackParam: x = %-12g alpha = %-12g\n", fX, fAlpha);
253 printf(" parameters: %12g %12g %12g %12g %12g\n",
254 fParam[0], fParam[1], fParam[2], fParam[3], fParam[4]);
255 printf(" covariance: %12g\n", fCovar[0]);
256 printf(" %12g %12g\n", fCovar[1], fCovar[2]);
257 printf(" %12g %12g %12g\n", fCovar[3], fCovar[4], fCovar[5]);
258 printf(" %12g %12g %12g %12g\n",
259 fCovar[6], fCovar[7], fCovar[8], fCovar[9]);
260 printf(" %12g %12g %12g %12g %12g\n",
261 fCovar[10], fCovar[11], fCovar[12], fCovar[13], fCovar[14]);