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 //-------------------------------------------------------------------------
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>
25 #include "AliKalmanTrack.h"
27 ClassImp(AliKalmanTrack)
29 //_______________________________________________________________________
30 AliKalmanTrack::AliKalmanTrack():AliExternalTrackParam(),
33 fMass(AliPID::ParticleMass(AliPID::kPion)),
36 fStartTimeIntegral(kFALSE),
40 // Default constructor
43 for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i] = 0;
46 AliKalmanTrack::AliKalmanTrack(const AliKalmanTrack &t):
47 AliExternalTrackParam(t),
48 fFakeRatio(t.fFakeRatio),
53 fStartTimeIntegral(t.fStartTimeIntegral),
54 fIntegratedLength(t.fIntegratedLength)
60 for (Int_t i=0; i<AliPID::kSPECIES; i++)
61 fIntegratedTime[i] = t.fIntegratedTime[i];
64 AliKalmanTrack& AliKalmanTrack::operator=(const AliKalmanTrack&o){
66 AliExternalTrackParam::operator=(o);
68 fFakeRatio = o.fFakeRatio;
72 fStartTimeIntegral = o.fStartTimeIntegral;
73 for(Int_t i = 0;i<AliPID::kSPECIES;++i)fIntegratedTime[i] = o.fIntegratedTime[i];
74 fIntegratedLength = o.fIntegratedLength;
79 //_______________________________________________________________________
80 void AliKalmanTrack::StartTimeIntegral()
82 // Sylwester Radomski, GSI
85 // Start time integration
86 // To be called at Vertex by ITS tracker
89 //if (fStartTimeIntegral)
90 // AliWarning("Reseting Recorded Time.");
92 fStartTimeIntegral = kTRUE;
93 for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i] = 0;
94 fIntegratedLength = 0;
97 //_______________________________________________________________________
98 void AliKalmanTrack:: AddTimeStep(Double_t length)
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.
106 // If integration not started function does nothing
109 // dt = dl * sqrt(p^2 + m^2) / p
110 // p = pT * (1 + tg^2 (lambda) )
112 // pt = 1/external parameter [4]
113 // tg lambda = external parameter [3]
116 // Sylwester Radomski, GSI
120 static const Double_t kcc = 2.99792458e-2;
122 if (!fStartTimeIntegral) return;
124 fIntegratedLength += length;
126 Double_t xr, param[5];
129 GetExternalParameters(xr, param);
133 Double_t p = TMath::Abs(pt * TMath::Sqrt(1+tgl*tgl));
135 if (length > 100) return;
137 for (Int_t i=0; i<AliPID::kSPECIES; i++) {
139 Double_t mass = AliPID::ParticleMass(i);
140 Double_t correction = TMath::Sqrt( pt*pt * (1 + tgl*tgl) + mass * mass ) / p;
141 Double_t time = length * correction / kcc;
143 fIntegratedTime[i] += time;
147 //_______________________________________________________________________
148 Double_t AliKalmanTrack::GetIntegratedTime(Int_t pdg) const
150 // Sylwester Radomski, GSI
153 // Return integrated time hypothesis for a given particle
157 // pdg - Pdg code of a particle type
161 if (!fStartTimeIntegral) {
162 AliWarning("Time integration not started");
166 for (Int_t i=0; i<AliPID::kSPECIES; i++)
167 if (AliPID::ParticleCode(i) == TMath::Abs(pdg)) return fIntegratedTime[i];
169 AliWarning(Form("Particle type [%d] not found", pdg));
173 void AliKalmanTrack::GetIntegratedTimes(Double_t *times) const {
174 for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fIntegratedTime[i];
177 void AliKalmanTrack::SetIntegratedTimes(const Double_t *times) {
178 for (Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i]=times[i];