// Markus.Oldenburg@cern.ch
//-------------------------------------------------------------------------
+#include <TVector3.h>
#include "AliLog.h"
#include "AliExternalTrackParam.h"
#include "AliVVertex.h"
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)<kSafe) {
+ alpha = kSafe;
+ cs=TMath::Cos(alpha);
+ sn=TMath::Sin(alpha);
+ }
+ else if (cs<kSafe) {
+ alpha -= TMath::Sign(kSafe, alpha);
+ cs=TMath::Cos(alpha);
+ sn=TMath::Sin(alpha);
+ }
+
+ // Get the vertex of origin and the momentum
+ TVector3 ver(fPosition[0],fPosition[1],fPosition[2]);
+ TVector3 mom(fMomentum[0],fMomentum[1],fMomentum[2]);
+ //
+ // avoid momenta along axis
+ if (TMath::Abs(mom[0])<kSafe) mom[0] = TMath::Sign(kSafe*TMath::Abs(mom[1]), mom[0]);
+ if (TMath::Abs(mom[1])<kSafe) mom[1] = TMath::Sign(kSafe*TMath::Abs(mom[0]), mom[1]);
+
+ // Rotate to the local coordinate system
+ ver.RotateZ(-alpha);
+ mom.RotateZ(-alpha);
+
+ Double_t param0 = ver.Y();
+ Double_t param1 = ver.Z();
+ Double_t param2 = TMath::Sin(mom.Phi());
+ Double_t param3 = mom.Pz()/mom.Pt();
+ Double_t param4 = TMath::Sign(1/mom.Pt(),(Double_t)fCharge);
+
+ //calculate the propagated coordinates
+ //this is based on AliExternalTrackParam::GetXYZAt(Double_t x, Double_t b, Double_t *r)
+ Double_t dx=x-ver.X();
+ if(TMath::Abs(dx)<=kAlmost0) return GetXYZ(r);
+
+ Double_t f1=param2;
+ Double_t f2=f1 + dx*param4*b*kB2C;
+
+ if (TMath::Abs(f1) >= 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);
+}
+
+
+
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);}
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;
}
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;}
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;}
\r
virtual Int_t GetID() const = 0;\r
virtual UChar_t GetITSClusterMap() const = 0;\r
+ virtual const TBits* GetTPCClusterMapPtr() const {return NULL;}\r
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.;}\r
- virtual AliTPCdEdxInfo * GetTPCdEdxInfo() {return 0x0;}\r
+ virtual AliTPCdEdxInfo * GetTPCdEdxInfo() const {return 0x0;}\r
virtual UShort_t GetTPCNcls() const { return 0;}\r
virtual UShort_t GetTPCNclsF() const { return 0;}\r
virtual Double_t GetTRDslice(Int_t /*plane*/, Int_t /*slice*/) const { return -1.; }\r
\r
virtual ULong_t GetStatus() const = 0;\r
virtual Bool_t GetXYZ(Double_t *p) const = 0;\r
+ virtual Bool_t GetXYZAt(Double_t /*x*/, Double_t /*b*/, Double_t* /*r*/ ) const {return kFALSE;}\r
virtual Double_t GetBz() const;\r
virtual void GetBxByBz(Double_t b[3]) const;\r
virtual Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const = 0;\r
virtual Bool_t PropagateToDCA(const AliVVertex *vtx,Double_t b,Double_t maxd,Double_t dz[2],Double_t covar[3]) = 0;\r
virtual const AliExternalTrackParam * GetOuterParam() const { return NULL; }\r
+ virtual const AliExternalTrackParam * GetInnerParam() const { return NULL; }\r
virtual Int_t GetNcls(Int_t /*idet*/) const { return 0; }\r
virtual Bool_t GetPxPyPz(Double_t */*p*/) const { return kFALSE; }\r
virtual void SetID(Short_t /*id*/) {;}\r