]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFtrack.cxx
PWG3 electrons task added to the train. Analysis train page updated (M.Gheata)
[u/mrichter/AliRoot.git] / TOF / AliTOFtrack.cxx
CommitLineData
74ea065c 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 **************************************************************************/
74ea065c 15
0e46b9ae 16/* $Id$ */
d3c7bfac 17
0e46b9ae 18/////////////////////////////////////////////////////////////////////////////
19// //
20// AliTOFtrack class //
21// //
22// Authors: Bologna-CERN-ITEP-Salerno Group //
23// //
24// Description: class for handling ESD extracted tracks for TOF matching. //
25// //
26/////////////////////////////////////////////////////////////////////////////
d3c7bfac 27
74ea065c 28#include "AliESDtrack.h"
6c94f330 29#include "AliTracker.h"
74ea065c 30
0e46b9ae 31#include "AliTOFGeometry.h"
d3c7bfac 32#include "AliTOFtrack.h"
33
74ea065c 34ClassImp(AliTOFtrack)
35
36//_____________________________________________________________________________
655e379f 37AliTOFtrack::AliTOFtrack() :
38 AliKalmanTrack(),
39 fSeedInd(-1),
ba66add8 40 fSeedLab(-1)
6c94f330 41{
74ea065c 42 //
6c94f330 43 // Default constructor.
74ea065c 44 //
6c94f330 45}
74ea065c 46
6c94f330 47//_____________________________________________________________________________
48AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) :
49 AliKalmanTrack(t),
50 fSeedInd(t.fSeedInd),
ba66add8 51 fSeedLab(t.fSeedLab)
6c94f330 52{
53 //
54 // Copy constructor.
55 //
74ea065c 56}
57
58//_____________________________________________________________________________
6c94f330 59AliTOFtrack::AliTOFtrack(const AliESDtrack& t) :
60 AliKalmanTrack(),
655e379f 61 fSeedInd(-1),
ba66add8 62 fSeedLab(-1)
6c94f330 63{
74ea065c 64 //
65 // Constructor from AliESDtrack
66 //
74ea065c 67 SetLabel(t.GetLabel());
68 SetChi2(0.);
69 SetMass(t.GetMass());
70
6c94f330 71 Set(t.GetX(),t.GetAlpha(),t.GetParameter(),t.GetCovariance());
74ea065c 72
73 if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
74 StartTimeIntegral();
75 Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
76 SetIntegratedLength(t.GetIntegratedLength());
77
74ea065c 78}
7aeeaf38 79
80//____________________________________________________________________________
2f584d46 81AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &/*source*/)
7aeeaf38 82{
83 // ass. op.
84
7aeeaf38 85 return *this;
86
87}
88
74ea065c 89//_____________________________________________________________________________
6c94f330 90Bool_t AliTOFtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
74ea065c 91{
92 // Propagates a track of particle with mass=pm to a reference plane
93 // defined by x=xk through media of density=rho and radiationLength=x0
94
6c94f330 95 if (xk == GetX()) return kTRUE;
74ea065c 96
6c94f330 97 Double_t oldX=GetX(), oldY=GetY(), oldZ=GetZ();
74ea065c 98
c4eac485 99 Double_t b[3];GetBxByBz(b);
100 if (!AliExternalTrackParam::PropagateToBxByBz(xk,b)) return kFALSE;
101 // OLD used code
102 //Double_t bz=GetBz();
103 //if (!AliExternalTrackParam::PropagateTo(xk,bz)) return kFALSE;
74ea065c 104
6c94f330 105 Double_t d = TMath::Sqrt((GetX()-oldX)*(GetX()-oldX) +
106 (GetY()-oldY)*(GetY()-oldY) +
107 (GetZ()-oldZ)*(GetZ()-oldZ));
108 if (IsStartedTimeIntegral() && GetX()>oldX) AddTimeStep(d);
109
110 if (!AliExternalTrackParam::CorrectForMaterial(d*rho/x0,x0,GetMass()))
111 return kFALSE;
74ea065c 112
74ea065c 113 /*
74ea065c 114 //Energy losses************************
115 if((5940*beta2/(1-beta2+1e-10) - beta2) < 0){return 0;}
116
117 Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2+1e-10)) - beta2)*d*rho;
983ebc4f 118 //
119 // suspicious part - think about it ?
120 Double_t kinE = TMath::Sqrt(p2);
121 if (dE>0.8*kinE) dE = 0.8*kinE; //
122 if (dE<0) dE = 0.0; // not valid region for Bethe bloch
6c94f330 123 */
74ea065c 124
6c94f330 125 return kTRUE;
74ea065c 126}
127
128//_____________________________________________________________________________
ba4161e8 129Bool_t AliTOFtrack::PropagateToInnerTOF()
74ea065c 130{
131 // Propagates a track of particle with mass=pm to a reference plane
132 // defined by x=xk through media of density=rho and radiationLength=x0
133
134
ba66add8 135 Double_t ymax=AliTOFGeometry::RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
74ea065c 136 Bool_t skip = kFALSE;
ba66add8 137 Double_t y=GetYat(AliTOFGeometry::RinTOF(),skip);
6c94f330 138 if (skip) {
139 return kFALSE;
74ea065c 140 }
141 if (y > ymax) {
2c770f53 142 if (!Rotate(AliTOFGeometry::GetAlpha())) {
6c94f330 143 return kFALSE;
74ea065c 144 }
145 } else if (y <-ymax) {
2c770f53 146 if (!Rotate(-AliTOFGeometry::GetAlpha())) {
6c94f330 147 return kFALSE;
74ea065c 148 }
149 }
150
151
2c770f53 152 Double_t x = GetX();
b3e52baa 153 Int_t nsteps=Int_t((AliTOFGeometry::Rmin()-x)/0.5); // 0.5 cm Steps
74ea065c 154 for (Int_t istep=0;istep<nsteps;istep++){
155 Float_t xp = x+istep*0.5;
156 Double_t param[2];
ba4161e8 157 GetPropagationParameters(param);
2c770f53 158 PropagateTo(xp,param[0],param[1]);
74ea065c 159
160 }
161
ba66add8 162 if(!PropagateTo(AliTOFGeometry::RinTOF()))return 0;
74ea065c 163
6c94f330 164 return kTRUE;
74ea065c 165
166}
167
ac359ffe 168//_________________________________________________________________________
169Double_t AliTOFtrack::GetPredictedChi2(const AliCluster3D *c) const {
170 //
171 //
172 //
173 Double_t p[3]={c->GetX(), c->GetY(), c->GetZ()};
174 Double_t covyz[3]={c->GetSigmaY2(), c->GetSigmaYZ(), c->GetSigmaZ2()};
175 Double_t covxyz[3]={c->GetSigmaX2(), c->GetSigmaXY(), c->GetSigmaXZ()};
176 return AliExternalTrackParam::GetPredictedChi2(p, covyz, covxyz);
177}
178//_________________________________________________________________________
179Bool_t AliTOFtrack::PropagateTo(const AliCluster3D *c) {
180 //
181 //
182 //
183 Double_t oldX=GetX(), oldY=GetY(), oldZ=GetZ();
184 Double_t p[3]={c->GetX(), c->GetY(), c->GetZ()};
185 Double_t covyz[3]={c->GetSigmaY2(), c->GetSigmaYZ(), c->GetSigmaZ2()};
186 Double_t covxyz[3]={c->GetSigmaX2(), c->GetSigmaXY(), c->GetSigmaXZ()};
187 Double_t bz=GetBz();
188 if (!AliExternalTrackParam::PropagateTo(p, covyz, covxyz, bz)) return kFALSE;
189 if (IsStartedTimeIntegral()) {
190 Double_t d = TMath::Sqrt((GetX()-oldX)*(GetX()-oldX) +
191 (GetY()-oldY)*(GetY()-oldY) +
192 (GetZ()-oldZ)*(GetZ()-oldZ));
193 if (GetX()<oldX) d=-d;
194 AddTimeStep(d);
195 }
196 return kTRUE;
197}
2c770f53 198//_________________________________________________________________________
4668c628 199Double_t AliTOFtrack::GetYat(Double_t xk, Bool_t & skip) const {
2c770f53 200//-----------------------------------------------------------------
201// This function calculates the Y-coordinate of a track at the plane x=xk.
202// Needed for matching with the TOF (I.Belikov)
203//-----------------------------------------------------------------
6c94f330 204 Double_t y=0.;
205 skip=(!GetYAt(xk,GetBz(),y));
206 return y;
2c770f53 207}
74ea065c 208
209//_____________________________________________________________________________
210Int_t AliTOFtrack::Compare(const TObject *o) const {
211 //-----------------------------------------------------------------
212 // This function compares tracks according to the their curvature
213 //-----------------------------------------------------------------
214 AliTOFtrack *t=(AliTOFtrack*)o;
215 Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
216 Double_t c =GetSigmaY2()*GetSigmaZ2();
217 if (c>co) return 1;
218 else if (c<co) return -1;
219 return 0;
220}
221
6c94f330 222
74ea065c 223//_____________________________________________________________________________
ba4161e8 224void AliTOFtrack::GetPropagationParameters(Double_t *param) {
74ea065c 225
2c770f53 226 //Get average medium density, x0 while propagating the track
227
228 //For TRD holes description
ba4161e8 229 /*
74ea065c 230 Double_t thetamin = (90.-31.1) * TMath::Pi()/180.;
231 Double_t thetamax = (90.+31.1) * TMath::Pi()/180.;
232
233 Double_t zmin = -55.;
234 Double_t zmax = 55.;
ba4161e8 235 */
74ea065c 236
2c770f53 237 // Detector inner/outer radii
74ea065c 238 Double_t rTPC = 261.53;
239 Double_t rTPCTRD = 294.5;
240 Double_t rTRD = 369.1;
241
2c770f53 242 // Medium parameters
74ea065c 243 Double_t x0TPC = 40.;
244 Double_t rhoTPC =0.06124;
245
246 Double_t x0Air = 36.66;
247 Double_t rhoAir =1.2931e-3;
248
249 Double_t x0TRD = 171.7;
250 Double_t rhoTRD =0.33;
251
ba4161e8 252 // Int_t isec = GetSector();
6c94f330 253 Double_t r[3]; GetXYZ(r);
ba4161e8 254 // Float_t thetatr = TMath::ATan2(TMath::Sqrt(r[0]*r[0]+r[1]*r[1]),r[2]);
74ea065c 255
ba4161e8 256 /*
74ea065c 257 if(holes){
258 if (isec == 0 || isec == 1 || isec == 2 ) {
259 if( thetatr>=thetamin && thetatr<=thetamax){
260 x0TRD= x0Air;
261 rhoTRD = rhoAir;
262 }
263 }
264 if (isec == 11 || isec == 12 || isec == 13 || isec == 14 || isec == 15 ) {
6c94f330 265 if( r[2]>=zmin && r[2]<=zmax){
74ea065c 266 x0TRD= x0Air;
267 rhoTRD = rhoAir;
268 }
269 }
270 }
ba4161e8 271 */
2c770f53 272 if(GetX() <= rTPC)
74ea065c 273 {param[0]=x0TPC;param[1]=rhoTPC;}
2c770f53 274 else if(GetX() > rTPC && GetX() < rTPCTRD)
74ea065c 275 {param[0]=x0Air;param[1]=rhoAir;}
2c770f53 276 else if(GetX() >= rTPCTRD && GetX() < rTRD)
74ea065c 277 {param[0]=x0TRD;param[1]=rhoTRD;}
2c770f53 278 else if(GetX() >= rTRD )
74ea065c 279 {param[0]=x0Air;param[1]=rhoAir;}
74ea065c 280}