]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bug #92723: request changes in STEER needed for PID and track selection
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 08:00:02 +0000 (08:00 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 21 Mar 2012 08:00:02 +0000 (08:00 +0000)
Mikolaj Krzewicki

STEER/AOD/AliAODTrack.cxx
STEER/AOD/AliAODTrack.h
STEER/ESD/AliESDtrack.h
STEER/STEERBase/AliVTrack.h

index facd38185b641051fd965ef526d7a19b4eb6d5cb..130117d4b4520c3c067f3b85980d79745e8909a0 100644 (file)
@@ -21,6 +21,7 @@
 //     Markus.Oldenburg@cern.ch
 //-------------------------------------------------------------------------
 
+#include <TVector3.h>
 #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)<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);
+}
+
+
+
index b65edbfd6c9fd4457cda77cc5597a984a1523d5f..a6f1aec18bf8d1f58b2baef49c5e5955bc43fd4e 100644 (file)
@@ -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;
   
index 1319250f790655d6933c6702b9e933b2d6f09c3c..c75d64758ec505c751f500c795e16d29345e6563 100644 (file)
@@ -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;}
index 53da122d40f9c5d770a341f836f476b4cdb216db..6418655a60d991a7d6c00bb4cf856b2b64da2694 100644 (file)
@@ -52,8 +52,9 @@ public:
 \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
@@ -85,11 +86,13 @@ public:
     \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