]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliKalmanTrack.cxx
Removing the obsolete version og MeanMaterailBudget
[u/mrichter/AliRoot.git] / STEER / AliKalmanTrack.cxx
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 ClassImp(AliKalmanTrack)
28
29 //_______________________________________________________________________
30   AliKalmanTrack::AliKalmanTrack():AliExternalTrackParam(),
31   fLab(-3141593),
32   fFakeRatio(0),
33   fChi2(0),
34   fMass(AliPID::ParticleMass(AliPID::kPion)),
35   fN(0),
36   fStartTimeIntegral(kFALSE),
37   fIntegratedLength(0)
38 {
39   //
40   // Default constructor
41   //
42
43   for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i] = 0;
44 }
45
46 //_______________________________________________________________________
47 AliKalmanTrack::AliKalmanTrack(const AliKalmanTrack &t):
48   AliExternalTrackParam(t),
49   fLab(t.fLab),
50   fFakeRatio(t.fFakeRatio),
51   fChi2(t.fChi2),
52   fMass(t.fMass),
53   fN(t.fN),
54   fStartTimeIntegral(t.fStartTimeIntegral),
55   fIntegratedLength(t.fIntegratedLength)
56 {
57   //
58   // Copy constructor
59   //
60   
61   for (Int_t i=0; i<AliPID::kSPECIES; i++)
62       fIntegratedTime[i] = t.fIntegratedTime[i];
63 }
64
65 //_______________________________________________________________________
66 void AliKalmanTrack::StartTimeIntegral() 
67 {
68   // Sylwester Radomski, GSI
69   // S.Radomski@gsi.de
70   //
71   // Start time integration
72   // To be called at Vertex by ITS tracker
73   //
74   
75   //if (fStartTimeIntegral) 
76   //  AliWarning("Reseting Recorded Time.");
77
78   fStartTimeIntegral = kTRUE;
79   for(Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i] = 0;  
80   fIntegratedLength = 0;
81 }
82
83 //_______________________________________________________________________
84 void AliKalmanTrack:: AddTimeStep(Double_t length) 
85 {
86   // 
87   // Add step to integrated time
88   // this method should be called by a sublasses at the end
89   // of the PropagateTo function or by a tracker
90   // each time step is made.
91   //
92   // If integration not started function does nothing
93   //
94   // Formula
95   // dt = dl * sqrt(p^2 + m^2) / p
96   // p = pT * (1 + tg^2 (lambda) )
97   //
98   // pt = 1/external parameter [4]
99   // tg lambda = external parameter [3]
100   //
101   //
102   // Sylwester Radomski, GSI
103   // S.Radomski@gsi.de
104   // 
105   
106   static const Double_t kcc = 2.99792458e-2;
107
108   if (!fStartTimeIntegral) return;
109   
110   fIntegratedLength += length;
111
112   Double_t xr, param[5];
113   Double_t pt, tgl;
114   
115   GetExternalParameters(xr, param);
116   pt =  1/param[4] ;
117   tgl = param[3];
118
119   Double_t p = TMath::Abs(pt * TMath::Sqrt(1+tgl*tgl));
120
121   if (length > 100) return;
122
123   for (Int_t i=0; i<AliPID::kSPECIES; i++) {
124     
125     Double_t mass = AliPID::ParticleMass(i);
126     Double_t correction = TMath::Sqrt( pt*pt * (1 + tgl*tgl) + mass * mass ) / p;
127     Double_t time = length * correction / kcc;
128
129     fIntegratedTime[i] += time;
130   }
131 }
132
133 //_______________________________________________________________________
134 Double_t AliKalmanTrack::GetIntegratedTime(Int_t pdg) const 
135 {
136   // Sylwester Radomski, GSI
137   // S.Radomski@gsi.de
138   //
139   // Return integrated time hypothesis for a given particle
140   // type assumption.
141   //
142   // Input parameter:
143   // pdg - Pdg code of a particle type
144   //
145
146
147   if (!fStartTimeIntegral) {
148     AliWarning("Time integration not started");
149     return 0.;
150   }
151
152   for (Int_t i=0; i<AliPID::kSPECIES; i++)
153     if (AliPID::ParticleCode(i) == TMath::Abs(pdg)) return fIntegratedTime[i];
154
155   AliWarning(Form("Particle type [%d] not found", pdg));
156   return 0;
157 }
158
159 void AliKalmanTrack::GetIntegratedTimes(Double_t *times) const {
160   for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fIntegratedTime[i];
161 }
162
163 void AliKalmanTrack::SetIntegratedTimes(const Double_t *times) {
164   for (Int_t i=0; i<AliPID::kSPECIES; i++) fIntegratedTime[i]=times[i];
165 }
166