X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliESDtrack.cxx;h=c39f9f21525d8c40639668147f703c185a20d18a;hb=4162b1d04ae4897e1a1f8dcde8782383ca555cfc;hp=d2e0c4f427abb170600cb2603cb0d49af53141d4;hpb=6e5b1b04f073347b41cc3f5dc2a6eb66ea0f81d8;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliESDtrack.cxx b/STEER/AliESDtrack.cxx index d2e0c4f427a..c39f9f21525 100644 --- a/STEER/AliESDtrack.cxx +++ b/STEER/AliESDtrack.cxx @@ -12,7 +12,6 @@ * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ - //----------------------------------------------------------------- // Implementation of the ESD track class // ESD = Event Summary Data @@ -22,6 +21,7 @@ //----------------------------------------------------------------- #include "TMath.h" +#include "TString.h" #include "AliESDtrack.h" #include "AliKalmanTrack.h" @@ -41,6 +41,8 @@ fCx(0), fCchi2(1e10), fIalpha(0), fIx(0), +fTalpha(0), +fTx(0), fOalpha(0), fOx(0), fITSchi2(0), @@ -52,44 +54,165 @@ fTPCClusterMap(159),//number of padrows fTPCsignal(0), fTRDchi2(0), fTRDncls(0), +fTRDncls0(0), fTRDsignal(0), fTOFchi2(0), fTOFindex(0), -fTOFsignal(-1) +fTOFsignal(-1), +fPHOSsignal(-1), +fEMCALsignal(-1), +fRICHsignal(-1) { // // The default ESD constructor // for (Int_t i=0; imax) {k=i; max=fR[i];} } - if (k==0) return 0.00051; - if (k==1) return 0.10566; + if (k==0) { // dE/dx "crossing points" in the TPC + Double_t p=GetP(); + if ((p>0.38)&&(p<0.48)) + if (fR[0]0.75)&&(p<0.85)) + if (fR[0]GetClusterIndex(i); fITSsignal=t->GetPIDsignal(); fITSLabel = t->GetLabel(); + fITSFakeRatio = t->GetFakeRatio(); break; case kTPCin: case kTPCrefit: @@ -197,22 +321,42 @@ Bool_t AliESDtrack::UpdateTrackParams(AliKalmanTrack *t, ULong_t flags) { break; case kTRDout: - { //requested by the PHOS ("temporary solution") - Double_t r=460.; - if (t->PropagateTo(r,30.,0.)) { + { //requested by the PHOS/EMCAL ("temporary solution") + Int_t i; + Double_t x=460.,buf[15]; + if (t->PropagateTo(x,30.,0.)) { fOalpha=t->GetAlpha(); - t->GetExternalParameters(fOx,fOp); - t->GetExternalCovariance(fOc); + t->GetExternalParameters(x,buf); fOx=x; + for (i=0; i<5; i++) fOp[i]=buf[i]; + t->GetExternalCovariance(buf); + for (i=0; i<15; i++) fOc[i]=buf[i]; + } + x=450.; + if (t->PropagateTo(x,30.,0.)) { + fXalpha=t->GetAlpha(); + t->GetExternalParameters(x,buf); fXx=x; + for (i=0; i<5; i++) fXp[i]=buf[i]; + t->GetExternalCovariance(buf); + for (i=0; i<15; i++) fXc[i]=buf[i]; } } case kTRDin: case kTRDrefit: fTRDLabel = t->GetLabel(); - + fTRDncls=t->GetNumberOfClusters(); fTRDchi2=t->GetChi2(); for (Int_t i=0;iGetClusterIndex(i); fTRDsignal=t->GetPIDsignal(); break; + case kTRDbackup: + t->GetExternalParameters(fTx,fTp); + t->GetExternalCovariance(fTc); + fTRDncls0 = t->GetNumberOfClusters(); + break; + case kTOFin: + break; + case kTOFout: + break; case kTRDStop: break; default: @@ -229,9 +373,13 @@ AliESDtrack::SetConstrainedTrackParams(AliKalmanTrack *t, Double_t chi2) { // // This function sets the constrained track parameters // + Int_t i; + Double_t x,buf[15]; fCalpha=t->GetAlpha(); - t->GetExternalParameters(fCx,fCp); - t->GetExternalCovariance(fCc); + t->GetExternalParameters(x,buf); fCx=x; + for (i=0; i<5; i++) fCp[i]=buf[i]; + t->GetExternalCovariance(buf); + for (i=0; i<15; i++) fCc[i]=buf[i]; fCchi2=chi2; } @@ -276,15 +424,19 @@ Double_t AliESDtrack::GetP() const { //--------------------------------------------------------------------- // This function returns the track momentum //--------------------------------------------------------------------- - Double_t lam=TMath::ATan(fRp[3]); + if (TMath::Abs(fRp[4])<=0) return 0; Double_t pt=1./TMath::Abs(fRp[4]); - return pt/TMath::Cos(lam); + return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]); } void AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const { //--------------------------------------------------------------------- // This function returns the constrained global track momentum components //--------------------------------------------------------------------- + if (TMath::Abs(fCp[4])<=0) { + p[0]=p[1]=p[2]=0; + return; + } Double_t phi=TMath::ASin(fCp[2]) + fCalpha; Double_t pt=1./TMath::Abs(fCp[4]); p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fCp[3]; @@ -302,6 +454,10 @@ void AliESDtrack::GetPxPyPz(Double_t *p) const { //--------------------------------------------------------------------- // This function returns the global track momentum components //--------------------------------------------------------------------- + if (TMath::Abs(fRp[4])<=0) { + p[0]=p[1]=p[2]=0; + return; + } Double_t phi=TMath::ASin(fRp[2]) + fRalpha; Double_t pt=1./TMath::Abs(fRp[4]); p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fRp[3]; @@ -357,26 +513,66 @@ void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const } -void AliESDtrack::GetOuterPxPyPz(Double_t *p) const { +void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t p[5], Double_t cov[15]) const +{ + // + //this function returns TRD parameters + // + x=fTx; + for (Int_t i=0; i<5; i++) p[i]=fTp[i]; + for (Int_t i=0; i<15; i++) cov[i]=fTc[i]; +} + +void AliESDtrack::GetOuterPxPyPz(Double_t *p, TString det) const { //--------------------------------------------------------------------- // This function returns the global track momentum components // af the radius of the PHOS //--------------------------------------------------------------------- - if (fOx==0) {p[0]=p[1]=p[2]=0.; return;} - Double_t phi=TMath::ASin(fOp[2]) + fOalpha; - Double_t pt=1./TMath::Abs(fOp[4]); - p[0]=pt*TMath::Cos(phi); p[1]=pt*TMath::Sin(phi); p[2]=pt*fOp[3]; + p[0]=p[1]=p[2]=0. ; + if (det == "PHOS") { + if (fOx==0) + return; + Double_t phi=TMath::ASin(fOp[2]) + fOalpha; + Double_t pt=1./TMath::Abs(fOp[4]); + p[0]=pt*TMath::Cos(phi); + p[1]=pt*TMath::Sin(phi); + p[2]=pt*fOp[3]; + } + else if (det == "EMCAL" ) { + if (fXx==0) + return; + Double_t phi=TMath::ASin(fXp[2]) + fXalpha; + Double_t pt=1./TMath::Abs(fXp[4]); + p[0]=pt*TMath::Cos(phi); + p[1]=pt*TMath::Sin(phi); + p[2]=pt*fXp[3]; + } + else + Warning("GetOuterPxPyPz", "Only valid for PHOS or EMCAL") ; } -void AliESDtrack::GetOuterXYZ(Double_t *xyz) const { +void AliESDtrack::GetOuterXYZ(Double_t *xyz, TString det) const { //--------------------------------------------------------------------- // This function returns the global track position - // af the radius of the PHOS - //--------------------------------------------------------------------- - if (fOx==0) {xyz[0]=xyz[1]=xyz[2]=0.; return;} - Double_t phi=TMath::ATan2(fOp[0],fOx) + fOalpha; - Double_t r=TMath::Sqrt(fOx*fOx + fOp[0]*fOp[0]); - xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fOp[1]; + // af the radius of the PHOS/EMCAL + //--------------------------------------------------------------------- + xyz[0]=xyz[1]=xyz[2]=0.; + if ( det == "PHOS" ) { + if (fOx==0) + return; + Double_t phi=TMath::ATan2(fOp[0],fOx) + fOalpha; + Double_t r=TMath::Sqrt(fOx*fOx + fOp[0]*fOp[0]); + xyz[0]=r*TMath::Cos(phi); xyz[1]=r*TMath::Sin(phi); xyz[2]=fOp[1]; + } + else if ( det == "EMCAL" ) { + if (fXx==0) + return; + Double_t phi=TMath::ATan2(fXp[0],fOx) + fXalpha; + Double_t r=TMath::Sqrt(fXx*fXx + fXp[0]*fXp[0]); + xyz[0]=r*TMath::Cos(phi); + xyz[1]=r*TMath::Sin(phi); + xyz[2]=fXp[1]; + } } //_______________________________________________________________________ @@ -398,6 +594,9 @@ void AliESDtrack::SetITSpid(const Double_t *p) { SetStatus(AliESDtrack::kITSpid); } +void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){ + for (Int_t i=0; i<12; i++) fITSchi2MIP[i]=chi2mip[i]; +} //_______________________________________________________________________ void AliESDtrack::GetITSpid(Double_t *p) const { // Gets the probability of each particle type (in ITS) @@ -442,7 +641,7 @@ Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const { // This function returns indices of the assgined TRD clusters //--------------------------------------------------------------------- if (idx!=0) - for (Int_t i=0; i<90; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant + for (Int_t i=0; i<130; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant return fTRDncls; } @@ -485,6 +684,49 @@ void AliESDtrack::GetTOFpid(Double_t *p) const { for (Int_t i=0; i