Line data Source code
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 :
25 : /// \cond CLASSIMP
26 12 : ClassImp(AliMFTTrackParam); // Class implementation in ROOT context
27 : /// \endcond
28 :
29 :
30 : //=============================================================================================
31 :
32 0 : AliMFTTrackParam::AliMFTTrackParam():TObject(),
33 0 : fCovariances(NULL),
34 0 : fPropagator(NULL),
35 0 : fExtrapParameters(NULL),
36 0 : fExtrapCovariances(NULL),
37 0 : fSmoothParameters(NULL),
38 0 : fSmoothCovariances(NULL),
39 0 : fParameters(5,1),
40 0 : fX(0.),
41 0 : fY(0.),
42 0 : fZ(0.),
43 0 : fTrackChi2(0.),
44 0 : fLocalChi2(0.)
45 0 : {
46 : /// Default constructor
47 0 : fParameters.Zero();
48 :
49 0 : }
50 :
51 : //=============================================================================================
52 : AliMFTTrackParam::AliMFTTrackParam(const AliMFTTrackParam& theMFTTrackParam)
53 0 : : TObject(theMFTTrackParam),
54 0 : fCovariances(NULL),
55 0 : fPropagator(NULL),
56 0 : fExtrapParameters(NULL),
57 0 : fExtrapCovariances(NULL),
58 0 : fSmoothParameters(NULL),
59 0 : fSmoothCovariances(NULL),
60 0 : fParameters(theMFTTrackParam.fParameters),
61 0 : fX(theMFTTrackParam.fX),
62 0 : fY(theMFTTrackParam.fY),
63 0 : fZ(theMFTTrackParam.fZ),
64 0 : fTrackChi2(theMFTTrackParam.fTrackChi2),
65 0 : fLocalChi2(theMFTTrackParam.fLocalChi2)
66 0 : {
67 : /// Copy constructor
68 0 : if (theMFTTrackParam.fCovariances) fCovariances = new TMatrixD(*(theMFTTrackParam.fCovariances));
69 0 : if (theMFTTrackParam.fPropagator) fPropagator = new TMatrixD(*(theMFTTrackParam.fPropagator));
70 0 : if (theMFTTrackParam.fExtrapParameters) fExtrapParameters = new TMatrixD(*(theMFTTrackParam.fExtrapParameters));
71 0 : if (theMFTTrackParam.fExtrapCovariances) fExtrapCovariances = new TMatrixD(*(theMFTTrackParam.fExtrapCovariances));
72 0 : if (theMFTTrackParam.fSmoothParameters) fSmoothParameters = new TMatrixD(*(theMFTTrackParam.fSmoothParameters));
73 0 : 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 0 : }
78 :
79 :
80 : //=============================================================================================
81 :
82 :
83 0 : AliMFTTrackParam::~AliMFTTrackParam() {
84 0 : DeleteCovariances();
85 :
86 0 : }
87 :
88 : //__________________________________________________________________________
89 : Double_t AliMFTTrackParam::P() const
90 : {
91 : /// return total momentum
92 0 : Double_t invPt = GetInverseTransverseMomentum();
93 0 : if(TMath::Abs(invPt)<1e-6) return 0.;
94 0 : return TMath::Sqrt(1+ 1./(GetSlopeX()*GetSlopeX() + GetSlopeY()*GetSlopeY()))/invPt;
95 :
96 0 : }
97 : //__________________________________________________________________________
98 : const TMatrixD& AliMFTTrackParam::GetCovariances() const
99 : {
100 : /// Return the covariance matrix (create it before if needed)
101 0 : if (!fCovariances) {
102 :
103 0 : fCovariances = new TMatrixD(5,5);
104 0 : fCovariances->Zero();
105 0 : }
106 0 : return *fCovariances;
107 0 : }
108 :
109 : //__________________________________________________________________________
110 : void AliMFTTrackParam::SetCovariances(const TMatrixD& covariances)
111 : {
112 : /// Set the covariance matrix
113 0 : if (fCovariances) *fCovariances = covariances;
114 0 : else fCovariances = new TMatrixD(covariances);
115 0 : }
116 :
117 : //__________________________________________________________________________
118 : void AliMFTTrackParam::SetCovariances(const Double_t matrix[5][5])
119 : {
120 : /// Set the covariance matrix
121 0 : if (fCovariances) fCovariances->SetMatrixArray(&(matrix[0][0]));
122 0 : else fCovariances = new TMatrixD(5,5,&(matrix[0][0]));
123 0 : }
124 :
125 : //__________________________________________________________________________
126 : void AliMFTTrackParam::SetVariances(const Double_t matrix[5][5])
127 : {
128 : /// Set the diagonal terms of the covariance matrix (variances)
129 0 : if (!fCovariances) fCovariances = new TMatrixD(5,5);
130 0 : fCovariances->Zero();
131 0 : for (Int_t i=0; i<5; i++) (*fCovariances)(i,i) = matrix[i][i];
132 0 : }
133 :
134 : //__________________________________________________________________________
135 : void AliMFTTrackParam::DeleteCovariances()
136 : {
137 : /// Delete the covariance matrix
138 0 : delete fCovariances;
139 0 : fCovariances = 0x0;
140 0 : }
141 : //__________________________________________________________________________
142 : const TMatrixD& AliMFTTrackParam::GetPropagator() const
143 : {
144 : /// Return the propagator (create it before if needed)
145 0 : if (!fPropagator) {
146 0 : fPropagator = new TMatrixD(5,5);
147 0 : fPropagator->UnitMatrix();
148 0 : }
149 0 : return *fPropagator;
150 0 : }
151 :
152 : //__________________________________________________________________________
153 : void AliMFTTrackParam::ResetPropagator()
154 : {
155 : /// Reset the propagator
156 0 : if (fPropagator) fPropagator->UnitMatrix();
157 0 : }
158 :
159 : //__________________________________________________________________________
160 : void AliMFTTrackParam::UpdatePropagator(const TMatrixD& propagator)
161 : {
162 : /// Update the propagator
163 0 : if (fPropagator) *fPropagator = TMatrixD(propagator,TMatrixD::kMult,*fPropagator);
164 0 : else fPropagator = new TMatrixD(propagator);
165 0 : }
166 : //__________________________________________________________________________
167 : void AliMFTTrackParam::Print(Option_t* opt) const
168 : {
169 : /// Printing TrackParam information
170 : /// "full" option for printing all the information about the TrackParam
171 0 : TString sopt(opt);
172 0 : sopt.ToUpper();
173 :
174 0 : if ( sopt.Contains("FULL") ) {
175 0 : if(TMath::Abs(fParameters(4,0))>1.e-6) {
176 0 : AliInfo(Form("\t Pt [GeV/c] = %.2e", 1./fParameters(4,0)));
177 0 : 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 0 : else AliInfo("\t Pt [GeV/c] = Infinite");
180 0 : AliInfo(Form("\t Slope X = %+.4f | Theta = %f", fParameters(2,0),GetTheta()*TMath::RadToDeg()));
181 0 : AliInfo(Form("\t Slope Y = %+.4f | Phi = %f", fParameters(3,0),GetPhi()*TMath::RadToDeg()));
182 0 : AliInfo(Form("\t (X,Y,Z) [cm] = (%e, %e, %e)", fParameters(0,0), fParameters(1,0), fZ));
183 0 : AliInfo(Form("\t Chi2 Local = %e Chi2 Track : %e", fLocalChi2,fTrackChi2));
184 : } else {
185 :
186 : }
187 :
188 0 : }
|