AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMFTTrackParam.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 /* $Id$ */
17 
18 #include "TMath.h"
19 
20 #include "AliLog.h"
21 
22 #include "AliMFTTrackParam.h"
23 
24 
26 ClassImp(AliMFTTrackParam); // Class implementation in ROOT context
28 
29 
30 //=============================================================================================
31 
33 fCovariances(NULL),
34 fPropagator(NULL),
35 fExtrapParameters(NULL),
36 fExtrapCovariances(NULL),
37 fSmoothParameters(NULL),
38 fSmoothCovariances(NULL),
39 fParameters(5,1),
40 fX(0.),
41 fY(0.),
42 fZ(0.),
43 fTrackChi2(0.),
44 fLocalChi2(0.)
45 {
47  fParameters.Zero();
48 
49 }
50 
51 //=============================================================================================
53 : TObject(theMFTTrackParam),
54 fCovariances(NULL),
55 fPropagator(NULL),
56 fExtrapParameters(NULL),
57 fExtrapCovariances(NULL),
58 fSmoothParameters(NULL),
59 fSmoothCovariances(NULL),
60 fParameters(theMFTTrackParam.fParameters),
61 fX(theMFTTrackParam.fX),
62 fY(theMFTTrackParam.fY),
63 fZ(theMFTTrackParam.fZ),
64 fTrackChi2(theMFTTrackParam.fTrackChi2),
65 fLocalChi2(theMFTTrackParam.fLocalChi2)
66 {
68  if (theMFTTrackParam.fCovariances) fCovariances = new TMatrixD(*(theMFTTrackParam.fCovariances));
69  if (theMFTTrackParam.fPropagator) fPropagator = new TMatrixD(*(theMFTTrackParam.fPropagator));
70  if (theMFTTrackParam.fExtrapParameters) fExtrapParameters = new TMatrixD(*(theMFTTrackParam.fExtrapParameters));
71  if (theMFTTrackParam.fExtrapCovariances) fExtrapCovariances = new TMatrixD(*(theMFTTrackParam.fExtrapCovariances));
72  if (theMFTTrackParam.fSmoothParameters) fSmoothParameters = new TMatrixD(*(theMFTTrackParam.fSmoothParameters));
73  if (theMFTTrackParam.fSmoothCovariances) fSmoothCovariances = new TMatrixD(*(theMFTTrackParam.fSmoothCovariances));
74 
75  // if(fOwnCluster) fClusterPtr = static_cast<AliMUONVCluster*>(theMFTTrackParam.fClusterPtr->Clone());
76  // else fClusterPtr = theMFTTrackParam.fClusterPtr;
77 }
78 
79 
80 //=============================================================================================
81 
82 
85 
86 }
87 
88 //__________________________________________________________________________
89 Double_t AliMFTTrackParam::P() const
90 {
92  Double_t invPt = GetInverseTransverseMomentum();
93  if(TMath::Abs(invPt)<1e-6) return 0.;
94  return TMath::Sqrt(1+ 1./(GetSlopeX()*GetSlopeX() + GetSlopeY()*GetSlopeY()))/invPt;
95 
96 }
97 //__________________________________________________________________________
98 const TMatrixD& AliMFTTrackParam::GetCovariances() const
99 {
101  if (!fCovariances) {
102 
103  fCovariances = new TMatrixD(5,5);
104  fCovariances->Zero();
105  }
106  return *fCovariances;
107 }
108 
109 //__________________________________________________________________________
110 void AliMFTTrackParam::SetCovariances(const TMatrixD& covariances)
111 {
113  if (fCovariances) *fCovariances = covariances;
114  else fCovariances = new TMatrixD(covariances);
115 }
116 
117 //__________________________________________________________________________
118 void AliMFTTrackParam::SetCovariances(const Double_t matrix[5][5])
119 {
121  if (fCovariances) fCovariances->SetMatrixArray(&(matrix[0][0]));
122  else fCovariances = new TMatrixD(5,5,&(matrix[0][0]));
123 }
124 
125 //__________________________________________________________________________
126 void AliMFTTrackParam::SetVariances(const Double_t matrix[5][5])
127 {
129  if (!fCovariances) fCovariances = new TMatrixD(5,5);
130  fCovariances->Zero();
131  for (Int_t i=0; i<5; i++) (*fCovariances)(i,i) = matrix[i][i];
132 }
133 
134 //__________________________________________________________________________
136 {
138  delete fCovariances;
139  fCovariances = 0x0;
140 }
141 //__________________________________________________________________________
142 const TMatrixD& AliMFTTrackParam::GetPropagator() const
143 {
145  if (!fPropagator) {
146  fPropagator = new TMatrixD(5,5);
147  fPropagator->UnitMatrix();
148  }
149  return *fPropagator;
150 }
151 
152 //__________________________________________________________________________
154 {
156  if (fPropagator) fPropagator->UnitMatrix();
157 }
158 
159 //__________________________________________________________________________
160 void AliMFTTrackParam::UpdatePropagator(const TMatrixD& propagator)
161 {
163  if (fPropagator) *fPropagator = TMatrixD(propagator,TMatrixD::kMult,*fPropagator);
164  else fPropagator = new TMatrixD(propagator);
165 }
166 //__________________________________________________________________________
167 void AliMFTTrackParam::Print(Option_t* opt) const
168 {
171  TString sopt(opt);
172  sopt.ToUpper();
173 
174  if ( sopt.Contains("FULL") ) {
175  if(TMath::Abs(fParameters(4,0))>1.e-6) {
176  AliInfo(Form("\t Pt [GeV/c] = %.2e", 1./fParameters(4,0)));
177  AliInfo(Form("\t P [GeV/c] = %.2e", 1./fParameters(4,0)*TMath::Sqrt(1.+1./(fParameters(2,0)*fParameters(2,0) + fParameters(3,0)*fParameters(3,0)))));
178  }
179  else AliInfo("\t Pt [GeV/c] = Infinite");
180  AliInfo(Form("\t Slope X = %+.4f | Theta = %f", fParameters(2,0),GetTheta()*TMath::RadToDeg()));
181  AliInfo(Form("\t Slope Y = %+.4f | Phi = %f", fParameters(3,0),GetPhi()*TMath::RadToDeg()));
182  AliInfo(Form("\t (X,Y,Z) [cm] = (%e, %e, %e)", fParameters(0,0), fParameters(1,0), fZ));
183  AliInfo(Form("\t Chi2 Local = %e Chi2 Track : %e", fLocalChi2,fTrackChi2));
184  } else {
185 
186  }
187 
188 }
Double_t GetSlopeY() const
return Y slope
Double_t GetPhi() const
return Azimuthal angle phi
virtual ~AliMFTTrackParam()
TMatrixD * fSmoothParameters
! Track parameters obtained using smoother
const TMatrixD & GetCovariances() const
Double_t fZ
Cluster Z coordinate (cm)
TMatrixD * fExtrapParameters
! Track parameters extrapolated to the actual z position (not filtered by Kalman) ...
void SetCovariances(const TMatrixD &covariances)
TMatrixD * fCovariances
Covariance matrix of track parameters.
Double_t GetInverseTransverseMomentum() const
return Inverse Momentum
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Double_t fTrackChi2
Chi2 of the track when the associated cluster was attached.
Double_t GetTheta() const
return Polar angle theta
const TMatrixD & GetPropagator() const
virtual void Print(Option_t *opt="") const
Double_t GetSlopeX() const
return X slope
Double_t P() const
return total momentum
Double_t fLocalChi2
Local chi2 of the associated cluster with respect to the track.
void UpdatePropagator(const TMatrixD &propagator)
TMatrixD * fPropagator
Jacobian used to extrapolate the track parameters and covariances to the actual z position...
Class holding the parameter of a MFT Standalone Track.
TMatrixD fParameters
Track parameters.
void SetVariances(const Double_t matrix[5][5])
TMatrixD * fExtrapCovariances
! Covariance matrix extrapolated to the actual z position (not filtered by Kalman) ...
TMatrixD * fSmoothCovariances
! Covariance matrix obtained using smoother