From 086400fc029165245485d441aaa2f03e92447fd5 Mon Sep 17 00:00:00 2001 From: morsch Date: Wed, 21 Mar 2012 08:00:02 +0000 Subject: [PATCH] bug #92723: request changes in STEER needed for PID and track selection Mikolaj Krzewicki --- STEER/AOD/AliAODTrack.cxx | 77 +++++++++++++++++++++++++++++++++++++ STEER/AOD/AliAODTrack.h | 5 ++- STEER/ESD/AliESDtrack.h | 3 +- STEER/STEERBase/AliVTrack.h | 5 ++- 4 files changed, 87 insertions(+), 3 deletions(-) diff --git a/STEER/AOD/AliAODTrack.cxx b/STEER/AOD/AliAODTrack.cxx index facd38185b6..130117d4b45 100644 --- a/STEER/AOD/AliAODTrack.cxx +++ b/STEER/AOD/AliAODTrack.cxx @@ -21,6 +21,7 @@ // Markus.Oldenburg@cern.ch //------------------------------------------------------------------------- +#include #include "AliLog.h" #include "AliExternalTrackParam.h" #include "AliVVertex.h" @@ -745,3 +746,79 @@ Int_t AliAODTrack::GetTOFBunchCrossing(Double_t b, Bool_t) const bcid = TMath::Nint((tdif - kShift)/kSpacing); return bcid; } + +//_____________________________________________________________________________ +Bool_t AliAODTrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const +{ + //--------------------------------------------------------------------- + // This function returns the global track position extrapolated to + // the radial position "x" (cm) in the magnetic field "b" (kG) + //--------------------------------------------------------------------- + + //conversion of track parameter representation is + //based on the implementation of AliExternalTrackParam::Set(...) + //maybe some of this code can be moved to AliVTrack to avoid code duplication + const double kSafe = 1e-5; + Double_t alpha=0.0; + Double_t radPos2 = fPosition[0]*fPosition[0]+fPosition[1]*fPosition[1]; + Double_t radMax = 45.; // approximately ITS outer radius + if (radPos2 < radMax*radMax) { // inside the ITS + alpha = TMath::ATan2(fMomentum[1],fMomentum[0]); + } else { // outside the ITS + Float_t phiPos = TMath::Pi()+TMath::ATan2(-fPosition[1], -fPosition[0]); + alpha = + TMath::DegToRad()*(20*((((Int_t)(phiPos*TMath::RadToDeg()))/20))+10); + } + // + Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha); + // protection: avoid alpha being too close to 0 or +-pi/2 + if (TMath::Abs(sn)= kAlmost1) return kFALSE; + if (TMath::Abs(f2) >= kAlmost1) return kFALSE; + + Double_t r1=TMath::Sqrt((1.-f1)*(1.+f1)), r2=TMath::Sqrt((1.-f2)*(1.+f2)); + r[0] = x; + r[1] = param0 + dx*(f1+f2)/(r1+r2); + r[2] = param1 + dx*(r2 + f2*(f1+f2)/(r1+r2))*param3;//Thanks to Andrea & Peter + + return Local2GlobalPosition(r,alpha); +} + + + diff --git a/STEER/AOD/AliAODTrack.h b/STEER/AOD/AliAODTrack.h index b65edbfd6c9..a6f1aec18bf 100644 --- a/STEER/AOD/AliAODTrack.h +++ b/STEER/AOD/AliAODTrack.h @@ -200,7 +200,9 @@ class AliAODTrack : public AliVTrack { Bool_t GetXYZ(Double_t *p) const { return GetPosition(p); } - + + Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const; + Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const { return GetCovMatrix(cv);} @@ -240,6 +242,7 @@ class AliAODTrack : public AliVTrack { UInt_t GetFilterMap() const {return fFilterMap;} const TBits& GetTPCClusterMap() const {return fTPCClusterMap;} + const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;} const TBits& GetTPCFitMap() const {return fTPCFitMap;} Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t /*type*/=0) const; diff --git a/STEER/ESD/AliESDtrack.h b/STEER/ESD/AliESDtrack.h index 1319250f790..c75d64758ec 100644 --- a/STEER/ESD/AliESDtrack.h +++ b/STEER/ESD/AliESDtrack.h @@ -220,7 +220,7 @@ public: } void SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo); - AliTPCdEdxInfo * GetTPCdEdxInfo(){return fTPCdEdxInfo;} + AliTPCdEdxInfo * GetTPCdEdxInfo() const {return fTPCdEdxInfo;} Double_t GetTPCsignal() const {return fTPCsignal;} Double_t GetTPCsignalSigma() const {return fTPCsignalS;} UShort_t GetTPCsignalN() const {return fTPCsignalN;} @@ -234,6 +234,7 @@ public: Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];} const TBits& GetTPCFitMap() const {return fTPCFitMap;} const TBits& GetTPCClusterMap() const {return fTPCClusterMap;} + const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;} const TBits& GetTPCSharedMap() const {return fTPCSharedMap;} void SetTPCFitMap(const TBits &amap) {fTPCFitMap = amap;} void SetTPCClusterMap(const TBits &amap) {fTPCClusterMap = amap;} diff --git a/STEER/STEERBase/AliVTrack.h b/STEER/STEERBase/AliVTrack.h index 53da122d40f..6418655a60d 100644 --- a/STEER/STEERBase/AliVTrack.h +++ b/STEER/STEERBase/AliVTrack.h @@ -52,8 +52,9 @@ public: virtual Int_t GetID() const = 0; virtual UChar_t GetITSClusterMap() const = 0; + virtual const TBits* GetTPCClusterMapPtr() const {return NULL;} virtual Float_t GetTPCClusterInfo(Int_t /*nNeighbours*/, Int_t /*type*/, Int_t /*row0*/=0, Int_t /*row1*/=159, Int_t /*type*/= 0) const {return 0.;} - virtual AliTPCdEdxInfo * GetTPCdEdxInfo() {return 0x0;} + virtual AliTPCdEdxInfo * GetTPCdEdxInfo() const {return 0x0;} virtual UShort_t GetTPCNcls() const { return 0;} virtual UShort_t GetTPCNclsF() const { return 0;} virtual Double_t GetTRDslice(Int_t /*plane*/, Int_t /*slice*/) const { return -1.; } @@ -85,11 +86,13 @@ public: virtual ULong_t GetStatus() const = 0; virtual Bool_t GetXYZ(Double_t *p) const = 0; + virtual Bool_t GetXYZAt(Double_t /*x*/, Double_t /*b*/, Double_t* /*r*/ ) const {return kFALSE;} virtual Double_t GetBz() const; virtual void GetBxByBz(Double_t b[3]) const; virtual Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const = 0; virtual Bool_t PropagateToDCA(const AliVVertex *vtx,Double_t b,Double_t maxd,Double_t dz[2],Double_t covar[3]) = 0; virtual const AliExternalTrackParam * GetOuterParam() const { return NULL; } + virtual const AliExternalTrackParam * GetInnerParam() const { return NULL; } virtual Int_t GetNcls(Int_t /*idet*/) const { return 0; } virtual Bool_t GetPxPyPz(Double_t */*p*/) const { return kFALSE; } virtual void SetID(Short_t /*id*/) {;} -- 2.43.0