X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDtrack.cxx;h=c8c41f78740afe86da7c1a7d77414e6643c4e6be;hb=74b154bd31f90ab1fbb95614f49420cb3164afe5;hp=a9b1b0d173420a71a92738c1989fe3c6f48a3e72;hpb=25cde026781e983116e466a6517bdda1012479ca;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDtrack.cxx b/TRD/AliTRDtrack.cxx index a9b1b0d1734..c8c41f78740 100644 --- a/TRD/AliTRDtrack.cxx +++ b/TRD/AliTRDtrack.cxx @@ -16,18 +16,77 @@ /* $Id$ */ #include -#include +#include +#include +#include "AliESDtrack.h" #include "AliTRDgeometry.h" #include "AliTRDcluster.h" #include "AliTRDtrack.h" -#include "AliESDtrack.h" -#include "AliTRDclusterCorrection.h" +#include "AliTRDtracklet.h" ClassImp(AliTRDtrack) -//_____________________________________________________________________________ +/////////////////////////////////////////////////////////////////////////////// +// // +// Represents a reconstructed TRD track // +// Local TRD Kalman track // +// // +/////////////////////////////////////////////////////////////////////////////// + +AliTRDtrack::AliTRDtrack(): + AliKalmanTrack(), + fSeedLab(-1), + fdEdx(0), + fdEdxT(0), + fDE(0), + fAlpha(0), + fX(0), + fStopped(kFALSE), + fY(0), + fZ(0), + fE(0), + fT(0), + fC(0), + fCyy(1e10), + fCzy(0), + fCzz(1e10), + fCey(0), + fCez(0), + fCee(1e10), + fCty(0), + fCtz(0), + fCte(0), + fCtt(1e10), + fCcy(0), + fCcz(0), + fCce(0), + fCct(0), + fCcc(1e10), + fLhElectron(0), + fNWrong(0), + fNRotate(0), + fNCross(0), + fNExpected(0), + fNLast(0), + fNExpectedLast(0), + fNdedx(0), + fChi2Last(1e10), + fBackupTrack(0x0) +{ + for (Int_t i=0; iGetQ()); Double_t s = fX*fC - fE, t=fT; if(s*s < 1) q *= TMath::Sqrt((1-s*s)/(1+t*t)); @@ -67,15 +140,20 @@ AliTRDtrack::AliTRDtrack(const AliTRDcluster *c, UInt_t index, fdQdl[0] = q; // initialisation [SR, GSI 18.02.2003] (i startd for 1) - for(UInt_t i=1; i= TMath::Pi()) fAlpha -= 2*TMath::Pi(); } 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]; @@ -232,64 +357,139 @@ AliTRDtrack::AliTRDtrack(const AliESDtrack& t) fCcy=c[10]; fCcz=c[11]; fCce=c42; fCct=c[13]; fCcc=c[14]; // Initialization [SR, GSI, 18.02.2003] - for(UInt_t i=0; i= TMath::Pi()) fAlpha -= 2*TMath::Pi(); + + return *this; + +} + +// //____________________________________________________________________________ +// AliTRDtrack * AliTRDtrack::MakeTrack(const AliTrackReference *ref, Double_t mass) +// { +// // +// // Make dummy track from the track reference +// // negative mass means opposite charge +// // +// Double_t xx[5]; +// Double_t cc[15]; +// for (Int_t i=0;i<15;i++) cc[i]=0; +// Double_t x = ref->X(), y = ref->Y(), z = ref->Z(); +// Double_t alpha = TMath::ATan2(y,x); +// Double_t xr = TMath::Sqrt(x*x+y*y); +// xx[0] = 0; +// xx[1] = z; +// xx[3] = ref->Pz()/ref->Pt(); +// Float_t b[3]; +// Float_t xyz[3]={x,y,z}; +// Float_t convConst = 0; +// (AliKalmanTrack::GetFieldMap())->Field(xyz,b); +// convConst=1000/0.299792458/(1e-13 - b[2]); +// xx[4] = 1./(convConst*ref->Pt()); +// if (mass<0) xx[4]*=-1.; // negative mass - negative direction +// Double_t lcos = (x*ref->Px()+y*ref->Py())/(xr*ref->Pt()); +// Double_t lsin = TMath::Sin(TMath::ACos(lcos)); +// if (mass<0) lsin*=-1.; +// xx[2] = xr*xx[4]-lsin; +// AliTRDcluster cl; +// AliTRDtrack * track = new AliTRDtrack(&cl,100,xx,cc,xr,alpha); +// track->SetMass(TMath::Abs(mass)); +// track->StartTimeIntegral(); +// return track; +// } + +//____________________________________________________________________________ +Float_t AliTRDtrack::StatusForTOF() +{ + // + // Defines the status of the TOF extrapolation + // + + Float_t res = (0.2 + 0.8*(fN/(fNExpected+5.)))*(0.4+0.6*fTracklets[5].GetN()/20.); + res *= (0.25+0.8*40./(40.+fBudget[2])); + return res; + + Int_t status=0; + if (GetNumberOfClusters()<20) return 0; // + if (fN>110&&fChi2/(Float_t(fN))<3) return 3; //gold + if (fNLast>30&&fChi2Last/(Float_t(fNLast))<3) return 3; //gold + if (fNLast>20&&fChi2Last/(Float_t(fNLast))<2) return 3; //gold + if (fNLast/(fNExpectedLast+3.)>0.8 && fChi2Last/Float_t(fNLast)<5&&fNLast>20) return 2; //silber + if (fNLast>5 &&((fNLast+1.)/(fNExpectedLast+1.))>0.8&&fChi2Last/(fNLast-5.)<6) return 1; - if (!track) return; - Double_t xr, vec[5], cov[15]; - - track->SetLabel(GetLabel()); - track->SetX(fX, fAlpha); - track->SetNClusters(GetNumberOfClusters(), GetChi2()); - track->SetNWrongClusters(fNWrong); - track->SetNRotate(fNRotate); - Double_t times[10]; - GetIntegratedTimes(times); - track->SetTime(times, GetIntegratedLength()); - - track->SetMass(GetMass()); - track->SetdEdX(GetdEdx()); - - GetExternalParameters(xr, vec); - track->SetStateVector(vec); - - GetExternalCovariance(cov); - track->SetCovarianceMatrix(cov); + return status; + } + //____________________________________________________________________________ -void AliTRDtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const { +void AliTRDtrack::GetExternalParameters(Double_t& xr, Double_t x[5]) const +{ // // This function returns external TRD track representation // - xr=fX; - x[0]=GetY(); - x[1]=GetZ(); - x[2]=GetSnp(); - x[3]=GetTgl(); - x[4]=Get1Pt(); + + xr = fX; + x[0] = GetY(); + x[1] = GetZ(); + x[2] = GetSnp(); + x[3] = GetTgl(); + x[4] = Get1Pt(); + } //_____________________________________________________________________________ -void AliTRDtrack::GetExternalCovariance(Double_t cc[15]) const { +void AliTRDtrack::GetExternalCovariance(Double_t cc[15]) 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; @@ -303,9 +503,12 @@ void AliTRDtrack::GetExternalCovariance(Double_t cc[15]) const { } - //_____________________________________________________________________________ -void AliTRDtrack::GetCovariance(Double_t cc[15]) const { +void AliTRDtrack::GetCovariance(Double_t cc[15]) const +{ + // + // Returns the track covariance matrix + // cc[0]=fCyy; cc[1]=fCzy; cc[2]=fCzz; @@ -316,9 +519,11 @@ void AliTRDtrack::GetCovariance(Double_t cc[15]) const { } //_____________________________________________________________________________ -Int_t AliTRDtrack::Compare(const TObject *o) const { - -// Compares tracks according to their Y2 or curvature +Int_t AliTRDtrack::Compare(const TObject *o) const +{ + // + // Compares tracks according to their Y2 or curvature + // AliTRDtrack *t=(AliTRDtrack*)o; // Double_t co=t->GetSigmaY2(); @@ -327,9 +532,10 @@ Int_t AliTRDtrack::Compare(const TObject *o) const { Double_t co=TMath::Abs(t->GetC()); Double_t c =TMath::Abs(GetC()); - if (c>co) return 1; + if (c>co) return 1; else if (c0.8*kinE) dE = 0.8*kinE; // + if (dE<0) dE = 0.0; // not valid region for Bethe bloch + // + // + fDE+=dE; if (x1 < x2) dE=-dE; cc=fC; fC*=(1.- sqrt(p2+GetMass()*GetMass())/p2*dE); fE+=fX*(fC-cc); + // Double_t sigmade = 0.1*dE*TMath::Sqrt(TMath::Sqrt(1+fT*fT)*90./(d+0.0001)); // 20 percent fluctuation - normalized to some length + Double_t sigmade = 0.07*TMath::Sqrt(TMath::Abs(dE)); // energy loss fluctuation + Double_t sigmac2 = sigmade*sigmade*fC*fC*(p2+GetMass()*GetMass())/(p2*p2); + fCcc += sigmac2; + fCee += fX*fX*sigmac2; // track time measurement [SR, GSI 17.02.2002] if (x1 < x2) if (IsStartedTimeIntegral()) { - Double_t l2 = (fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY) + (fZ-oldZ)*(fZ-oldZ); - AddTimeStep(TMath::Sqrt(l2)); + Double_t l2 = TMath::Sqrt((fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY) + (fZ-oldZ)*(fZ-oldZ)); + if (TMath::Abs(l2*fC)>0.0001){ + // make correction for curvature if neccesary + l2 = 0.5*TMath::Sqrt((fX-oldX)*(fX-oldX) + (fY-oldY)*(fY-oldY)); + l2 = 2*TMath::ASin(l2*fC)/fC; + l2 = TMath::Sqrt(l2*l2+(fZ-oldZ)*(fZ-oldZ)); + } + AddTimeStep(l2); } return 1; } - //_____________________________________________________________________________ -Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index, Double_t h01) +Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index + , Double_t h01) { // Assignes found cluster to the track and updates track information @@ -520,7 +761,7 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index, fC = cur; } else { - Double_t xu_factor = 100.; // empirical factor set by C.Xu + Double_t xuFactor = 100.; // empirical factor set by C.Xu // in the first tilt version dy=c->GetY() - fY; dz=c->GetZ() - fZ; dy=dy+h01*dz; @@ -535,10 +776,11 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index, - r00=c->GetSigmaY2()+errang+add, r01=0., r11=c->GetSigmaZ2()*xu_factor; + r00=c->GetSigmaY2()+errang+add, r01=0., r11=c->GetSigmaZ2()*xuFactor; r00+=(fCyy+2.0*h01*fCzy+h01*h01*fCzz); + r01+=(fCzy+h01*fCzz); + r11+=fCzz; - r01+=(fCzy+h01*fCzz); det=r00*r11 - r01*r01; tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; @@ -597,10 +839,12 @@ Int_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq, UInt_t index, // cerr<<"in update: fIndex["<GetNPads()==4) extend=2; + //if (c->GetNPads()==5) extend=3; + //if (c->GetNPads()==6) extend=3; + //if (c->GetQ()<15) return 1; + /* if (corrector!=0){ //if (0){ @@ -630,9 +881,9 @@ Int_t AliTRDtrack::UpdateMI(const AliTRDcluster *c, Double_t chisq, UInt_t index } */ // - Double_t padlength = TMath::Sqrt(c->GetSigmaZ2()*12.); + // Double_t padlength = TMath::Sqrt(c->GetSigmaZ2()*12.); - Double_t r00=c->GetSigmaY2() +errang, r01=0., r11=c->GetSigmaZ2()*10000.; + Double_t r00=(c->GetSigmaY2() +errang+errsys)*extend, r01=0., r11=c->GetSigmaZ2()*10000.; r00+=fCyy; r01+=fCzy; r11+=fCzz; Double_t det=r00*r11 - r01*r01; Double_t tmp=r00; r00=r11/det; r11=tmp/det; r01=-r01/det; @@ -660,20 +911,30 @@ Int_t AliTRDtrack::UpdateMI(const AliTRDcluster *c, Double_t chisq, UInt_t index fC = cur; } else { - Double_t xu_factor = 1000.; // empirical factor set by C.Xu + Double_t padlength = TMath::Sqrt(c->GetSigmaZ2()*12); + + Double_t xuFactor = 1000.; // empirical factor set by C.Xu // in the first tilt version dy=c->GetY() - fY; dz=c->GetZ() - fZ; - dy=dy+h01*dz+correction; + //dy=dy+h01*dz+correction; + + Double_t tiltdz = dz; + if (TMath::Abs(tiltdz)>padlength/2.) { + tiltdz = TMath::Sign(padlength/2,dz); + } + // dy=dy+h01*dz; + dy=dy+h01*tiltdz; + Double_t add=0; if (TMath::Abs(dz)>padlength/2.){ //Double_t dy2 = c->GetY() - fY; //Double_t sign = (dz>0) ? -1.: 1.; //dy2-=h01*sign*padlength/2.; //dy = dy2; - add =1.; + add =1; } - Double_t s00 = c->GetSigmaY2()+errang+add; // error pad - Double_t s11 = c->GetSigmaZ2()*xu_factor; // error pad-row + Double_t s00 = (c->GetSigmaY2()+errang)*extend+errsys+add; // error pad + Double_t s11 = c->GetSigmaZ2()*xuFactor; // error pad-row // r00 = fCyy + 2*fCzy*h01 + fCzz*h01*h01+s00; r01 = fCzy + fCzz*h01; @@ -747,15 +1008,129 @@ Int_t AliTRDtrack::UpdateMI(const AliTRDcluster *c, Double_t chisq, UInt_t index // cerr<<"in update: fIndex["<= 0.90000) { + //Int_t n=GetNumberOfClusters(); + // if (n>4) cerr<