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 /////////////////////////////////////////////////////////////////////////////
20 // AliTOFtrack class //
22 // Authors: Bologna-CERN-ITEP-Salerno Group //
24 // Description: class for handling ESD extracted tracks for TOF matching. //
26 /////////////////////////////////////////////////////////////////////////////
28 #include "AliESDtrack.h"
29 #include "AliTracker.h"
31 #include "AliTOFGeometryV5.h"
32 #include "AliTOFGeometry.h"
33 #include "AliTOFtrack.h"
37 //_____________________________________________________________________________
38 AliTOFtrack::AliTOFtrack() :
45 // Default constructor.
49 //_____________________________________________________________________________
50 AliTOFtrack::AliTOFtrack(const AliTOFtrack& t) :
54 fTOFgeometry(new AliTOFGeometryV5())
61 //_____________________________________________________________________________
62 AliTOFtrack::AliTOFtrack(const AliESDtrack& t) :
66 fTOFgeometry(new AliTOFGeometryV5())
69 // Constructor from AliESDtrack
71 SetLabel(t.GetLabel());
75 Set(t.GetX(),t.GetAlpha(),t.GetParameter(),t.GetCovariance());
77 if ((t.GetStatus()&AliESDtrack::kTIME) == 0) return;
79 Double_t times[10]; t.GetIntegratedTimes(times); SetIntegratedTimes(times);
80 SetIntegratedLength(t.GetIntegratedLength());
84 //____________________________________________________________________________
85 AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &source)
89 this->fTOFgeometry=source.fTOFgeometry;
94 //_____________________________________________________________________________
95 Bool_t AliTOFtrack::PropagateTo(Double_t xk,Double_t x0,Double_t rho)
97 // Propagates a track of particle with mass=pm to a reference plane
98 // defined by x=xk through media of density=rho and radiationLength=x0
100 if (xk == GetX()) return kTRUE;
102 Double_t oldX=GetX(), oldY=GetY(), oldZ=GetZ();
105 if (!AliExternalTrackParam::PropagateTo(xk,bz)) return kFALSE;
107 Double_t d = TMath::Sqrt((GetX()-oldX)*(GetX()-oldX) +
108 (GetY()-oldY)*(GetY()-oldY) +
109 (GetZ()-oldZ)*(GetZ()-oldZ));
110 if (IsStartedTimeIntegral() && GetX()>oldX) AddTimeStep(d);
112 if (!AliExternalTrackParam::CorrectForMaterial(d*rho/x0,x0,GetMass()))
116 //Energy losses************************
117 if((5940*beta2/(1-beta2+1e-10) - beta2) < 0){return 0;}
119 Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2+1e-10)) - beta2)*d*rho;
121 // suspicious part - think about it ?
122 Double_t kinE = TMath::Sqrt(p2);
123 if (dE>0.8*kinE) dE = 0.8*kinE; //
124 if (dE<0) dE = 0.0; // not valid region for Bethe bloch
130 //_____________________________________________________________________________
131 Bool_t AliTOFtrack::PropagateToInnerTOF()
133 // Propagates a track of particle with mass=pm to a reference plane
134 // defined by x=xk through media of density=rho and radiationLength=x0
137 Double_t ymax=fTOFgeometry->RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
138 Bool_t skip = kFALSE;
139 Double_t y=GetYat(fTOFgeometry->RinTOF(),skip);
144 if (!Rotate(AliTOFGeometry::GetAlpha())) {
147 } else if (y <-ymax) {
148 if (!Rotate(-AliTOFGeometry::GetAlpha())) {
155 Int_t nsteps=Int_t((370.-x)/0.5); // 0.5 cm Steps
156 for (Int_t istep=0;istep<nsteps;istep++){
157 Float_t xp = x+istep*0.5;
159 GetPropagationParameters(param);
160 PropagateTo(xp,param[0],param[1]);
164 if(!PropagateTo(fTOFgeometry->RinTOF()))return 0;
170 //_________________________________________________________________________
171 Double_t AliTOFtrack::GetPredictedChi2(const AliCluster3D *c) const {
175 Double_t p[3]={c->GetX(), c->GetY(), c->GetZ()};
176 Double_t covyz[3]={c->GetSigmaY2(), c->GetSigmaYZ(), c->GetSigmaZ2()};
177 Double_t covxyz[3]={c->GetSigmaX2(), c->GetSigmaXY(), c->GetSigmaXZ()};
178 return AliExternalTrackParam::GetPredictedChi2(p, covyz, covxyz);
180 //_________________________________________________________________________
181 Bool_t AliTOFtrack::PropagateTo(const AliCluster3D *c) {
185 Double_t oldX=GetX(), oldY=GetY(), oldZ=GetZ();
186 Double_t p[3]={c->GetX(), c->GetY(), c->GetZ()};
187 Double_t covyz[3]={c->GetSigmaY2(), c->GetSigmaYZ(), c->GetSigmaZ2()};
188 Double_t covxyz[3]={c->GetSigmaX2(), c->GetSigmaXY(), c->GetSigmaXZ()};
190 if (!AliExternalTrackParam::PropagateTo(p, covyz, covxyz, bz)) return kFALSE;
191 if (IsStartedTimeIntegral()) {
192 Double_t d = TMath::Sqrt((GetX()-oldX)*(GetX()-oldX) +
193 (GetY()-oldY)*(GetY()-oldY) +
194 (GetZ()-oldZ)*(GetZ()-oldZ));
195 if (GetX()<oldX) d=-d;
200 //_________________________________________________________________________
201 Double_t AliTOFtrack::GetYat(Double_t xk, Bool_t & skip) const {
202 //-----------------------------------------------------------------
203 // This function calculates the Y-coordinate of a track at the plane x=xk.
204 // Needed for matching with the TOF (I.Belikov)
205 //-----------------------------------------------------------------
207 skip=(!GetYAt(xk,GetBz(),y));
211 //_____________________________________________________________________________
212 Int_t AliTOFtrack::Compare(const TObject *o) const {
213 //-----------------------------------------------------------------
214 // This function compares tracks according to the their curvature
215 //-----------------------------------------------------------------
216 AliTOFtrack *t=(AliTOFtrack*)o;
217 Double_t co=t->GetSigmaY2()*t->GetSigmaZ2();
218 Double_t c =GetSigmaY2()*GetSigmaZ2();
220 else if (c<co) return -1;
224 //_____________________________________________________________________________
225 Double_t AliTOFtrack::GetBz() const {
227 // returns Bz component of the magnetic field (kG)
229 if (AliTracker::UniformField()) return AliTracker::GetBz();
230 Double_t r[3]; GetXYZ(r);
231 return AliTracker::GetBz(r);
234 //_____________________________________________________________________________
235 void AliTOFtrack::GetPropagationParameters(Double_t *param) {
237 //Get average medium density, x0 while propagating the track
239 //For TRD holes description
241 Double_t thetamin = (90.-31.1) * TMath::Pi()/180.;
242 Double_t thetamax = (90.+31.1) * TMath::Pi()/180.;
244 Double_t zmin = -55.;
248 // Detector inner/outer radii
249 Double_t rTPC = 261.53;
250 Double_t rTPCTRD = 294.5;
251 Double_t rTRD = 369.1;
254 Double_t x0TPC = 40.;
255 Double_t rhoTPC =0.06124;
257 Double_t x0Air = 36.66;
258 Double_t rhoAir =1.2931e-3;
260 Double_t x0TRD = 171.7;
261 Double_t rhoTRD =0.33;
263 // Int_t isec = GetSector();
264 Double_t r[3]; GetXYZ(r);
265 // Float_t thetatr = TMath::ATan2(TMath::Sqrt(r[0]*r[0]+r[1]*r[1]),r[2]);
269 if (isec == 0 || isec == 1 || isec == 2 ) {
270 if( thetatr>=thetamin && thetatr<=thetamax){
275 if (isec == 11 || isec == 12 || isec == 13 || isec == 14 || isec == 15 ) {
276 if( r[2]>=zmin && r[2]<=zmax){
284 {param[0]=x0TPC;param[1]=rhoTPC;}
285 else if(GetX() > rTPC && GetX() < rTPCTRD)
286 {param[0]=x0Air;param[1]=rhoAir;}
287 else if(GetX() >= rTPCTRD && GetX() < rTRD)
288 {param[0]=x0TRD;param[1]=rhoTRD;}
289 else if(GetX() >= rTRD )
290 {param[0]=x0Air;param[1]=rhoAir;}