]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Introducing a new function GetYAt (Yuri)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jun 2006 14:28:57 +0000 (14:28 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jun 2006 14:28:57 +0000 (14:28 +0000)
STEER/AliExternalTrackParam.cxx
STEER/AliExternalTrackParam.h

index aae47b86239fa4b914046cd79ebda350e794a8fa..c936ff351571e239f656bf8b23b0f2c250f953a0 100644 (file)
@@ -714,6 +714,26 @@ AliExternalTrackParam::GetPxPyPzAt(Double_t x, Double_t b, Double_t *p) const {
   return Local2GlobalMomentum(p,fAlpha);
 }
 
+Bool_t 
+AliExternalTrackParam::GetYAt(Double_t x, Double_t b, Double_t &y) const {
+  //---------------------------------------------------------------------
+  // This function returns the local Y-coordinate of the intersection 
+  // point between this track and the reference plane "x" (cm). 
+  // Magnetic field "b" (kG)
+  //---------------------------------------------------------------------
+  Double_t dx=x-fX;
+  if(TMath::Abs(dx)<=kAlmost0) {y=fP[0]; return kTRUE;}
+
+  Double_t f1=fP[2], f2=f1 + dx*fP[4]*b*kB2C;
+
+  if (TMath::Abs(f1) >= kAlmost1) return kFALSE;
+  if (TMath::Abs(f2) >= kAlmost1) return kFALSE;
+  
+  Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2);
+  y = fP[0] + dx*(f1+f2)/(r1+r2);
+  return kTRUE;
+}
+
 Bool_t 
 AliExternalTrackParam::GetXYZAt(Double_t x, Double_t b, Double_t *r) const {
   //---------------------------------------------------------------------
index 1ec305998fafbd8f6db8a19fdcdc1bcc2cab46ae..fd219d6e7d5b1a75f148a66d69e14c1eae4b8f2d 100644 (file)
@@ -77,6 +77,7 @@ class AliExternalTrackParam: public TObject {
   Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const;
   Bool_t GetPxPyPzAt(Double_t x, Double_t b, Double_t p[3]) const;
   Bool_t GetXYZAt(Double_t x, Double_t b, Double_t r[3]) const;
+  Bool_t GetYAt(Double_t x,  Double_t b,  Double_t &y) const;
   void Print(Option_t* option = "") const;
   // MI
   virtual Bool_t   PropagateTo(Double_t x, Double_t b, Double_t mass, Double_t maxStep, Bool_t rotateTo=kTRUE, Double_t maxSnp=0.8);