/* $Id$ */
-#include <Riostream.h>
-#include <TObject.h>
-#include "AliTOFGeometry.h"
-#include "AliTOFtrack.h"
+/////////////////////////////////////////////////////////////////////////////
+// //
+// AliTOFtrack class //
+// //
+// Authors: Bologna-CERN-ITEP-Salerno Group //
+// //
+// Description: class for handling ESD extracted tracks for TOF matching. //
+// //
+/////////////////////////////////////////////////////////////////////////////
+
#include "AliESDtrack.h"
+#include "AliLog.h"
+
+#include "AliTOFGeometryV4.h"
+#include "AliTOFGeometry.h"
+#include "AliTOFtrack.h"
ClassImp(AliTOFtrack)
fCty=t.fCty; fCtz=t.fCtz; fCte=t.fCte; fCtt=t.fCtt;
fCcy=t.fCcy; fCcz=t.fCcz; fCce=t.fCce; fCct=t.fCct; fCcc=t.fCcc;
+ fTOFgeometry = new AliTOFGeometryV4();
}
// Constructor from AliESDtrack
//
+ fTOFgeometry = new AliTOFGeometryV4();
+
SetSeedIndex(-1);
SetLabel(t.GetLabel());
SetChi2(0.);
fX=x;
- x = GetConvConst();
-
fY=p[0];
- fZ=p[1];
- fT=p[3];
+ fZ=p[1]; SaveLocalConvConst();
+ fT=p[3]; x=GetLocalConvConst();
fC=p[4]/x;
fE=fC*fX - p[2];
}
+
+//____________________________________________________________________________
+AliTOFtrack& AliTOFtrack::operator=(const AliTOFtrack &source)
+{
+ // ass. op.
+
+ this->fTOFgeometry=source.fTOFgeometry;
+ return *this;
+
+}
+
//____________________________________________________________________________
void AliTOFtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const {
//
//
// This function returns external representation of the covriance matrix.
//
- Double_t a=GetConvConst();
+ Double_t a=GetLocalConvConst();
Double_t c22=fX*fX*fCcc-2*fX*fCce+fCee;
Double_t c32=fX*fCct-fCte;
Double_t c20=fX*fCcy-fCey, c21=fX*fCcz-fCez, c42=fX*fCcc-fCce;
//_____________________________________________________________________________
void AliTOFtrack::GetCovariance(Double_t cc[15]) const {
+ //
+ // Returns the covariance matrix.
+ //
cc[0]=fCyy;
cc[1]=fCzy; cc[2]=fCzz;
if (TMath::Abs(fC*xk - fE) >= 0.90000) {
return 0;
}
+ Double_t lcc=GetLocalConvConst();
// track Length measurement [SR, GSI, 17.02.2003]
fX=x2;
+ //Change of the magnetic field *************
+ SaveLocalConvConst();
+ cc=fC;
+ fC*=lcc/GetLocalConvConst();
+ fE+=fX*(fC-cc);
+
//Multiple scattering ******************
Double_t d=sqrt((x1-fX)*(x1-fX)+(y1-fY)*(y1-fY)+(z1-fZ)*(z1-fZ));
Double_t p2=(1.+ GetTgl()*GetTgl())/(Get1Pt()*Get1Pt());
if((5940*beta2/(1-beta2+1e-10) - beta2) < 0){return 0;}
Double_t dE=0.153e-3/beta2*(log(5940*beta2/(1-beta2+1e-10)) - beta2)*d*rho;
+ //
+ // suspicious part - think about it ?
+ Double_t kinE = TMath::Sqrt(p2);
+ if (dE>0.8*kinE) dE = 0.8*kinE; //
+ if (dE<0) dE = 0.0; // not valid region for Bethe bloch
+ //
+ //
if (x1 < x2) dE=-dE;
cc=fC;
fC*=(1.- sqrt(p2+GetMass()*GetMass())/p2*dE);
// defined by x=xk through media of density=rho and radiationLength=x0
- Double_t ymax=AliTOFGeometry::RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
+ Double_t ymax=fTOFgeometry->RinTOF()*TMath::Tan(0.5*AliTOFGeometry::GetAlpha());
Bool_t skip = kFALSE;
- Double_t y=this->GetYat(AliTOFGeometry::RinTOF(),skip);
+ Double_t y=GetYat(fTOFgeometry->RinTOF(),skip);
if(skip){
return 0;
}
if (y > ymax) {
- if (!this->Rotate(AliTOFGeometry::GetAlpha())) {
+ if (!Rotate(AliTOFGeometry::GetAlpha())) {
return 0;
}
} else if (y <-ymax) {
- if (!this->Rotate(-AliTOFGeometry::GetAlpha())) {
+ if (!Rotate(-AliTOFGeometry::GetAlpha())) {
return 0;
}
}
- Double_t x = this->GetX();
+ Double_t x = GetX();
Int_t nsteps=Int_t((370.-x)/0.5); // 0.5 cm Steps
for (Int_t istep=0;istep<nsteps;istep++){
Float_t xp = x+istep*0.5;
Double_t param[2];
- this->GetPropagationParameters(holes,param);
- this->PropagateTo(xp,param[0],param[1]);
+ GetPropagationParameters(holes,param);
+ PropagateTo(xp,param[0],param[1]);
}
- if(!this->PropagateTo(AliTOFGeometry::RinTOF()))return 0;
+ if(!PropagateTo(fTOFgeometry->RinTOF()))return 0;
return 1;
Double_t r2=fC*fX - fE;
if (TMath::Abs(r2) >= 0.90000) {
- cerr<<" AliTOFtrack warning: Rotation failed !\n";
+ AliWarning("Rotation failed !");
return 0;
}
if((r2*r2) > 1) return 0;
Double_t y0=fY + sqrt(1.- r2*r2)/fC;
if ((fY-y0)*fC >= 0.) {
- cerr<<" AliTOFtrack warning: Rotation failed !!!\n";
+ AliWarning("Rotation failed !!!");
return 0;
}
return 1;
}
-
-
+//_________________________________________________________________________
+Double_t AliTOFtrack::GetYat(Double_t xk, Bool_t & skip) const {
+//-----------------------------------------------------------------
+// This function calculates the Y-coordinate of a track at the plane x=xk.
+// Needed for matching with the TOF (I.Belikov)
+//-----------------------------------------------------------------
+ skip=kFALSE;
+ Double_t c1=fC*fX - fE, r1=TMath::Sqrt(TMath::Abs(1.- c1*c1));
+ Double_t c2=fC*xk - fE, r2=TMath::Sqrt(TMath::Abs(1.- c2*c2));
+ if( ((1.- c2*c2)<0) || ((1.- c1*c1)<0) ) skip=kTRUE;
+ return fY + (xk-fX)*(c1+c2)/(r1+r2);
+}
//_________________________________________________________________________
void AliTOFtrack::GetPxPyPz(Double_t& px, Double_t& py, Double_t& pz) const
{
//_____________________________________________________________________________
void AliTOFtrack::GetPropagationParameters(Bool_t holes, Double_t *param) {
+ //Get average medium density, x0 while propagating the track
+
+ //For TRD holes description
Double_t thetamin = (90.-31.1) * TMath::Pi()/180.;
Double_t thetamax = (90.+31.1) * TMath::Pi()/180.;
Double_t zmin = -55.;
Double_t zmax = 55.;
+ // Detector inner/outer radii
Double_t rTPC = 261.53;
Double_t rTPCTRD = 294.5;
Double_t rTRD = 369.1;
+ // Medium parameters
Double_t x0TPC = 40.;
Double_t rhoTPC =0.06124;
Double_t x0TRD = 171.7;
Double_t rhoTRD =0.33;
- Int_t isec = this->GetSector();
+ Int_t isec = GetSector();
Double_t xtr,ytr,ztr;
- this->GetGlobalXYZ(xtr,ytr,ztr);
+ GetGlobalXYZ(xtr,ytr,ztr);
Float_t thetatr = TMath::ATan2(TMath::Sqrt(xtr*xtr+ytr*ytr),ztr);
if(holes){
}
}
- if(this->GetX() <= rTPC)
+ if(GetX() <= rTPC)
{param[0]=x0TPC;param[1]=rhoTPC;}
- else if(this->GetX() > rTPC && this->GetX() < rTPCTRD)
+ else if(GetX() > rTPC && GetX() < rTPCTRD)
{param[0]=x0Air;param[1]=rhoAir;}
- else if(this->GetX() >= rTPCTRD && this->GetX() < rTRD)
+ else if(GetX() >= rTPCTRD && GetX() < rTRD)
{param[0]=x0TRD;param[1]=rhoTRD;}
- else if(this->GetX() >= rTRD )
+ else if(GetX() >= rTRD )
{param[0]=x0Air;param[1]=rhoAir;}
-
}