From: hristov Date: Fri, 27 Aug 2004 08:55:50 +0000 (+0000) Subject: Faster access to the parameters at PHOS and EMCAL position. Non-persistent debug... X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=3fd96ae3cff338ed0d3928e1f8b078c9182b7ab5;ds=sidebyside Faster access to the parameters at PHOS and EMCAL position. Non-persistent debug data members --- diff --git a/STEER/AliESDtrack.cxx b/STEER/AliESDtrack.cxx index c39f9f21525..56b1bbc8201 100644 --- a/STEER/AliESDtrack.cxx +++ b/STEER/AliESDtrack.cxx @@ -21,7 +21,6 @@ //----------------------------------------------------------------- #include "TMath.h" -#include "TString.h" #include "AliESDtrack.h" #include "AliKalmanTrack.h" @@ -192,8 +191,8 @@ AliESDtrack::~AliESDtrack(){ // This is destructor according Coding Conventrions // //printf("Delete track\n"); - if (fITStrack) delete fITStrack; - if (fTRDtrack) delete fTRDtrack; + delete fITStrack; + delete fTRDtrack; } //_______________________________________________________________________ @@ -523,57 +522,59 @@ void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t p[5], Double_t for (Int_t i=0; i<15; i++) cov[i]=fTc[i]; } -void AliESDtrack::GetOuterPxPyPz(Double_t *p, TString det) const { +void AliESDtrack::GetOuterPxPyPzPHOS(Double_t *p) const { //--------------------------------------------------------------------- // This function returns the global track momentum components // af the radius of the PHOS //--------------------------------------------------------------------- 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") ; + 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]; +} +void AliESDtrack::GetOuterPxPyPzEMCAL(Double_t *p) const { + //--------------------------------------------------------------------- + // This function returns the global track momentum components + // af the radius of the 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]; } -void AliESDtrack::GetOuterXYZ(Double_t *xyz, TString det) const { +void AliESDtrack::GetOuterXYZPHOS(Double_t *xyz) const { //--------------------------------------------------------------------- // This function returns the global track position - // af the radius of the PHOS/EMCAL + // af the radius of the PHOS //--------------------------------------------------------------------- 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]; - } -} + 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]; +} +void AliESDtrack::GetOuterXYZEMCAL(Double_t *xyz) const { + //--------------------------------------------------------------------- + // This function returns the global track position + // af the radius of the 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]; +} //_______________________________________________________________________ void AliESDtrack::GetIntegratedTimes(Double_t *times) const { diff --git a/STEER/AliESDtrack.h b/STEER/AliESDtrack.h index a635a4d9c21..d980ee72204 100644 --- a/STEER/AliESDtrack.h +++ b/STEER/AliESDtrack.h @@ -14,7 +14,6 @@ #include #include -class TString ; class AliKalmanTrack; class AliESDtrack : public TObject { @@ -60,8 +59,10 @@ public: Double_t GetInnerAlpha() const {return fIalpha;} - void GetOuterPxPyPz(Double_t *p, TString det) const; - void GetOuterXYZ(Double_t *r, TString det) const; + void GetOuterPxPyPzPHOS(Double_t *p) const; + void GetOuterPxPyPzEMCAL(Double_t *p) const; + void GetOuterXYZPHOS(Double_t *r) const; + void GetOuterXYZEMCAL(Double_t *r) const; void SetITSpid(const Double_t *p); void SetITSChi2MIP(const Float_t *chi2mip); @@ -208,7 +209,7 @@ protected: Float_t fITSr[kSPECIES]; // "detector response probabilities" (for the PID) Int_t fITSLabel; // label according TPC Float_t fITSFakeRatio; // ration of fake tracks - AliKalmanTrack * fITStrack; //OWNER: pointer to the ITS track -- currently for debug purpose + AliKalmanTrack * fITStrack; //! OWNER: pointer to the ITS track -- currently for debug purpose // TPC related track information Float_t fTPCchi2; // chi2 in the TPC @@ -226,7 +227,7 @@ protected: Float_t fTRDsignal; // detector's PID signal Float_t fTRDr[kSPECIES]; // "detector response probabilities" (for the PID) Int_t fTRDLabel; // label according TRD - AliKalmanTrack * fTRDtrack; //OWNER: pointer to the TRD track -- currently for debug purpose + AliKalmanTrack * fTRDtrack; //! OWNER: pointer to the TRD track -- currently for debug purpose // TOF related track information Float_t fTOFchi2; // chi2 in the TOF UInt_t fTOFindex; // index of the assigned TOF cluster @@ -247,7 +248,7 @@ protected: Float_t fRICHsignal; // detector's PID signal (beta for RICH) Float_t fRICHr[kSPECIES];// "detector response probabilities" (for the PID) - ClassDef(AliESDtrack,6) //ESDtrack + ClassDef(AliESDtrack,7) //ESDtrack }; #endif