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 : //-------------------------------------------------------------------------
19 : // Implementation of the AliKalmanTrack class
20 : // that is the base for AliTPCtrack, AliITStrackV2 and AliTRDtrack
21 : // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
22 : //-------------------------------------------------------------------------
23 : #include <TGeoManager.h>
24 :
25 : #include "AliKalmanTrack.h"
26 :
27 172 : ClassImp(AliKalmanTrack)
28 :
29 : //_______________________________________________________________________
30 20210 : AliKalmanTrack::AliKalmanTrack():AliExternalTrackParam(),
31 20210 : fFakeRatio(0),
32 20210 : fChi2(0),
33 40420 : fMass(AliPID::ParticleMass(AliPID::kPion)),
34 20210 : fLab(-3141593),
35 20210 : fN(0),
36 20210 : fStartTimeIntegral(kFALSE),
37 20210 : fIntegratedLength(0)
38 60630 : {
39 : //
40 : // Default constructor
41 : //
42 :
43 404200 : for(Int_t i=0; i<AliPID::kSPECIESC; i++) fIntegratedTime[i] = 0;
44 20210 : }
45 :
46 : AliKalmanTrack::AliKalmanTrack(const AliKalmanTrack &t):
47 16733 : AliExternalTrackParam(t),
48 16733 : fFakeRatio(t.fFakeRatio),
49 16733 : fChi2(t.fChi2),
50 16733 : fMass(t.fMass),
51 16733 : fLab(t.fLab),
52 16733 : fN(t.fN),
53 16733 : fStartTimeIntegral(t.fStartTimeIntegral),
54 16733 : fIntegratedLength(t.fIntegratedLength)
55 50199 : {
56 : //
57 : // Copy constructor
58 : //
59 :
60 334660 : for (Int_t i=0; i<AliPID::kSPECIESC; i++)
61 150597 : fIntegratedTime[i] = t.fIntegratedTime[i];
62 16733 : }
63 :
64 : AliKalmanTrack& AliKalmanTrack::operator=(const AliKalmanTrack&o){
65 8472 : if(this!=&o){
66 4236 : AliExternalTrackParam::operator=(o);
67 4236 : fLab = o.fLab;
68 4236 : fFakeRatio = o.fFakeRatio;
69 4236 : fChi2 = o.fChi2;
70 4236 : fMass = o.fMass;
71 4236 : fN = o.fN;
72 4236 : fStartTimeIntegral = o.fStartTimeIntegral;
73 84720 : for(Int_t i = 0;i<AliPID::kSPECIESC;++i)fIntegratedTime[i] = o.fIntegratedTime[i];
74 4236 : fIntegratedLength = o.fIntegratedLength;
75 4236 : }
76 4236 : return *this;
77 : }
78 :
79 : //_______________________________________________________________________
80 : void AliKalmanTrack::StartTimeIntegral()
81 : {
82 : // Sylwester Radomski, GSI
83 : // S.Radomski@gsi.de
84 : //
85 : // Start time integration
86 : // To be called at Vertex by ITS tracker
87 : //
88 :
89 : //if (fStartTimeIntegral)
90 : // AliWarning("Reseting Recorded Time.");
91 :
92 2832 : fStartTimeIntegral = kTRUE;
93 28320 : for(Int_t i=0; i<AliPID::kSPECIESC; i++) fIntegratedTime[i] = 0;
94 1416 : fIntegratedLength = 0;
95 1416 : }
96 :
97 : //_______________________________________________________________________
98 : void AliKalmanTrack:: AddTimeStep(Double_t length)
99 : {
100 : //
101 : // Add step to integrated time
102 : // this method should be called by a sublasses at the end
103 : // of the PropagateTo function or by a tracker
104 : // each time step is made.
105 : //
106 : // If integration not started function does nothing
107 : //
108 : // Formula
109 : // dt = dl * sqrt(p^2 + m^2) / p
110 : // p = pT * (1 + tg^2 (lambda) )
111 : //
112 : // pt = 1/external parameter [4]
113 : // tg lambda = external parameter [3]
114 : //
115 : //
116 : // Sylwester Radomski, GSI
117 : // S.Radomski@gsi.de
118 : //
119 :
120 : static const Double_t kcc = 2.99792458e-2;
121 :
122 126840 : if (!fStartTimeIntegral) return;
123 :
124 63420 : fIntegratedLength += length;
125 :
126 63420 : Double_t xr, param[5];
127 :
128 63420 : GetExternalParameters(xr, param);
129 63420 : double tgl = param[3];
130 :
131 63420 : Double_t p2inv = param[4]*param[4]/(1+tgl*tgl);
132 :
133 : // if (length > 100) return;
134 :
135 1268400 : for (Int_t i=0; i<AliPID::kSPECIESC; i++) {
136 :
137 570780 : Double_t massz = AliPID::ParticleMassZ(i);
138 570780 : Double_t correction = TMath::Sqrt( 1. + massz*massz*p2inv ); // 1/beta
139 570780 : Double_t time = length * correction / kcc;
140 :
141 570780 : fIntegratedTime[i] += time;
142 : }
143 126840 : }
144 :
145 : //_______________________________________________________________________
146 : Double_t AliKalmanTrack::GetIntegratedTime(Int_t pdg) const
147 : {
148 : // Sylwester Radomski, GSI
149 : // S.Radomski@gsi.de
150 : //
151 : // Return integrated time hypothesis for a given particle
152 : // type assumption.
153 : //
154 : // Input parameter:
155 : // pdg - Pdg code of a particle type
156 : //
157 :
158 :
159 0 : if (!fStartTimeIntegral) {
160 0 : AliWarning("Time integration not started");
161 0 : return 0.;
162 : }
163 :
164 0 : for (Int_t i=0; i<AliPID::kSPECIESC; i++)
165 0 : if (AliPID::ParticleCode(i) == TMath::Abs(pdg)) return fIntegratedTime[i];
166 :
167 0 : AliWarning(Form("Particle type [%d] not found", pdg));
168 0 : return 0;
169 0 : }
170 :
171 : void AliKalmanTrack::GetIntegratedTimes(Double_t *times, Int_t nspec) const {
172 24486 : for (Int_t i=nspec; i--;) times[i]=fIntegratedTime[i];
173 1166 : }
174 :
175 : void AliKalmanTrack::SetIntegratedTimes(const Double_t *times) {
176 26544 : for (Int_t i=AliPID::kSPECIESC; i--;) fIntegratedTime[i]=times[i];
177 1264 : }
178 :
|